Commit f940a75c authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[heap] Honor --inline-new when removing allocation trackers.

The heap profiler and debugger use allocation trackers to observe allocation
events and need to disable inlined allocations temporarily. But if
--no-inline-new is passed, they do not need to.

However, when removing allocation trackers they would accidently enable it
again.

Bug: v8:9906
Change-Id: I6f8322886a3ada66d3f1cc26f0e321a9863dcf08
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1895572Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#64762}
parent dfcc4199
......@@ -652,7 +652,9 @@ void Heap::ReportStatisticsAfterGC() {
void Heap::AddHeapObjectAllocationTracker(
HeapObjectAllocationTracker* tracker) {
if (allocation_trackers_.empty()) DisableInlineAllocation();
if (allocation_trackers_.empty() && FLAG_inline_new) {
DisableInlineAllocation();
}
allocation_trackers_.push_back(tracker);
}
......@@ -661,7 +663,9 @@ void Heap::RemoveHeapObjectAllocationTracker(
allocation_trackers_.erase(std::remove(allocation_trackers_.begin(),
allocation_trackers_.end(), tracker),
allocation_trackers_.end());
if (allocation_trackers_.empty()) EnableInlineAllocation();
if (allocation_trackers_.empty() && FLAG_inline_new) {
EnableInlineAllocation();
}
}
void Heap::AddRetainingPathTarget(Handle<HeapObject> object,
......
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