Chromium Code Reviews| 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 if (node.hasTypeInformation) { | |
|
asgerf
2015/03/24 12:37:22
This type of check drives me crazy. Please remove
karlklose
2015/03/26 09:50:07
Done.
| |
| 662 node.typeInformation.forEach((Reference ref) => ref.parent = node); | |
| 663 } | |
| 661 } | 664 } |
| 662 | 665 |
| 663 processCreateBox(CreateBox node) { | 666 processCreateBox(CreateBox node) { |
| 664 } | 667 } |
| 665 | 668 |
| 666 processReifyRuntimeType(ReifyRuntimeType node) { | 669 processReifyRuntimeType(ReifyRuntimeType node) { |
| 667 node.value.parent = node; | 670 node.value.parent = node; |
| 668 } | 671 } |
| 669 | 672 |
| 670 processReadTypeVariable(ReadTypeVariable node) { | 673 processReadTypeVariable(ReadTypeVariable node) { |
| 671 node.target.parent = node; | 674 node.target.parent = node; |
| 672 } | 675 } |
| 676 | |
| 677 processTypeExpression(TypeExpression node) { | |
| 678 node.arguments.forEach((Reference ref) => ref.parent = node); | |
| 679 } | |
| 673 } | 680 } |
| 674 | 681 |
| 675 class _ReductionKind { | 682 class _ReductionKind { |
| 676 final String name; | 683 final String name; |
| 677 final int hashCode; | 684 final int hashCode; |
| 678 | 685 |
| 679 const _ReductionKind(this.name, this.hashCode); | 686 const _ReductionKind(this.name, this.hashCode); |
| 680 | 687 |
| 681 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); | 688 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); |
| 682 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); | 689 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 709 } | 716 } |
| 710 | 717 |
| 711 String toString() => "$kind: $node"; | 718 String toString() => "$kind: $node"; |
| 712 } | 719 } |
| 713 | 720 |
| 714 /// A dummy class used solely to mark nodes as deleted once they are removed | 721 /// A dummy class used solely to mark nodes as deleted once they are removed |
| 715 /// from a term. | 722 /// from a term. |
| 716 class _DeletedNode extends Node { | 723 class _DeletedNode extends Node { |
| 717 accept(_) => null; | 724 accept(_) => null; |
| 718 } | 725 } |
| OLD | NEW |