Index: runtime/vm/aot_optimizer.cc |
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc |
index 168471ceeb93252db7dae73defb027ad0ff5ddd1..814f512455164038d44e0c4c20be0d4d8514f86d 100644 |
--- a/runtime/vm/aot_optimizer.cc |
+++ b/runtime/vm/aot_optimizer.cc |
@@ -291,6 +291,15 @@ bool AotOptimizer::TryCreateICData(InstanceCallInstr* call) { |
call->set_ic_data(&ic_data); |
if (has_unique_no_such_method_) { |
call->set_has_unique_selector(true); |
+ // Add redefinition of the receiver to prevent code motion across |
Vyacheslav Egorov (Google)
2016/11/16 10:16:34
I don't think renaming here is "future proof", tho
Florian Schneider
2016/11/16 17:55:18
Agree. I remember we had this issue already in a d
|
+ // this call. |
+ RedefinitionInstr* redefinition = |
+ new (Z) RedefinitionInstr(new (Z) Value(call->ArgumentAt(0))); |
+ redefinition->set_ssa_temp_index(flow_graph_->alloc_ssa_temp_index()); |
+ redefinition->InsertAfter(call); |
+ // Replace all uses of the receiver dominated by this call. |
+ FlowGraph::RenameDominatedUses(call->ArgumentAt(0), redefinition, |
Vyacheslav Egorov (Google)
2016/11/16 10:16:34
There might be no dominated uses. Maybe check that
Florian Schneider
2016/11/16 17:55:18
Done. For now, I'll remove the redefinition eagerl
|
+ redefinition); |
} |
return true; |
} |