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 [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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 Statement visitFunctionDeclaration(FunctionDeclaration node) { | 121 Statement visitFunctionDeclaration(FunctionDeclaration node) { |
122 new LoopRewriter().rewrite(node.definition); | 122 new LoopRewriter().rewrite(node.definition); |
123 node.next = visitStatement(node.next); | 123 node.next = visitStatement(node.next); |
124 return node; | 124 return node; |
125 } | 125 } |
126 | 126 |
127 void visitFunctionExpression(FunctionExpression node) { | 127 void visitFunctionExpression(FunctionExpression node) { |
128 new LoopRewriter().rewrite(node.definition); | 128 new LoopRewriter().rewrite(node.definition); |
129 } | 129 } |
| 130 |
| 131 Statement visitSetField(SetField node) { |
| 132 visitExpression(node.object); |
| 133 visitExpression(node.value); |
| 134 node.next = visitStatement(node.next); |
| 135 return node; |
| 136 } |
| 137 |
130 } | 138 } |
OLD | NEW |