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

Unified Diff: pkg/compiler/lib/src/js_backend/minify_namer.dart

Issue 1212613009: dart2js: Implement frequency based naming. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Reserve reserved names :) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/minify_namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/minify_namer.dart b/pkg/compiler/lib/src/js_backend/minify_namer.dart
index 8e5bb409010fdb175bb15066fabca672fc806faa..b561ee26420263cc339b8b03c3285cb377ee00ad 100644
--- a/pkg/compiler/lib/src/js_backend/minify_namer.dart
+++ b/pkg/compiler/lib/src/js_backend/minify_namer.dart
@@ -33,11 +33,11 @@ class MinifyNamer extends Namer with _MinifiedFieldNamer,
/// [sanitizeForNatives] and [sanitizeForAnnotations] are ignored because the
/// minified names will always avoid clashing with annotated names or natives.
@override
- jsAst.Name getFreshName(String proposedName,
- Set<String> usedNames,
- Map<String, String> suggestedNames,
- {bool sanitizeForNatives: false,
- bool sanitizeForAnnotations: false}) {
+ String _generateFreshStringForName(String proposedName,
+ Set<String> usedNames,
+ Map<String, String> suggestedNames,
+ {bool sanitizeForNatives: false,
+ bool sanitizeForAnnotations: false}) {
String freshName;
String suggestion = suggestedNames[proposedName];
if (suggestion != null && !usedNames.contains(suggestion)) {
@@ -47,7 +47,7 @@ class MinifyNamer extends Namer with _MinifiedFieldNamer,
suggestedNames.values);
}
usedNames.add(freshName);
- return new StringBackedName(freshName);
+ return freshName;
}
// From issue 7554. These should not be used on objects (as instance
@@ -193,7 +193,7 @@ class MinifyNamer extends Namer with _MinifiedFieldNamer,
/// Instance members starting with g and s are reserved for getters and
/// setters.
- bool _hasBannedPrefix(String name) {
+ static bool _hasBannedPrefix(String name) {
int code = name.codeUnitAt(0);
return code == $g || code == $s;
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.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