Chromium Code Reviews| 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 if (declaredType.slowToString() == '=List') return HType.READABLE_ARRAY; |
|
sra1
2012/11/29 00:12:51
I have not figured out how to do it yet, but we sh
ngeoffray
2012/11/29 11:10:44
Agree. The current JS form is pretty limited and w
| |
| 1513 return HType.UNKNOWN; | 1513 return HType.UNKNOWN; |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 HType get guaranteedType => foreignType; | 1516 HType get guaranteedType => foreignType; |
| 1517 | 1517 |
| 1518 bool isJsStatement(HTypeMap types) => _isStatement; | 1518 bool isJsStatement(HTypeMap types) => _isStatement; |
| 1519 } | 1519 } |
| 1520 | 1520 |
| 1521 class HForeignNew extends HForeign { | 1521 class HForeignNew extends HForeign { |
| 1522 ClassElement element; | 1522 ClassElement element; |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2940 HBasicBlock get start => expression.start; | 2940 HBasicBlock get start => expression.start; |
| 2941 HBasicBlock get end { | 2941 HBasicBlock get end { |
| 2942 // We don't create a switch block if there are no cases. | 2942 // We don't create a switch block if there are no cases. |
| 2943 assert(!statements.isEmpty); | 2943 assert(!statements.isEmpty); |
| 2944 return statements.last.end; | 2944 return statements.last.end; |
| 2945 } | 2945 } |
| 2946 | 2946 |
| 2947 bool accept(HStatementInformationVisitor visitor) => | 2947 bool accept(HStatementInformationVisitor visitor) => |
| 2948 visitor.visitSwitchInfo(this); | 2948 visitor.visitSwitchInfo(this); |
| 2949 } | 2949 } |
| OLD | NEW |