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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 node.arguments.forEach((Reference ref) => ref.parent = node); | 578 node.arguments.forEach((Reference ref) => ref.parent = node); |
579 } | 579 } |
580 | 580 |
581 processBranch(Branch node) { | 581 processBranch(Branch node) { |
582 node.condition.parent = node; | 582 node.condition.parent = node; |
583 node.trueContinuation.parent = node; | 583 node.trueContinuation.parent = node; |
584 node.falseContinuation.parent = node; | 584 node.falseContinuation.parent = node; |
585 } | 585 } |
586 | 586 |
587 processTypeOperator(TypeOperator node) { | 587 processTypeOperator(TypeOperator node) { |
588 node.typeArguments.forEach((Reference ref) => ref.parent = node); | |
589 node.continuation.parent = node; | 588 node.continuation.parent = node; |
590 node.value.parent = node; | 589 node.receiver.parent = node; |
591 } | 590 } |
592 | 591 |
593 processSetMutableVariable(SetMutableVariable node) { | 592 processSetMutableVariable(SetMutableVariable node) { |
594 node.variable.parent = node; | 593 node.variable.parent = node; |
595 node.body.parent = node; | 594 node.body.parent = node; |
596 node.value.parent = node; | 595 node.value.parent = node; |
597 } | 596 } |
598 | 597 |
599 processDeclareFunction(DeclareFunction node) { | 598 processDeclareFunction(DeclareFunction node) { |
600 node.variable.parent = node; | 599 node.variable.parent = node; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 } | 736 } |
738 | 737 |
739 String toString() => "$kind: $node"; | 738 String toString() => "$kind: $node"; |
740 } | 739 } |
741 | 740 |
742 /// A dummy class used solely to mark nodes as deleted once they are removed | 741 /// A dummy class used solely to mark nodes as deleted once they are removed |
743 /// from a term. | 742 /// from a term. |
744 class _DeletedNode extends Node { | 743 class _DeletedNode extends Node { |
745 accept(_) => null; | 744 accept(_) => null; |
746 } | 745 } |
OLD | NEW |