| Index: src/ia32/macro-assembler-ia32.cc
 | 
| ===================================================================
 | 
| --- src/ia32/macro-assembler-ia32.cc	(revision 10127)
 | 
| +++ src/ia32/macro-assembler-ia32.cc	(working copy)
 | 
| @@ -755,7 +755,7 @@
 | 
|  
 | 
|    // Push the state and the code object.
 | 
|    push(Immediate(state));
 | 
| -  push(CodeObject());
 | 
| +  Push(CodeObject());
 | 
|  
 | 
|    // Link the current handler as the next handler.
 | 
|    ExternalReference handler_address(Isolate::kHandlerAddress, isolate());
 | 
| @@ -2022,7 +2022,7 @@
 | 
|    ASSERT(flag == JUMP_FUNCTION || has_frame());
 | 
|  
 | 
|    // Get the function and setup the context.
 | 
| -  mov(edi, Immediate(function));
 | 
| +  LoadHeapObject(edi, function);
 | 
|    mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
 | 
|  
 | 
|    ParameterCount expected(function->shared()->formal_parameter_count());
 | 
| @@ -2151,6 +2151,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);
 | 
|  }
 | 
| @@ -2182,11 +2205,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));
 | 
| 
 |