| Index: runtime/vm/flow_graph_compiler.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler.cc (revision 35546)
|
| +++ runtime/vm/flow_graph_compiler.cc (working copy)
|
| @@ -471,13 +471,22 @@
|
| }
|
|
|
|
|
| +// Add a lazy deoptimization environment at a call. input_count specifies
|
| +// a number of input operands that will be removed from the environment to
|
| +// match the stack frame layout after the call: Pushed args are present,
|
| +// input operands are consumed before the call.
|
| void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
|
| - intptr_t token_pos) {
|
| + intptr_t token_pos,
|
| + intptr_t input_count) {
|
| ASSERT(is_optimizing());
|
| + Environment* env = pending_deoptimization_env_;
|
| + if (input_count > 0) {
|
| + env = env->DeepCopy(env->Length() - input_count);
|
| + }
|
| CompilerDeoptInfo* info =
|
| new CompilerDeoptInfo(deopt_id,
|
| ICData::kDeoptAtCall,
|
| - pending_deoptimization_env_);
|
| + env);
|
| info->set_pc_offset(assembler()->CodeSize());
|
| deopt_infos_.Add(info);
|
| }
|
|
|