Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index 543dc7234bdf847b38bb1965e05ba78afffb0557..86ddefa9ad40ea23fe770d8edbe3ef8ea9df62a6 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -1425,7 +1425,14 @@ |
void MacroAssembler::LoadHeapObject(Register result, |
Handle<HeapObject> object) { |
- Mov(result, Operand(object)); |
+ AllowDeferredHandleDereference using_raw_address; |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<Cell> cell = isolate()->factory()->NewCell(object); |
+ Mov(result, Operand(cell)); |
+ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
+ } else { |
+ Mov(result, Operand(object)); |
+ } |
} |