| Index: pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
|
| index 6bc41cc82f3e19144a0dade020f311773be6bcc1..130e2cb6b9e5c7f2bcd330617c44f56afcb6623a 100644
|
| --- a/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/mirrors_analysis.dart
|
| @@ -126,33 +126,20 @@ class MirrorsResolutionAnalysisImpl implements MirrorsResolutionAnalysis {
|
| if (_mirrorsData.mustRetainMetadata) {
|
| _reporter.log('Retaining metadata.');
|
|
|
| - for (LibraryEntity library in _compiler.libraryLoader.libraries) {
|
| - _mirrorsData.retainMetadataOfLibrary(library,
|
| - addForEmission: !enqueuer.isResolutionQueue);
|
| + /// Register the constant value of [metadata] as live in resolution.
|
| + void registerMetadataConstant(MetadataAnnotation metadata) {
|
| + metadata.ensureResolved(_compiler.resolution);
|
| + ConstantValue constant =
|
| + _constants.getConstantValueForMetadata(metadata);
|
| + Dependency dependency =
|
| + new Dependency(constant, metadata.annotatedElement);
|
| + _metadataConstants.add(dependency);
|
| + _impactBuilder.registerConstantUse(new ConstantUse.mirrors(constant));
|
| }
|
|
|
| - if (!enqueuer.queueIsClosed) {
|
| - /// Register the constant value of [metadata] as live in resolution.
|
| - void registerMetadataConstant(MetadataAnnotation metadata) {
|
| - ConstantValue constant =
|
| - _constants.getConstantValueForMetadata(metadata);
|
| - Dependency dependency =
|
| - new Dependency(constant, metadata.annotatedElement);
|
| - _metadataConstants.add(dependency);
|
| - _impactBuilder.registerConstantUse(new ConstantUse.mirrors(constant));
|
| - }
|
| -
|
| - // TODO(johnniwinther): We should have access to all recently processed
|
| - // elements and process these instead.
|
| - processMetadata(enqueuer.processedEntities, registerMetadataConstant);
|
| - } else {
|
| - for (Dependency dependency in _metadataConstants) {
|
| - _impactBuilder.registerConstantUse(
|
| - new ConstantUse.mirrors(dependency.constant));
|
| - }
|
| - _metadataConstants.clear();
|
| - }
|
| - enqueuer.applyImpact(_impactBuilder.flush());
|
| + // TODO(johnniwinther): We should have access to all recently processed
|
| + // elements and process these instead.
|
| + processMetadata(enqueuer.processedEntities, registerMetadataConstant);
|
| }
|
| }
|
|
|
| @@ -186,11 +173,10 @@ class MirrorsResolutionAnalysisImpl implements MirrorsResolutionAnalysis {
|
| if (element.enclosingElement is ClassElement) {
|
| // Use [enclosingElement] instead of [enclosingClass] to ensure that
|
| // we process patch class metadata for patch and injected members.
|
| - processElementMetadata(element.enclosingElement);
|
| }
|
| - } else {
|
| - processLibraryMetadata(element.library);
|
| + processElementMetadata(element.enclosingClass);
|
| }
|
| + processLibraryMetadata(element.library);
|
| }
|
| }
|
|
|
|
|