Index: src/ia32/macro-assembler-ia32.cc |
=================================================================== |
--- src/ia32/macro-assembler-ia32.cc (revision 9574) |
+++ src/ia32/macro-assembler-ia32.cc (working copy) |
@@ -2066,7 +2066,7 @@ |
ASSERT(function->is_compiled()); |
// Get the function and setup the context. |
- mov(edi, Immediate(Handle<JSFunction>(function))); |
+ LoadHeapObject(edi, Handle<JSFunction>(function)); |
mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
ParameterCount expected(function->shared()->formal_parameter_count()); |
@@ -2201,6 +2201,29 @@ |
} |
+void MacroAssembler::LoadHeapObject(Register result, |
+ Handle<HeapObject> object) { |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ mov(result, Operand::Cell(cell)); |
+ } else { |
+ mov(result, object); |
+ } |
+} |
+ |
+ |
+void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ push(Operand::Cell(cell)); |
+ } else { |
+ Push(object); |
+ } |
+} |
+ |
+ |
void MacroAssembler::Ret() { |
ret(0); |
} |
@@ -2234,11 +2257,6 @@ |
} |
-void MacroAssembler::Move(Register dst, Handle<Object> value) { |
- mov(dst, value); |
-} |
- |
- |
void MacroAssembler::SetCounter(StatsCounter* counter, int value) { |
if (FLAG_native_code_counters && counter->Enabled()) { |
mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value)); |