Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_dbc.cc |
| diff --git a/runtime/vm/flow_graph_compiler_dbc.cc b/runtime/vm/flow_graph_compiler_dbc.cc |
| index 47cfb97c4d0c605ba11660405c98e1837f27ef24..d623467fd736361aada26262962b93a5cc157a52 100644 |
| --- a/runtime/vm/flow_graph_compiler_dbc.cc |
| +++ b/runtime/vm/flow_graph_compiler_dbc.cc |
| @@ -184,22 +184,28 @@ void FlowGraphCompiler::RecordAfterCallHelper(TokenPosition token_pos, |
| 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 = Thread::ToDeoptAfter(deopt_id); |
| if (is_optimizing()) { |
| // Return/ReturnTOS instruction drops incoming arguments so |
| // we have to drop outgoing arguments from the innermost environment. |
| // On all other architectures caller drops outgoing arguments itself |
| // hence the difference. |
| pending_deoptimization_env_->DropArguments(argument_count); |
| - CompilerDeoptInfo* info = AddDeoptIndexAtCall(deopt_id_after); |
| - if (result == kHasResult) { |
| - info->mark_lazy_deopt_with_result(); |
| + intptr_t deopt_id_after; |
|
Vyacheslav Egorov (Google)
2017/05/24 19:14:05
This is a bit suspicious. What kind of instruction
rmacnak
2017/05/24 19:17:31
A CreateArrayInstr. The other architectures are fa
Vyacheslav Egorov (Google)
2017/05/24 19:25:17
I think it is possible to cause lazy deoptimizatio
Vyacheslav Egorov (Google)
2017/05/24 19:50:32
Actually these days a simplest repro like this wou
|
| + if (deopt_id == Thread::kNoDeoptId) { |
| + deopt_id_after = deopt_id; |
| + } else { |
| + deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| + CompilerDeoptInfo* info = AddDeoptIndexAtCall(deopt_id_after); |
| + if (result == kHasResult) { |
| + info->mark_lazy_deopt_with_result(); |
| + } |
| } |
| // This descriptor is needed for exception handling in optimized code. |
| AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id_after, token_pos); |
| } else { |
| // Add deoptimization continuation point after the call and before the |
| // arguments are removed. |
| + const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
| } |
| } |