| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ++impureCounter; | 308 ++impureCounter; |
| 309 return node; | 309 return node; |
| 310 } | 310 } |
| 311 | 311 |
| 312 Expression visitSetStatic(SetStatic node) { | 312 Expression visitSetStatic(SetStatic node) { |
| 313 super.visitSetStatic(node); | 313 super.visitSetStatic(node); |
| 314 ++impureCounter; | 314 ++impureCounter; |
| 315 return node; | 315 return node; |
| 316 } | 316 } |
| 317 | 317 |
| 318 Expression visitGetLength(GetLength node) { |
| 319 super.visitGetLength(node); |
| 320 ++impureCounter; |
| 321 return node; |
| 322 } |
| 323 |
| 324 Expression visitGetIndex(GetIndex node) { |
| 325 super.visitGetIndex(node); |
| 326 ++impureCounter; |
| 327 return node; |
| 328 } |
| 329 |
| 330 Expression visitSetIndex(SetIndex node) { |
| 331 super.visitSetIndex(node); |
| 332 ++impureCounter; |
| 333 return node; |
| 334 } |
| 335 |
| 318 void visitInnerFunction(FunctionDefinition node) { | 336 void visitInnerFunction(FunctionDefinition node) { |
| 319 new PullIntoInitializers().rewrite(node); | 337 new PullIntoInitializers().rewrite(node); |
| 320 } | 338 } |
| 321 | 339 |
| 322 Expression visitFunctionExpression(FunctionExpression node) { | 340 Expression visitFunctionExpression(FunctionExpression node) { |
| 323 visitInnerFunction(node.definition); | 341 visitInnerFunction(node.definition); |
| 324 return node; | 342 return node; |
| 325 } | 343 } |
| 326 | 344 |
| 327 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) { | 345 Expression visitApplyBuiltinOperator(ApplyBuiltinOperator node) { |
| 328 rewriteList(node.arguments); | 346 rewriteList(node.arguments); |
| 329 return node; | 347 return node; |
| 330 } | 348 } |
| 331 | 349 |
| 332 @override | 350 @override |
| 333 Expression visitForeignExpression(ForeignExpression node) { | 351 Expression visitForeignExpression(ForeignExpression node) { |
| 334 rewriteList(node.arguments); | 352 rewriteList(node.arguments); |
| 335 if (node.nativeBehavior.sideEffects.hasSideEffects()) { | 353 if (node.nativeBehavior.sideEffects.hasSideEffects()) { |
| 336 ++impureCounter; | 354 ++impureCounter; |
| 337 } | 355 } |
| 338 return node; | 356 return node; |
| 339 } | 357 } |
| 340 } | 358 } |
| OLD | NEW |