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

Side by Side Diff: pkg/compiler/lib/src/js_backend/minify_namer.dart

Issue 2820953002: Use shorter names for some standard properties on closures. (Closed)
Patch Set: revert call* - used by mirrors Created 3 years, 8 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) 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 part of js_backend.namer; 5 part of js_backend.namer;
6 6
7 /** 7 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 8 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 */ 9 */
10 class MinifyNamer extends Namer 10 class MinifyNamer extends Namer
(...skipping 10 matching lines...) Expand all
21 21
22 _FieldNamingRegistry fieldRegistry; 22 _FieldNamingRegistry fieldRegistry;
23 23
24 String get isolateName => 'I'; 24 String get isolateName => 'I';
25 String get isolatePropertiesName => 'p'; 25 String get isolatePropertiesName => 'p';
26 bool get shouldMinify => true; 26 bool get shouldMinify => true;
27 27
28 final String getterPrefix = 'g'; 28 final String getterPrefix = 'g';
29 final String setterPrefix = 's'; 29 final String setterPrefix = 's';
30 final String callPrefix = ''; // this will create function names $<n> 30 final String callPrefix = ''; // this will create function names $<n>
31 String get requiredParameterField => r'$R';
32 String get defaultValuesField => r'$D';
33 String get operatorSignature => r'$S';
31 34
32 final ALPHABET_CHARACTERS = 52; // a-zA-Z. 35 final ALPHABET_CHARACTERS = 52; // a-zA-Z.
33 final ALPHANUMERIC_CHARACTERS = 62; // a-zA-Z0-9. 36 final ALPHANUMERIC_CHARACTERS = 62; // a-zA-Z0-9.
34 37
35 /// You can pass an invalid identifier to this and unlike its non-minifying 38 /// You can pass an invalid identifier to this and unlike its non-minifying
36 /// counterpart it will never return the proposedName as the new fresh name. 39 /// counterpart it will never return the proposedName as the new fresh name.
37 /// 40 ///
38 /// [sanitizeForNatives] and [sanitizeForAnnotations] are ignored because the 41 /// [sanitizeForNatives] and [sanitizeForAnnotations] are ignored because the
39 /// minified names will always avoid clashing with annotated names or natives. 42 /// minified names will always avoid clashing with annotated names or natives.
40 @override 43 @override
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 String prefix = 384 String prefix =
382 selector.isGetter ? r"$get" : selector.isSetter ? r"$set" : ""; 385 selector.isGetter ? r"$get" : selector.isSetter ? r"$set" : "";
383 String callSuffix = selector.isCall 386 String callSuffix = selector.isCall
384 ? callSuffixForStructure(selector.callStructure).join() 387 ? callSuffixForStructure(selector.callStructure).join()
385 : ""; 388 : "";
386 String suffix = suffixForGetInterceptor(classes); 389 String suffix = suffixForGetInterceptor(classes);
387 String fullName = "\$intercepted$prefix\$$root$callSuffix\$$suffix"; 390 String fullName = "\$intercepted$prefix\$$root$callSuffix\$$suffix";
388 return _disambiguateInternalGlobal(fullName); 391 return _disambiguateInternalGlobal(fullName);
389 } 392 }
390 } 393 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/frequency_namer.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698