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

Unified Diff: runtime/vm/flow_graph.cc

Issue 2716593002: Propagate this-specialization to regular (megamorphic) calls (Closed)
Patch Set: Add new Canonicalize call to make use of type data Created 3 years, 10 months 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 | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 92c75ac3f2f97f5e7a6754d2b35dc5ee02d4fb3d..8a3a69155d0fb6b5ac6c536198d5b206f2ff4d95 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -83,11 +83,15 @@ void FlowGraph::ReplaceCurrentInstruction(ForwardInstructionIterator* iterator,
}
}
if (current->ArgumentCount() != 0) {
- // This is a call instruction. Must remove original push arguments.
+ // Replacing a call instruction with something else. Must remove
+ // superfluous push arguments.
for (intptr_t i = 0; i < current->ArgumentCount(); ++i) {
PushArgumentInstr* push = current->PushArgumentAt(i);
- push->ReplaceUsesWith(push->value()->definition());
- push->RemoveFromGraph();
+ if (replacement == NULL || i >= replacement->ArgumentCount() ||
+ replacement->PushArgumentAt(i) != push) {
+ push->ReplaceUsesWith(push->value()->definition());
+ push->RemoveFromGraph();
+ }
}
}
iterator->RemoveCurrentFromGraph();
« no previous file with comments | « runtime/vm/aot_optimizer.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698