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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 Expression visitFunctionExpression(FunctionExpression node) { | 340 Expression visitFunctionExpression(FunctionExpression node) { |
341 visitInnerFunction(node.definition); | 341 visitInnerFunction(node.definition); |
342 return node; | 342 return node; |
343 } | 343 } |
344 | 344 |
345 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) { | 345 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) { |
346 rewriteList(node.arguments); | 346 rewriteList(node.arguments); |
347 return node; | 347 return node; |
348 } | 348 } |
349 | 349 |
| 350 Expression visitApplyBuiltinMethod(ApplyBuiltinMethod node) { |
| 351 node.receiver = visitExpression(node.receiver); |
| 352 if (!node.receiverIsNotNull) { |
| 353 // If the receiver is null, the method lookup throws. |
| 354 ++impureCounter; |
| 355 } |
| 356 rewriteList(node.arguments); |
| 357 ++impureCounter; |
| 358 return node; |
| 359 } |
| 360 |
350 @override | 361 @override |
351 Expression visitForeignExpression(ForeignExpression node) { | 362 Expression visitForeignExpression(ForeignExpression node) { |
352 rewriteList(node.arguments); | 363 rewriteList(node.arguments); |
353 if (node.nativeBehavior.sideEffects.hasSideEffects()) { | 364 if (node.nativeBehavior.sideEffects.hasSideEffects()) { |
354 ++impureCounter; | 365 ++impureCounter; |
355 } | 366 } |
356 return node; | 367 return node; |
357 } | 368 } |
358 } | 369 } |
OLD | NEW |