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

Side by Side Diff: lib/compiler/implementation/namer.dart

Issue 10854158: Make selector registration in the resolver and code generator more explicit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge from master. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Assigns JavaScript identifiers to Dart variables, class-names and members. 6 * Assigns JavaScript identifiers to Dart variables, class-names and members.
7 */ 7 */
8 class Namer { 8 class Namer {
9 final Compiler compiler; 9 final Compiler compiler;
10 10
(...skipping 17 matching lines...) Expand all
28 usedGlobals = new Map<String, int>(), 28 usedGlobals = new Map<String, int>(),
29 usedPrivateNames = new Map<String, Set<LibraryElement>>(), 29 usedPrivateNames = new Map<String, Set<LibraryElement>>(),
30 shortPrivateNameOwners = new Map<String, LibraryElement>(); 30 shortPrivateNameOwners = new Map<String, LibraryElement>();
31 31
32 final String CURRENT_ISOLATE = @'$'; 32 final String CURRENT_ISOLATE = @'$';
33 final String ISOLATE = 'Isolate'; 33 final String ISOLATE = 'Isolate';
34 final String ISOLATE_PROPERTIES = @"$isolateProperties"; 34 final String ISOLATE_PROPERTIES = @"$isolateProperties";
35 /** Some closures must contain their name. The name is stored in 35 /** Some closures must contain their name. The name is stored in
36 * [STATIC_CLOSURE_NAME_NAME]. */ 36 * [STATIC_CLOSURE_NAME_NAME]. */
37 final String STATIC_CLOSURE_NAME_NAME = @'$name'; 37 final String STATIC_CLOSURE_NAME_NAME = @'$name';
38 final SourceString CLOSURE_INVOCATION_NAME = Compiler.CALL_OPERATOR_NAME; 38 static final SourceString CLOSURE_INVOCATION_NAME =
floitsch 2012/08/15 14:14:04 we should remove the CLOSURE_INVOCATION_NAME from
39 Compiler.CALL_OPERATOR_NAME;
39 40
40 41
41 String closureInvocationName(Selector selector) { 42 String closureInvocationName(Selector selector) {
42 // TODO(floitsch): mangle, while not conflicting with instance names. 43 // TODO(floitsch): mangle, while not conflicting with instance names.
43 return instanceMethodInvocationName(null, CLOSURE_INVOCATION_NAME, 44 return instanceMethodInvocationName(null, CLOSURE_INVOCATION_NAME,
44 selector); 45 selector);
45 } 46 }
46 47
47 String breakLabelName(LabelElement label) { 48 String breakLabelName(LabelElement label) {
48 return '\$${label.labelName}\$${label.target.nestingLevel}'; 49 return '\$${label.labelName}\$${label.target.nestingLevel}';
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 302 }
302 303
303 String safeName(String name) { 304 String safeName(String name) {
304 if (jsReserved.contains(name) || name.startsWith('\$')) { 305 if (jsReserved.contains(name) || name.startsWith('\$')) {
305 name = "\$$name"; 306 name = "\$$name";
306 assert(!jsReserved.contains(name)); 307 assert(!jsReserved.contains(name));
307 } 308 }
308 return name; 309 return name;
309 } 310 }
310 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698