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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2783623002: Extract SuperMemberData from JavaScriptBackend (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698