Index: src/x64/macro-assembler-x64.h |
diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h |
index bbbfdb0ab52ca75447360b0cb859caca9298c623..9cc496f8c2dd13b3e0c4328724bf202f2f762bc8 100644 |
--- a/src/x64/macro-assembler-x64.h |
+++ b/src/x64/macro-assembler-x64.h |
@@ -788,6 +788,7 @@ class MacroAssembler: public Assembler { |
// Load a heap object and handle the case of new-space objects by |
// indirecting via a global cell. |
void LoadHeapObject(Register result, Handle<HeapObject> object); |
+ void CmpHeapObject(Register reg, Handle<HeapObject> object); |
void PushHeapObject(Handle<HeapObject> object); |
void LoadObject(Register result, Handle<Object> object) { |
@@ -799,6 +800,15 @@ class MacroAssembler: public Assembler { |
} |
} |
+ void CmpObject(Register reg, Handle<Object> object) { |
+ ALLOW_HANDLE_DEREF(isolate(), "heap object check"); |
+ if (object->IsHeapObject()) { |
+ CmpHeapObject(reg, Handle<HeapObject>::cast(object)); |
+ } else { |
+ Cmp(reg, object); |
+ } |
+ } |
+ |
// Load a global cell into a register. |
void LoadGlobalCell(Register dst, Handle<JSGlobalPropertyCell> cell); |