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

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

Issue 2314703002: Split World usage into open, inference, and closed world. (Closed)
Patch Set: Updated cf. comments Created 4 years, 3 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/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 feaed3e7536e13904d3793226496f731cfd4dad4..833f611a2e1c10635227f279ff6a31bfea315558 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -639,7 +639,8 @@ class ParameterTypeInformation extends ElementTypeInformation {
giveUp(inferrer);
return safeType(inferrer);
}
- if (inferrer.compiler.world.getMightBePassedToApply(declaration)) {
+ if (inferrer.compiler.inferenceWorld
+ .getCurrentlyKnownMightBePassedToApply(declaration)) {
giveUp(inferrer);
return safeType(inferrer);
}
@@ -816,7 +817,8 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
void addToGraph(TypeGraphInferrerEngine inferrer) {
assert(receiver != null);
TypeMask typeMask = computeTypedSelector(inferrer);
- targets = inferrer.compiler.world.allFunctions.filter(selector, typeMask);
+ targets =
+ inferrer.compiler.closedWorld.allFunctions.filter(selector, typeMask);
receiver.addUser(this);
if (arguments != null) {
arguments.forEach((info) => info.addUser(this));
@@ -968,16 +970,16 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
Compiler compiler = inferrer.compiler;
TypeMask maskToUse =
- compiler.world.extendMaskIfReachesAll(selector, typeMask);
+ compiler.closedWorld.extendMaskIfReachesAll(selector, typeMask);
bool canReachAll = compiler.enabledInvokeOn && (maskToUse != typeMask);
// If this call could potentially reach all methods that satisfy
// the untyped selector (through noSuchMethod's `Invocation`
// and a call to `delegate`), we iterate over all these methods to
// update their parameter types.
- targets = compiler.world.allFunctions.filter(selector, maskToUse);
+ targets = compiler.closedWorld.allFunctions.filter(selector, maskToUse);
Iterable<Element> typedTargets = canReachAll
- ? compiler.world.allFunctions.filter(selector, typeMask)
+ ? compiler.closedWorld.allFunctions.filter(selector, typeMask)
: targets;
// Update the call graph if the targets could have changed.
@@ -1073,7 +1075,8 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
if (!abandonInferencing) {
inferrer.updateSelectorInTree(caller, call, selector, mask);
Iterable<Element> oldTargets = targets;
- targets = inferrer.compiler.world.allFunctions.filter(selector, mask);
+ targets =
+ inferrer.compiler.closedWorld.allFunctions.filter(selector, mask);
for (Element element in targets) {
if (!oldTargets.contains(element)) {
MemberTypeInformation callee =
@@ -1734,9 +1737,10 @@ TypeMask _narrowType(Compiler compiler, TypeMask type, DartType annotation,
otherType = compiler.commonMasks.nullType;
} else {
assert(annotation.isInterfaceType);
- otherType = new TypeMask.nonNullSubtype(annotation.element, compiler.world);
+ otherType =
+ new TypeMask.nonNullSubtype(annotation.element, compiler.closedWorld);
}
if (isNullable) otherType = otherType.nullable();
if (type == null) return otherType;
- return type.intersection(otherType, compiler.world);
+ return type.intersection(otherType, compiler.closedWorld);
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698