| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 processGetField(GetField node) { | 651 processGetField(GetField node) { |
| 652 node.object.parent = node; | 652 node.object.parent = node; |
| 653 } | 653 } |
| 654 | 654 |
| 655 processGetMutableVariable(GetMutableVariable node) { | 655 processGetMutableVariable(GetMutableVariable node) { |
| 656 node.variable.parent = node; | 656 node.variable.parent = node; |
| 657 } | 657 } |
| 658 | 658 |
| 659 processCreateInstance(CreateInstance node) { | 659 processCreateInstance(CreateInstance node) { |
| 660 node.arguments.forEach((Reference ref) => ref.parent = node); | 660 node.arguments.forEach((Reference ref) => ref.parent = node); |
| 661 node.typeInformation.forEach((Reference ref) => ref.parent = node); |
| 661 } | 662 } |
| 662 | 663 |
| 663 processCreateBox(CreateBox node) { | 664 processCreateBox(CreateBox node) { |
| 664 } | 665 } |
| 665 | 666 |
| 666 processReifyRuntimeType(ReifyRuntimeType node) { | 667 processReifyRuntimeType(ReifyRuntimeType node) { |
| 667 node.value.parent = node; | 668 node.value.parent = node; |
| 668 } | 669 } |
| 669 | 670 |
| 670 processReadTypeVariable(ReadTypeVariable node) { | 671 processReadTypeVariable(ReadTypeVariable node) { |
| 671 node.target.parent = node; | 672 node.target.parent = node; |
| 672 } | 673 } |
| 674 |
| 675 processTypeExpression(TypeExpression node) { |
| 676 node.arguments.forEach((Reference ref) => ref.parent = node); |
| 677 } |
| 673 } | 678 } |
| 674 | 679 |
| 675 class _ReductionKind { | 680 class _ReductionKind { |
| 676 final String name; | 681 final String name; |
| 677 final int hashCode; | 682 final int hashCode; |
| 678 | 683 |
| 679 const _ReductionKind(this.name, this.hashCode); | 684 const _ReductionKind(this.name, this.hashCode); |
| 680 | 685 |
| 681 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); | 686 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); |
| 682 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); | 687 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 709 } | 714 } |
| 710 | 715 |
| 711 String toString() => "$kind: $node"; | 716 String toString() => "$kind: $node"; |
| 712 } | 717 } |
| 713 | 718 |
| 714 /// A dummy class used solely to mark nodes as deleted once they are removed | 719 /// A dummy class used solely to mark nodes as deleted once they are removed |
| 715 /// from a term. | 720 /// from a term. |
| 716 class _DeletedNode extends Node { | 721 class _DeletedNode extends Node { |
| 717 accept(_) => null; | 722 accept(_) => null; |
| 718 } | 723 } |
| OLD | NEW |