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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart

Issue 1287253002: dart2js cps: Compile some loops as 'for' loops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
Index: pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
index 79f018ba204d3015e358cc52f1275fe3e8c07523..30286db81babc2ad91b6d1f75761eb85c481e7b8 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
@@ -209,9 +209,10 @@ class BlockGraphBuilder extends RecursiveVisitor {
}
visitWhileCondition(WhileCondition node) {
- Block join = _jumpTarget[node.label] = newBlock();
- join.predecessors.add(_currentBlock);
- _currentBlock = join;
+ Block entry = _currentBlock;
+ _currentBlock = _jumpTarget[node.label] = newBlock();
+ node.updates.forEach(visitExpression);
+ joinFrom(entry, _currentBlock);
visitExpression(node.condition);
Block afterCondition = _currentBlock;
branchFrom(afterCondition);

Powered by Google App Engine
This is Rietveld 408576698