Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index 5667a4e8a195cb25286f316599d3369fdf2bc914..aa83fbed981fc174f531d840facb1a633a064a1e 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -13,7 +13,7 @@ import 'common/backend_api.dart' show Backend; |
import 'common/codegen.dart' show CodegenWorkItem; |
import 'common/names.dart' show Selectors; |
import 'common/names.dart' show Identifiers, Uris; |
-import 'common/registry.dart' show Registry; |
+import 'common/registry.dart' show EagerRegistry, Registry; |
import 'common/resolution.dart' |
show |
ParsingContext, |
@@ -244,7 +244,7 @@ abstract class Compiler implements LibraryLoaderListener { |
// TODO(johnniwinther): Separate the dependency tracking from the enqueuing |
// for global dependencies. |
- globalDependencies = new GlobalDependencyRegistry(); |
+ globalDependencies = new GlobalDependencyRegistry(this); |
if (makeBackend != null) { |
backend = makeBackend(this); |
@@ -310,11 +310,7 @@ abstract class Compiler implements LibraryLoaderListener { |
ClosedWorldRefiner get inferenceWorld => _world; |
/// The closed world after resolution and inference. |
- ClosedWorld get closedWorld { |
- assert(invariant(CURRENT_ELEMENT_SPANNABLE, _world.isClosed, |
- message: "Closed world not computed yet.")); |
- return _world; |
- } |
+ ClosedWorld get closedWorld => _world; |
/// Creates the scanner task. |
/// |
@@ -725,7 +721,7 @@ abstract class Compiler implements LibraryLoaderListener { |
assert(mainFunction != null); |
phase = PHASE_DONE_RESOLVING; |
- openWorld.closeWorld(); |
+ openWorld.populate(); |
// Compute whole-program-knowledge that the backend needs. (This might |
// require the information computed in [world.populate].) |
backend.onResolutionComplete(); |
@@ -2196,10 +2192,16 @@ class _CompilerResolution implements Resolution { |
} |
} |
-class GlobalDependencyRegistry extends Registry { |
+class GlobalDependencyRegistry extends EagerRegistry { |
+ final Compiler compiler; |
Setlet<Element> _otherDependencies; |
- GlobalDependencyRegistry(); |
+ GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null); |
+ |
+ // TODO(johnniwinther): Rename world/universe/enqueuer through out the |
+ // compiler. |
+ @override |
+ Enqueuer get world => compiler.enqueuer.codegen; |
void registerDependency(Element element) { |
if (element == null) return; |
@@ -2212,8 +2214,6 @@ class GlobalDependencyRegistry extends Registry { |
Iterable<Element> get otherDependencies { |
return _otherDependencies != null ? _otherDependencies : const <Element>[]; |
} |
- |
- String get name => 'GlobalDependencies'; |
} |
class _ScriptLoader implements ScriptLoader { |