Commit 133b8dfa authored by danno's avatar danno Committed by Commit bot

[csa] micro-optimization of Allocation

Instead of loading the address both the limit and top pointers, rely on the
property that the limit pointer is always directly after the top pointer so that
it can be loaded with the limit pointer's address plus a fixed offset.

This generates smaller code and reduces the number of registers required by the
allocation sequence by one.

LOG=N
R=epertoso@chromium.org

Review-Url: https://codereview.chromium.org/2605043002
Cr-Commit-Position: refs/heads/master@{#41975}
parent 1d963547
...@@ -896,10 +896,17 @@ Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) { ...@@ -896,10 +896,17 @@ Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) {
new_space new_space
? ExternalReference::new_space_allocation_top_address(isolate()) ? ExternalReference::new_space_allocation_top_address(isolate())
: ExternalReference::old_space_allocation_top_address(isolate())); : ExternalReference::old_space_allocation_top_address(isolate()));
Node* limit_address = ExternalConstant( DCHECK_EQ(kPointerSize,
new_space ExternalReference::new_space_allocation_limit_address(isolate())
? ExternalReference::new_space_allocation_limit_address(isolate()) .address() -
: ExternalReference::old_space_allocation_limit_address(isolate())); ExternalReference::new_space_allocation_top_address(isolate())
.address());
DCHECK_EQ(kPointerSize,
ExternalReference::old_space_allocation_limit_address(isolate())
.address() -
ExternalReference::old_space_allocation_top_address(isolate())
.address());
Node* limit_address = IntPtrAdd(top_address, IntPtrConstant(kPointerSize));
#ifdef V8_HOST_ARCH_32_BIT #ifdef V8_HOST_ARCH_32_BIT
if (flags & kDoubleAlignment) { if (flags & kDoubleAlignment) {
......
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