Index: src/x64/macro-assembler-x64.cc |
=================================================================== |
--- src/x64/macro-assembler-x64.cc (revision 9574) |
+++ src/x64/macro-assembler-x64.cc (working copy) |
@@ -2294,6 +2294,43 @@ |
} |
+void MacroAssembler::LoadHeapObject(Register result, |
+ Handle<HeapObject> object) { |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ movq(result, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
+ movq(result, Operand(result, 0)); |
+ } else { |
+ Move(result, object); |
+ } |
+} |
+ |
+ |
+void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { |
+ if (isolate()->heap()->InNewSpace(*object)) { |
+ Handle<JSGlobalPropertyCell> cell = |
+ isolate()->factory()->NewJSGlobalPropertyCell(object); |
+ movq(kScratchRegister, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
+ movq(kScratchRegister, Operand(kScratchRegister, 0)); |
+ push(kScratchRegister); |
+ } else { |
+ Push(object); |
+ } |
+} |
+ |
+ |
+void MacroAssembler::LoadGlobalCell(Register dst, |
+ Handle<JSGlobalPropertyCell> cell) { |
+ if (dst.is(rax)) { |
+ load_rax(cell.location(), RelocInfo::GLOBAL_PROPERTY_CELL); |
+ } else { |
+ movq(dst, cell, RelocInfo::GLOBAL_PROPERTY_CELL); |
+ movq(dst, Operand(dst, 0)); |
+ } |
+} |
+ |
+ |
void MacroAssembler::Push(Smi* source) { |
intptr_t smi = reinterpret_cast<intptr_t>(source); |
if (is_int32(smi)) { |
@@ -3069,7 +3106,7 @@ |
ASSERT(function->is_compiled()); |
// Get the function and setup the context. |
- Move(rdi, Handle<JSFunction>(function)); |
+ LoadHeapObject(rdi, Handle<JSFunction>(function)); |
movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
if (V8::UseCrankshaft()) { |