| Index: runtime/vm/flow_graph_compiler.cc
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler.cc (revision 40150)
|
| +++ runtime/vm/flow_graph_compiler.cc (working copy)
|
| @@ -541,13 +541,16 @@
|
|
|
|
|
| void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id,
|
| - intptr_t token_pos) {
|
| + intptr_t token_pos,
|
| + intptr_t input_count) {
|
| ASSERT(is_optimizing());
|
| ASSERT(!intrinsic_mode());
|
| + Environment* env = pending_deoptimization_env_->DeepCopy(
|
| + isolate(), pending_deoptimization_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);
|
| }
|
| @@ -872,6 +875,29 @@
|
| }
|
|
|
|
|
| +// Record safe point and deoptimization info if applicable.
|
| +void FlowGraphCompiler::RecordCallInfo(intptr_t token_pos,
|
| + RawPcDescriptors::Kind kind,
|
| + intptr_t deopt_id,
|
| + LocationSummary* locs,
|
| + intptr_t input_count_adjustment) {
|
| + AddCurrentDescriptor(kind, deopt_id, token_pos);
|
| + RecordSafepoint(locs);
|
| + 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_after, token_pos, input_count_adjustment);
|
| + } else {
|
| + // Add deoptimization continuation point after the call and before the
|
| + // arguments are removed.
|
| + AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| void FlowGraphCompiler::GenerateInstanceCall(
|
| intptr_t deopt_id,
|
| intptr_t token_pos,
|
|
|