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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2278213003: Rename the global inference task and reduce it's API surface by introducing the (Closed)
Patch Set: cl comments Created 4 years, 4 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/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 7d088f14978d313aae0b52297de15470e678ad17..e44ebf3b6c1d1a683aa13237b7c036c16af89fbe 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -683,11 +683,7 @@ class SsaBuilder extends ast.Visitor
// A generative constructor body is not seen by global analysis,
// so we should not query for its type.
if (!element.isGenerativeConstructorBody) {
- // Don't inline if the return type was inferred to be non-null empty.
- // This means that the function always throws an exception.
- TypeMask returnType =
- compiler.typesTask.getGuaranteedReturnTypeOfElement(element);
- if (returnType != null && returnType.isEmpty) {
+ if (compiler.globalInference.throwsAlways(element)) {
isReachable = false;
return false;
}
@@ -824,8 +820,7 @@ class SsaBuilder extends ast.Visitor
// ConstructorBodyElements are not in the type inference graph.
return false;
}
- TypesInferrer inferrer = compiler.typesTask.typesInferrer;
- return inferrer.isCalledOnce(element);
+ return compiler.globalInference.isCalledOnce(element);
}
bool isCalledOnce(Element element) {
@@ -4229,8 +4224,7 @@ class SsaBuilder extends ast.Visitor
? native.NativeThrowBehavior.MAY
: native.NativeThrowBehavior.NEVER);
push(foreign);
- TypesInferrer inferrer = compiler.typesTask.typesInferrer;
- if (inferrer.isFixedArrayCheckedForGrowable(send)) {
+ if (compiler.globalInference.isFixedArrayCheckedForGrowable(send)) {
js.Template code = js.js.parseForeignJS(r'#.fixed$length = Array');
// We set the instruction as [canThrow] to avoid it being dead code.
// We need a finer grained side effect.
« no previous file with comments | « pkg/compiler/lib/src/js_backend/no_such_method_registry.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698