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

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

Issue 2563443007: Reduce use of Compiler.closedWorld (Closed)
Patch Set: Created 4 years 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_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 16053883cf448680a3e2b0ed37b29818babd9f87..1d7f7d815c5b114b2bc5fc8f2c0478c453343924 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -252,8 +252,7 @@ class TypeInformationSystem extends TypeSystem<TypeInformation> {
TypeInformation refineReceiver(Selector selector, TypeMask mask,
TypeInformation receiver, bool isConditional) {
if (receiver.type.isExact) return receiver;
- TypeMask otherType =
- compiler.closedWorld.allFunctions.receiverType(selector, mask);
+ TypeMask otherType = closedWorld.allFunctions.receiverType(selector, mask);
// Conditional sends (a?.b) can still narrow the possible types of `a`,
// however, we still need to consider that `a` may be null.
if (isConditional) {
@@ -916,8 +915,7 @@ class TypeGraphInferrerEngine
if (!info.inLoop) return;
if (info is StaticCallSiteTypeInformation) {
compiler.inferenceWorld.addFunctionCalledInLoop(info.calledElement);
- } else if (info.mask != null &&
- !info.mask.containsAll(compiler.closedWorld)) {
+ } else if (info.mask != null && !info.mask.containsAll(closedWorld)) {
// For instance methods, we only register a selector called in a
// loop if it is a typed selector, to avoid marking too many
// methods as being called from within a loop. This cuts down
@@ -1189,7 +1187,7 @@ class TypeGraphInferrerEngine
arguments, sideEffects, inLoop);
}
- compiler.closedWorld.allFunctions.filter(selector, mask).forEach((callee) {
+ closedWorld.allFunctions.filter(selector, mask).forEach((callee) {
updateSideEffects(sideEffects, selector, callee);
});
@@ -1414,11 +1412,11 @@ class TypeGraphInferrer implements TypesInferrer {
TypeMask result = const TypeMask.nonNullEmpty();
Iterable<Element> elements =
- compiler.closedWorld.allFunctions.filter(selector, mask);
+ inferrer.closedWorld.allFunctions.filter(selector, mask);
for (Element element in elements) {
TypeMask type =
inferrer.typeOfElementWithSelector(element, selector).type;
- result = result.union(type, compiler.closedWorld);
+ result = result.union(type, inferrer.closedWorld);
}
return result;
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698