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

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: Incorporated review comments. Created 7 years, 7 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/flow_graph.h ('k') | runtime/vm/flow_graph_allocator.cc » ('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 34ca6932d6aad8b34e57e39fe44fab42b493ba5d..8f9e48c4efecf70000a6e56e85356ea0a59e742e 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -522,7 +522,6 @@ void FlowGraph::ComputeDominators(
dom_index = idom[dom_index];
}
idom[block_index] = dom_index;
- preorder_[block_index]->set_dominator(preorder_[dom_index]);
preorder_[dom_index]->AddDominatedBlock(preorder_[block_index]);
}
@@ -847,6 +846,28 @@ void FlowGraph::RemoveDeadPhis(GrowableArray<PhiInstr*>* live_phis) {
}
+void FlowGraph::RemoveRedefinitions() {
+ // 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) {
+ Definition* original;
+ do {
+ original = redefinition->value()->definition();
+ } while (original->IsRedefinition());
+ redefinition->ReplaceUsesWith(original);
+ 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.
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698