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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 693883003: Encode super calls via extra properties on prototypes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index dfd5a92a974849f20cdaecc6a8e44d7428143636..ee38cac2d3811bac63562f0ac7b017c487b67603 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -323,6 +323,12 @@ class JavaScriptBackend extends Backend {
*/
final Set<ClassElement> specialOperatorEqClasses = new Set<ClassElement>();
+ /**
+ * A Map from classes to the members of superclasses they call via super.
+ */
+ final Map<ClassElement, Set<Element>> aliasedSuperMembers =
+ new Map<ClassElement, Set<Element>>();
+
List<CompilerTask> get tasks {
return <CompilerTask>[builder, optimizer, generator, emitter];
}
@@ -528,6 +534,18 @@ class JavaScriptBackend extends Backend {
return name;
}
+ void registerAliasedSuperMember(Element method, ClassElement caller) {
+ Set<Element> methods =
+ aliasedSuperMembers.putIfAbsent(caller, () => new Setlet<Element>());
+ methods.add(method);
+ }
+
+ Set<Element> getAliasedSuperMembers(ClassElement subclass) {
+ Set<Element> aliases = aliasedSuperMembers[subclass];
+ if (aliases == null) return const ImmutableEmptySet<Element>();
+ return aliases;
+ }
+
bool isInterceptedMethod(Element element) {
if (!element.isInstanceMember) return false;
if (element.isGenerativeConstructorBody) {

Powered by Google App Engine
This is Rietveld 408576698