| 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 /// Eliminates moving assignments, such as w := v, by assigning directly to w | 7 /// Eliminates moving assignments, such as w := v, by assigning directly to w |
| 8 /// at the definition of v. | 8 /// at the definition of v. |
| 9 /// | 9 /// |
| 10 /// This compensates for suboptimal register allocation, and merges closure | 10 /// This compensates for suboptimal register allocation, and merges closure |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 node.next = visitStatement(node.next); | 217 node.next = visitStatement(node.next); |
| 218 return node; | 218 return node; |
| 219 } | 219 } |
| 220 | 220 |
| 221 Statement visitExpressionStatement(ExpressionStatement node) { | 221 Statement visitExpressionStatement(ExpressionStatement node) { |
| 222 node.next = visitStatement(node.next); | 222 node.next = visitStatement(node.next); |
| 223 visitExpression(node.expression); | 223 visitExpression(node.expression); |
| 224 return node; | 224 return node; |
| 225 } | 225 } |
| 226 | 226 |
| 227 Statement visitSetField(SetField node) { |
| 228 node.next = visitStatement(node.next); |
| 229 visitExpression(node.value); |
| 230 visitExpression(node.object); |
| 231 return node; |
| 232 } |
| 233 |
| 227 void visitFunctionExpression(FunctionExpression node) { | 234 void visitFunctionExpression(FunctionExpression node) { |
| 228 new CopyPropagator().rewrite(node.definition); | 235 new CopyPropagator().rewrite(node.definition); |
| 229 } | 236 } |
| 230 | 237 |
| 231 void visitFieldInitializer(FieldInitializer node) { | 238 void visitFieldInitializer(FieldInitializer node) { |
| 232 visitStatement(node.body); | 239 visitStatement(node.body); |
| 233 } | 240 } |
| 234 | 241 |
| 235 } | 242 } |
| OLD | NEW |