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

Unified Diff: pkg/compiler/lib/src/universe/use.dart

Issue 2423953002: Change TypeInference to handle super calls as direct invocations. (Closed)
Patch Set: Register instance methods from direct invocation. Created 4 years, 2 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/universe/function_set.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/use.dart
diff --git a/pkg/compiler/lib/src/universe/use.dart b/pkg/compiler/lib/src/universe/use.dart
index fad9d905e8c6fec7a4bb8f80693538449f597fc5..7cb642eae11b7f86834091035dda2d5355597c16 100644
--- a/pkg/compiler/lib/src/universe/use.dart
+++ b/pkg/compiler/lib/src/universe/use.dart
@@ -73,6 +73,7 @@ enum StaticUseKind {
CLOSURE,
CONSTRUCTOR_INVOKE,
CONST_CONSTRUCTOR_INVOKE,
+ DIRECT_INVOKE,
}
/// Statically known use of an [Element].
@@ -207,6 +208,35 @@ class StaticUse {
return new StaticUse.internal(element, StaticUseKind.GENERAL);
}
+ /// Direct invocation of a method [element] with the given [callStructure].
+ factory StaticUse.directInvoke(
+ MethodElement element, CallStructure callStructure) {
+ // TODO(johnniwinther): Use the [callStructure].
+ assert(invariant(element, element.isInstanceMember,
+ message: "Direct invoke element $element must be an instance member."));
+ assert(invariant(element, element.isFunction,
+ message: "Direct invoke element $element must be a method."));
+ return new StaticUse.internal(element, StaticUseKind.DIRECT_INVOKE);
+ }
+
+ /// Direct read access of a field or getter [element].
+ factory StaticUse.directGet(MemberElement element) {
+ assert(invariant(element, element.isInstanceMember,
+ message: "Direct get element $element must be an instance member."));
+ assert(invariant(element, element.isField || element.isGetter,
+ message: "Direct get element $element must be a field or a getter."));
+ return new StaticUse.internal(element, StaticUseKind.GENERAL);
Siggi Cherem (dart-lang) 2016/10/18 14:45:22 shouldn't this and the one below be a DIRECT_INVOK
Johnni Winther 2016/10/19 07:45:43 No. This is only used for getters and fields which
+ }
+
+ /// Direct write access of a field [element].
+ factory StaticUse.directSet(FieldElement element) {
+ assert(invariant(element, element.isInstanceMember,
+ message: "Direct set element $element must be an instance member."));
+ assert(invariant(element, element.isField,
+ message: "Direct set element $element must be a field."));
+ return new StaticUse.internal(element, StaticUseKind.GENERAL);
+ }
+
/// Constructor invocation of [element] with the given [callStructure].
factory StaticUse.constructorInvoke(
ConstructorElement element, CallStructure callStructure) {
« no previous file with comments | « pkg/compiler/lib/src/universe/function_set.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698