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

Unified Diff: vm/flow_graph_builder.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 | « vm/flow_graph_allocator.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flow_graph_builder.cc
===================================================================
--- vm/flow_graph_builder.cc (revision 9435)
+++ vm/flow_graph_builder.cc (working copy)
@@ -2511,8 +2511,8 @@
}
// 2. Process normal instructions.
- Instruction* current = block_entry->successor();
- while ((current != NULL) && !current->IsBlockEntry()) {
+ for (ForwardInstructionIterator it(block_entry); !it.Done(); it.Advance()) {
+ Instruction* current = it.Current();
// Attach current environment to the instruction.
// TODO(fschneider): Currently each instruction gets a full copy of the
// enviroment. This should be optimized: Only instructions that can
@@ -2568,7 +2568,7 @@
if (bind->is_used()) {
env->Add(CopyValue((*env)[index]));
}
- current = current->RemoveFromGraph();
+ it.RemoveCurrentFromGraph();
} else {
// Not a load or store.
if (bind->is_used()) {
@@ -2576,11 +2576,7 @@
bind->set_ssa_temp_index(current_ssa_temp_index_++);
env->Add(new UseVal(bind));
}
- current = current->successor();
}
- } else {
- // Not a computation.
- current = current->successor();
}
}
« no previous file with comments | « vm/flow_graph_allocator.cc ('k') | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698