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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart

Issue 2804293002: Add MemberEntity.isAbstract and use MemberEntity in function_set.dart (Closed)
Patch Set: Inference doesn't like MemberEntity Created 3 years, 8 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/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/kernel/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 3a62a544c2191e073cbdd61aa28282b2056ee591..5ecd80392f1b7042669e33bc8cab1a68e8a382e1 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -807,7 +807,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
final TypeInformation receiver;
/// Cached targets of this call.
- Iterable<Element> targets;
+ Iterable<MemberEntity> targets;
DynamicCallSiteTypeInformation(
MemberTypeInformation context,
@@ -828,7 +828,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
if (arguments != null) {
arguments.forEach((info) => info.addUser(this));
}
- for (Element element in targets) {
+ for (MemberElement element in targets) {
MemberTypeInformation callee = inferrer.types.getInferredTypeOf(element);
callee.addCall(caller, call);
callee.addUser(this);
@@ -838,7 +838,8 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
}
}
- Iterable<Element> get callees => targets.map((e) => e.implementation);
+ Iterable<Element> get callees =>
+ targets.map((MemberElement e) => e.implementation);
TypeMask computeTypedSelector(InferrerEngine inferrer) {
TypeMask receiverType = receiver.type;
@@ -853,7 +854,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
}
bool targetsIncludeComplexNoSuchMethod(InferrerEngine inferrer) {
- return targets.any((Element e) {
+ return targets.any((MemberElement e) {
return e is MethodElement &&
e.isInstanceMember &&
e.name == Identifiers.noSuchMethod_ &&
@@ -970,7 +971,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
}
TypeMask computeType(InferrerEngine inferrer) {
- Iterable<Element> oldTargets = targets;
+ Iterable<MemberEntity> oldTargets = targets;
TypeMask typeMask = computeTypedSelector(inferrer);
inferrer.updateSelectorInTree(caller, call, selector, typeMask);
@@ -986,7 +987,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
// and a call to `delegate`), we iterate over all these methods to
// update their parameter types.
targets = inferrer.closedWorld.allFunctions.filter(selector, maskToUse);
- Iterable<Element> typedTargets = canReachAll
+ Iterable<MemberEntity> typedTargets = canReachAll
? inferrer.closedWorld.allFunctions.filter(selector, typeMask)
: targets;
@@ -995,7 +996,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
// Add calls to new targets to the graph.
targets
.where((target) => !oldTargets.contains(target))
- .forEach((element) {
+ .forEach((MemberElement element) {
MemberTypeInformation callee =
inferrer.types.getInferredTypeOf(element);
callee.addCall(caller, call);
@@ -1008,7 +1009,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
// Walk over the old targets, and remove calls that cannot happen anymore.
oldTargets
.where((target) => !targets.contains(target))
- .forEach((element) {
+ .forEach((MemberElement element) {
MemberTypeInformation callee =
inferrer.types.getInferredTypeOf(element);
callee.removeCall(caller, call);
@@ -1021,7 +1022,8 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
// Walk over the found targets, and compute the joined union type mask
// for all these targets.
- TypeMask result = inferrer.types.joinTypeMasks(targets.map((element) {
+ TypeMask result =
+ inferrer.types.joinTypeMasks(targets.map((MemberElement element) {
// If [canReachAll] is true, then we are iterating over all
// targets that satisfy the untyped selector. We skip the return
// type of the targets that can only be reached through
@@ -1081,9 +1083,9 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
void giveUp(InferrerEngine inferrer, {bool clearAssignments: true}) {
if (!abandonInferencing) {
inferrer.updateSelectorInTree(caller, call, selector, mask);
- Iterable<Element> oldTargets = targets;
+ Iterable<MemberEntity> oldTargets = targets;
targets = inferrer.closedWorld.allFunctions.filter(selector, mask);
- for (Element element in targets) {
+ for (MemberElement element in targets) {
if (!oldTargets.contains(element)) {
MemberTypeInformation callee =
inferrer.types.getInferredTypeOf(element);
@@ -1098,7 +1100,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
}
void removeAndClearReferences(InferrerEngine inferrer) {
- for (Element element in targets) {
+ for (MemberElement element in targets) {
ElementTypeInformation callee = inferrer.types.getInferredTypeOf(element);
callee.removeUser(this);
}
@@ -1116,8 +1118,8 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
bool hasStableType(InferrerEngine inferrer) {
return receiver.isStable &&
- targets.every(
- (element) => inferrer.types.getInferredTypeOf(element).isStable) &&
+ targets.every((MemberElement element) =>
+ inferrer.types.getInferredTypeOf(element).isStable) &&
(arguments == null || arguments.every((info) => info.isStable)) &&
super.hasStableType(inferrer);
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/kernel/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698