Chromium Code Reviews| 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); |