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

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

Issue 2935663002: Remove Compiler.commonElements (Closed)
Patch Set: Remove Compiler._commonElements Created 3 years, 6 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
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 0238e431d934e50cc463ca748e08b1dcb51c0e3e..28178793c2498caf4f9f0f7a74393a0c16839527 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -314,6 +314,8 @@ class JavaScriptBackend {
final Compiler compiler;
+ FrontendStrategy get frontendStrategy => compiler.frontendStrategy;
+
/// Returns true if the backend supports reflection.
bool get supportsReflection => emitter.supportsReflection;
@@ -451,8 +453,8 @@ class JavaScriptBackend {
bool useKernel: false})
: _rti = new RuntimeTypesImpl(
compiler.elementEnvironment, compiler.frontendStrategy.dartTypes),
- optimizerHints = new OptimizerHintsForTests(
- compiler.elementEnvironment, compiler.commonElements),
+ optimizerHints = new OptimizerHintsForTests(compiler.elementEnvironment,
+ compiler.frontendStrategy.commonElements),
this.sourceInformationStrategy =
compiler.backendStrategy.sourceInformationStrategy,
constantCompilerTask = new JavaScriptConstantTask(compiler),
@@ -684,11 +686,11 @@ class JavaScriptBackend {
void validateInterceptorImplementsAllObjectMethods(
ClassEntity interceptorClass) {
if (interceptorClass == null) return;
- ClassEntity objectClass = compiler.commonElements.objectClass;
- compiler.elementEnvironment.forEachClassMember(objectClass,
+ ClassEntity objectClass = frontendStrategy.commonElements.objectClass;
+ frontendStrategy.elementEnvironment.forEachClassMember(objectClass,
(_, MemberEntity member) {
if (member.isConstructor) return;
- MemberEntity interceptorMember = compiler.elementEnvironment
+ MemberEntity interceptorMember = frontendStrategy.elementEnvironment
.lookupClassMember(interceptorClass, member.name);
// Interceptors must override all Object methods due to calling convention
// differences.
@@ -703,25 +705,25 @@ class JavaScriptBackend {
}
/// Called before processing of the resolution queue is started.
- void onResolutionStart(ResolutionEnqueuer enqueuer) {
+ void onResolutionStart() {
// TODO(johnniwinther): Avoid the compiler.elementEnvironment.getThisType
// calls. Currently needed to ensure resolution of the classes for various
// queries in native behavior computation, inference and codegen.
- compiler.elementEnvironment
- .getThisType(compiler.commonElements.jsArrayClass);
- compiler.elementEnvironment
- .getThisType(compiler.commonElements.jsExtendableArrayClass);
+ frontendStrategy.elementEnvironment
+ .getThisType(frontendStrategy.commonElements.jsArrayClass);
+ frontendStrategy.elementEnvironment
+ .getThisType(frontendStrategy.commonElements.jsExtendableArrayClass);
validateInterceptorImplementsAllObjectMethods(
- compiler.commonElements.jsInterceptorClass);
+ frontendStrategy.commonElements.jsInterceptorClass);
// The null-interceptor must also implement *all* methods.
validateInterceptorImplementsAllObjectMethods(
- compiler.commonElements.jsNullClass);
+ frontendStrategy.commonElements.jsNullClass);
}
/// Called when the resolution queue has been closed.
void onResolutionEnd() {
- compiler.frontendStrategy.annotationProcesser
+ frontendStrategy.annotationProcesser
.processJsInteropAnnotations(nativeBasicData, nativeDataBuilder);
}
@@ -976,7 +978,7 @@ class JavaScriptBackend {
if (library.isInternalLibrary) continue;
for (ImportElement import in library.imports) {
LibraryElement importedLibrary = import.importedLibrary;
- if (importedLibrary != compiler.commonElements.mirrorsLibrary)
+ if (importedLibrary != closedWorld.commonElements.mirrorsLibrary)
continue;
MessageKind kind =
compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(library)
« no previous file with comments | « pkg/compiler/lib/src/inferrer/node_tracer.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698