Index: src/s390/macro-assembler-s390.cc |
diff --git a/src/s390/macro-assembler-s390.cc b/src/s390/macro-assembler-s390.cc |
index 66c04d2adc72b385adeaac2e338afa66b7b988ed..fbf82ccbc539d38e4bc545205bf5984a28830e61 100644 |
--- a/src/s390/macro-assembler-s390.cc |
+++ b/src/s390/macro-assembler-s390.cc |
@@ -3354,7 +3354,8 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
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; |
DCHECK(!AreAliased(receiver_reg, scratch_reg)); |
@@ -3365,7 +3366,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
// If the object is in new space, we need to check whether it is on the same |
// page as the current top. |
- AddP(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
+ AddP(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
mov(ip, Operand(new_space_allocation_top_adr)); |
LoadP(ip, MemOperand(ip)); |
XorP(r0, scratch_reg, ip); |
@@ -3383,7 +3384,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
// we are below top. |
bind(&top_check); |
CmpP(scratch_reg, ip); |
- bgt(no_memento_found); |
+ bge(no_memento_found); |
// Memento map check. |
bind(&map_check); |
LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |