Index: runtime/vm/flow_graph_compiler_x64.cc |
=================================================================== |
--- runtime/vm/flow_graph_compiler_x64.cc (revision 26436) |
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy) |
@@ -66,10 +66,9 @@ |
// The real frame starts here. |
builder->MarkFrameStart(); |
- // Callee's PC marker is not used anymore. Pass Function::null() to set to 0. |
+ // Current PP, FP, and PC. |
+ builder->AddPp(current->function(), slot_ix++); |
builder->AddPcMarker(Function::Handle(), slot_ix++); |
- |
- // Current FP and PC. |
builder->AddCallerFp(slot_ix++); |
builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++); |
@@ -85,13 +84,14 @@ |
builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); |
} |
- // Current PC marker and caller FP. |
- builder->AddPcMarker(current->function(), slot_ix++); |
- builder->AddCallerFp(slot_ix++); |
- |
Environment* previous = current; |
current = current->outer(); |
while (current != NULL) { |
+ // PP, FP, and PC. |
+ builder->AddPp(current->function(), slot_ix++); |
+ builder->AddPcMarker(previous->function(), slot_ix++); |
+ builder->AddCallerFp(slot_ix++); |
+ |
// For any outer environment the deopt id is that of the call instruction |
// which is recorded in the outer environment. |
builder->AddReturnAddress(current->function(), |
@@ -115,10 +115,6 @@ |
slot_ix++); |
} |
- // PC marker and caller FP. |
- builder->AddPcMarker(current->function(), slot_ix++); |
- builder->AddCallerFp(slot_ix++); |
- |
// Iterate on the outer environment. |
previous = current; |
current = current->outer(); |
@@ -126,7 +122,11 @@ |
// The previous pointer is now the outermost environment. |
ASSERT(previous != NULL); |
- // For the outermost environment, set caller PC. |
+ // For the outermost environment, set caller PC, caller PP, and caller FP. |
+ builder->AddCallerPp(slot_ix++); |
+ // PC marker. |
+ builder->AddPcMarker(previous->function(), slot_ix++); |
+ builder->AddCallerFp(slot_ix++); |
builder->AddCallerPc(slot_ix++); |
// For the outermost environment, set the incoming arguments. |
@@ -138,7 +138,6 @@ |
return deopt_info.raw(); |
} |
- |
void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler, |
intptr_t stub_ix) { |
// Calls do not need stubs, they share a deoptimization trampoline. |
@@ -1016,7 +1015,7 @@ |
ICData::New(function, Symbols::Call(), Object::empty_array(), |
Isolate::kNoDeoptId, kNumArgsChecked)); |
__ LoadObject(RBX, ic_data); |
- __ LeaveFrame(); // The arguments are still on the stack. |
+ __ LeaveFrame(true); // The arguments are still on the stack. |
__ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); |
// The noSuchMethod call may return to the caller, but not here. |
__ int3(); |
@@ -1077,7 +1076,14 @@ |
function.is_optimizable() && |
(!is_optimizing() || may_reoptimize())) { |
const Register function_reg = RDI; |
+ |
+ |
+ // Temporarily load pool pointer. |
+ __ pushq(PP); // Preserve PP of caller. |
+ __ LoadPoolPointer(); |
__ LoadObject(function_reg, function); |
+ __ popq(PP); // Restore PP of caller. |
+ |
// Patch point is after the eventually inlined function object. |
AddCurrentDescriptor(PcDescriptors::kEntryPatch, |
Isolate::kNoDeoptId, |
@@ -1170,7 +1176,7 @@ |
ICData::New(function, name, Object::empty_array(), |
Isolate::kNoDeoptId, kNumArgsChecked)); |
__ LoadObject(RBX, ic_data); |
- __ LeaveFrame(); // The arguments are still on the stack. |
+ __ LeaveFrame(true); // The arguments are still on the stack. |
__ jmp(&StubCode::CallNoSuchMethodFunctionLabel()); |
// The noSuchMethod call may return to the caller, but not here. |
__ int3(); |
@@ -1229,7 +1235,7 @@ |
const ExternalLabel* label, |
PcDescriptors::Kind kind, |
LocationSummary* locs) { |
- __ call(label); |
+ __ CallPatchable(label); |
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos); |
RecordSafepoint(locs); |
} |
@@ -1240,7 +1246,7 @@ |
const ExternalLabel* label, |
PcDescriptors::Kind kind, |
LocationSummary* locs) { |
- __ call(label); |
+ __ CallPatchable(label); |
AddCurrentDescriptor(kind, deopt_id, token_pos); |
RecordSafepoint(locs); |
// Marks either the continuation point in unoptimized code or the |
@@ -1613,7 +1619,6 @@ |
} |
- |
void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, |
FpuRegister left, |
FpuRegister right, |