Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2836323002: Add more factory methods to FrontEndStrategy. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/frontend_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_data.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 647af8e70d238b13c5500740cba1b6082ee54c9f..9bafc913246c59fee926a1b9f5d2af756147150b 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -28,7 +28,6 @@ import '../enqueue.dart'
Enqueuer,
EnqueueTask,
ResolutionEnqueuer,
- ResolutionWorkItemBuilder,
TreeShakingEnqueuerStrategy;
import '../frontend_strategy.dart';
import '../io/multi_information.dart' show MultiSourceInformationStrategy;
@@ -361,8 +360,7 @@ class JavaScriptBackend {
return result;
}
- final RuntimeTypesNeedBuilder _rtiNeedBuilder =
- new _RuntimeTypesNeedBuilder();
+ final RuntimeTypesNeedBuilder _rtiNeedBuilder;
RuntimeTypesNeed _rtiNeed;
final _RuntimeTypes _rti;
@@ -486,11 +484,12 @@ class JavaScriptBackend {
useMultiSourceInfo: useMultiSourceInfo,
useNewSourceInfo: useNewSourceInfo),
constantCompilerTask = new JavaScriptConstantTask(compiler),
- _nativeDataResolver = new NativeDataResolverImpl(compiler) {
+ _nativeDataResolver = new NativeDataResolverImpl(compiler),
+ _rtiNeedBuilder =
+ compiler.frontEndStrategy.createRuntimeTypesNeedBuilder() {
_target = new JavaScriptBackendTarget(this);
impacts = new BackendImpacts(compiler.options, commonElements);
- _mirrorsData = new MirrorsDataImpl(
- compiler, compiler.options, commonElements, constants);
+ _mirrorsData = compiler.frontEndStrategy.createMirrorsDataBuilder();
_backendUsageBuilder = new BackendUsageBuilderImpl(commonElements);
_checkedModeHelpers = new CheckedModeHelpers(commonElements);
emitter =
@@ -500,12 +499,12 @@ class JavaScriptBackend {
compiler.elementEnvironment, impacts, backendUsageBuilder);
jsInteropAnalysis = new JsInteropAnalysis(this);
_mirrorsResolutionAnalysis =
- new MirrorsResolutionAnalysisImpl(this, compiler.resolution);
+ compiler.frontEndStrategy.createMirrorsResolutionAnalysis(this);
lookupMapResolutionAnalysis =
new LookupMapResolutionAnalysis(reporter, compiler.elementEnvironment);
noSuchMethodRegistry = new NoSuchMethodRegistry(
- commonElements, new NoSuchMethodResolverImpl());
+ commonElements, compiler.frontEndStrategy.createNoSuchMethodResolver());
kernelTask = new KernelTask(compiler);
patchResolverTask = new PatchResolverTask(compiler);
functionCompiler =
@@ -833,12 +832,9 @@ class JavaScriptBackend {
backendUsageBuilder,
compiler.frontEndStrategy.createNativeClassResolver(nativeBasicData));
_nativeData = new NativeDataImpl(nativeBasicData);
- _customElementsResolutionAnalysis = new CustomElementsResolutionAnalysis(
- compiler.resolution,
- constantSystem,
- commonElements,
- nativeBasicData,
- backendUsageBuilder);
+ _customElementsResolutionAnalysis = compiler.frontEndStrategy
+ .createCustomElementsResolutionAnalysis(
+ nativeBasicData, backendUsageBuilder);
impactTransformer = new JavaScriptImpactTransformer(
compiler.options,
compiler.elementEnvironment,
@@ -877,9 +873,10 @@ class JavaScriptBackend {
_nativeResolutionEnqueuer,
compiler.deferredLoadTask,
kernelTask),
- new ElementResolutionWorldBuilder(
- this, compiler.resolution, const OpenWorldStrategy()),
- new ResolutionWorkItemBuilder(compiler.resolution));
+ compiler.frontEndStrategy.createResolutionWorldBuilder(
+ nativeBasicData, const OpenWorldStrategy()),
+ compiler.frontEndStrategy
+ .createResolutionWorkItemBuilder(impactTransformer));
}
/// Creates an [Enqueuer] for code generation specific to this backend.
« no previous file with comments | « pkg/compiler/lib/src/frontend_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698