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

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

Issue 2559373004: Remove Compiler.inferenceWorld (Closed)
Patch Set: Created 4 years 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 82384c9dd6bb6f2db2a961ee0f4b966cd4c4a85d..82895d960a01c9ef38e0e73e01ea8da29947194b 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -279,13 +279,6 @@ abstract class Compiler implements LibraryLoaderListener {
tasks.addAll(backend.tasks);
}
- /// The world currently being computed by resolution. This forms a basis for
- /// the [inferenceWorld] and later the [closedWorld].
- OpenWorld get openWorld => _world;
-
- /// The closed world after resolution but currently refined by inference.
- ClosedWorldRefiner get inferenceWorld => _world;
-
/// The closed world after resolution and inference.
ClosedWorld get closedWorld {
assert(invariant(CURRENT_ELEMENT_SPANNABLE, _world.isClosed,
@@ -728,10 +721,11 @@ abstract class Compiler implements LibraryLoaderListener {
}
assert(mainFunction != null);
- closeResolution();
+ ClosedWorldRefiner closedWorldRefiner = closeResolution();
reporter.log('Inferring types...');
- globalInference.runGlobalTypeInference(mainFunction);
+ globalInference.runGlobalTypeInference(
+ mainFunction, closedWorld, closedWorldRefiner);
if (stopAfterTypeInference) return;
@@ -763,19 +757,20 @@ abstract class Compiler implements LibraryLoaderListener {
});
/// Perform the steps needed to fully end the resolution phase.
- void closeResolution() {
+ ClosedWorldRefiner closeResolution() {
phase = PHASE_DONE_RESOLVING;
- resolverWorld.openWorld.closeWorld(reporter);
+ WorldImpl world = resolverWorld.openWorld.closeWorld(reporter);
// Compute whole-program-knowledge that the backend needs. (This might
// require the information computed in [world.closeWorld].)
- backend.onResolutionComplete();
+ backend.onResolutionComplete(world);
deferredLoadTask.onResolutionComplete(mainFunction);
// TODO(johnniwinther): Move this after rti computation but before
// reflection members computation, and (re-)close the world afterwards.
- closureToClassMapper.createClosureClasses();
+ closureToClassMapper.createClosureClasses(world);
+ return world;
}
/// Compute the [WorldImpact] for accessing all elements in [library].
« no previous file with comments | « pkg/compiler/lib/src/common/backend_api.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698