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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.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_emitter/old_emitter/class_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart
index deb4fc44ba18ce9d2125fa356e1766b665ec58c4..68b6bf2d2f5a04f4e37cb1237599b64a899c9e1c 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/old_emitter/class_builder.dart
@@ -10,6 +10,7 @@ part of dart2js.js_emitter;
class ClassBuilder {
final List<jsAst.Property> properties = <jsAst.Property>[];
final List<String> fields = <String>[];
+ final List<String> aliasedSuperMethods = <String>[];
sra1 2014/11/03 18:30:56 Maybe allocate on first use since most classes don
herhut 2014/11/04 12:52:49 The field is now gone.
String superName;
String functionType;
@@ -34,6 +35,10 @@ class ClassBuilder {
fields.add(field);
}
+ void addAliasedSuperMethod(String method) {
+ aliasedSuperMethods.add(method);
+ }
+
jsAst.ObjectInitializer toObjectInitializer() {
StringBuffer buffer = new StringBuffer();
if (superName != null) {
@@ -44,6 +49,12 @@ class ClassBuilder {
buffer.write(';');
}
buffer.writeAll(fields, ',');
+
+ if (aliasedSuperMethods.isNotEmpty) {
+ buffer.write(';');
+ buffer.writeAll(aliasedSuperMethods, ',');
sra1 2014/11/03 18:30:56 I commented elsewhere about a canoncial order. Sor
herhut 2014/11/04 12:52:49 Not required in the new encoding.
+ }
+
var classData = js.string('$buffer');
if (fieldMetadata != null) {
// If we need to store fieldMetadata, classData is turned into an array,

Powered by Google App Engine
This is Rietveld 408576698