Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index d567bbaed7ccc89da0e7b15c5ed6d35bc4ee817e..bf8f242cd2ef2da09e3b099293c5c35eebf8bb4a 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -166,9 +166,6 @@ abstract class Compiler implements LibraryLoaderListener { |
ClassElement typedDataClass; |
- /// The constant for the [proxy] variable defined in dart:core. |
- ConstantValue proxyConstant; |
- |
// TODO(johnniwinther): Move this to the JavaScriptBackend. |
/// The class for patch annotation defined in dart:_js_helper. |
ClassElement patchAnnotationClass; |
@@ -373,7 +370,8 @@ abstract class Compiler implements LibraryLoaderListener { |
/// |
/// Override this to mock the resolver for testing. |
ResolverTask createResolverTask() { |
- return new ResolverTask(this, backend.constantCompilerTask); |
+ return new ResolverTask( |
+ resolution, backend.constantCompilerTask, world, measurer); |
} |
Universe get resolverWorld => enqueuer.resolution.universe; |
@@ -386,6 +384,8 @@ abstract class Compiler implements LibraryLoaderListener { |
bool get disableTypeInference => |
options.disableTypeInference || compilationFailed; |
+ // TODO(het): remove this from here. Either inline at all use sites or add it |
+ // to Reporter. |
void unimplemented(Spannable spannable, String methodName) { |
reporter.internalError(spannable, "$methodName not implemented."); |
} |
@@ -581,17 +581,6 @@ abstract class Compiler implements LibraryLoaderListener { |
}).then((_) => backend.onLibrariesLoaded(loadedLibraries)); |
} |
- bool isProxyConstant(ConstantValue value) { |
- FieldElement field = coreLibrary.find('proxy'); |
- if (field == null) return false; |
- if (!resolution.hasBeenResolved(field)) return false; |
- if (proxyConstant == null) { |
- proxyConstant = constants |
- .getConstantValue(resolver.constantCompiler.compileConstant(field)); |
- } |
- return proxyConstant == value; |
- } |
- |
Element findRequiredElement(LibraryElement library, String name) { |
var element = library.find(name); |
if (element == null) { |
@@ -1906,6 +1895,48 @@ class _CompilerResolution implements Resolution { |
Target get target => compiler.backend; |
@override |
+ ResolverTask get resolver => compiler.resolver; |
+ |
+ @override |
+ ResolutionEnqueuer get enqueuer => compiler.enqueuer.resolution; |
+ |
+ @override |
+ CompilerOptions get options => compiler.options; |
+ |
+ @override |
+ IdGenerator get idGenerator => compiler.idGenerator; |
+ |
+ @override |
+ ConstantEnvironment get constants => compiler.constants; |
+ |
+ @override |
+ MirrorUsageAnalyzerTask get mirrorUsageAnalyzerTask => |
+ compiler.mirrorUsageAnalyzerTask; |
+ |
+ @override |
+ LibraryElement get coreLibrary => compiler.coreLibrary; |
+ |
+ @override |
+ FunctionElement get identicalFunction => compiler.identicalFunction; |
+ |
+ @override |
+ ClassElement get mirrorSystemClass => compiler.mirrorSystemClass; |
+ |
+ @override |
+ FunctionElement get mirrorSystemGetNameFunction => |
+ compiler.mirrorSystemGetNameFunction; |
+ |
+ @override |
+ ConstructorElement get mirrorsUsedConstructor => |
+ compiler.mirrorsUsedConstructor; |
+ |
+ @override |
+ ConstructorElement get symbolConstructor => compiler.symbolConstructor; |
+ |
+ @override |
+ ConstantValue proxyConstant; |
+ |
+ @override |
void registerClass(ClassElement cls) { |
compiler.world.registerClass(cls); |
} |
@@ -1944,6 +1975,14 @@ class _CompilerResolution implements Resolution { |
} |
@override |
+ void onClassResolved(ClassElement element) => |
+ compiler.onClassResolved(element); |
+ |
+ @override |
+ void registerCompiletimeError(Element element, DiagnosticMessage message) => |
+ compiler.registerCompiletimeError(element, message); |
+ |
+ @override |
bool hasResolvedAst(ExecutableElement element) { |
assert(invariant(element, element.isDeclaration, |
message: "Element $element must be the declaration.")); |
@@ -2084,6 +2123,18 @@ class _CompilerResolution implements Resolution { |
_worldImpactCache.remove(element); |
_resolutionImpactCache.remove(element); |
} |
+ |
+ @override |
+ bool isProxyConstant(ConstantValue value) { |
+ FieldElement field = coreLibrary.find('proxy'); |
+ if (field == null) return false; |
+ if (!hasBeenResolved(field)) return false; |
+ if (proxyConstant == null) { |
+ proxyConstant = constants |
+ .getConstantValue(resolver.constantCompiler.compileConstant(field)); |
+ } |
+ return proxyConstant == value; |
+ } |
} |
class GlobalDependencyRegistry extends EagerRegistry { |