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

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

Issue 2745133002: Create LookupMapAnalysis late. (Closed)
Patch Set: Updated cf. comment. 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') | pkg/compiler/lib/src/js_backend/codegen_listener.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 949f59a430ca60d9dc60281957d5ed1633d29e42..67765fd7380211e9a1301d0a7d730e0d5c2c36a3 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -397,7 +397,7 @@ class JavaScriptBackend {
LookupMapLibraryAccess lookupMapLibraryAccess;
/// Codegen support for tree-shaking entries of `LookupMap`.
- LookupMapAnalysis lookupMapAnalysis;
+ LookupMapAnalysis _lookupMapAnalysis;
/// Codegen support for typed JavaScript interop.
JsInteropAnalysis jsInteropAnalysis;
@@ -537,8 +537,6 @@ class JavaScriptBackend {
mirrorsAnalysis = new MirrorsAnalysis(this, compiler.resolution);
lookupMapLibraryAccess =
new LookupMapLibraryAccess(reporter, compiler.elementEnvironment);
- lookupMapAnalysis = new LookupMapAnalysis(this, compiler.options, reporter,
- compiler.elementEnvironment, commonElements, helpers, backendClasses);
noSuchMethodRegistry = new NoSuchMethodRegistry(this);
kernelTask = new KernelTask(compiler);
@@ -575,6 +573,13 @@ class JavaScriptBackend {
Target get target => _target;
+ /// Codegen support for tree-shaking entries of `LookupMap`.
+ LookupMapAnalysis get lookupMapAnalysis {
+ assert(invariant(NO_LOCATION_SPANNABLE, _lookupMapAnalysis != null,
+ message: "LookupMapAnalysis has not been created yet."));
+ return _lookupMapAnalysis;
+ }
+
InterceptorData get interceptorData {
assert(invariant(NO_LOCATION_SPANNABLE, _interceptorData != null,
message: "InterceptorData has not been computed yet."));
@@ -884,6 +889,15 @@ class JavaScriptBackend {
/// Creates an [Enqueuer] for code generation specific to this backend.
CodegenEnqueuer createCodegenEnqueuer(
CompilerTask task, Compiler compiler, ClosedWorld closedWorld) {
+ _lookupMapAnalysis = new LookupMapAnalysis(
+ reporter,
+ constantSystem,
+ constants,
+ compiler.elementEnvironment,
+ commonElements,
+ helpers,
+ backendClasses,
+ lookupMapLibraryAccess);
return new CodegenEnqueuer(
task,
compiler.options,
@@ -1141,7 +1155,6 @@ class JavaScriptBackend {
/// Called after the queue is closed. [onQueueEmpty] may be called multiple
/// times, but [onQueueClosed] is only called once.
void onQueueClosed() {
- lookupMapAnalysis.onQueueClosed();
jsInteropAnalysis.onQueueClosed();
}
@@ -1183,7 +1196,6 @@ class JavaScriptBackend {
lookupMapAnalysis,
customElementsCodegenAnalysis,
rtiChecksBuilder);
- lookupMapAnalysis.onCodegenStart(lookupMapLibraryAccess);
return const WorldImpact();
}
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/js_backend/codegen_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698