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

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

Issue 70073004: Revert "Retain types of toplevel and instance variables for reflection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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(':'); 215 buffer.write(new String.fromCharCode(REFLECTION_MARKER));
216 if (backend.isNeededForReflection(field)) {
217 DartType type = field.computeType(compiler);
218 buffer.write('${task.metadataEmitter.reifyType(type)}');
219 }
220 } 216 }
221 } 217 }
222 }); 218 });
223 } 219 }
224 220
225 bool fieldsAdded = buffer.length > bufferClassLength; 221 bool fieldsAdded = buffer.length > bufferClassLength;
226 String compactClassData = buffer.toString(); 222 String compactClassData = buffer.toString();
227 jsAst.Expression classDataNode = js.string(compactClassData); 223 jsAst.Expression classDataNode = js.string(compactClassData);
228 if (hasMetadata) { 224 if (hasMetadata) {
229 fieldMetadata.insert(0, classDataNode); 225 fieldMetadata.insert(0, classDataNode);
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 ? new Selector.getter(member.name, member.getLibrary()) 576 ? new Selector.getter(member.name, member.getLibrary())
581 : new Selector.setter(member.name, member.getLibrary()); 577 : new Selector.setter(member.name, member.getLibrary());
582 String reflectionName = task.getReflectionName(selector, name); 578 String reflectionName = task.getReflectionName(selector, name);
583 if (reflectionName != null) { 579 if (reflectionName != null) {
584 var reflectable = 580 var reflectable =
585 js(backend.isAccessibleByReflection(member) ? '1' : '0'); 581 js(backend.isAccessibleByReflection(member) ? '1' : '0');
586 builder.addProperty('+$reflectionName', reflectable); 582 builder.addProperty('+$reflectionName', reflectable);
587 } 583 }
588 } 584 }
589 } 585 }
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