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

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

Issue 2884233002: Use entities in runtime_types (Closed)
Patch Set: Updated cf. comments Created 3 years, 7 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/ssa/optimize.dart ('k') | tests/compiler/dart2js/type_representation_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/codegen_world_builder.dart
diff --git a/pkg/compiler/lib/src/universe/codegen_world_builder.dart b/pkg/compiler/lib/src/universe/codegen_world_builder.dart
index fe7c615bcc4eda975c7088816a4c9ebab2772013..05bcca7e314b7879357f48941c20e3572a5fe596 100644
--- a/pkg/compiler/lib/src/universe/codegen_world_builder.dart
+++ b/pkg/compiler/lib/src/universe/codegen_world_builder.dart
@@ -38,13 +38,16 @@ abstract class CodegenWorldBuilder implements WorldBuilder {
Map<Selector, SelectorConstraints> setterInvocationsByName(String name);
- Iterable<FunctionElement> get staticFunctionsNeedingGetter;
- Iterable<FunctionElement> get methodsNeedingSuperGetter;
+ Iterable<FunctionEntity> get staticFunctionsNeedingGetter;
+ Iterable<FunctionEntity> get methodsNeedingSuperGetter;
/// The set of all referenced static fields.
///
/// Invariant: Elements are declaration elements.
- Iterable<FieldElement> get allReferencedStaticFields;
+ Iterable<FieldEntity> get allReferencedStaticFields;
+
+ /// Set of methods in instantiated classes that are potentially closurized.
+ Iterable<FunctionEntity> get closurizedMembers;
}
class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
@@ -81,10 +84,10 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
*
* Invariant: Elements are declaration elements.
*/
- final Set<FunctionElement> staticFunctionsNeedingGetter =
- new Set<FunctionElement>();
- final Set<FunctionElement> methodsNeedingSuperGetter =
- new Set<FunctionElement>();
+ final Set<FunctionEntity> staticFunctionsNeedingGetter =
+ new Set<FunctionEntity>();
+ final Set<FunctionEntity> methodsNeedingSuperGetter =
+ new Set<FunctionEntity>();
final Map<String, Map<Selector, SelectorConstraints>> _invokedNames =
<String, Map<Selector, SelectorConstraints>>{};
final Map<String, Map<Selector, SelectorConstraints>> _invokedGetters =
@@ -119,6 +122,9 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
final Set<ConstantValue> _constantValues = new Set<ConstantValue>();
+ /// Set of methods in instantiated classes that are potentially closurized.
+ final Set<FunctionEntity> closurizedMembers = new Set<FunctionEntity>();
+
CodegenWorldBuilderImpl(this._nativeData, this._world, this._constants,
this.selectorConstraintsStrategy);
@@ -328,10 +334,12 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
}
switch (staticUse.kind) {
case StaticUseKind.STATIC_TEAR_OFF:
- staticFunctionsNeedingGetter.add(element);
+ MethodElement method = element;
+ staticFunctionsNeedingGetter.add(method);
break;
case StaticUseKind.SUPER_TEAR_OFF:
- methodsNeedingSuperGetter.add(element);
+ MethodElement method = element;
+ methodsNeedingSuperGetter.add(method);
break;
case StaticUseKind.SUPER_FIELD_SET:
case StaticUseKind.FIELD_SET:
@@ -400,6 +408,11 @@ class CodegenWorldBuilderImpl implements CodegenWorldBuilder {
}
}
+ /// Registers that [element] has been closurized.
+ void registerClosurizedMember(MemberEntity element) {
+ closurizedMembers.add(element);
+ }
+
void processClassMembers(ClassElement cls, MemberUsedCallback memberUsed) {
cls.implementation.forEachMember((_, MemberElement member) {
assert(invariant(member, member.isDeclaration));
« no previous file with comments | « pkg/compiler/lib/src/ssa/optimize.dart ('k') | tests/compiler/dart2js/type_representation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698