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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10704119: Use the instruction iterator rather than an explicit loop in more places. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 833b12a2c868a3d60782241d7aa02c071172d454..d668e63c1a3dd8134a990bb4d14d4acc4f06727d 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2220,12 +2220,12 @@ void FlowGraphBuilder::BuildGraph(bool for_optimized, bool use_ssa) {
if (for_optimized && use_ssa) {
// Link instructions backwards for optimized compilation.
for (intptr_t i = 0; i < block_count; ++i) {
- Instruction* prev = postorder_block_entries_[i];
- Instruction* current = prev->next();
- while (current != NULL && !current->IsBlockEntry()) {
- current->set_previous(prev);
- prev = current;
- current = current->next();
+ BlockEntryInstr* entry = postorder_block_entries_[i];
+ Instruction* previous = entry;
+ for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
+ Instruction* current = it.Current();
+ current->set_previous(previous);
+ previous = current;
}
}
GrowableArray<BitVector*> dominance_frontier;
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698