| 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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 DartString declaredType, | 1522 DartString declaredType, |
| 1523 List<HInstruction> inputs, | 1523 List<HInstruction> inputs, |
| 1524 {this.isStatement: false}) | 1524 {this.isStatement: false}) |
| 1525 : foreignType = computeTypeFromDeclaredType(declaredType), | 1525 : foreignType = computeTypeFromDeclaredType(declaredType), |
| 1526 super(inputs) { | 1526 super(inputs) { |
| 1527 setAllSideEffects(); | 1527 setAllSideEffects(); |
| 1528 setDependsOnSomething(); | 1528 setDependsOnSomething(); |
| 1529 } | 1529 } |
| 1530 | 1530 |
| 1531 HForeign.statement(code, List<HInstruction> inputs) | 1531 HForeign.statement(code, List<HInstruction> inputs) |
| 1532 : this(code, const LiteralDartString('var'), input, isStatement: true); | 1532 : this(code, const LiteralDartString('var'), inputs, isStatement: true); |
| 1533 | 1533 |
| 1534 accept(HVisitor visitor) => visitor.visitForeign(this); | 1534 accept(HVisitor visitor) => visitor.visitForeign(this); |
| 1535 | 1535 |
| 1536 static HType computeTypeFromDeclaredType(DartString declaredType) { | 1536 static HType computeTypeFromDeclaredType(DartString declaredType) { |
| 1537 if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; | 1537 if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; |
| 1538 if (declaredType.slowToString() == 'int') return HType.INTEGER; | 1538 if (declaredType.slowToString() == 'int') return HType.INTEGER; |
| 1539 if (declaredType.slowToString() == 'double') return HType.DOUBLE; | 1539 if (declaredType.slowToString() == 'double') return HType.DOUBLE; |
| 1540 if (declaredType.slowToString() == 'num') return HType.NUMBER; | 1540 if (declaredType.slowToString() == 'num') return HType.NUMBER; |
| 1541 if (declaredType.slowToString() == 'String') return HType.STRING; | 1541 if (declaredType.slowToString() == 'String') return HType.STRING; |
| 1542 if (declaredType.slowToString() == '=List') return HType.READABLE_ARRAY; | 1542 if (declaredType.slowToString() == '=List') return HType.READABLE_ARRAY; |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2635 HBasicBlock get start => expression.start; | 2635 HBasicBlock get start => expression.start; |
| 2636 HBasicBlock get end { | 2636 HBasicBlock get end { |
| 2637 // We don't create a switch block if there are no cases. | 2637 // We don't create a switch block if there are no cases. |
| 2638 assert(!statements.isEmpty); | 2638 assert(!statements.isEmpty); |
| 2639 return statements.last.end; | 2639 return statements.last.end; |
| 2640 } | 2640 } |
| 2641 | 2641 |
| 2642 bool accept(HStatementInformationVisitor visitor) => | 2642 bool accept(HStatementInformationVisitor visitor) => |
| 2643 visitor.visitSwitchInfo(this); | 2643 visitor.visitSwitchInfo(this); |
| 2644 } | 2644 } |
| OLD | NEW |