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..e4dc81d8da18d8acfa68fa18a912d2531d75e954 100644 |
| --- a/pkg/compiler/lib/src/universe/world_builder.dart |
| +++ b/pkg/compiler/lib/src/universe/world_builder.dart |
| @@ -21,6 +21,7 @@ import '../universe/function_set.dart' show FunctionSetBuilder; |
| import '../util/enumset.dart'; |
| import '../util/util.dart'; |
| import '../world.dart' show World, ClosedWorld, ClosedWorldImpl, OpenWorld; |
| +import 'call_structure.dart' show CallStructure; |
| import 'selector.dart' show Selector; |
| import 'use.dart' show DynamicUse, DynamicUseKind, StaticUse, StaticUseKind; |
| @@ -1103,6 +1104,11 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder { |
| /// |
| /// This adds additional access to liveness of selectors and elements. |
| abstract class CodegenWorldBuilder implements WorldBuilder { |
| + /// Calls [f] with every instance field, together with its declarer, in an |
| + /// instance of [cls]. |
| + void forEachInstanceField( |
|
Siggi Cherem (dart-lang)
2017/01/03 17:39:37
I like the move of this out of the entities.
Coup
Johnni Winther
2017/01/04 10:39:49
Currently all, in time it should be at the world b
|
| + ClassEntity cls, void f(ClassEntity declarer, FieldEntity field)); |
| + |
| void forEachInvokedName( |
| f(String name, Map<Selector, SelectorConstraints> selectors)); |
| @@ -1130,6 +1136,8 @@ abstract class CodegenWorldBuilder implements WorldBuilder { |
| /// |
| /// Invariant: Elements are declaration elements. |
| Iterable<FieldElement> get allReferencedStaticFields; |
| + |
| + CallStructure getCallStructureFor(FunctionEntity entity); |
| } |
| class CodegenWorldBuilderImpl implements CodegenWorldBuilder { |
| @@ -1202,6 +1210,18 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder { |
| CodegenWorldBuilderImpl(this._backend, this.selectorConstraintsStrategy); |
| + /// Calls [f] with every instance field, together with its declarer, in an |
| + /// instance of [cls]. |
| + void forEachInstanceField( |
| + ClassElement cls, void f(ClassEntity declarer, FieldEntity field)) { |
| + cls.implementation |
| + .forEachInstanceField(f, includeSuperAndInjectedMembers: true); |
| + } |
| + |
| + CallStructure getCallStructureFor(MethodElement element) { |
| + return new CallStructure.unnamed(element.parameters.length); |
| + } |
| + |
| // TODO(johnniwinther): Remove this hack: |
| ClosedWorld get _world => |
| _backend.compiler.resolverWorld.closedWorldForTesting; |