Index: src/ppc/macro-assembler-ppc.cc |
diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc |
index 80e17e36f6a1bc5c6e80497bc99785c67586062c..658854003573ca5cd86581cc77da9277aeab8b6d 100644 |
--- a/src/ppc/macro-assembler-ppc.cc |
+++ b/src/ppc/macro-assembler-ppc.cc |
@@ -4430,7 +4430,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; |
Register mask = scratch2_reg; |
DCHECK(!AreAliased(receiver_reg, scratch_reg, mask)); |
@@ -4440,7 +4441,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
DCHECK((~Page::kPageAlignmentMask & 0xffff) == 0); |
lis(mask, Operand((~Page::kPageAlignmentMask >> 16))); |
- addi(scratch_reg, receiver_reg, Operand(kMementoEndOffset)); |
+ addi(scratch_reg, receiver_reg, Operand(kMementoLastWordOffset)); |
// If the object is in new space, we need to check whether it is on the same |
// page as the current top. |
@@ -4461,7 +4462,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver_reg, |
// we are below top. |
bind(&top_check); |
cmp(scratch_reg, ip); |
- bgt(no_memento_found); |
+ bge(no_memento_found); |
// Memento map check. |
bind(&map_check); |
LoadP(scratch_reg, MemOperand(receiver_reg, kMementoMapOffset)); |