Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index c1161d73dd5ec411e79c767cff5b95717553ef77..cdacbf3c0d86cb588e0bfafbfd8392f017f447f4 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -81,6 +81,19 @@ void MacroAssembler::StoreRoot(Register source, |
} |
+void MacroAssembler::LoadHeapObject(Register result, |
+ Handle<HeapObject> object) { |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ li(result, Operand(cell)); |
+ lw(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset)); |
+ } else { |
+ li(result, Operand(object)); |
+ } |
+} |
+ |
+ |
// Push and pop all registers that can hold pointers. |
void MacroAssembler::PushSafepointRegisters() { |
// Safepoints expect a block of kNumSafepointRegisters values on the |
@@ -3555,7 +3568,7 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
ASSERT(flag == JUMP_FUNCTION || has_frame()); |
// Get the function and setup the context. |
- li(a1, Operand(function)); |
+ LoadHeapObject(a1, function); |
lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
ParameterCount expected(function->shared()->formal_parameter_count()); |