| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface HVisitor<R> { | 5 interface HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 if (this === other) return true; | 734 if (this === other) return true; |
| 735 other = other.dominator; | 735 other = other.dominator; |
| 736 } while (other !== null && other.id >= id); | 736 } while (other !== null && other.id >= id); |
| 737 return false; | 737 return false; |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 | 740 |
| 741 | 741 |
| 742 class HInstruction implements Hashable { | 742 class HInstruction implements Hashable { |
| 743 Element sourceElement; | 743 Element sourceElement; |
| 744 Token sourcePosition; | 744 SourceFileLocation sourcePosition; |
| 745 | 745 |
| 746 final int id; | 746 final int id; |
| 747 static int idCounter; | 747 static int idCounter; |
| 748 | 748 |
| 749 final List<HInstruction> inputs; | 749 final List<HInstruction> inputs; |
| 750 final List<HInstruction> usedBy; | 750 final List<HInstruction> usedBy; |
| 751 | 751 |
| 752 HBasicBlock block; | 752 HBasicBlock block; |
| 753 HInstruction previous = null; | 753 HInstruction previous = null; |
| 754 HInstruction next = null; | 754 HInstruction next = null; |
| (...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2721 static const int FOR_IN_LOOP = 3; | 2721 static const int FOR_IN_LOOP = 3; |
| 2722 static const int NOT_A_LOOP = -1; | 2722 static const int NOT_A_LOOP = -1; |
| 2723 | 2723 |
| 2724 final int kind; | 2724 final int kind; |
| 2725 final HExpressionInformation initializer; | 2725 final HExpressionInformation initializer; |
| 2726 final HExpressionInformation condition; | 2726 final HExpressionInformation condition; |
| 2727 final HStatementInformation body; | 2727 final HStatementInformation body; |
| 2728 final HExpressionInformation updates; | 2728 final HExpressionInformation updates; |
| 2729 final TargetElement target; | 2729 final TargetElement target; |
| 2730 final List<LabelElement> labels; | 2730 final List<LabelElement> labels; |
| 2731 final Node sourcePosition; | 2731 final SourceFileLocation sourcePosition; |
| 2732 final SourceFileLocation endSourcePosition; |
| 2732 | 2733 |
| 2733 HLoopBlockInformation(this.kind, | 2734 HLoopBlockInformation(this.kind, |
| 2734 this.initializer, | 2735 this.initializer, |
| 2735 this.condition, | 2736 this.condition, |
| 2736 this.body, | 2737 this.body, |
| 2737 this.updates, | 2738 this.updates, |
| 2738 this.target, | 2739 this.target, |
| 2739 this.labels, | 2740 this.labels, |
| 2740 this.sourcePosition); | 2741 this.sourcePosition, |
| 2742 this.endSourcePosition); |
| 2741 | 2743 |
| 2742 HBasicBlock get start { | 2744 HBasicBlock get start { |
| 2743 if (initializer !== null) return initializer.start; | 2745 if (initializer !== null) return initializer.start; |
| 2744 if (kind == DO_WHILE_LOOP) { | 2746 if (kind == DO_WHILE_LOOP) { |
| 2745 return body.start; | 2747 return body.start; |
| 2746 } | 2748 } |
| 2747 return condition.start; | 2749 return condition.start; |
| 2748 } | 2750 } |
| 2749 | 2751 |
| 2750 HBasicBlock get loopHeader { | 2752 HBasicBlock get loopHeader { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2841 HBasicBlock get start => expression.start; | 2843 HBasicBlock get start => expression.start; |
| 2842 HBasicBlock get end { | 2844 HBasicBlock get end { |
| 2843 // We don't create a switch block if there are no cases. | 2845 // We don't create a switch block if there are no cases. |
| 2844 assert(!statements.isEmpty()); | 2846 assert(!statements.isEmpty()); |
| 2845 return statements.last().end; | 2847 return statements.last().end; |
| 2846 } | 2848 } |
| 2847 | 2849 |
| 2848 bool accept(HStatementInformationVisitor visitor) => | 2850 bool accept(HStatementInformationVisitor visitor) => |
| 2849 visitor.visitSwitchInfo(this); | 2851 visitor.visitSwitchInfo(this); |
| 2850 } | 2852 } |
| OLD | NEW |