| Index: pkg/compiler/lib/src/js_backend/backend.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
|
| index e21c2a341a4c618563cf821c8bc361fc0a4814c5..890779618d1e58fd7ad1663596083376f64ecb9b 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart
|
| @@ -380,10 +380,10 @@ class JavaScriptBackend {
|
| bool htmlLibraryIsLoaded = false;
|
|
|
| /// Resolution analysis for tracking reflective access to type variables.
|
| - TypeVariableAnalysis typeVariableAnalysis;
|
| + TypeVariableAnalysis _typeVariableAnalysis;
|
|
|
| /// Codegen handler for reflective access to type variables.
|
| - TypeVariableHandler typeVariableHandler;
|
| + TypeVariableHandler _typeVariableHandler;
|
|
|
| /// Resolution support for generating table of interceptors and
|
| /// constructors for custom elements.
|
| @@ -440,7 +440,7 @@ class JavaScriptBackend {
|
| OneShotInterceptorData _oneShotInterceptorData;
|
| BackendUsage _backendUsage;
|
| BackendUsageBuilder _backendUsageBuilder;
|
| - MirrorsData mirrorsData;
|
| + MirrorsDataImpl _mirrorsData;
|
| CheckedModeHelpers _checkedModeHelpers;
|
|
|
| native.NativeResolutionEnqueuer _nativeResolutionEnqueuer;
|
| @@ -504,7 +504,7 @@ class JavaScriptBackend {
|
| impacts = new BackendImpacts(compiler.options, commonElements, helpers);
|
| backendClasses = new JavaScriptBackendClasses(
|
| compiler.elementEnvironment, helpers, nativeClassData);
|
| - mirrorsData = new MirrorsData(
|
| + _mirrorsData = new MirrorsDataImpl(
|
| compiler, compiler.options, commonElements, helpers, constants);
|
| _backendUsageBuilder = new BackendUsageBuilderImpl(
|
| compiler.elementEnvironment, commonElements, helpers);
|
| @@ -515,9 +515,8 @@ class JavaScriptBackend {
|
| _nativeCodegenEnqueuer = new native.NativeCodegenEnqueuer(
|
| compiler, emitter, _nativeResolutionEnqueuer);
|
|
|
| - typeVariableAnalysis = new TypeVariableAnalysis(
|
| + _typeVariableAnalysis = new TypeVariableAnalysis(
|
| compiler.elementEnvironment, impacts, backendUsageBuilder);
|
| - typeVariableHandler = new TypeVariableHandler(this, helpers, mirrorsData);
|
| customElementsResolutionAnalysis = new CustomElementsResolutionAnalysis(
|
| compiler.resolution,
|
| constantSystem,
|
| @@ -549,7 +548,7 @@ class JavaScriptBackend {
|
| nativeClassData,
|
| nativeResolutionEnqueuer,
|
| backendUsageBuilder,
|
| - mirrorsData,
|
| + mirrorsDataBuilder,
|
| customElementsResolutionAnalysis,
|
| rtiNeedBuilder);
|
| patchResolverTask = new PatchResolverTask(compiler);
|
| @@ -573,6 +572,24 @@ class JavaScriptBackend {
|
|
|
| Target get target => _target;
|
|
|
| + /// Resolution analysis for tracking reflective access to type variables.
|
| + TypeVariableAnalysis get typeVariableAnalysis {
|
| + assert(invariant(NO_LOCATION_SPANNABLE, _typeVariableHandler == null,
|
| + message: "TypeVariableHandler has already been created."));
|
| + return _typeVariableAnalysis;
|
| + }
|
| +
|
| + /// Codegen handler for reflective access to type variables.
|
| + TypeVariableHandler get typeVariableHandler {
|
| + assert(invariant(NO_LOCATION_SPANNABLE, _typeVariableHandler != null,
|
| + message: "TypeVariableHandler has not been created yet."));
|
| + return _typeVariableHandler;
|
| + }
|
| +
|
| + MirrorsData get mirrorsData => _mirrorsData;
|
| +
|
| + MirrorsDataBuilder get mirrorsDataBuilder => _mirrorsData;
|
| +
|
| /// Codegen support for tree-shaking entries of `LookupMap`.
|
| LookupMapAnalysis get lookupMapAnalysis {
|
| assert(invariant(NO_LOCATION_SPANNABLE, _lookupMapAnalysis != null,
|
| @@ -781,7 +798,7 @@ class JavaScriptBackend {
|
| for (Entity entity in compiler.enqueuer.resolution.processedEntities) {
|
| processAnnotations(entity, closedWorldRefiner);
|
| }
|
| - mirrorsData.computeMembersNeededForReflection(
|
| + mirrorsDataBuilder.computeMembersNeededForReflection(
|
| compiler.enqueuer.resolution.worldBuilder, closedWorld);
|
| _backendUsage = _backendUsageBuilder.close();
|
| _rtiNeed = rtiNeedBuilder.computeRuntimeTypesNeed(
|
| @@ -874,7 +891,7 @@ class JavaScriptBackend {
|
| _interceptorDataBuilder,
|
| _backendUsageBuilder,
|
| _rtiNeedBuilder,
|
| - mirrorsData,
|
| + mirrorsDataBuilder,
|
| noSuchMethodRegistry,
|
| customElementsResolutionAnalysis,
|
| lookupMapLibraryAccess,
|
| @@ -889,6 +906,7 @@ class JavaScriptBackend {
|
| /// Creates an [Enqueuer] for code generation specific to this backend.
|
| CodegenEnqueuer createCodegenEnqueuer(
|
| CompilerTask task, Compiler compiler, ClosedWorld closedWorld) {
|
| + _typeVariableHandler = new TypeVariableHandler(this, helpers, mirrorsData);
|
| _lookupMapAnalysis = new LookupMapAnalysis(
|
| reporter,
|
| constantSystem,
|
| @@ -914,7 +932,6 @@ class JavaScriptBackend {
|
| backendClasses,
|
| backendUsage,
|
| rtiNeed,
|
| - mirrorsData,
|
| customElementsCodegenAnalysis,
|
| typeVariableHandler,
|
| lookupMapAnalysis,
|
| @@ -1191,7 +1208,6 @@ class JavaScriptBackend {
|
| rtiNeed,
|
| nativeCodegenEnqueuer,
|
| namer,
|
| - mirrorsData,
|
| oneShotInterceptorData,
|
| lookupMapAnalysis,
|
| rtiChecksBuilder);
|
|
|