| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 node.parameters.forEach((Definition parameter) { | 502 node.parameters.forEach((Definition parameter) { |
| 503 parameter.parent = node; | 503 parameter.parent = node; |
| 504 if (parameter is Parameter) parameter.parentIndex = index++; | 504 if (parameter is Parameter) parameter.parentIndex = index++; |
| 505 }); | 505 }); |
| 506 node.initializers.forEach((Initializer i) => i.parent = node); | 506 node.initializers.forEach((Initializer i) => i.parent = node); |
| 507 } | 507 } |
| 508 | 508 |
| 509 // Expressions. | 509 // Expressions. |
| 510 | 510 |
| 511 processFieldInitializer(FieldInitializer node) { | 511 processFieldInitializer(FieldInitializer node) { |
| 512 node.body.body.parent = node; | 512 node.body.parent = node; |
| 513 } | 513 } |
| 514 | 514 |
| 515 processSuperInitializer(SuperInitializer node) { | 515 processSuperInitializer(SuperInitializer node) { |
| 516 node.arguments.forEach( | 516 node.arguments.forEach((RunnableBody argument) => argument.parent = node); |
| 517 (RunnableBody argument) => argument.body.parent = node); | |
| 518 } | 517 } |
| 519 | 518 |
| 520 processLetPrim(LetPrim node) { | 519 processLetPrim(LetPrim node) { |
| 521 node.primitive.parent = node; | 520 node.primitive.parent = node; |
| 522 node.body.parent = node; | 521 node.body.parent = node; |
| 523 } | 522 } |
| 524 | 523 |
| 525 processLetCont(LetCont node) { | 524 processLetCont(LetCont node) { |
| 526 int index = 0; | 525 int index = 0; |
| 527 node.continuations.forEach((Continuation continuation) { | 526 node.continuations.forEach((Continuation continuation) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 } | 698 } |
| 700 | 699 |
| 701 String toString() => "$kind: $node"; | 700 String toString() => "$kind: $node"; |
| 702 } | 701 } |
| 703 | 702 |
| 704 /// A dummy class used solely to mark nodes as deleted once they are removed | 703 /// A dummy class used solely to mark nodes as deleted once they are removed |
| 705 /// from a term. | 704 /// from a term. |
| 706 class _DeletedNode extends Node { | 705 class _DeletedNode extends Node { |
| 707 accept(_) => null; | 706 accept(_) => null; |
| 708 } | 707 } |
| OLD | NEW |