Chromium Code Reviews| Index: runtime/vm/intermediate_language.cc |
| diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
| index 9ca50407861f25d80bfa09e82cf196ef1b1d42c6..a48dcf517a179ea9b9046b830c0b22d570106e13 100644 |
| --- a/runtime/vm/intermediate_language.cc |
| +++ b/runtime/vm/intermediate_language.cc |
| @@ -3192,6 +3192,29 @@ RawType* PolymorphicInstanceCallInstr::ComputeRuntimeType( |
| } |
| +Definition* InstanceCallInstr::Canonicalize(FlowGraph* flow_graph) { |
| + const intptr_t receiver_cid = PushArgumentAt(0)->value()->Type()->ToCid(); |
| + |
| + if (!HasICData()) return this; |
| + |
| + const ICData& new_ic_data = |
| + FlowGraphCompiler::TrySpecializeICData(*ic_data(), receiver_cid); |
| + if (new_ic_data.raw() == ic_data()->raw()) { |
| + // No specialization. |
| + return this; |
| + } |
| + |
| + const bool with_checks = false; |
| + const bool complete = false; |
| + PolymorphicInstanceCallInstr* specialized = new PolymorphicInstanceCallInstr( |
| + this, new_ic_data, with_checks, complete); |
| + |
|
Vyacheslav Egorov (Google)
2017/02/23 15:32:38
Remove empty line before and after InsertBefore.
|
| + flow_graph->InsertBefore(this, specialized, env(), FlowGraph::kValue); |
| + |
| + return specialized; |
| +} |
| + |
| + |
| Definition* PolymorphicInstanceCallInstr::Canonicalize(FlowGraph* flow_graph) { |
| if (!HasSingleRecognizedTarget() || with_checks()) { |
| return this; |