Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart |
| index a9e49c0f3a94f4bd2e4135cc72eef5626c55527f..e8621a5d91c28c3d0ddf9cfba946603834757f0c 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart |
| @@ -196,6 +196,28 @@ class ConstantEmitter implements ConstantVisitor { |
| } |
| } |
| + void visitType(TypeConstant constant) { |
| + if (shouldEmitCanonicalVersion) { |
| + emitCanonicalVersion(constant); |
| + } else { |
| + SourceString helperSourceName = |
| + const SourceString('createRuntimeType'); |
| + Element helper = compiler.findHelper(helperSourceName); |
| + JavaScriptBackend backend = compiler.backend; |
| + String helperName = backend.namer.getName(helper); |
| + DartType type = constant.representedType; |
| + Element element = type.element; |
| + String typeName; |
| + if (type.kind == TypeKind.INTERFACE) { |
| + typeName = backend.rti.generateRuntimeTypeString(element, 0); |
| + } else { |
| + assert(type.kind == TypeKind.TYPEDEF); |
| + typeName = element.name.slowToString(); |
|
floitsch
2012/11/20 16:25:43
Discuss with Erik if (and potentially how) this sh
|
| + } |
| + buffer.add("${namer.CURRENT_ISOLATE}.$helperName('$typeName')"); |
| + } |
| + } |
| + |
| void visitConstructed(ConstructedConstant constant) { |
| if (shouldEmitCanonicalVersion) { |
| emitCanonicalVersion(constant); |