Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index 0c3f231a3f17e382cbe33350150ec777922f2416..0490c388d9bbbb8c79a01639edd58a75abb338a8 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -3097,6 +3097,9 @@ |
// The top pointer is not updated for allocation folding dominators. |
Str(result_end, MemOperand(top_address)); |
} |
+ |
+ // Tag the object. |
+ ObjectTag(result, result); |
} |
@@ -3166,7 +3169,7 @@ |
if (emit_debug_code()) { |
Tst(result_end, kObjectAlignmentMask); |
- Check(ne, kUnalignedAllocationInNewSpace); |
+ Check(eq, kUnalignedAllocationInNewSpace); |
} |
Ccmp(result_end, alloc_limit, NoFlag, cc); |
@@ -3176,6 +3179,9 @@ |
// The top pointer is not updated for allocation folding dominators. |
Str(result_end, MemOperand(top_address)); |
} |
+ |
+ // Tag the object. |
+ ObjectTag(result, result); |
} |
void MacroAssembler::FastAllocate(int object_size, Register result, |
@@ -3208,6 +3214,8 @@ |
// Calculate new top and write it back. |
Adds(result_end, result, object_size); |
Str(result_end, MemOperand(top_address)); |
+ |
+ ObjectTag(result, result); |
} |
void MacroAssembler::FastAllocate(Register object_size, Register result, |
@@ -3241,8 +3249,10 @@ |
if (emit_debug_code()) { |
Tst(result_end, kObjectAlignmentMask); |
- Check(ne, kUnalignedAllocationInNewSpace); |
- } |
+ Check(eq, kUnalignedAllocationInNewSpace); |
+ } |
+ |
+ ObjectTag(result, result); |
} |
void MacroAssembler::AllocateTwoByteString(Register result, |