Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 852e0788604f45c851adfa551c0d3ae0e58361ba..d095b3ae9b6f5b83596dd6b0f364b47e21c8f80a 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -2966,8 +2966,15 @@ |
void MacroAssembler::MoveHeapObject(Register result, |
Handle<Object> object) { |
+ AllowDeferredHandleDereference using_raw_address; |
DCHECK(object->IsHeapObject()); |
- Move(result, object, RelocInfo::EMBEDDED_OBJECT); |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<Cell> cell = isolate()->factory()->NewCell(object); |
+ Move(result, cell, RelocInfo::CELL); |
+ movp(result, Operand(result, 0)); |
+ } else { |
+ Move(result, object, RelocInfo::EMBEDDED_OBJECT); |
+ } |
} |