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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1582103002: Revert "dart2js cps: for(;;) is shorter than while(true)" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 1d07d37330b6fee089af2fd7b0a83607f37274b2..bc8ed93511e60d6b00bfbe1c2f38bc95a481ac47 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -749,6 +749,7 @@ class CodeGenerator extends tree_ir.StatementVisitor
@override
void visitWhileTrue(tree_ir.WhileTrue node) {
+ js.Expression condition = new js.LiteralBool(true);
// A short break in the while will jump to the current fallthrough target.
shortBreak.push(fallthrough.target);
shortContinue.push(node);
@@ -763,8 +764,7 @@ class CodeGenerator extends tree_ir.StatementVisitor
fallthrough.use();
}
shortBreak.pop();
- accumulator.add(
- insertLabel(node.label, new js.For(null, null, null, jsBody)));
+ accumulator.add(insertLabel(node.label, new js.While(condition, jsBody)));
}
bool isNull(tree_ir.Expression node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698