| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library tree_ir.optimization.pull_into_initializers; | 5 library tree_ir.optimization.pull_into_initializers; |
| 6 | 6 |
| 7 import 'optimization.dart' show Pass; | 7 import 'optimization.dart' show Pass; |
| 8 import '../tree_ir_nodes.dart'; | 8 import '../tree_ir_nodes.dart'; |
| 9 | 9 |
| 10 /// Where a variable has been assigned. | 10 /// Where a variable has been assigned. |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 Statement visitFor(For node) { | 163 Statement visitFor(For node) { |
| 164 return node; | 164 return node; |
| 165 } | 165 } |
| 166 | 166 |
| 167 Statement visitTry(Try node) { | 167 Statement visitTry(Try node) { |
| 168 return node; | 168 return node; |
| 169 } | 169 } |
| 170 | 170 |
| 171 Statement visitNullCheck(NullCheck node) { | 171 Statement visitReceiverCheck(ReceiverCheck node) { |
| 172 if (node.condition != null) { | 172 if (node.condition != null) { |
| 173 node.condition = visitExpression(node.condition); | 173 node.condition = visitExpression(node.condition); |
| 174 // The value occurs in conditional context, so don't pull from that. | 174 // The value occurs in conditional context, so don't pull from that. |
| 175 } else { | 175 } else { |
| 176 node.value = visitExpression(node.value); | 176 node.value = visitExpression(node.value); |
| 177 } | 177 } |
| 178 return node; | 178 return node; |
| 179 } | 179 } |
| 180 | 180 |
| 181 Expression visitAssign(Assign node) { | 181 Expression visitAssign(Assign node) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 @override | 365 @override |
| 366 Expression visitForeignExpression(ForeignExpression node) { | 366 Expression visitForeignExpression(ForeignExpression node) { |
| 367 rewriteList(node.arguments); | 367 rewriteList(node.arguments); |
| 368 if (node.nativeBehavior.sideEffects.hasSideEffects()) { | 368 if (node.nativeBehavior.sideEffects.hasSideEffects()) { |
| 369 ++impureCounter; | 369 ++impureCounter; |
| 370 } | 370 } |
| 371 return node; | 371 return node; |
| 372 } | 372 } |
| 373 } | 373 } |
| OLD | NEW |