| Index: src/x64/macro-assembler-x64.cc
|
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
|
| index f753b0e1d53319136243b44d2cd5a25ec5db5890..2efb5295974c8e061a579a1eb63f1a3ba0f4f8f5 100644
|
| --- a/src/x64/macro-assembler-x64.cc
|
| +++ b/src/x64/macro-assembler-x64.cc
|
| @@ -4830,7 +4830,7 @@ void MacroAssembler::MakeSureDoubleAlignedHelper(Register result,
|
| Label aligned;
|
| testl(result, Immediate(kDoubleAlignmentMask));
|
| j(zero, &aligned, Label::kNear);
|
| - if ((flags & PRETENURE) != 0) {
|
| + if (((flags & ALLOCATION_FOLDED) == 0) && ((flags & PRETENURE) != 0)) {
|
| ExternalReference allocation_limit =
|
| AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| cmpp(result, ExternalOperand(allocation_limit));
|
| @@ -4873,6 +4873,7 @@ void MacroAssembler::Allocate(int object_size,
|
| AllocationFlags flags) {
|
| DCHECK((flags & (RESULT_CONTAINS_TOP | SIZE_IN_WORDS)) == 0);
|
| DCHECK(object_size <= Page::kMaxRegularHeapObjectSize);
|
| + DCHECK((flags & ALLOCATION_FOLDED) == 0);
|
| if (!FLAG_inline_new) {
|
| if (emit_debug_code()) {
|
| // Trash the registers to simulate an allocation failure.
|
| @@ -4910,8 +4911,10 @@ void MacroAssembler::Allocate(int object_size,
|
| cmpp(top_reg, limit_operand);
|
| j(above, gc_required);
|
|
|
| - // Update allocation top.
|
| - UpdateAllocationTopHelper(top_reg, scratch, flags);
|
| + if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) {
|
| + // The top pointer is not updated for allocation folding dominators.
|
| + UpdateAllocationTopHelper(top_reg, scratch, flags);
|
| + }
|
|
|
| if (top_reg.is(result)) {
|
| subp(result, Immediate(object_size - kHeapObjectTag));
|
| @@ -4932,6 +4935,8 @@ void MacroAssembler::Allocate(int header_size,
|
| Label* gc_required,
|
| AllocationFlags flags) {
|
| DCHECK((flags & SIZE_IN_WORDS) == 0);
|
| + DCHECK((flags & ALLOCATION_FOLDING_DOMINATOR) == 0);
|
| + DCHECK((flags & ALLOCATION_FOLDED) == 0);
|
| leap(result_end, Operand(element_count, element_size, header_size));
|
| Allocate(result_end, result, result_end, scratch, gc_required, flags);
|
| }
|
| @@ -4944,6 +4949,7 @@ void MacroAssembler::Allocate(Register object_size,
|
| Label* gc_required,
|
| AllocationFlags flags) {
|
| DCHECK((flags & SIZE_IN_WORDS) == 0);
|
| + DCHECK((flags & ALLOCATION_FOLDED) == 0);
|
| if (!FLAG_inline_new) {
|
| if (emit_debug_code()) {
|
| // Trash the registers to simulate an allocation failure.
|
| @@ -4966,25 +4972,58 @@ void MacroAssembler::Allocate(Register object_size,
|
| MakeSureDoubleAlignedHelper(result, scratch, gc_required, flags);
|
| }
|
|
|
| - // Calculate new top and bail out if new space is exhausted.
|
| ExternalReference allocation_limit =
|
| AllocationUtils::GetAllocationLimitReference(isolate(), flags);
|
| if (!object_size.is(result_end)) {
|
| movp(result_end, object_size);
|
| }
|
| addp(result_end, result);
|
| - j(carry, gc_required);
|
| Operand limit_operand = ExternalOperand(allocation_limit);
|
| cmpp(result_end, limit_operand);
|
| j(above, gc_required);
|
|
|
| - // Update allocation top.
|
| - UpdateAllocationTopHelper(result_end, scratch, flags);
|
| + if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) {
|
| + // The top pointer is not updated for allocation folding dominators.
|
| + UpdateAllocationTopHelper(result_end, scratch, flags);
|
| + }
|
|
|
| // Tag the result.
|
| addp(result, Immediate(kHeapObjectTag));
|
| }
|
|
|
| +void MacroAssembler::FastAllocate(int object_size, Register result,
|
| + Register result_end, AllocationFlags flags) {
|
| + DCHECK(!result.is(result_end));
|
| + // Load address of new object into result.
|
| + LoadAllocationTopHelper(result, no_reg, flags);
|
| +
|
| + if ((flags & DOUBLE_ALIGNMENT) != 0) {
|
| + MakeSureDoubleAlignedHelper(result, no_reg, NULL, flags);
|
| + }
|
| +
|
| + leap(result_end, Operand(result, object_size));
|
| +
|
| + UpdateAllocationTopHelper(result_end, no_reg, flags);
|
| +
|
| + addp(result, Immediate(kHeapObjectTag));
|
| +}
|
| +
|
| +void MacroAssembler::FastAllocate(Register object_size, Register result,
|
| + Register result_end, AllocationFlags flags) {
|
| + DCHECK(!result.is(result_end));
|
| + // Load address of new object into result.
|
| + LoadAllocationTopHelper(result, no_reg, flags);
|
| +
|
| + if ((flags & DOUBLE_ALIGNMENT) != 0) {
|
| + MakeSureDoubleAlignedHelper(result, no_reg, NULL, flags);
|
| + }
|
| +
|
| + leap(result_end, Operand(result, object_size, times_1, 0));
|
| +
|
| + UpdateAllocationTopHelper(result_end, no_reg, flags);
|
| +
|
| + addp(result, Immediate(kHeapObjectTag));
|
| +}
|
|
|
| void MacroAssembler::AllocateHeapNumber(Register result,
|
| Register scratch,
|
|
|