| Index: runtime/vm/flow_graph.cc
|
| diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
|
| index 16ed1ebacf2ba492cc0366c771511fe4e3790cf0..642ec9be5d2cd31c8679abc9264b218a82c2bdbb 100644
|
| --- a/runtime/vm/flow_graph.cc
|
| +++ b/runtime/vm/flow_graph.cc
|
| @@ -1996,11 +1996,17 @@ bool FlowGraph::Canonicalize() {
|
| Instruction* replacement = current->Canonicalize(this);
|
|
|
| if (replacement != current) {
|
| - // For non-definitions Canonicalize should return either NULL or
|
| - // this.
|
| - ASSERT((replacement == NULL) || current->IsDefinition());
|
| - ReplaceCurrentInstruction(&it, current, replacement);
|
| changed = true;
|
| +
|
| + if (current->IsInstanceCall()) {
|
| + current->AsDefinition()->ReplaceWith(replacement->AsDefinition(),
|
| + &it);
|
| + } else {
|
| + // For non-definitions Canonicalize should return either NULL or
|
| + // this.
|
| + ASSERT((replacement == NULL) || current->IsDefinition());
|
| + ReplaceCurrentInstruction(&it, current, replacement);
|
| + }
|
| }
|
| }
|
| }
|
|
|