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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart

Issue 813603002: dart2js: Add a pointer from the emitter's JS code to the encoding part. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/old_emitter/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
index 92108cd9dac4d0a8f8c8e045ef3c6a80ccba0419..c0650902bc2fc628cdeeb6589a0ee2ee6d4bbde2 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_builder.dart
@@ -34,16 +34,27 @@ class ClassBuilder {
fields.add(field);
}
+ static String functionTypeEncodingDescription =
+ 'For simple function types the function type is stored in the metadata '
+ 'and the index is encoded into the superclass field.';
+
+ static String fieldEncodingDescription =
+ 'Fields are encoded as a comma separated list. If there is a superclass '
+ '(and possibly a function type encoding) the fields are separated from '
+ 'the superclass by a semicolon.';
+
jsAst.ObjectInitializer toObjectInitializer(
{bool emitClassDescriptor: true}) {
StringBuffer buffer = new StringBuffer();
if (superName != null) {
- buffer.write('$superName');
+ buffer.write(superName);
if (functionType != null) {
+ // See [functionTypeEncodingDescription] above.
buffer.write(':$functionType');
}
buffer.write(';');
}
+ // See [fieldEncodingDescription] above.
buffer.writeAll(fields, ',');
var classData = js.string('$buffer');
if (fieldMetadata != null) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698