| 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 dart2js.cps_ir.optimizers; | 5 part of dart2js.cps_ir.optimizers; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * [ShrinkingReducer] applies shrinking reductions to CPS terms as described | 8 * [ShrinkingReducer] applies shrinking reductions to CPS terms as described |
| 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. | 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. |
| 10 */ | 10 */ |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 } | 473 } |
| 474 | 474 |
| 475 processRunnableBody(RunnableBody node) { | 475 processRunnableBody(RunnableBody node) { |
| 476 node.returnContinuation.parent = node; | 476 node.returnContinuation.parent = node; |
| 477 node.body.parent = node; | 477 node.body.parent = node; |
| 478 } | 478 } |
| 479 | 479 |
| 480 processConstructorDefinition(ConstructorDefinition node) { | 480 processConstructorDefinition(ConstructorDefinition node) { |
| 481 node.body.parent = node; | 481 node.body.parent = node; |
| 482 int index = 0; | 482 int index = 0; |
| 483 node.parameters.forEach((Parameter parameter) { | 483 node.parameters.forEach((Definition parameter) { |
| 484 parameter.parent = node; | 484 parameter.parent = node; |
| 485 parameter.parent_index = index++; | 485 if (parameter is Parameter) parameter.parent_index = index++; |
| 486 }); | 486 }); |
| 487 node.initializers.forEach((Initializer i) => i.parent = node); | 487 node.initializers.forEach((Initializer i) => i.parent = node); |
| 488 } | 488 } |
| 489 | 489 |
| 490 // Expressions. | 490 // Expressions. |
| 491 | 491 |
| 492 processFieldInitializer(FieldInitializer node) { | 492 processFieldInitializer(FieldInitializer node) { |
| 493 node.body.body.parent = node; | 493 node.body.body.parent = node; |
| 494 } | 494 } |
| 495 | 495 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 } | 663 } |
| 664 | 664 |
| 665 String toString() => "$kind: $node"; | 665 String toString() => "$kind: $node"; |
| 666 } | 666 } |
| 667 | 667 |
| 668 /// A dummy class used solely to mark nodes as deleted once they are removed | 668 /// A dummy class used solely to mark nodes as deleted once they are removed |
| 669 /// from a term. | 669 /// from a term. |
| 670 class _DeletedNode extends Node { | 670 class _DeletedNode extends Node { |
| 671 accept(_) => null; | 671 accept(_) => null; |
| 672 } | 672 } |
| OLD | NEW |