Commit 3e7b7ed2 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[heap] Remove MemoryChunks from CodePageCollectionMemoryModificationScope set if they get freed.

Bug:chromium:831501
Change-Id: I82daa3dc1a6cc08cb63e42f4a54b69d28303ce0f

NOTREECHECKS=true

Change-Id: I82daa3dc1a6cc08cb63e42f4a54b69d28303ce0f
Reviewed-on: https://chromium-review.googlesource.com/1006755
Commit-Queue: Michael Hablich <hablich@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52546}
parent 8d3d738c
...@@ -2247,6 +2247,10 @@ void Heap::UnprotectAndRegisterMemoryChunk(HeapObject* object) { ...@@ -2247,6 +2247,10 @@ void Heap::UnprotectAndRegisterMemoryChunk(HeapObject* object) {
UnprotectAndRegisterMemoryChunk(MemoryChunk::FromAddress(object->address())); UnprotectAndRegisterMemoryChunk(MemoryChunk::FromAddress(object->address()));
} }
void Heap::UnregisterUnprotectedMemoryChunk(MemoryChunk* chunk) {
unprotected_memory_chunks_.erase(chunk);
}
void Heap::ProtectUnprotectedMemoryChunks() { void Heap::ProtectUnprotectedMemoryChunks() {
DCHECK(unprotected_memory_chunks_registry_enabled_); DCHECK(unprotected_memory_chunks_registry_enabled_);
for (auto chunk = unprotected_memory_chunks_.begin(); for (auto chunk = unprotected_memory_chunks_.begin();
......
...@@ -838,7 +838,7 @@ class Heap { ...@@ -838,7 +838,7 @@ class Heap {
void UnprotectAndRegisterMemoryChunk(MemoryChunk* chunk); void UnprotectAndRegisterMemoryChunk(MemoryChunk* chunk);
void UnprotectAndRegisterMemoryChunk(HeapObject* object); void UnprotectAndRegisterMemoryChunk(HeapObject* object);
void UnregisterUnprotectedMemoryChunk(MemoryChunk* chunk);
V8_EXPORT_PRIVATE void ProtectUnprotectedMemoryChunks(); V8_EXPORT_PRIVATE void ProtectUnprotectedMemoryChunks();
void EnableUnprotectedMemoryChunksRegistry() { void EnableUnprotectedMemoryChunksRegistry() {
......
...@@ -1435,6 +1435,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator { ...@@ -1435,6 +1435,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
void UnregisterExecutableMemoryChunk(MemoryChunk* chunk) { void UnregisterExecutableMemoryChunk(MemoryChunk* chunk) {
DCHECK_NE(executable_memory_.find(chunk), executable_memory_.end()); DCHECK_NE(executable_memory_.find(chunk), executable_memory_.end());
executable_memory_.erase(chunk); executable_memory_.erase(chunk);
chunk->heap()->UnregisterUnprotectedMemoryChunk(chunk);
} }
Isolate* isolate_; Isolate* isolate_;
......
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