Index: runtime/vm/flow_graph_compiler_x64.cc |
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc |
index bc5181d8ea0325fd91dbe3c2ae39a86969458b45..2e76af5b98183743a909ac78b335c30e5181972e 100644 |
--- a/runtime/vm/flow_graph_compiler_x64.cc |
+++ b/runtime/vm/flow_graph_compiler_x64.cc |
@@ -504,7 +504,10 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos, |
__ pushq(RDX); // Instantiator type arguments. |
__ LoadObject(RAX, test_cache); |
__ pushq(RAX); |
- GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, locs); |
+ GenerateCallRuntime(token_pos, |
+ deopt_id, |
+ kInstanceofRuntimeEntry, |
+ locs); |
// Pop the parameters supplied to the runtime entry. The result of the |
// instanceof runtime call will be left as the result of the operation. |
__ Drop(5); |
@@ -624,14 +627,18 @@ void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { |
if (!is_optimizing()) { |
if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { |
AssertAssignableInstr* assert = instr->AsAssertAssignable(); |
- AddCurrentDescriptor(PcDescriptors::kDeoptBefore, |
+ AddCurrentDescriptor(PcDescriptors::kDeopt, |
assert->deopt_id(), |
assert->token_pos()); |
} else if (instr->IsGuardField()) { |
GuardFieldInstr* guard = instr->AsGuardField(); |
- AddCurrentDescriptor(PcDescriptors::kDeoptBefore, |
+ AddCurrentDescriptor(PcDescriptors::kDeopt, |
guard->deopt_id(), |
Scanner::kDummyTokenIndex); |
+ } else if (instr->CanBeDeoptimizationTarget()) { |
+ AddCurrentDescriptor(PcDescriptors::kDeopt, |
+ instr->deopt_id(), |
+ Scanner::kDummyTokenIndex); |
} |
AllocateRegistersLocally(instr); |
} |
@@ -1094,14 +1101,13 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
RecordSafepoint(locs); |
// Marks either the continuation point in unoptimized code or the |
// deoptimization point in optimized code, after call. |
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
if (is_optimizing()) { |
- AddDeoptIndexAtCall(deopt_id, token_pos); |
+ AddDeoptIndexAtCall(deopt_id_after, token_pos); |
} else { |
// Add deoptimization continuation point after the call and before the |
// arguments are removed. |
- AddCurrentDescriptor(PcDescriptors::kDeoptAfter, |
- deopt_id, |
- token_pos); |
+ AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
} |
} |
@@ -1116,14 +1122,13 @@ void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos, |
if (deopt_id != Isolate::kNoDeoptId) { |
// Marks either the continuation point in unoptimized code or the |
// deoptimization point in optimized code, after call. |
+ const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
if (is_optimizing()) { |
- AddDeoptIndexAtCall(deopt_id, token_pos); |
+ AddDeoptIndexAtCall(deopt_id_after, token_pos); |
} else { |
// Add deoptimization continuation point after the call and before the |
// arguments are removed. |
- AddCurrentDescriptor(PcDescriptors::kDeoptAfter, |
- deopt_id, |
- token_pos); |
+ AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
} |
} |
} |
@@ -1235,7 +1240,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
__ call(RAX); |
AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
RecordSafepoint(locs); |
- AddDeoptIndexAtCall(deopt_id, token_pos); |
+ AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
__ Drop(argument_count); |
} |