Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 17700) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy) |
| @@ -1767,6 +1767,15 @@ |
| assignVariable(variableNames.getName(node.receiver), pop()); |
| } |
| + void registerForeignType(HType type) { |
| + DartType dartType = type.computeType(compiler); |
| + if (dartType == null) { |
| + assert(type == HType.UNKNOWN); |
| + return; |
| + } |
| + world.registerInstantiatedClass(dartType.element); |
|
sra1
2013/01/28 20:12:20
This might be too broad - might be the least upper
|
| + } |
| + |
| visitForeign(HForeign node) { |
| String code = node.code.slowToString(); |
| List<HInstruction> inputs = node.inputs; |
| @@ -1784,10 +1793,7 @@ |
| } |
| push(new js.LiteralExpression.withData(code, data), node); |
| } |
| - DartType type = types[node].computeType(compiler); |
| - if (type != null) { |
| - world.registerInstantiatedClass(type.element); |
| - } |
| + registerForeignType(types[node]); |
| // TODO(sra): Tell world.nativeEnqueuer about the types created here. |
| } |
| @@ -1803,6 +1809,7 @@ |
| // TODO(floitsch): jsClassReference is an Access. We shouldn't treat it |
| // as if it was a string. |
| push(new js.New(new js.VariableUse(jsClassReference), arguments), node); |
| + registerForeignType(types[node]); |
| } |
| js.Expression newLiteralBool(bool value) { |