Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 17848) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy) |
| @@ -1547,42 +1547,29 @@ |
| final bool isStatement; |
| HForeign(this.code, |
| - DartString declaredType, |
| + this.foreignType, |
| List<HInstruction> inputs, |
| {this.isStatement: false}) |
| - : foreignType = computeTypeFromDeclaredType(declaredType), |
| - super(inputs) { |
| + : super(inputs) { |
|
kasperl
2013/02/04 09:27:50
Too much indentation.
ngeoffray
2013/02/04 10:45:06
Done.
|
| setAllSideEffects(); |
| setDependsOnSomething(); |
| } |
| HForeign.statement(code, List<HInstruction> inputs) |
| - : this(code, const LiteralDartString('var'), inputs, isStatement: true); |
| + : this(code, HType.UNKNOWN, inputs, isStatement: true); |
| accept(HVisitor visitor) => visitor.visitForeign(this); |
| - static HType computeTypeFromDeclaredType(DartString declaredType) { |
| - if (declaredType.slowToString() == 'bool') return HType.BOOLEAN; |
| - if (declaredType.slowToString() == 'int') return HType.INTEGER; |
| - if (declaredType.slowToString() == 'double') return HType.DOUBLE; |
| - if (declaredType.slowToString() == 'num') return HType.NUMBER; |
| - if (declaredType.slowToString() == 'String') return HType.STRING; |
| - if (declaredType.slowToString() == '=List') return HType.READABLE_ARRAY; |
| - return HType.UNKNOWN; |
| - } |
| - |
| HType get guaranteedType => foreignType; |
| bool isJsStatement() => isStatement; |
| bool canThrow() => true; |
| - |
| } |
| class HForeignNew extends HForeign { |
| ClassElement element; |
| - HForeignNew(this.element, List<HInstruction> inputs) |
| - : super(const LiteralDartString("new"), |
| - const LiteralDartString("Object"), inputs); |
| + HForeignNew(this.element, HType type, List<HInstruction> inputs) |
| + : super(const LiteralDartString("new"), type, inputs); |
| accept(HVisitor visitor) => visitor.visitForeignNew(this); |
| } |