| 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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 // However it turns out that inserting an integer check in the optimized | 2174 // However it turns out that inserting an integer check in the optimized |
| 2175 // version is cheaper than having another bailout case. This is true, | 2175 // version is cheaper than having another bailout case. This is true, |
| 2176 // because the integer check will simply throw if it fails. | 2176 // because the integer check will simply throw if it fails. |
| 2177 return HType.UNKNOWN; | 2177 return HType.UNKNOWN; |
| 2178 } | 2178 } |
| 2179 | 2179 |
| 2180 bool get builtin() => receiver.isMutableArray() && index.isInteger(); | 2180 bool get builtin() => receiver.isMutableArray() && index.isInteger(); |
| 2181 } | 2181 } |
| 2182 | 2182 |
| 2183 class HIs extends HInstruction { | 2183 class HIs extends HInstruction { |
| 2184 final Type typeName; | 2184 final Type typeExpression; |
| 2185 final bool nullOk; | 2185 final bool nullOk; |
| 2186 | 2186 |
| 2187 HIs(this.typeName, HInstruction expression, [nullOk = false]) | 2187 HIs(this.typeExpression, HInstruction expression, [nullOk = false]) |
| 2188 : this.nullOk = nullOk, super(<HInstruction>[expression]); | 2188 : this.nullOk = nullOk, super(<HInstruction>[expression]); |
| 2189 | 2189 |
| 2190 HInstruction get expression() => inputs[0]; | 2190 HInstruction get expression() => inputs[0]; |
| 2191 | 2191 |
| 2192 HType get guaranteedType() => HType.BOOLEAN; | 2192 HType get guaranteedType() => HType.BOOLEAN; |
| 2193 | 2193 |
| 2194 accept(HVisitor visitor) => visitor.visitIs(this); | 2194 accept(HVisitor visitor) => visitor.visitIs(this); |
| 2195 | 2195 |
| 2196 toString() => "$expression is $typeName"; | 2196 toString() => "$expression is $typeExpression"; |
| 2197 } | 2197 } |
| 2198 | 2198 |
| 2199 | 2199 |
| 2200 interface HBlockInformation { | 2200 interface HBlockInformation { |
| 2201 bool accept(HBlockInformationVisitor visitor); | 2201 bool accept(HBlockInformationVisitor visitor); |
| 2202 } | 2202 } |
| 2203 | 2203 |
| 2204 interface HBlockInformationVisitor { | 2204 interface HBlockInformationVisitor { |
| 2205 bool visitLabeledBlockInfo(HLabeledBlockInformation info); | 2205 bool visitLabeledBlockInfo(HLabeledBlockInformation info); |
| 2206 bool visitLoopInfo(HLoopInformation info); | 2206 bool visitLoopInfo(HLoopInformation info); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2322 final bool isAnd; | 2322 final bool isAnd; |
| 2323 final SubExpression left; | 2323 final SubExpression left; |
| 2324 final SubExpression right; | 2324 final SubExpression right; |
| 2325 final HBasicBlock joinBlock; | 2325 final HBasicBlock joinBlock; |
| 2326 HAndOrBlockInformation(this.isAnd, | 2326 HAndOrBlockInformation(this.isAnd, |
| 2327 this.left, | 2327 this.left, |
| 2328 this.right, | 2328 this.right, |
| 2329 this.joinBlock); | 2329 this.joinBlock); |
| 2330 bool accept(HBlockInformationVisitor visitor) => visitor.visitAndOrInfo(this); | 2330 bool accept(HBlockInformationVisitor visitor) => visitor.visitAndOrInfo(this); |
| 2331 } | 2331 } |
| OLD | NEW |