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

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

Issue 2729383002: Prepare for late creation of ResolutionEnqueuer (Closed)
Patch Set: Created 3 years, 9 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/enqueue.dart ('k') | no next file » | 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 82710ac16931a27bd78d0ece82d8c887cf671ea5..be709f53ef62a823ed779c33bc2f6ada50247ca2 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -29,10 +29,12 @@ import '../elements/resolution_types.dart';
import '../elements/types.dart';
import '../enqueue.dart'
show
+ DirectEnqueuerStrategy,
Enqueuer,
EnqueuerListener,
EnqueueTask,
ResolutionEnqueuer,
+ ResolutionWorkItemBuilder,
TreeShakingEnqueuerStrategy;
import '../io/multi_information.dart' show MultiSourceInformationStrategy;
import '../io/position_information.dart' show PositionSourceInformationStrategy;
@@ -444,8 +446,6 @@ class JavaScriptBackend {
MirrorsData mirrorsData;
CheckedModeHelpers _checkedModeHelpers;
- ResolutionEnqueuerListener _resolutionEnqueuerListener;
-
native.NativeResolutionEnqueuer _nativeResolutionEnqueuer;
native.NativeCodegenEnqueuer _nativeCodegenEnqueuer;
@@ -551,24 +551,6 @@ class JavaScriptBackend {
serialization = new JavaScriptBackendSerialization(nativeData);
_interceptorDataBuilder = new InterceptorDataBuilderImpl(
nativeClassData, helpers, commonElements, compiler.resolution);
- _resolutionEnqueuerListener = new ResolutionEnqueuerListener(
- kernelTask,
- compiler.options,
- compiler.elementEnvironment,
- commonElements,
- helpers,
- impacts,
- nativeClassData,
- _interceptorDataBuilder,
- _backendUsageBuilder,
- _rtiNeedBuilder,
- mirrorsData,
- noSuchMethodRegistry,
- customElementsResolutionAnalysis,
- lookupMapLibraryAccess,
- mirrorsAnalysis,
- typeVariableAnalysis,
- _nativeResolutionEnqueuer);
}
/// The [ConstantSystem] used to interpret compile-time constants for this
@@ -647,9 +629,6 @@ class JavaScriptBackend {
CheckedModeHelpers get checkedModeHelpers => _checkedModeHelpers;
- EnqueuerListener get resolutionEnqueuerListener =>
- _resolutionEnqueuerListener;
-
/// Returns constant environment for the JavaScript interpretation of the
/// constants.
JavaScriptConstantCompiler get constants {
@@ -929,6 +908,38 @@ class JavaScriptBackend {
bool isComplexNoSuchMethod(FunctionElement element) =>
noSuchMethodRegistry.isComplex(element);
+ ResolutionEnqueuer createResolutionEnqueuer(
+ CompilerTask task, Compiler compiler) {
+ return new ResolutionEnqueuer(
+ task,
+ compiler.options,
+ compiler.reporter,
+ compiler.options.analyzeOnly && compiler.options.analyzeMain
+ ? const DirectEnqueuerStrategy()
+ : const TreeShakingEnqueuerStrategy(),
+ new ResolutionEnqueuerListener(
+ kernelTask,
+ compiler.options,
+ compiler.elementEnvironment,
+ commonElements,
+ helpers,
+ impacts,
+ nativeClassData,
+ _interceptorDataBuilder,
+ _backendUsageBuilder,
+ _rtiNeedBuilder,
+ mirrorsData,
+ noSuchMethodRegistry,
+ customElementsResolutionAnalysis,
+ lookupMapLibraryAccess,
+ mirrorsAnalysis,
+ typeVariableAnalysis,
+ _nativeResolutionEnqueuer),
+ new ElementResolutionWorldBuilder(
+ this, compiler.resolution, const OpenWorldStrategy()),
+ new ResolutionWorkItemBuilder(compiler.resolution));
+ }
+
/// Creates an [Enqueuer] for code generation specific to this backend.
CodegenEnqueuer createCodegenEnqueuer(
CompilerTask task, Compiler compiler, ClosedWorld closedWorld) {
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698