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

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

Issue 2875313002: Access BackendUsage through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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/node_tracer.dart ('k') | pkg/compiler/lib/src/js_backend/backend.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 8bf8c87b6b72e8776a664109606827fa299aadb7..96b5923ab496dc6d4f5ba1a8d4ff2dbef7df3af6 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -18,7 +18,6 @@ import '../elements/resolution_types.dart'
ResolutionFunctionType,
ResolutionInterfaceType,
ResolutionTypeKind;
-import '../js_backend/backend.dart';
import '../tree/tree.dart' as ast show Node, Send;
import '../types/masks.dart'
show
@@ -462,7 +461,8 @@ class MemberTypeInformation extends ElementTypeInformation
TypeMask handleSpecialCases(InferrerEngine inferrer) {
if (element.isField &&
- (!inferrer.backend.canFieldBeUsedForGlobalOptimizations(element) ||
+ (!inferrer.backend.canFieldBeUsedForGlobalOptimizations(
+ element, inferrer.closedWorld) ||
inferrer.assumeDynamic(element))) {
// Do not infer types for fields that have a corresponding annotation or
// are assigned by synthesized calls
@@ -616,7 +616,7 @@ class ParameterTypeInformation extends ElementTypeInformation {
// TODO(herhut): Cleanup into one conditional.
TypeMask handleSpecialCases(InferrerEngine inferrer) {
if (!inferrer.backend.canFunctionParametersBeUsedForGlobalOptimizations(
- element.functionDeclaration) ||
+ element.functionDeclaration, inferrer.closedWorld) ||
inferrer.assumeDynamic(declaration)) {
// Do not infer types for parameters that have a corresponding annotation
// or that are assigned by synthesized calls.
@@ -975,12 +975,10 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
TypeMask typeMask = computeTypedSelector(inferrer);
inferrer.updateSelectorInTree(caller, call, selector, typeMask);
- Compiler compiler = inferrer.compiler;
- JavaScriptBackend backend = compiler.backend;
TypeMask maskToUse =
inferrer.closedWorld.extendMaskIfReachesAll(selector, typeMask);
- bool canReachAll =
- backend.backendUsage.isInvokeOnUsed && (maskToUse != typeMask);
+ bool canReachAll = inferrer.closedWorld.backendUsage.isInvokeOnUsed &&
+ (maskToUse != typeMask);
// If this call could potentially reach all methods that satisfy
// the untyped selector (through noSuchMethod's `Invocation`
« no previous file with comments | « pkg/compiler/lib/src/inferrer/node_tracer.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