Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index 2c0fd16b56ca8292a694cfa88b35580f8360bbba..fd70711c34ea64eb3f059d27e5f03c498fd45edf 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -1536,7 +1536,7 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
Label* no_memento_found) { |
Label map_check; |
Label top_check; |
- ExternalReference new_space_allocation_top = |
+ 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; |
@@ -1546,7 +1546,9 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
Add(scratch1, receiver, kMementoEndOffset); |
// If the object is in new space, we need to check whether it is on the same |
// page as the current top. |
- Eor(scratch2, scratch1, new_space_allocation_top); |
+ Mov(scratch2, new_space_allocation_top_adr); |
+ Ldr(scratch2, MemOperand(scratch2)); |
+ Eor(scratch2, scratch1, scratch2); |
Tst(scratch2, ~Page::kPageAlignmentMask); |
B(eq, &top_check); |
// The object is on a different page than allocation top. Bail out if the |
@@ -1560,7 +1562,9 @@ void MacroAssembler::TestJSArrayForAllocationMemento(Register receiver, |
// If top is on the same page as the current object, we need to check whether |
// we are below top. |
bind(&top_check); |
- Cmp(scratch1, new_space_allocation_top); |
+ Mov(scratch2, new_space_allocation_top_adr); |
+ Ldr(scratch2, MemOperand(scratch2)); |
+ Cmp(scratch1, scratch2); |
B(gt, no_memento_found); |
// Memento map check. |
bind(&map_check); |