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

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

Issue 2936233003: Remove Compiler.mainApp and Compiler.mainFunction (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/tool/perf.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 b8db4081076e06cedf663fcb2fc2fbfe1d6b2383..33440831bd26583136d7fb7e882dce1c8c35646c 100644
--- a/pkg/compiler/lib/src/resolution/resolution_strategy.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
@@ -47,7 +47,7 @@ import 'no_such_method_resolver.dart';
/// model using the resolver.
class ResolutionFrontEndStrategy implements FrontendStrategy {
final Compiler _compiler;
- final ElementEnvironment elementEnvironment;
+ final _CompilerElementEnvironment _elementEnvironment;
final CommonElements commonElements;
AnnotationProcessor _annotationProcessor;
@@ -61,7 +61,9 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
}
ResolutionFrontEndStrategy.internal(
- this._compiler, this.elementEnvironment, this.commonElements);
+ this._compiler, this._elementEnvironment, this.commonElements);
+
+ ElementEnvironment get elementEnvironment => _elementEnvironment;
DartTypes get dartTypes => _compiler.types;
@@ -141,6 +143,7 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
FunctionEntity computeMain(
LibraryElement mainApp, WorldImpactBuilder impactBuilder) {
+ _elementEnvironment._mainLibrary = mainApp;
if (mainApp == null) return null;
MethodElement mainFunction;
Element main = mainApp.findExported(Identifiers.main);
@@ -211,6 +214,7 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
mainFunction.computeType(_compiler.resolution);
mainMethod = mainFunction;
}
+ _elementEnvironment._mainFunction = mainMethod;
return mainMethod;
}
@@ -370,6 +374,9 @@ class ResolutionFrontEndStrategy implements FrontendStrategy {
class _CompilerElementEnvironment implements ElementEnvironment {
final Compiler _compiler;
+ LibraryEntity _mainLibrary;
+ FunctionEntity _mainFunction;
+
_CompilerElementEnvironment(this._compiler);
LibraryProvider get _libraryProvider => _compiler.libraryLoader;
@@ -378,10 +385,10 @@ class _CompilerElementEnvironment implements ElementEnvironment {
ResolutionDynamicType get dynamicType => const ResolutionDynamicType();
@override
- LibraryEntity get mainLibrary => _compiler.mainApp;
+ LibraryEntity get mainLibrary => _mainLibrary;
@override
- FunctionEntity get mainFunction => _compiler.mainFunction;
+ FunctionEntity get mainFunction => _mainFunction;
@override
Iterable<LibraryEntity> get libraries => _compiler.libraryLoader.libraries;
« no previous file with comments | « pkg/compiler/lib/src/kernel/task.dart ('k') | pkg/compiler/tool/perf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698