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

Unified Diff: runtime/vm/flow_graph.cc

Issue 14740005: Initial support for polymorphic inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 34ca6932d6aad8b34e57e39fe44fab42b493ba5d..6157a160756049d76e732e80ba8ece9715b067ca 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -847,6 +847,24 @@ void FlowGraph::RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis) {
}
+void FlowGraph::RemoveRedefinitions() {
Florian Schneider 2013/05/03 10:41:36 This is very similar to what we do with Constraint
Kevin Millikin (Google) 2013/05/03 11:47:38 That one uses a maintained list of constraints, th
+ // Remove redefinition instructions inserted to inhibit hoisting.
+ for (BlockIterator block_it = reverse_postorder_iterator();
+ !block_it.Done();
+ block_it.Advance()) {
+ for (ForwardInstructionIterator instr_it(block_it.Current());
+ !instr_it.Done();
+ instr_it.Advance()) {
+ RedefinitionInstr* redefinition = instr_it.Current()->AsRedefinition();
+ if (redefinition != NULL) {
+ redefinition->ReplaceUsesWith(redefinition->value()->definition());
+ instr_it.RemoveCurrentFromGraph();
+ }
+ }
+ }
+}
+
+
// Find the natural loop for the back edge m->n and attach loop information
// to block n (loop header). The algorithm is described in "Advanced Compiler
// Design & Implementation" (Muchnick) p192.

Powered by Google App Engine
This is Rietveld 408576698