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

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

Issue 2611633002: Make closedWorld a property of ClosedWorldRefiner. (Closed)
Patch Set: Created 3 years, 12 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/compiler.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/world_builder.dart
diff --git a/pkg/compiler/lib/src/universe/world_builder.dart b/pkg/compiler/lib/src/universe/world_builder.dart
index 05cae632087b4e55bb370f00436ae9f815d95e30..fc649b94df1213a2d4dd81e8fd2424afa24ddea9 100644
--- a/pkg/compiler/lib/src/universe/world_builder.dart
+++ b/pkg/compiler/lib/src/universe/world_builder.dart
@@ -1103,6 +1103,10 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
///
/// This adds additional access to liveness of selectors and elements.
abstract class CodegenWorldBuilder implements WorldBuilder {
+ /// Opens this world builder using [closedWorld] as the known superset of
+ /// possible runtime entities.
+ void open(ClosedWorld closedWorld);
+
void forEachInvokedName(
f(String name, Map<Selector, SelectorConstraints> selectors));
@@ -1134,6 +1138,7 @@ abstract class CodegenWorldBuilder implements WorldBuilder {
class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
final Backend _backend;
+ ClosedWorld __world;
Siggi Cherem (dart-lang) 2017/01/03 17:46:08 I guess this is really really private ;-)
/// The set of all directly instantiated classes, that is, classes with a
/// generative constructor that has been called directly and not only through
@@ -1202,9 +1207,17 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
CodegenWorldBuilderImpl(this._backend, this.selectorConstraintsStrategy);
- // TODO(johnniwinther): Remove this hack:
- ClosedWorld get _world =>
- _backend.compiler.resolverWorld.closedWorldForTesting;
+ void open(ClosedWorld closedWorld) {
+ assert(invariant(NO_LOCATION_SPANNABLE, __world == null,
+ message: "CodegenWorldBuilder has already been opened."));
+ __world = closedWorld;
+ }
+
+ ClosedWorld get _world {
+ assert(invariant(NO_LOCATION_SPANNABLE, __world != null,
+ message: "CodegenWorldBuilder has not been opened."));
+ return __world;
+ }
Iterable<ClassElement> get processedClasses => _processedClasses.keys
.where((cls) => _processedClasses[cls].isInstantiated);
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698