Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 8976d9fde1af877654e9fa21452c1da934702dff..9afb7604af3743d79c3dca24647074ee6b4c13e0 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -3804,13 +3804,14 @@ void MacroAssembler::TestJSArrayForAllocationMemento( |
ExternalReference new_space_allocation_top_adr = |
ExternalReference::new_space_allocation_top_address(isolate()); |
const int kMementoMapOffset = JSArray::kSize - kHeapObjectTag; |
- const int kMementoEndOffset = kMementoMapOffset + AllocationMemento::kSize; |
+ const int kMementoLastWordOffset = |
+ kMementoMapOffset + AllocationMemento::kSize - kPointerSize; |
// Bail out if the object is not in new space. |
JumpIfNotInNewSpace(receiver_reg, scratch_reg, no_memento_found); |
// If the object is in new space, we need to check whether it is on the same |
// page as the current top. |
- add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
+ add(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
mov(ip, Operand(new_space_allocation_top_adr)); |
ldr(ip, MemOperand(ip)); |
eor(scratch_reg, scratch_reg, Operand(ip)); |
@@ -3819,7 +3820,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento( |
// The object is on a different page than allocation top. Bail out if the |
// object sits on the page boundary as no memento can follow and we cannot |
// touch the memory following it. |
- add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
+ add(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
eor(scratch_reg, scratch_reg, Operand(receiver_reg)); |
tst(scratch_reg, Operand(~Page::kPageAlignmentMask)); |
b(ne, no_memento_found); |
@@ -3828,11 +3829,11 @@ void MacroAssembler::TestJSArrayForAllocationMemento( |
// If top is on the same page as the current object, we need to check whether |
// we are below top. |
bind(&top_check); |
- add(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
+ add(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
mov(ip, Operand(new_space_allocation_top_adr)); |
ldr(ip, MemOperand(ip)); |
cmp(scratch_reg, ip); |
- b(gt, no_memento_found); |
+ b(ge, no_memento_found); |
// Memento map check. |
bind(&map_check); |
ldr(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |