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

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

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Reinsert missing features uses. Created 4 years, 3 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/common/registry.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index aa83fbed981fc174f531d840facb1a633a064a1e..5667a4e8a195cb25286f316599d3369fdf2bc914 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 EagerRegistry, Registry;
+import 'common/registry.dart' show 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(this);
+ globalDependencies = new GlobalDependencyRegistry();
if (makeBackend != null) {
backend = makeBackend(this);
@@ -310,7 +310,11 @@ abstract class Compiler implements LibraryLoaderListener {
ClosedWorldRefiner get inferenceWorld => _world;
/// The closed world after resolution and inference.
- ClosedWorld get closedWorld => _world;
+ ClosedWorld get closedWorld {
+ assert(invariant(CURRENT_ELEMENT_SPANNABLE, _world.isClosed,
+ message: "Closed world not computed yet."));
+ return _world;
+ }
/// Creates the scanner task.
///
@@ -721,7 +725,7 @@ abstract class Compiler implements LibraryLoaderListener {
assert(mainFunction != null);
phase = PHASE_DONE_RESOLVING;
- openWorld.populate();
+ openWorld.closeWorld();
// Compute whole-program-knowledge that the backend needs. (This might
// require the information computed in [world.populate].)
backend.onResolutionComplete();
@@ -2192,16 +2196,10 @@ class _CompilerResolution implements Resolution {
}
}
-class GlobalDependencyRegistry extends EagerRegistry {
- final Compiler compiler;
+class GlobalDependencyRegistry extends Registry {
Setlet<Element> _otherDependencies;
- GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null);
-
- // TODO(johnniwinther): Rename world/universe/enqueuer through out the
- // compiler.
- @override
- Enqueuer get world => compiler.enqueuer.codegen;
+ GlobalDependencyRegistry();
void registerDependency(Element element) {
if (element == null) return;
@@ -2214,6 +2212,8 @@ class GlobalDependencyRegistry extends EagerRegistry {
Iterable<Element> get otherDependencies {
return _otherDependencies != null ? _otherDependencies : const <Element>[];
}
+
+ String get name => 'GlobalDependencies';
}
class _ScriptLoader implements ScriptLoader {
« no previous file with comments | « pkg/compiler/lib/src/common/registry.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698