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

Unified Diff: pkg/compiler/lib/src/resolution/access_semantics.dart

Issue 1279863005: Begin refactoring of visitSendSet for unqualified updates. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: pkg/compiler/lib/src/resolution/access_semantics.dart
diff --git a/pkg/compiler/lib/src/resolution/access_semantics.dart b/pkg/compiler/lib/src/resolution/access_semantics.dart
index 834a04318f485706d8d1881999fefcedfe2a7fb2..fad2570bc0b0e3ab8b51dab54a337958649188ee 100644
--- a/pkg/compiler/lib/src/resolution/access_semantics.dart
+++ b/pkg/compiler/lib/src/resolution/access_semantics.dart
@@ -239,6 +239,10 @@ class AccessSemantics {
/// [element] otherwise.
Element get setter => element;
+ // TODO(johnniwinther): Make access semantics getter/setter specific.
+ /// `true` if the [element] of this access is accessed statically.
+ bool get isAccessedStatically => false;
+
AccessSemantics.expression()
: kind = AccessKind.EXPRESSION;
@@ -275,6 +279,8 @@ class DynamicAccess extends AccessSemantics {
DynamicAccess.ifNotNullProperty(this.target)
: super._(AccessKind.CONDITIONAL_DYNAMIC_PROPERTY);
+
+ bool get isAccessedStatically => false;
}
class ConstantAccess extends AccessSemantics {
@@ -291,6 +297,8 @@ class ConstantAccess extends AccessSemantics {
ConstantAccess.dynamicTypeLiteral(this.constant)
: super._(AccessKind.DYNAMIC_TYPE_LITERAL);
+
+ bool get isAccessedStatically => false;
}
class StaticAccess extends AccessSemantics {
@@ -372,6 +380,18 @@ class StaticAccess extends AccessSemantics {
StaticAccess.invalid(this.element)
: super._(AccessKind.INVALID);
+
+ bool get isAccessedStatically {
+ switch (kind) {
+ case AccessKind.UNRESOLVED:
+ case AccessKind.UNRESOLVED_SUPER:
+ case AccessKind.INVALID:
+ case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
+ return false;
+ default:
+ return true;
+ }
+ }
}
class CompoundAccessSemantics extends AccessSemantics {
@@ -386,6 +406,9 @@ class CompoundAccessSemantics extends AccessSemantics {
Element get element => setter;
+ // TODO(johnniwinther): Discriminate between access of the getter and setter.
+ bool get isAccessedStatically => true;
+
String toString() {
StringBuffer sb = new StringBuffer();
sb.write('CompoundAccessSemantics[');
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | pkg/compiler/lib/src/resolution/members.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698