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

Unified Diff: pkg/compiler/lib/src/resolution/resolution_strategy.dart

Issue 2932883002: Add FrontendStrategy.commonElements and remove Backend.commonElements (Closed)
Patch Set: 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
« no previous file with comments | « pkg/compiler/lib/src/kernel/task.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/resolution_strategy.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution_strategy.dart b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
index 0987585491e55cd619963d1374526ad555d21b22..c29092f2b3b938f5090efe9b0754c9090128d06e 100644
--- a/pkg/compiler/lib/src/resolution/resolution_strategy.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
@@ -48,10 +48,20 @@ import 'no_such_method_resolver.dart';
class ResolutionFrontEndStrategy implements FrontendStrategy {
final Compiler _compiler;
final ElementEnvironment elementEnvironment;
+ final CommonElements commonElements;
+
AnnotationProcessor _annotationProcessor;
- ResolutionFrontEndStrategy(this._compiler)
- : elementEnvironment = new _CompilerElementEnvironment(_compiler);
+ factory ResolutionFrontEndStrategy(Compiler compiler) {
+ ElementEnvironment elementEnvironment =
+ new _CompilerElementEnvironment(compiler);
+ CommonElements commonElements = new CommonElements(elementEnvironment);
+ return new ResolutionFrontEndStrategy.internal(
+ compiler, elementEnvironment, commonElements);
+ }
+
+ ResolutionFrontEndStrategy.internal(
+ this._compiler, this.elementEnvironment, this.commonElements);
DartTypes get dartTypes => _compiler.types;
@@ -147,7 +157,7 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
errorElement = new ErroneousElementX(MessageKind.MISSING_MAIN,
{'main': Identifiers.main}, Identifiers.main, mainApp);
}
- mainFunction = _compiler.backend.helperForMissingMain();
+ mainFunction = commonElements.missingMain;
} else if (main.isError && main.isSynthesized) {
if (main is ErroneousElement) {
errorElement = main;
@@ -155,11 +165,11 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
_compiler.reporter
.internalError(main, 'Problem with ${Identifiers.main}.');
}
- mainFunction = _compiler.backend.helperForBadMain();
+ mainFunction = commonElements.badMain;
} else if (!main.isFunction) {
errorElement = new ErroneousElementX(MessageKind.MAIN_NOT_A_FUNCTION,
{'main': Identifiers.main}, Identifiers.main, main);
- mainFunction = _compiler.backend.helperForBadMain();
+ mainFunction = commonElements.badMain;
} else {
mainFunction = main;
mainFunction.computeType(_compiler.resolution);
@@ -177,7 +187,7 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
impactBuilder.registerStaticUse(
new StaticUse.staticInvoke(mainFunction, CallStructure.NO_ARGS));
- mainFunction = _compiler.backend.helperForMainArity();
+ mainFunction = commonElements.mainHasTooManyParameters;
});
}
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/task.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698