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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 61683007: Reapply "Retain types of toplevel and instance variables for reflection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix: use '-' instead of ':' as a separator in the field descriptor. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 /** 8 /**
9 * Documentation wanted -- johnniwinther 9 * Documentation wanted -- johnniwinther
10 * 10 *
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 int code = getterCode + (setterCode << 2); 206 int code = getterCode + (setterCode << 2);
207 if (code == 0) { 207 if (code == 0) {
208 compiler.reportInternalError( 208 compiler.reportInternalError(
209 field, 'Internal error: code is 0 ($element/$field)'); 209 field, 'Internal error: code is 0 ($element/$field)');
210 } else { 210 } else {
211 buffer.write(FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]); 211 buffer.write(FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]);
212 } 212 }
213 } 213 }
214 if (backend.isAccessibleByReflection(field)) { 214 if (backend.isAccessibleByReflection(field)) {
215 buffer.write(new String.fromCharCode(REFLECTION_MARKER)); 215 buffer.write('-');
216 if (backend.isNeededForReflection(field)) {
217 DartType type = field.computeType(compiler);
218 buffer.write('${task.metadataEmitter.reifyType(type)}');
219 }
216 } 220 }
217 } 221 }
218 }); 222 });
219 } 223 }
220 224
221 bool fieldsAdded = buffer.length > bufferClassLength; 225 bool fieldsAdded = buffer.length > bufferClassLength;
222 String compactClassData = buffer.toString(); 226 String compactClassData = buffer.toString();
223 jsAst.Expression classDataNode = js.string(compactClassData); 227 jsAst.Expression classDataNode = js.string(compactClassData);
224 if (hasMetadata) { 228 if (hasMetadata) {
225 fieldMetadata.insert(0, classDataNode); 229 fieldMetadata.insert(0, classDataNode);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 ? new Selector.getter(member.name, member.getLibrary()) 580 ? new Selector.getter(member.name, member.getLibrary())
577 : new Selector.setter(member.name, member.getLibrary()); 581 : new Selector.setter(member.name, member.getLibrary());
578 String reflectionName = task.getReflectionName(selector, name); 582 String reflectionName = task.getReflectionName(selector, name);
579 if (reflectionName != null) { 583 if (reflectionName != null) {
580 var reflectable = 584 var reflectable =
581 js(backend.isAccessibleByReflection(member) ? '1' : '0'); 585 js(backend.isAccessibleByReflection(member) ? '1' : '0');
582 builder.addProperty('+$reflectionName', reflectable); 586 builder.addProperty('+$reflectionName', reflectable);
583 } 587 }
584 } 588 }
585 } 589 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698