Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 03c5e0fc16375c82108a3704faae3dd3e6a6a15d..e9b29b94460b317ae358562241d412cfa2d6b171 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -355,11 +355,6 @@ class JavaScriptBackend { |
*/ |
final Set<ClassElement> specialOperatorEqClasses = new Set<ClassElement>(); |
- /** |
- * A set of members that are called from subclasses via `super`. |
- */ |
- final Set<MethodElement> aliasedSuperMembers = new Setlet<MethodElement>(); |
- |
List<CompilerTask> get tasks { |
List<CompilerTask> result = functionCompiler.tasks; |
result.add(emitter); |
@@ -446,6 +441,8 @@ class JavaScriptBackend { |
MirrorsDataImpl _mirrorsData; |
CheckedModeHelpers _checkedModeHelpers; |
+ final SuperMemberData superMemberData = new SuperMemberData(); |
+ |
native.NativeResolutionEnqueuer _nativeResolutionEnqueuer; |
native.NativeCodegenEnqueuer _nativeCodegenEnqueuer; |
@@ -746,31 +743,6 @@ class JavaScriptBackend { |
!mirrorsData.invokedReflectively(method); |
} |
- /** |
- * Record that [method] is called from a subclass via `super`. |
- */ |
- bool maybeRegisterAliasedSuperMember( |
- MemberElement member, Selector selector) { |
- if (!canUseAliasedSuperMember(member, selector)) { |
- // Invoking a super getter isn't supported, this would require changes to |
- // compact field descriptors in the emitter. |
- return false; |
- } |
- aliasedSuperMembers.add(member); |
- return true; |
- } |
- |
- bool canUseAliasedSuperMember(Element member, Selector selector) { |
- return !selector.isGetter; |
- } |
- |
- /** |
- * Returns `true` if [member] is called from a subclass via `super`. |
- */ |
- bool isAliasedSuperMember(FunctionElement member) { |
- return aliasedSuperMembers.contains(member); |
- } |
- |
/// Maps compile-time classes to their runtime class. The runtime class is |
/// always a superclass or the class itself. |
ClassElement getRuntimeClass(ClassElement class_) { |
@@ -1621,3 +1593,28 @@ class JavaScriptBackendTarget extends Target { |
@override |
bool isForeign(Element element) => _backend.isForeign(element); |
} |
+ |
+class SuperMemberData { |
+ /// A set of member that are called from subclasses via `super`. |
+ final Set<MemberEntity> _aliasedSuperMembers = new Setlet<MemberEntity>(); |
+ |
+ /// Record that [member] is called from a subclass via `super`. |
+ bool maybeRegisterAliasedSuperMember(MemberEntity member, Selector selector) { |
+ if (!canUseAliasedSuperMember(member, selector)) { |
+ // Invoking a super getter isn't supported, this would require changes to |
+ // compact field descriptors in the emitter. |
+ return false; |
+ } |
+ _aliasedSuperMembers.add(member); |
+ return true; |
+ } |
+ |
+ bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
+ return !selector.isGetter; |
+ } |
+ |
+ /// Returns `true` if [member] is called from a subclass via `super`. |
+ bool isAliasedSuperMember(MemberEntity member) { |
+ return _aliasedSuperMembers.contains(member); |
+ } |
+} |