Chromium Code Reviews| 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..a82b5792972d35668a61b2ece70ca252902b229b 100644 |
| --- a/src/x64/macro-assembler-x64.cc |
| +++ b/src/x64/macro-assembler-x64.cc |
| @@ -4816,7 +4816,7 @@ void MacroAssembler::MakeSureDoubleAlignedHelper(Register result, |
| AllocationFlags flags) { |
| if (kPointerSize == kDoubleSize) { |
| if (FLAG_debug_code) { |
| - testl(result, Immediate(kDoubleAlignmentMask)); |
| + testl(result, Immediate(kDoubleAlignmentMask - kHeapObjectTag)); |
|
Michael Lippautz
2016/04/28 16:58:08
Don't really like this one (and below) but also do
Hannes Payer (out of office)
2016/04/29 14:13:31
I think that is fine. Maybe have a constant for th
|
| Check(zero, kAllocationIsNotDoubleAligned); |
| } |
| } else { |
| @@ -4828,7 +4828,7 @@ void MacroAssembler::MakeSureDoubleAlignedHelper(Register result, |
| // used in UpdateAllocationTopHelper later. |
| DCHECK(!scratch.is(kScratchRegister)); |
| Label aligned; |
| - testl(result, Immediate(kDoubleAlignmentMask)); |
| + testl(result, Immediate(kDoubleAlignmentMask - kHeapObjectTag)); |
| j(zero, &aligned, Label::kNear); |
| if ((flags & PRETENURE) != 0) { |
| ExternalReference allocation_limit = |
| @@ -4849,7 +4849,7 @@ void MacroAssembler::UpdateAllocationTopHelper(Register result_end, |
| AllocationFlags flags) { |
| if (emit_debug_code()) { |
| testp(result_end, Immediate(kObjectAlignmentMask)); |
| - Check(zero, kUnalignedAllocationInNewSpace); |
| + Check(not_zero, kUnalignedAllocationInNewSpace); |
| } |
| ExternalReference allocation_top = |
| @@ -4913,12 +4913,12 @@ void MacroAssembler::Allocate(int object_size, |
| // Update allocation top. |
| UpdateAllocationTopHelper(top_reg, scratch, flags); |
| + // Untag result_end. |
| + STATIC_ASSERT(kHeapObjectTag == 1); |
| + decp(result_end); |
|
Benedikt Meurer
2016/05/01 17:30:03
Hm, who needs this result_end anyways? Shouldn't t
|
| + |
| if (top_reg.is(result)) { |
| - subp(result, Immediate(object_size - kHeapObjectTag)); |
| - } else { |
| - // Tag the result. |
| - DCHECK(kHeapObjectTag == 1); |
| - incp(result); |
| + subp(result, Immediate(object_size)); |
| } |
| } |
| @@ -4981,8 +4981,9 @@ void MacroAssembler::Allocate(Register object_size, |
| // Update allocation top. |
| UpdateAllocationTopHelper(result_end, scratch, flags); |
| - // Tag the result. |
| - addp(result, Immediate(kHeapObjectTag)); |
| + // Untag result_end. |
| + STATIC_ASSERT(kHeapObjectTag == 1); |
| + decp(result_end); |
| } |