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

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

Issue 1212613009: dart2js: Implement frequency based naming. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
Index: pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
diff --git a/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart b/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
index 61383b92f79061dd0ec85957a729acfad1abe8e6..707e7e7636929fe89ff84514e6d5a3e390f5bd20 100644
--- a/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
+++ b/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
@@ -44,7 +44,7 @@ abstract class _MinifiedFieldNamer implements Namer {
* hierarchy is encoded using instances of [_FieldNamingScope].
*/
class _FieldNamingRegistry {
- final MinifyNamer namer;
+ final Namer namer;
final Map<Entity, _FieldNamingScope> scopes =
new Map<Entity, _FieldNamingScope>();
@@ -71,14 +71,13 @@ class _FieldNamingRegistry {
// existing properties on JS objects (see [_reservedNativeProperties]).
// However, some of them are really short and safe to use for fields.
// Thus, we shortcut the namer to use those first.
- assert(index == nameStore.length + 1);
+ assert(index == nameStore.length);
herhut 2015/06/30 16:33:26 this is a back-ported fix from a later revision...
if (index < MinifyNamer._reservedNativeProperties.length &&
MinifyNamer._reservedNativeProperties[index].length <= 2) {
nameStore.add(
new StringBackedName(MinifyNamer._reservedNativeProperties[index]));
} else {
- nameStore.add(namer.getFreshName("field$index", namer.usedInstanceNames,
- namer.suggestedInstanceNames));
+ nameStore.add(namer.getFreshName(NamingScope.instance, "field$index"));
}
}

Powered by Google App Engine
This is Rietveld 408576698