Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 1fdf22d3f2030c10c10e91d743b534e9b8b31232..63d4f8530e36851f5409adeb7bd1fdb8f44ef44c 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -4896,23 +4896,27 @@ void MacroAssembler::Allocate(int 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); |
- |
Register top_reg = result_end.is_valid() ? result_end : result; |
if (!top_reg.is(result)) { |
Benedikt Meurer
2016/04/19 07:25:39
We can fuse this movp and the addp into a single l
Hannes Payer (out of office)
2016/04/19 11:03:56
Done.
|
movp(top_reg, result); |
} |
addp(top_reg, Immediate(object_size)); |
- j(carry, gc_required); |
- Operand limit_operand = ExternalOperand(allocation_limit); |
- cmpp(top_reg, limit_operand); |
- j(above, gc_required); |
- // Update allocation top. |
- UpdateAllocationTopHelper(top_reg, scratch, flags); |
+ if ((flags & ALLOCATION_FOLDING_DOMINATED) == 0) { |
+ j(carry, gc_required); |
+ // Calculate new top and bail out if new space is exhausted. |
Benedikt Meurer
2016/04/19 07:25:39
This comment is wrong here, as the calculation hap
Hannes Payer (out of office)
2016/04/19 11:03:56
Done.
|
+ ExternalReference allocation_limit = |
+ AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
+ Operand limit_operand = ExternalOperand(allocation_limit); |
+ cmpp(top_reg, limit_operand); |
+ j(above, gc_required); |
+ } |
+ |
+ if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { |
+ // Update allocation top. |
+ UpdateAllocationTopHelper(top_reg, scratch, flags); |
+ } |
bool tag_result = (flags & TAG_OBJECT) != 0; |
if (top_reg.is(result)) { |
@@ -4972,20 +4976,25 @@ 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)) { |
Benedikt Meurer
2016/04/19 07:25:38
Same here, see comment above.
Hannes Payer (out of office)
2016/04/19 11:03:56
Done.
|
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_DOMINATED) == 0) { |
+ j(carry, gc_required); |
+ // Calculate new top and bail out if new space is exhausted. |
Benedikt Meurer
2016/04/19 07:25:38
Same here, see comment above.
Hannes Payer (out of office)
2016/04/19 11:03:56
Done.
|
+ ExternalReference allocation_limit = |
+ AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
+ Operand limit_operand = ExternalOperand(allocation_limit); |
+ cmpp(result_end, limit_operand); |
+ j(above, gc_required); |
+ } |
+ |
+ if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { |
+ // Update allocation top. |
+ UpdateAllocationTopHelper(result_end, scratch, flags); |
+ } |
// Tag the result if requested. |
if ((flags & TAG_OBJECT) != 0) { |
@@ -4993,6 +5002,14 @@ void MacroAssembler::Allocate(Register object_size, |
} |
} |
+void MacroAssembler::SetTop(Register value, AllocationFlags flags) { |
+ ExternalReference allocation_top = |
+ AllocationUtils::GetAllocationTopReference(isolate(), flags); |
+ |
+ subp(value, Immediate(kHeapObjectTag)); |
Benedikt Meurer
2016/04/19 07:25:39
How about this one instead?
// TODO(hpayer): Chan
Hannes Payer (out of office)
2016/04/19 11:03:56
Store already uses the scratch register.
|
+ Store(allocation_top, value); |
+ addp(value, Immediate(kHeapObjectTag)); |
+} |
void MacroAssembler::AllocateHeapNumber(Register result, |
Register scratch, |