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

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

Issue 923013002: dart2dart: Implementation of simple try/catch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed break/continue, incorporated comments. Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of tree_ir.optimization; 5 part of tree_ir.optimization;
6 6
7 /// Rewrites [WhileTrue] statements with an [If] body into a [WhileCondition], 7 /// Rewrites [WhileTrue] statements with an [If] body into a [WhileCondition],
8 /// in situations where only one of the branches contains a [Continue] to the 8 /// in situations where only one of the branches contains a [Continue] to the
9 /// loop. Schematically: 9 /// loop. Schematically:
10 /// 10 ///
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 node.next = visitStatement(node.next); 111 node.next = visitStatement(node.next);
112 return node; 112 return node;
113 } 113 }
114 114
115 Statement visitExpressionStatement(ExpressionStatement node) { 115 Statement visitExpressionStatement(ExpressionStatement node) {
116 visitExpression(node.expression); 116 visitExpression(node.expression);
117 node.next = visitStatement(node.next); 117 node.next = visitStatement(node.next);
118 return node; 118 return node;
119 } 119 }
120 120
121 Statement visitTry(Try node) {
122 node.tryBody = visitStatement(node.tryBody);
123 node.catchBody = visitStatement(node.catchBody);
124 return node;
125 }
126
121 Statement visitFunctionDeclaration(FunctionDeclaration node) { 127 Statement visitFunctionDeclaration(FunctionDeclaration node) {
122 new LoopRewriter().rewrite(node.definition); 128 new LoopRewriter().rewrite(node.definition);
123 node.next = visitStatement(node.next); 129 node.next = visitStatement(node.next);
124 return node; 130 return node;
125 } 131 }
126 132
127 void visitFunctionExpression(FunctionExpression node) { 133 void visitFunctionExpression(FunctionExpression node) {
128 new LoopRewriter().rewrite(node.definition); 134 new LoopRewriter().rewrite(node.definition);
129 } 135 }
130 136
131 Statement visitSetField(SetField node) { 137 Statement visitSetField(SetField node) {
132 visitExpression(node.object); 138 visitExpression(node.object);
133 visitExpression(node.value); 139 visitExpression(node.value);
134 node.next = visitStatement(node.next); 140 node.next = visitStatement(node.next);
135 return node; 141 return node;
136 } 142 }
137 143
138 } 144 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698