Commit cac5e4bf authored by JianxiaoLuIntel's avatar JianxiaoLuIntel Committed by V8 LUCI CQ

[heap] Fix fast path for young allocations

Bug: v8:12305
Change-Id: Ibc71e864bfb19c720d4cecf61f1254402859db6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3215100Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77477}
parent ee74e718
......@@ -325,12 +325,12 @@ HeapObject Heap::AllocateRawWith(int size, AllocationType allocation,
Heap* heap = isolate()->heap();
if (allocation == AllocationType::kYoung &&
alignment == AllocationAlignment::kWordAligned &&
size <= MaxRegularHeapObjectSize(allocation) && !FLAG_single_generation) {
size <= MaxRegularHeapObjectSize(allocation) &&
V8_LIKELY(!FLAG_single_generation && FLAG_inline_new &&
FLAG_gc_interval == -1)) {
Address* top = heap->NewSpaceAllocationTopAddress();
Address* limit = heap->NewSpaceAllocationLimitAddress();
if ((*limit - *top >= static_cast<unsigned>(size)) &&
V8_LIKELY(!FLAG_single_generation && FLAG_inline_new &&
FLAG_gc_interval == 0)) {
if (*limit - *top >= static_cast<unsigned>(size)) {
DCHECK(IsAligned(size, kTaggedSize));
HeapObject obj = HeapObject::FromAddress(*top);
*top += 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