OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 visitBitAnd(HBitAnd node); | 7 R visitBitAnd(HBitAnd node); |
8 R visitBitNot(HBitNot node); | 8 R visitBitNot(HBitNot node); |
9 R visitBitOr(HBitOr node); | 9 R visitBitOr(HBitOr node); |
10 R visitBitXor(HBitXor node); | 10 R visitBitXor(HBitXor node); |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 // 'Not' only works on booleans. That's what we want as input. | 1779 // 'Not' only works on booleans. That's what we want as input. |
1780 HType computeDesiredTypeForInput(HInstruction input) => HType.BOOLEAN; | 1780 HType computeDesiredTypeForInput(HInstruction input) => HType.BOOLEAN; |
1781 | 1781 |
1782 accept(HVisitor visitor) => visitor.visitNot(this); | 1782 accept(HVisitor visitor) => visitor.visitNot(this); |
1783 int typeCode() => 18; | 1783 int typeCode() => 18; |
1784 bool typeEquals(other) => other is HNot; | 1784 bool typeEquals(other) => other is HNot; |
1785 bool dataEquals(HInstruction other) => true; | 1785 bool dataEquals(HInstruction other) => true; |
1786 } | 1786 } |
1787 | 1787 |
1788 class HParameterValue extends HInstruction { | 1788 class HParameterValue extends HInstruction { |
1789 final Element element; | 1789 HParameterValue(element) : super(<HInstruction>[]) { |
1790 | 1790 sourceElement = element; |
1791 HParameterValue(this.element) : super(<HInstruction>[]); | 1791 } |
1792 | 1792 |
1793 void prepareGvn() { | 1793 void prepareGvn() { |
1794 assert(!hasSideEffects()); | 1794 assert(!hasSideEffects()); |
1795 } | 1795 } |
1796 toString() => 'parameter ${element.name}'; | 1796 toString() => 'parameter ${sourceElement.name}'; |
1797 accept(HVisitor visitor) => visitor.visitParameterValue(this); | 1797 accept(HVisitor visitor) => visitor.visitParameterValue(this); |
1798 bool isCodeMotionInvariant() => true; | 1798 bool isCodeMotionInvariant() => true; |
1799 } | 1799 } |
1800 | 1800 |
1801 class HThis extends HParameterValue { | 1801 class HThis extends HParameterValue { |
1802 HThis([HType type = HType.UNKNOWN]) : super(null) { | 1802 HThis([HType type = HType.UNKNOWN]) : super(null) { |
1803 guaranteedType = type; | 1803 guaranteedType = type; |
1804 } | 1804 } |
1805 toString() => 'this'; | 1805 toString() => 'this'; |
1806 accept(HVisitor visitor) => visitor.visitThis(this); | 1806 accept(HVisitor visitor) => visitor.visitThis(this); |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 this.catchBlock, | 2496 this.catchBlock, |
2497 this.finallyBlock); | 2497 this.finallyBlock); |
2498 | 2498 |
2499 HBasicBlock get start() => body.start; | 2499 HBasicBlock get start() => body.start; |
2500 HBasicBlock get end() => | 2500 HBasicBlock get end() => |
2501 finallyBlock === null ? catchBlock.end : finallyBlock.end; | 2501 finallyBlock === null ? catchBlock.end : finallyBlock.end; |
2502 | 2502 |
2503 bool accept(HStatementInformationVisitor visitor) => | 2503 bool accept(HStatementInformationVisitor visitor) => |
2504 visitor.visitTryInfo(this); | 2504 visitor.visitTryInfo(this); |
2505 } | 2505 } |
OLD | NEW |