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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 } | 919 } |
920 } | 920 } |
921 | 921 |
922 bool isConstant() => false; | 922 bool isConstant() => false; |
923 bool isConstantBoolean() => false; | 923 bool isConstantBoolean() => false; |
924 bool isConstantNull() => false; | 924 bool isConstantNull() => false; |
925 bool isConstantNumber() => false; | 925 bool isConstantNumber() => false; |
926 bool isConstantString() => false; | 926 bool isConstantString() => false; |
927 bool isConstantList() => false; | 927 bool isConstantList() => false; |
928 bool isConstantMap() => false; | 928 bool isConstantMap() => false; |
| 929 bool isConstantFalse() => false; |
| 930 bool isConstantTrue() => false; |
929 | 931 |
930 bool isValid() { | 932 bool isValid() { |
931 HValidator validator = new HValidator(); | 933 HValidator validator = new HValidator(); |
932 validator.currentBlock = block; | 934 validator.currentBlock = block; |
933 validator.visitInstruction(this); | 935 validator.visitInstruction(this); |
934 return validator.isValid; | 936 return validator.isValid; |
935 } | 937 } |
936 | 938 |
937 /** | 939 /** |
938 * The code for computing a bailout environment, and the code | 940 * The code for computing a bailout environment, and the code |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 | 1736 |
1735 HType get guaranteedType() => constantType; | 1737 HType get guaranteedType() => constantType; |
1736 | 1738 |
1737 bool isConstant() => true; | 1739 bool isConstant() => true; |
1738 bool isConstantBoolean() => constant.isBool(); | 1740 bool isConstantBoolean() => constant.isBool(); |
1739 bool isConstantNull() => constant.isNull(); | 1741 bool isConstantNull() => constant.isNull(); |
1740 bool isConstantNumber() => constant.isNum(); | 1742 bool isConstantNumber() => constant.isNum(); |
1741 bool isConstantString() => constant.isString(); | 1743 bool isConstantString() => constant.isString(); |
1742 bool isConstantList() => constant.isList(); | 1744 bool isConstantList() => constant.isList(); |
1743 bool isConstantMap() => constant.isMap(); | 1745 bool isConstantMap() => constant.isMap(); |
| 1746 bool isConstantFalse() => constant.isFalse(); |
| 1747 bool isConstantTrue() => constant.isTrue(); |
1744 | 1748 |
1745 // Maybe avoid this if the literal is big? | 1749 // Maybe avoid this if the literal is big? |
1746 bool isCodeMotionInvariant() => true; | 1750 bool isCodeMotionInvariant() => true; |
1747 } | 1751 } |
1748 | 1752 |
1749 class HNot extends HInstruction { | 1753 class HNot extends HInstruction { |
1750 HNot(HInstruction value) : super(<HInstruction>[value]); | 1754 HNot(HInstruction value) : super(<HInstruction>[value]); |
1751 void prepareGvn() { | 1755 void prepareGvn() { |
1752 assert(!hasSideEffects()); | 1756 assert(!hasSideEffects()); |
1753 setUseGvn(); | 1757 setUseGvn(); |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2479 this.catchBlock, | 2483 this.catchBlock, |
2480 this.finallyBlock); | 2484 this.finallyBlock); |
2481 | 2485 |
2482 HBasicBlock get start() => body.start; | 2486 HBasicBlock get start() => body.start; |
2483 HBasicBlock get end() => | 2487 HBasicBlock get end() => |
2484 finallyBlock === null ? catchBlock.end : finallyBlock.end; | 2488 finallyBlock === null ? catchBlock.end : finallyBlock.end; |
2485 | 2489 |
2486 bool accept(HStatementInformationVisitor visitor) => | 2490 bool accept(HStatementInformationVisitor visitor) => |
2487 visitor.visitTryInfo(this); | 2491 visitor.visitTryInfo(this); |
2488 } | 2492 } |
OLD | NEW |