Commit 2e51265f authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] CodeSpaceMemoryModificationScope also handles large pages.

Bug: chromium:774108,v8:6792
Change-Id: I09ec58f7fdc17f1cc50d9445f8b473e17a584dc1
Reviewed-on: https://chromium-review.googlesource.com/756843Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49185}
parent 7084bd25
......@@ -601,12 +601,26 @@ CodeSpaceMemoryModificationScope::CodeSpaceMemoryModificationScope(Heap* heap)
: heap_(heap) {
if (FLAG_write_protect_code_memory) {
heap_->code_space()->SetReadAndWritable();
LargePage* page = heap_->lo_space()->first_page();
while (page != nullptr) {
if (page->IsFlagSet(MemoryChunk::IS_EXECUTABLE)) {
page->SetReadAndWritable();
}
page = page->next_page();
}
}
}
CodeSpaceMemoryModificationScope::~CodeSpaceMemoryModificationScope() {
if (FLAG_write_protect_code_memory) {
heap_->code_space()->SetReadAndExecutable();
LargePage* page = heap_->lo_space()->first_page();
while (page != nullptr) {
if (page->IsFlagSet(MemoryChunk::IS_EXECUTABLE)) {
page->SetReadAndExecutable();
}
page = page->next_page();
}
}
}
......
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