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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 ++impureCounter; | 258 ++impureCounter; |
259 return node; | 259 return node; |
260 } | 260 } |
261 | 261 |
262 Expression visitOneShotInterceptor(OneShotInterceptor node) { | 262 Expression visitOneShotInterceptor(OneShotInterceptor node) { |
263 super.visitOneShotInterceptor(node); | 263 super.visitOneShotInterceptor(node); |
264 ++impureCounter; | 264 ++impureCounter; |
265 return node; | 265 return node; |
266 } | 266 } |
267 | 267 |
| 268 Expression visitAwait(Await node) { |
| 269 super.visitAwait(node); |
| 270 ++impureCounter; |
| 271 return node; |
| 272 } |
| 273 |
268 Expression visitConditional(Conditional node) { | 274 Expression visitConditional(Conditional node) { |
269 node.condition = visitExpression(node.condition); | 275 node.condition = visitExpression(node.condition); |
270 // Visit the branches to detect impure subexpressions, but do not pull | 276 // Visit the branches to detect impure subexpressions, but do not pull |
271 // expressions out of the branch. | 277 // expressions out of the branch. |
272 ++branchCounter; | 278 ++branchCounter; |
273 node.thenExpression = visitExpression(node.thenExpression); | 279 node.thenExpression = visitExpression(node.thenExpression); |
274 node.elseExpression = visitExpression(node.elseExpression); | 280 node.elseExpression = visitExpression(node.elseExpression); |
275 --branchCounter; | 281 --branchCounter; |
276 return node; | 282 return node; |
277 } | 283 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 370 |
365 @override | 371 @override |
366 Expression visitForeignExpression(ForeignExpression node) { | 372 Expression visitForeignExpression(ForeignExpression node) { |
367 rewriteList(node.arguments); | 373 rewriteList(node.arguments); |
368 if (node.nativeBehavior.sideEffects.hasSideEffects()) { | 374 if (node.nativeBehavior.sideEffects.hasSideEffects()) { |
369 ++impureCounter; | 375 ++impureCounter; |
370 } | 376 } |
371 return node; | 377 return node; |
372 } | 378 } |
373 } | 379 } |
OLD | NEW |