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

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

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Cleanup. 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
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 9c644d847f23dee1ce448fe717ba53906f8ed0e8..0dfc2918fe1970fe852f7ad2b246ab76323332b1 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 {
InferenceWorld 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.
///
@@ -719,7 +723,7 @@ abstract class Compiler implements LibraryLoaderListener {
assert(mainFunction != null);
phase = PHASE_DONE_RESOLVING;
- openWorld.populate();
+ openWorld.closeWorld();
Harry Terkelsen 2016/09/19 21:17:52 consider renaming 'closeWorld' to close?
// Compute whole-program-knowledge that the backend needs. (This might
// require the information computed in [world.populate].)
backend.onResolutionComplete();
@@ -2190,16 +2194,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;
@@ -2212,6 +2210,8 @@ class GlobalDependencyRegistry extends EagerRegistry {
Iterable<Element> get otherDependencies {
return _otherDependencies != null ? _otherDependencies : const <Element>[];
}
+
+ String get name => 'GlobalDependencies';
}
class _ScriptLoader implements ScriptLoader {

Powered by Google App Engine
This is Rietveld 408576698