Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2498073004: AOT: Fix bug in receiver type propagation after unique selector calls. (Closed)
Patch Set: address comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 168471ceeb93252db7dae73defb027ad0ff5ddd1..00131579c16799ad18408bc5371c31cd49c62e3e 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -291,6 +291,18 @@ 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
+ // 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,
+ redefinition);
+ if (!redefinition->HasUses()) {
+ redefinition->RemoveFromGraph();
+ }
}
return true;
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698