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

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: reworked encoding 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..0f01f9c86572926652e2c1bf78a4637cc4c23fd5 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 set of members that are called from subclasses via super.
+ */
+ final Set<FunctionElement> aliasedSuperMembers =
+ new Setlet<FunctionElement>();
+
List<CompilerTask> get tasks {
return <CompilerTask>[builder, optimizer, generator, emitter];
}
@@ -528,6 +534,20 @@ class JavaScriptBackend extends Backend {
return name;
}
+ /**
+ * Record that [method] is called from a subclass via `super`.
+ */
+ void registerAliasedSuperMember(FunctionElement method) {
+ aliasedSuperMembers.add(method);
+ }
+
+ /**
+ * Returns `true` is [member] is called from a subclass via `super`.
+ */
+ bool isAliasedSuperMember(FunctionElement member) {
+ return aliasedSuperMembers.contains(member);
+ }
+
bool isInterceptedMethod(Element element) {
if (!element.isInstanceMember) return false;
if (element.isGenerativeConstructorBody) {

Powered by Google App Engine
This is Rietveld 408576698