Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 3c8b4ad8b1453c13549c1a8ea36c3512fcec4b0d..dc30a6ca626df5633da45ae97281d8df446b288f 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -2299,6 +2299,7 @@ void MacroAssembler::Move(Register dst, Handle<Object> source) { |
if (source->IsSmi()) { |
Move(dst, Smi::cast(*source)); |
} else { |
+ ASSERT(source->IsHeapObject()); |
movq(dst, source, RelocInfo::EMBEDDED_OBJECT); |
} |
} |
@@ -2309,6 +2310,7 @@ void MacroAssembler::Move(const Operand& dst, Handle<Object> source) { |
if (source->IsSmi()) { |
Move(dst, Smi::cast(*source)); |
} else { |
+ ASSERT(source->IsHeapObject()); |
movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
movq(dst, kScratchRegister); |
} |
@@ -2320,7 +2322,8 @@ void MacroAssembler::Cmp(Register dst, Handle<Object> source) { |
if (source->IsSmi()) { |
Cmp(dst, Smi::cast(*source)); |
} else { |
- Move(kScratchRegister, source); |
+ ASSERT(source->IsHeapObject()); |
+ movq(kScratchRegister, source, RelocInfo::EMBEDDED_OBJECT); |
cmpq(dst, kScratchRegister); |
} |
} |
@@ -2364,6 +2367,19 @@ void MacroAssembler::LoadHeapObject(Register result, |
} |
+void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { |
+ ALLOW_HANDLE_DEREF(isolate(), "using raw address"); |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
+ cmpq(reg, Operand(kScratchRegister, 0)); |
+ } else { |
+ Cmp(reg, object); |
+ } |
+} |
+ |
+ |
void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
ALLOW_HANDLE_DEREF(isolate(), "using raw address"); |
if (isolate()->heap()->InNewSpace(*object)) { |