Commit e8e9c07e authored by alph's avatar alph Committed by Commit bot

Make sure the heap is in consistent state when calling allocation observers.

The observer might want to lookup something in the heap, e.g. code objects
it has in the call stack.

BUG=v8:4959
LOG=N

Review-Url: https://codereview.chromium.org/1948893002
Cr-Commit-Position: refs/heads/master@{#36027}
parent 9ae91f8d
...@@ -2444,7 +2444,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { ...@@ -2444,7 +2444,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
int new_node_size = 0; int new_node_size = 0;
FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size); FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size);
if (new_node == nullptr) return nullptr; if (new_node == nullptr) return nullptr;
owner_->AllocationStep(new_node->address(), size_in_bytes);
int bytes_left = new_node_size - size_in_bytes; int bytes_left = new_node_size - size_in_bytes;
DCHECK(bytes_left >= 0); DCHECK(bytes_left >= 0);
...@@ -2490,6 +2489,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { ...@@ -2490,6 +2489,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
new_node->address() + new_node_size); new_node->address() + new_node_size);
} }
owner_->AllocationStep(new_node->address(), size_in_bytes);
return new_node; return new_node;
} }
......
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