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}
This commit is contained in:
parent
9ae91f8d77
commit
e8e9c07e54
@ -2444,7 +2444,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
|
||||
int new_node_size = 0;
|
||||
FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size);
|
||||
if (new_node == nullptr) return nullptr;
|
||||
owner_->AllocationStep(new_node->address(), size_in_bytes);
|
||||
|
||||
int bytes_left = new_node_size - size_in_bytes;
|
||||
DCHECK(bytes_left >= 0);
|
||||
@ -2490,6 +2489,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
|
||||
new_node->address() + new_node_size);
|
||||
}
|
||||
|
||||
owner_->AllocationStep(new_node->address(), size_in_bytes);
|
||||
|
||||
return new_node;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user