OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 abstract class HVisitor<R> { | 7 abstract class HVisitor<R> { |
8 R visitAdd(HAdd node); | 8 R visitAdd(HAdd node); |
9 R visitBailoutTarget(HBailoutTarget node); | 9 R visitBailoutTarget(HBailoutTarget node); |
10 R visitBitAnd(HBitAnd node); | 10 R visitBitAnd(HBitAnd node); |
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 _isStatement = true, | 1502 _isStatement = true, |
1503 super(inputs); | 1503 super(inputs); |
1504 accept(HVisitor visitor) => visitor.visitForeign(this); | 1504 accept(HVisitor visitor) => visitor.visitForeign(this); |
1505 | 1505 |
1506 static HType computeTypeFromDeclaredType(DartString declaredType) { | 1506 static HType computeTypeFromDeclaredType(DartString declaredType) { |
1507 if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; | 1507 if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; |
1508 if (declaredType.slowToString() == 'int') return HType.INTEGER; | 1508 if (declaredType.slowToString() == 'int') return HType.INTEGER; |
1509 if (declaredType.slowToString() == 'double') return HType.DOUBLE; | 1509 if (declaredType.slowToString() == 'double') return HType.DOUBLE; |
1510 if (declaredType.slowToString() == 'num') return HType.NUMBER; | 1510 if (declaredType.slowToString() == 'num') return HType.NUMBER; |
1511 if (declaredType.slowToString() == 'String') return HType.STRING; | 1511 if (declaredType.slowToString() == 'String') return HType.STRING; |
| 1512 if (declaredType.slowToString() == 'JSArray') return HType.READABLE_ARRAY; |
1512 return HType.UNKNOWN; | 1513 return HType.UNKNOWN; |
1513 } | 1514 } |
1514 | 1515 |
1515 HType get guaranteedType => foreignType; | 1516 HType get guaranteedType => foreignType; |
1516 | 1517 |
1517 bool isJsStatement(HTypeMap types) => _isStatement; | 1518 bool isJsStatement(HTypeMap types) => _isStatement; |
1518 } | 1519 } |
1519 | 1520 |
1520 class HForeignNew extends HForeign { | 1521 class HForeignNew extends HForeign { |
1521 ClassElement element; | 1522 ClassElement element; |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2934 HBasicBlock get start => expression.start; | 2935 HBasicBlock get start => expression.start; |
2935 HBasicBlock get end { | 2936 HBasicBlock get end { |
2936 // We don't create a switch block if there are no cases. | 2937 // We don't create a switch block if there are no cases. |
2937 assert(!statements.isEmpty); | 2938 assert(!statements.isEmpty); |
2938 return statements.last.end; | 2939 return statements.last.end; |
2939 } | 2940 } |
2940 | 2941 |
2941 bool accept(HStatementInformationVisitor visitor) => | 2942 bool accept(HStatementInformationVisitor visitor) => |
2942 visitor.visitSwitchInfo(this); | 2943 visitor.visitSwitchInfo(this); |
2943 } | 2944 } |
OLD | NEW |