Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
| index 32844bf2fd452c68d0c5fe994dc7f504cf64ca8d..855c3c23053777cac82523effa2e101ed52a815f 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
| @@ -16,7 +16,6 @@ class CodeEmitterTask extends CompilerTask { |
| // TODO(floitsch): the code-emitter task should not need a namer. |
| final Namer namer; |
| final TypeTestEmitter typeTestEmitter = new TypeTestEmitter(); |
| - final InterceptorEmitter interceptorEmitter = new InterceptorEmitter(); |
| NativeEmitter nativeEmitter; |
| OldEmitter oldEmitter; |
| Emitter emitter; |
| @@ -47,7 +46,6 @@ class CodeEmitterTask extends CompilerTask { |
| : oldEmitter; |
| nativeEmitter = new NativeEmitter(this); |
| typeTestEmitter.emitter = this.oldEmitter; |
| - interceptorEmitter.emitter = this.oldEmitter; |
| // TODO(18886): Remove this call (and the show in the import) once the |
| // memory-leak in the VM is fixed. |
| templateManager.clear(); |
| @@ -62,6 +60,19 @@ class CodeEmitterTask extends CompilerTask { |
| return emitter.constantReference(value); |
| } |
| + Set<ClassElement> interceptorsReferencedFromConstants() { |
|
floitsch
2014/09/24 14:02:06
Straight copy from `interceptor_emitter.dart`.
|
| + Set<ClassElement> classes = new Set<ClassElement>(); |
| + JavaScriptConstantCompiler handler = backend.constants; |
| + List<Constant> constants = handler.getConstantsForEmission(); |
| + for (Constant constant in constants) { |
| + if (constant is InterceptorConstant) { |
| + InterceptorConstant interceptorConstant = constant; |
| + classes.add(interceptorConstant.dispatchedType.element); |
| + } |
| + } |
| + return classes; |
| + } |
| + |
| /** |
| * Return a function that returns true if its argument is a class |
| * that needs to be emitted. |
| @@ -84,7 +95,7 @@ class CodeEmitterTask extends CompilerTask { |
| ); |
| // Add interceptors referenced by constants. |
| - needed.addAll(interceptorEmitter.interceptorsReferencedFromConstants()); |
| + needed.addAll(interceptorsReferencedFromConstants()); |
| // Add unneeded interceptors to the [unneededClasses] set. |
| for (ClassElement interceptor in backend.interceptedClasses) { |
| @@ -281,7 +292,7 @@ class OldEmitter implements Emitter { |
| final ClassEmitter classEmitter = new ClassEmitter(); |
| final NsmEmitter nsmEmitter = new NsmEmitter(); |
| TypeTestEmitter get typeTestEmitter => task.typeTestEmitter; |
| - InterceptorEmitter get interceptorEmitter => task.interceptorEmitter; |
| + final InterceptorEmitter interceptorEmitter = new InterceptorEmitter(); |
| final MetadataEmitter metadataEmitter = new MetadataEmitter(); |
| final Set<Constant> cachedEmittedConstants; |