| OLD | NEW |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 node.next = visitStatement(node.next); | 170 node.next = visitStatement(node.next); |
| 171 return node; | 171 return node; |
| 172 } | 172 } |
| 173 | 173 |
| 174 Statement visitExpressionStatement(ExpressionStatement node) { | 174 Statement visitExpressionStatement(ExpressionStatement node) { |
| 175 node.expression = visitExpression(node.expression); | 175 node.expression = visitExpression(node.expression); |
| 176 node.next = visitStatement(node.next); | 176 node.next = visitStatement(node.next); |
| 177 return node; | 177 return node; |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 Expression visitVariableUse(VariableUse node) { |
| 181 Expression visitVariable(Variable node) { | |
| 182 return node; | 181 return node; |
| 183 } | 182 } |
| 184 | 183 |
| 185 Expression visitInvokeStatic(InvokeStatic node) { | 184 Expression visitInvokeStatic(InvokeStatic node) { |
| 186 _rewriteList(node.arguments); | 185 _rewriteList(node.arguments); |
| 187 return node; | 186 return node; |
| 188 } | 187 } |
| 189 | 188 |
| 190 Expression visitInvokeMethod(InvokeMethod node) { | 189 Expression visitInvokeMethod(InvokeMethod node) { |
| 191 node.receiver = visitExpression(node.receiver); | 190 node.receiver = visitExpression(node.receiver); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 482 } |
| 484 | 483 |
| 485 /// Destructively updates each entry of [l] with the result of visiting it. | 484 /// Destructively updates each entry of [l] with the result of visiting it. |
| 486 void _rewriteList(List<Expression> l) { | 485 void _rewriteList(List<Expression> l) { |
| 487 for (int i = 0; i < l.length; i++) { | 486 for (int i = 0; i < l.length; i++) { |
| 488 l[i] = visitExpression(l[i]); | 487 l[i] = visitExpression(l[i]); |
| 489 } | 488 } |
| 490 } | 489 } |
| 491 } | 490 } |
| 492 | 491 |
| OLD | NEW |