Skip to content

Commit e8e9c07

Browse files
a1phCommit bot
authored andcommitted
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}
1 parent 9ae91f8 commit e8e9c07

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/heap/spaces.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
24442444
int new_node_size = 0;
24452445
FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size);
24462446
if (new_node == nullptr) return nullptr;
2447-
owner_->AllocationStep(new_node->address(), size_in_bytes);
24482447

24492448
int bytes_left = new_node_size - size_in_bytes;
24502449
DCHECK(bytes_left >= 0);
@@ -2490,6 +2489,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) {
24902489
new_node->address() + new_node_size);
24912490
}
24922491

2492+
owner_->AllocationStep(new_node->address(), size_in_bytes);
2493+
24932494
return new_node;
24942495
}
24952496

0 commit comments

Comments
 (0)