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

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

Issue 2423953002: Change TypeInference to handle super calls as direct invocations. (Closed)
Patch Set: Fix comment. 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
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..0a534cec7794483ba1177ba63d6f8c329a0d129f 100644
--- a/pkg/compiler/lib/src/universe/use.dart
+++ b/pkg/compiler/lib/src/universe/use.dart
@@ -207,6 +207,33 @@ 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 method."));
+ return new StaticUse.internal(element, StaticUseKind.GENERAL);
+ }
+
+ /// 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 method."));
+ 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);
+ }
+
+ /// 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 method."));
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698