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

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

Issue 1291333002: Revert "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 91a5aac7d4c6367ae7fa746122cf67d44940a986..79f018ba204d3015e358cc52f1275fe3e8c07523 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
@@ -208,11 +208,10 @@ class BlockGraphBuilder extends RecursiveVisitor {
visitStatement(node.body); // visitContinue will add predecessors to join.
}
- visitFor(For node) {
- Block entry = _currentBlock;
- _currentBlock = _jumpTarget[node.label] = newBlock();
- node.updates.forEach(visitExpression);
- joinFrom(entry, _currentBlock);
+ visitWhileCondition(WhileCondition node) {
+ Block join = _jumpTarget[node.label] = newBlock();
+ join.predecessors.add(_currentBlock);
+ _currentBlock = join;
visitExpression(node.condition);
Block afterCondition = _currentBlock;
branchFrom(afterCondition);
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698