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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/code_emitter_task.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 backend.retainMetadataOf); 209 backend.retainMetadataOf);
210 } 210 }
211 } 211 }
212 } 212 }
213 for (ClassElement cls in neededClasses) { 213 for (ClassElement cls in neededClasses) {
214 final onlyForRti = typeTestRegistry.rtiNeededClasses.contains(cls); 214 final onlyForRti = typeTestRegistry.rtiNeededClasses.contains(cls);
215 if (!onlyForRti) { 215 if (!onlyForRti) {
216 backend.retainMetadataOf(cls); 216 backend.retainMetadataOf(cls);
217 oldEmitter.classEmitter.visitFields(cls, false, 217 oldEmitter.classEmitter.visitFields(cls, false,
218 (Element member, 218 (Element member,
219 String name, 219 jsAst.Name name,
220 String accessorName, 220 jsAst.Name accessorName,
221 bool needsGetter, 221 bool needsGetter,
222 bool needsSetter, 222 bool needsSetter,
223 bool needsCheckedSetter) { 223 bool needsCheckedSetter) {
224 bool needsAccessor = needsGetter || needsSetter; 224 bool needsAccessor = needsGetter || needsSetter;
225 if (needsAccessor && backend.isAccessibleByReflection(member)) { 225 if (needsAccessor && backend.isAccessibleByReflection(member)) {
226 backend.retainMetadataOf(member); 226 backend.retainMetadataOf(member);
227 } 227 }
228 }); 228 });
229 } 229 }
230 } 230 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 453 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
454 454
455 /// Returns the JS code for accessing the given [constant]. 455 /// Returns the JS code for accessing the given [constant].
456 jsAst.Expression constantReference(ConstantValue constant); 456 jsAst.Expression constantReference(ConstantValue constant);
457 457
458 /// Returns the JS template for the given [builtin]. 458 /// Returns the JS template for the given [builtin].
459 jsAst.Template templateForBuiltin(JsBuiltin builtin); 459 jsAst.Template templateForBuiltin(JsBuiltin builtin);
460 460
461 void invalidateCaches(); 461 void invalidateCaches();
462 } 462 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698