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

Unified Diff: pkg/compiler/lib/src/enqueue.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/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 7de0de1819a8c3352f4abbfb2f26ea9ddda7e7a5..8963fb3b6256f6f4c50db6f1ba687171fec877c2 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -35,20 +35,19 @@ class EnqueueTask extends CompilerTask {
EnqueueTask(Compiler compiler)
: this.compiler = compiler,
super(compiler.measurer) {
- _resolution = new ResolutionEnqueuer(
- this,
- compiler.options,
- compiler.reporter,
- compiler.options.analyzeOnly && compiler.options.analyzeMain
- ? const DirectEnqueuerStrategy()
- : const TreeShakingEnqueuerStrategy(),
- compiler.backend.resolutionEnqueuerListener,
- new ElementResolutionWorldBuilder(
- compiler.backend, compiler.resolution, const OpenWorldStrategy()),
- new ResolutionWorkItemBuilder(compiler.resolution));
- }
-
- ResolutionEnqueuer get resolution => _resolution;
+ createResolutionEnqueuer();
+ }
+
+ ResolutionEnqueuer get resolution {
+ assert(invariant(NO_LOCATION_SPANNABLE, _resolution != null,
+ message: "ResolutionEnqueuer has not been created yet."));
+ return _resolution;
+ }
+
+ ResolutionEnqueuer createResolutionEnqueuer() {
+ return _resolution ??=
+ compiler.backend.createResolutionEnqueuer(this, compiler);
+ }
Enqueuer createCodegenEnqueuer(ClosedWorld closedWorld) {
return compiler.backend.createCodegenEnqueuer(this, compiler, closedWorld);
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698