| 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 visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 bool builtin = false; | 1192 bool builtin = false; |
| 1193 /** The first input must be the target. */ | 1193 /** The first input must be the target. */ |
| 1194 HInvokeStatic(selector, inputs) : super(selector, inputs); | 1194 HInvokeStatic(selector, inputs) : super(selector, inputs); |
| 1195 toString() => 'invoke static: ${element.name}'; | 1195 toString() => 'invoke static: ${element.name}'; |
| 1196 accept(HVisitor visitor) => visitor.visitInvokeStatic(this); | 1196 accept(HVisitor visitor) => visitor.visitInvokeStatic(this); |
| 1197 Element get element() => target.element; | 1197 Element get element() => target.element; |
| 1198 HStatic get target() => inputs[0]; | 1198 HStatic get target() => inputs[0]; |
| 1199 | 1199 |
| 1200 HType computeType() { | 1200 HType computeType() { |
| 1201 if (element.isFactoryConstructor() | 1201 if (element.isFactoryConstructor() |
| 1202 && element.enclosingElement.name.toString() == 'List') { | 1202 && element.enclosingElement.name.slowToString() == 'List') { |
| 1203 builtin = true; | 1203 builtin = true; |
| 1204 return HType.ARRAY; | 1204 return HType.ARRAY; |
| 1205 } | 1205 } |
| 1206 return HType.UNKNOWN; | 1206 return HType.UNKNOWN; |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 bool hasExpectedType() => builtin; | 1209 bool hasExpectedType() => builtin; |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 class HInvokeSuper extends HInvokeStatic { | 1212 class HInvokeSuper extends HInvokeStatic { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 // Inputs for foreigns must not be generated at use site. In particular | 1314 // Inputs for foreigns must not be generated at use site. In particular |
| 1315 // literals would make troubles as we do a search/replace which would be | 1315 // literals would make troubles as we do a search/replace which would be |
| 1316 // complicated if we had to stringify literals first. | 1316 // complicated if we had to stringify literals first. |
| 1317 for (HInstruction input in inputs) { | 1317 for (HInstruction input in inputs) { |
| 1318 input.clearGenerateAtUseSite(); | 1318 input.clearGenerateAtUseSite(); |
| 1319 } | 1319 } |
| 1320 } | 1320 } |
| 1321 accept(HVisitor visitor) => visitor.visitForeign(this); | 1321 accept(HVisitor visitor) => visitor.visitForeign(this); |
| 1322 | 1322 |
| 1323 HType computeType() { | 1323 HType computeType() { |
| 1324 if (declaredType.stringValue == 'bool') return HType.BOOLEAN; | 1324 if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; |
| 1325 if (declaredType.stringValue == 'int') return HType.INTEGER; | 1325 if (declaredType.slowToString() == 'int') return HType.INTEGER; |
| 1326 if (declaredType.stringValue == 'num') return HType.NUMBER; | 1326 if (declaredType.slowToString() == 'num') return HType.NUMBER; |
| 1327 if (declaredType.stringValue == 'String') return HType.STRING; | 1327 if (declaredType.slowToString() == 'String') return HType.STRING; |
| 1328 return HType.UNKNOWN; | 1328 return HType.UNKNOWN; |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 bool hasExpectedType() => true; | 1331 bool hasExpectedType() => true; |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 class HForeignNew extends HForeign { | 1334 class HForeignNew extends HForeign { |
| 1335 ClassElement element; | 1335 ClassElement element; |
| 1336 HForeignNew(this.element, List<HInstruction> inputs) | 1336 HForeignNew(this.element, List<HInstruction> inputs) |
| 1337 : super(const SourceString("new"), const SourceString("Object"), inputs); | 1337 : super(const SourceString("new"), const SourceString("Object"), inputs); |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 | 2252 |
| 2253 HInstruction get expression() => inputs[0]; | 2253 HInstruction get expression() => inputs[0]; |
| 2254 | 2254 |
| 2255 HType computeType() => HType.BOOLEAN; | 2255 HType computeType() => HType.BOOLEAN; |
| 2256 bool hasExpectedType() => true; | 2256 bool hasExpectedType() => true; |
| 2257 | 2257 |
| 2258 accept(HVisitor visitor) => visitor.visitIs(this); | 2258 accept(HVisitor visitor) => visitor.visitIs(this); |
| 2259 | 2259 |
| 2260 toString() => "$expression is $typeExpression"; | 2260 toString() => "$expression is $typeExpression"; |
| 2261 } | 2261 } |
| OLD | NEW |