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

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

Issue 2996463002: Make minification Entity-friendly. (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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/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 a213223f8bea5168bec2863a0367ab439e946e66..f23cd9013e80225fa2cf2335f47686fe99f7b677 100644
--- a/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
+++ b/pkg/compiler/lib/src/js_backend/field_naming_mixin.dart
@@ -13,16 +13,16 @@ abstract class _MinifiedFieldNamer implements Namer {
// The inheritance scope based naming might not yield a name. For instance,
// this could be because the field belongs to a mixin. In such a case this
// will return `null` and a normal field name has to be used.
- jsAst.Name _minifiedInstanceFieldPropertyName(FieldElement element) {
+ jsAst.Name _minifiedInstanceFieldPropertyName(FieldEntity element) {
if (_nativeData.hasFixedBackendName(element)) {
return new StringBackedName(_nativeData.getFixedBackendName(element));
}
_FieldNamingScope names;
- if (element is BoxFieldElement) {
+ if (element is BoxFieldElement || element is JBoxedField) {
names = new _FieldNamingScope.forBox(element.box, fieldRegistry);
Siggi Cherem (dart-lang) 2017/08/03 23:44:54 this might trigger some unhappy analyzer in strong
Emily Fortuna 2017/08/04 01:35:03 yes, sorry about that. Just ran the analyzer tests
} else {
- ClassElement cls = element.enclosingClass;
+ ClassEntity cls = element.enclosingClass;
names = new _FieldNamingScope.forClass(cls, _closedWorld, fieldRegistry);
}
@@ -116,19 +116,20 @@ class _FieldNamingScope {
}
factory _FieldNamingScope.forClass(
- ClassElement cls, ClosedWorld world, _FieldNamingRegistry registry) {
+ ClassEntity cls, ClosedWorld world, _FieldNamingRegistry registry) {
_FieldNamingScope result = registry.scopes[cls];
if (result != null) return result;
if (world.isUsedAsMixin(cls)) {
result = new _MixinFieldNamingScope.mixin(cls, registry);
} else {
- if (cls.superclass == null) {
+ var superclass = world.elementEnvironment.getSuperClass(cls);
+ if (superclass == null) {
result = new _FieldNamingScope.rootScope(cls, registry);
} else {
_FieldNamingScope superScope =
- new _FieldNamingScope.forClass(cls.superclass, world, registry);
- if (cls.isMixinApplication) {
+ new _FieldNamingScope.forClass(superclass, world, registry);
+ if (world.elementEnvironment.isMixinApplication(cls)) {
result =
new _MixinFieldNamingScope.mixedIn(cls, superScope, registry);
} else {
@@ -137,7 +138,10 @@ class _FieldNamingScope {
}
}
- cls.forEachInstanceField((cls, field) => result.add(field));
+ world.elementEnvironment.forEachClassMember(cls,
+ (ClassEntity declarer, MemberEntity member) {
+ if (member.isField && member.isInstanceMember) result.add(member);
+ });
registry.scopes[cls] = result;
return result;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698