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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart

Issue 1184853002: Cleanup TypedSelector.appliesUnnamed (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Emit top level and static getters/setters for mirrors. 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 | « no previous file | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
index 0de9dc06539097f9ba7530f7ae6a52d056531c8c..5f5cb45276ce4a99418abcf27b9f105d1c9476f4 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
@@ -470,23 +470,27 @@ class ClassEmitter extends CodeEmitterHelper {
bool fieldNeedsGetter(VariableElement field) {
assert(field.isField);
if (fieldAccessNeverThrows(field)) return false;
- return backend.shouldRetainGetter(field)
- || compiler.codegenWorld.hasInvokedGetter(field, compiler.world);
+ if (backend.shouldRetainGetter(field)) return true;
+ return field.isClassMember &&
+ compiler.codegenWorld.hasInvokedGetter(field, compiler.world);
}
bool fieldNeedsSetter(VariableElement field) {
assert(field.isField);
if (fieldAccessNeverThrows(field)) return false;
- return (!field.isFinal && !field.isConst)
- && (backend.shouldRetainSetter(field)
- || compiler.codegenWorld.hasInvokedSetter(field, compiler.world));
+ if (field.isFinal || field.isConst) return false;
+ if (backend.shouldRetainSetter(field)) return true;
+ return field.isClassMember &&
+ compiler.codegenWorld.hasInvokedSetter(field, compiler.world);
}
- // We never access a field in a closure (a captured variable) without knowing
- // that it is there. Therefore we don't need to use a getter (that will throw
- // if the getter method is missing), but can always access the field directly.
static bool fieldAccessNeverThrows(VariableElement field) {
- return field is ClosureFieldElement;
+ return
+ // We never access a field in a closure (a captured variable) without
+ // knowing that it is there. Therefore we don't need to use a getter
+ // (that will throw if the getter method is missing), but can always
+ // access the field directly.
+ field is ClosureFieldElement;
}
bool canAvoidGeneratedCheckedSetter(VariableElement member) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/types/type_mask.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698