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

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

Issue 1474713002: dart2js cps: Clean up and avoid processing unreachable code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years, 1 month 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/loop_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
index 14069e87ac0e6a9b3bebc134b43a49bbf0ab14c2..2f5a9fd870735b49b6173584b856694908f60011 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -52,13 +52,13 @@ import '../tree_ir_nodes.dart';
///
/// Note that the pattern above needs no iteration since nested ifs have been
/// collapsed previously in the [StatementRewriter] phase.
-///
+///
///
/// PULL INTO UPDATE EXPRESSION:
-///
+///
/// Assignment expressions before the unique continue to a [whileCondition] are
/// pulled into the updates for the loop.
-///
+///
/// L:
/// for (; condition; updates) {
/// S [ x = E; continue L ]
@@ -69,7 +69,7 @@ import '../tree_ir_nodes.dart';
/// S [ continue L ]
/// }
///
-/// The decision to only pull in assignments is a heuristic to balance
+/// The decision to only pull in assignments is a heuristic to balance
/// readability and stack trace usability versus the modest code size
/// reduction one might get by aggressively moving expressions into the
/// updates.
@@ -88,11 +88,6 @@ class LoopRewriter extends RecursiveTransformer
root.body = visitStatement(root.body);
}
- @override
- void visitInnerFunction(FunctionDefinition node) {
- node.body = new LoopRewriter().visitStatement(node.body);
- }
-
Statement visitContinue(Continue node) {
usedContinueLabels.add(node.target);
return node;

Powered by Google App Engine
This is Rietveld 408576698