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 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 } | 2072 } |
2073 | 2073 |
2074 bool get builtin() => receiver.isMutableArray(); | 2074 bool get builtin() => receiver.isMutableArray(); |
2075 HType computeType() => value.type; | 2075 HType computeType() => value.type; |
2076 // This instruction does not yield a new value, so it always | 2076 // This instruction does not yield a new value, so it always |
2077 // has the expected type (void). | 2077 // has the expected type (void). |
2078 bool hasExpectedType() => true; | 2078 bool hasExpectedType() => true; |
2079 } | 2079 } |
2080 | 2080 |
2081 class HIs extends HInstruction { | 2081 class HIs extends HInstruction { |
2082 // TODO(ahe): This should be a Type, not Element. | 2082 final Type typeName; |
2083 final Element typeExpression; | |
2084 final bool nullOk; | 2083 final bool nullOk; |
2085 | 2084 |
2086 HIs(this.typeExpression, HInstruction expression, [nullOk = false]) | 2085 HIs(this.typeName, HInstruction expression, [nullOk = false]) |
2087 : this.nullOk = nullOk, super(<HInstruction>[expression]); | 2086 : this.nullOk = nullOk, super(<HInstruction>[expression]); |
2088 | 2087 |
2089 HInstruction get expression() => inputs[0]; | 2088 HInstruction get expression() => inputs[0]; |
2090 | 2089 |
2091 HType computeType() => HType.BOOLEAN; | 2090 HType computeType() => HType.BOOLEAN; |
2092 bool hasExpectedType() => true; | 2091 bool hasExpectedType() => true; |
2093 | 2092 |
2094 accept(HVisitor visitor) => visitor.visitIs(this); | 2093 accept(HVisitor visitor) => visitor.visitIs(this); |
2095 | 2094 |
2096 toString() => "$expression is $typeExpression"; | 2095 toString() => "$expression is $typeName"; |
2097 } | 2096 } |
2098 | 2097 |
2099 class HIfBlockInformation { | 2098 class HIfBlockInformation { |
2100 final HIf branch; | 2099 final HIf branch; |
2101 final SubGraph thenGraph; | 2100 final SubGraph thenGraph; |
2102 final SubGraph elseGraph; | 2101 final SubGraph elseGraph; |
2103 final HBasicBlock joinBlock; | 2102 final HBasicBlock joinBlock; |
2104 HIfBlockInformation(this.branch, | 2103 HIfBlockInformation(this.branch, |
2105 this.thenGraph, | 2104 this.thenGraph, |
2106 this.elseGraph, | 2105 this.elseGraph, |
2107 this.joinBlock); | 2106 this.joinBlock); |
2108 } | 2107 } |
OLD | NEW |