Index: src/ia32/macro-assembler-ia32.h |
diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h |
index fd4a4b39ecae73d70f5ae10d6b5c3dd6b046f1b9..340055ad86055e25045532a4320b7f69cb89d36b 100644 |
--- a/src/ia32/macro-assembler-ia32.h |
+++ b/src/ia32/macro-assembler-ia32.h |
@@ -272,6 +272,7 @@ class MacroAssembler: public Assembler { |
void LoadFromSafepointRegisterSlot(Register dst, Register src); |
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) { |
@@ -283,6 +284,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, Immediate(object)); |
+ } |
+ } |
+ |
// --------------------------------------------------------------------------- |
// JavaScript invokes |