| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 static HType mapConstantTypeToSsaType(Constant constant) { | 150 static HType mapConstantTypeToSsaType(Constant constant) { |
| 151 if (constant.isNull()) return HType.NULL; | 151 if (constant.isNull()) return HType.NULL; |
| 152 if (constant.isBool()) return HType.BOOLEAN; | 152 if (constant.isBool()) return HType.BOOLEAN; |
| 153 if (constant.isInt()) return HType.INTEGER; | 153 if (constant.isInt()) return HType.INTEGER; |
| 154 if (constant.isDouble()) return HType.DOUBLE; | 154 if (constant.isDouble()) return HType.DOUBLE; |
| 155 if (constant.isString()) return HType.STRING; | 155 if (constant.isString()) return HType.STRING; |
| 156 if (constant.isList()) return HType.READABLE_ARRAY; | 156 if (constant.isList()) return HType.READABLE_ARRAY; |
| 157 ObjectConstant objectConstant = constant; | 157 ObjectConstant objectConstant = constant; |
| 158 return new HExactType(objectConstant.type); | 158 return new HBoundedType.exact(objectConstant.type); |
| 159 } | 159 } |
| 160 | 160 |
| 161 HConstant addConstant(Constant constant) { | 161 HConstant addConstant(Constant constant) { |
| 162 HConstant result = constants[constant]; | 162 HConstant result = constants[constant]; |
| 163 if (result === null) { | 163 if (result === null) { |
| 164 HType type = mapConstantTypeToSsaType(constant); | 164 HType type = mapConstantTypeToSsaType(constant); |
| 165 result = new HConstant.internal(constant, type); | 165 result = new HConstant.internal(constant, type); |
| 166 entry.addAtExit(result); | 166 entry.addAtExit(result); |
| 167 constants[constant] = result; | 167 constants[constant] = result; |
| 168 } | 168 } |
| (...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 this.catchBlock, | 2467 this.catchBlock, |
| 2468 this.finallyBlock); | 2468 this.finallyBlock); |
| 2469 | 2469 |
| 2470 HBasicBlock get start() => body.start; | 2470 HBasicBlock get start() => body.start; |
| 2471 HBasicBlock get end() => | 2471 HBasicBlock get end() => |
| 2472 finallyBlock === null ? catchBlock.end : finallyBlock.end; | 2472 finallyBlock === null ? catchBlock.end : finallyBlock.end; |
| 2473 | 2473 |
| 2474 bool accept(HStatementInformationVisitor visitor) => | 2474 bool accept(HStatementInformationVisitor visitor) => |
| 2475 visitor.visitTryInfo(this); | 2475 visitor.visitTryInfo(this); |
| 2476 } | 2476 } |
| OLD | NEW |