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

Unified Diff: vm/flow_graph_allocator.cc

Issue 10692107: Add forward iterator to iterate instructions inside a basic block. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 | « no previous file | vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flow_graph_allocator.cc
===================================================================
--- vm/flow_graph_allocator.cc (revision 9435)
+++ vm/flow_graph_allocator.cc (working copy)
@@ -66,9 +66,9 @@
}
}
- Instruction* current = block->successor();
// TODO(vegorov): iterate backwards.
- while ((current != NULL) && !current->IsBlockEntry()) {
+ for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
+ Instruction* current = it.Current();
for (intptr_t j = 0; j < current->InputCount(); j++) {
Value* input = current->InputAt(j);
if (!input->IsUse()) continue;
@@ -78,8 +78,6 @@
const intptr_t def = ToVirtualRegister(current);
if (def >= 0) kill->Add(def);
-
- current = current->successor();
}
}
« no previous file with comments | « no previous file | vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698