Commit 47afc6fd authored by Victor Gomes's avatar Victor Gomes Committed by V8 LUCI CQ

[heap] Unprotect code space lab before MakeIterable

When closing a concurrent allocator, for instance when closing a
LocalHeap, we need to make the LAB of the code space iterable.
We add then a CodePageMemoryModificationScope to allow
code space modification.

Bug: v8:12054
Change-Id: I438d7c1a50694930b7558dec2dd552bec22b7552
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3277887
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77871}
parent 9e9c61b6
......@@ -81,10 +81,22 @@ void StressConcurrentAllocatorTask::Schedule(Isolate* isolate) {
}
void ConcurrentAllocator::FreeLinearAllocationArea() {
// The code page of the linear allocation area needs to be unprotected
// because we are going to write a filler into that memory area below.
base::Optional<CodePageMemoryModificationScope> optional_scope;
if (lab_.IsValid() && space_->identity() == CODE_SPACE) {
optional_scope.emplace(MemoryChunk::FromAddress(lab_.top()));
}
lab_.CloseAndMakeIterable();
}
void ConcurrentAllocator::MakeLinearAllocationAreaIterable() {
// The code page of the linear allocation area needs to be unprotected
// because we are going to write a filler into that memory area below.
base::Optional<CodePageMemoryModificationScope> optional_scope;
if (lab_.IsValid() && space_->identity() == CODE_SPACE) {
optional_scope.emplace(MemoryChunk::FromAddress(lab_.top()));
}
lab_.MakeIterable();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment