Commit dd4f93c4 authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

[heap] Only track allocation origins in slow path

Allocation origin tracking also implicitly disables inline allocations.

Bug: chromium:1316121, v8:12612
Change-Id: I7efecff3bb0cceef1071853e18a01effcc97243f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3593116Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80052}
parent 10cae735
......@@ -1225,6 +1225,8 @@ DEFINE_BOOL(
trace_allocations_origins, false,
"Show statistics about the origins of allocations. "
"Combine with --no-inline-new to track allocations from generated code")
DEFINE_NEG_IMPLICATION(trace_allocations_origins, inline_new)
DEFINE_BOOL(trace_pending_allocations, false,
"trace calls to Heap::IsAllocationPending that return true")
......
......@@ -202,10 +202,6 @@ AllocationResult SpaceWithLinearArea::AllocateFastUnaligned(
MSAN_ALLOCATED_UNINITIALIZED_MEMORY(obj.address(), size_in_bytes);
if (FLAG_trace_allocations_origins) {
UpdateAllocationOrigins(origin);
}
return AllocationResult::FromObject(obj);
}
......@@ -230,10 +226,6 @@ AllocationResult SpaceWithLinearArea::AllocateFastAligned(
MSAN_ALLOCATED_UNINITIALIZED_MEMORY(obj.address(), size_in_bytes);
if (FLAG_trace_allocations_origins) {
UpdateAllocationOrigins(origin);
}
return AllocationResult::FromObject(obj);
}
......@@ -269,6 +261,10 @@ AllocationResult SpaceWithLinearArea::AllocateRawUnaligned(
AllocationResult result = AllocateFastUnaligned(size_in_bytes, origin);
DCHECK(!result.IsFailure());
if (FLAG_trace_allocations_origins) {
UpdateAllocationOrigins(origin);
}
InvokeAllocationObservers(result.ToAddress(), size_in_bytes, size_in_bytes,
size_in_bytes);
......@@ -293,6 +289,10 @@ AllocationResult SpaceWithLinearArea::AllocateRawAligned(
DCHECK_GE(max_aligned_size, aligned_size_in_bytes);
DCHECK(!result.IsFailure());
if (FLAG_trace_allocations_origins) {
UpdateAllocationOrigins(origin);
}
InvokeAllocationObservers(result.ToAddress(), size_in_bytes,
aligned_size_in_bytes, max_aligned_size);
......
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