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

Unified Diff: runtime/vm/intermediate_language.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 | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 9e3d227d6ef31e0d5f3ac728c46c10f266bab23f..bf75bd42771ae2ca6d74f50582102f236523771e 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -64,9 +64,8 @@ FOR_EACH_COMPUTATION(DEFINE_ACCEPT)
#define DEFINE_ACCEPT(ShortName) \
-Instruction* ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \
+void ShortName##Instr::Accept(FlowGraphVisitor* visitor) { \
visitor->Visit##ShortName(this); \
- return next(); \
}
FOR_EACH_INSTRUCTION(DEFINE_ACCEPT)
@@ -85,9 +84,10 @@ static bool VerifyValues(Value* v1, Value* v2) {
// Default implementation of visiting basic blocks. Can be overridden.
void FlowGraphVisitor::VisitBlocks() {
for (intptr_t i = 0; i < block_order_.length(); ++i) {
- Instruction* current = block_order_[i]->Accept(this);
- while ((current != NULL) && !current->IsBlockEntry()) {
- current = current->Accept(this);
+ BlockEntryInstr* entry = block_order_[i];
+ entry->Accept(this);
+ for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
+ it.Current()->Accept(this);
}
}
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698