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

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

Issue 2609063002: Further reduce use of Element in codegen. (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/universe/use.dart ('k') | tests/compiler/dart2js/patch_test.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..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;
« no previous file with comments | « pkg/compiler/lib/src/universe/use.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698