Commit 757d82ee authored by danno's avatar danno Committed by Commit bot

[stubs] Micro optimizations to CodeAssember's allocation path

Now that the GC team has landed the appropriate changes to ensure that the top
page of the address space is never used for allocation, the inlined fast-case
allocation path in the CodeAssembler can be micro-optimized to an add to top
followed by an unsigned compare to limit, eliding a no-longer-needed overflow
check.

Review-Url: https://codereview.chromium.org/1923803003
Cr-Commit-Position: refs/heads/master@{#35830}
parent 9bf7a31a
......@@ -322,7 +322,8 @@ Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes,
Label runtime_call(this, Label::kDeferred), no_runtime_call(this);
Label merge_runtime(this, &result);
Branch(IntPtrLessThan(IntPtrSub(limit, top), size_in_bytes), &runtime_call,
Node* new_top = IntPtrAdd(top, size_in_bytes);
Branch(UintPtrGreaterThanOrEqual(new_top, limit), &runtime_call,
&no_runtime_call);
Bind(&runtime_call);
......@@ -342,7 +343,7 @@ Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes,
Bind(&no_runtime_call);
Node* no_runtime_result = top;
StoreNoWriteBarrier(MachineType::PointerRepresentation(), top_address,
IntPtrAdd(top, size_in_bytes));
new_top);
no_runtime_result = BitcastWordToTagged(
IntPtrAdd(no_runtime_result, IntPtrConstant(kHeapObjectTag)));
result.Bind(no_runtime_result);
......
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