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

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

Issue 923013002: dart2dart: Implementation of simple try/catch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 logical expressions to be more compact in the Tree IR. 7 /// Rewrites logical expressions to be more compact in the Tree IR.
8 /// 8 ///
9 /// In this class an expression is said to occur in "boolean context" if 9 /// In this class an expression is said to occur in "boolean context" if
10 /// its result is immediately applied to boolean conversion. 10 /// its result is immediately applied to boolean conversion.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return node; 164 return node;
165 } 165 }
166 166
167 Statement visitWhileCondition(WhileCondition node) { 167 Statement visitWhileCondition(WhileCondition node) {
168 node.condition = makeCondition(node.condition, true, liftNots: false); 168 node.condition = makeCondition(node.condition, true, liftNots: false);
169 node.body = visitStatement(node.body); 169 node.body = visitStatement(node.body);
170 node.next = visitStatement(node.next); 170 node.next = visitStatement(node.next);
171 return node; 171 return node;
172 } 172 }
173 173
174 Statement visitTryStatement(TryStatement node) {
175 node.tryBody = visitStatement(node.tryBody);
176 node.catchBody = visitStatement(node.catchBody);
177 return node;
178 }
179
174 Statement visitExpressionStatement(ExpressionStatement node) { 180 Statement visitExpressionStatement(ExpressionStatement node) {
175 node.expression = visitExpression(node.expression); 181 node.expression = visitExpression(node.expression);
176 node.next = visitStatement(node.next); 182 node.next = visitStatement(node.next);
177 return node; 183 return node;
178 } 184 }
179 185
180 186
181 Expression visitVariable(Variable node) { 187 Expression visitVariable(Variable node) {
182 return node; 188 return node;
183 } 189 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 } 489 }
484 490
485 /// Destructively updates each entry of [l] with the result of visiting it. 491 /// Destructively updates each entry of [l] with the result of visiting it.
486 void _rewriteList(List<Expression> l) { 492 void _rewriteList(List<Expression> l) {
487 for (int i = 0; i < l.length; i++) { 493 for (int i = 0; i < l.length; i++) {
488 l[i] = visitExpression(l[i]); 494 l[i] = visitExpression(l[i]);
489 } 495 }
490 } 496 }
491 } 497 }
492 498
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698