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

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

Issue 1776533002: dart2js: Destroy some type inference graph edges after type inference. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix failing tests that use initialized MemberTypeInformations Created 4 years, 9 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_nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fb979aaeab98cbd9be949c15c5a9159847f2f8dd..a9084c8e4b1fc7ab0883433f7fcf3912edca085d 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1533,12 +1533,19 @@ class SsaBuilder extends ast.Visitor
return inliningStack.isEmpty || inliningStack.last.allFunctionsCalledOnce;
}
- bool isCalledOnce(Element element) {
- if (!allInlinedFunctionsCalledOnce) return false;
+ bool isFunctionCalledOnce(Element element) {
+ if (element is ConstructorBodyElement) {
+ // ConstructorBodyElements are not in the type inference graph.
+ return false;
+ }
TypesInferrer inferrer = compiler.typesTask.typesInferrer;
return inferrer.isCalledOnce(element);
}
+ bool isCalledOnce(Element element) {
+ return allInlinedFunctionsCalledOnce && isFunctionCalledOnce(element);
+ }
+
inlinedFrom(Element element, f()) {
assert(element is FunctionElement || element is VariableElement);
return reporter.withCurrentElement(element, () {
@@ -8526,11 +8533,10 @@ class SsaBuilder extends ast.Visitor
ast.Node _,
List<HInstruction> compiledArguments,
{InterfaceType instanceType}) {
- TypesInferrer inferrer = compiler.typesTask.typesInferrer;
AstInliningState state = new AstInliningState(
function, returnLocal, returnType, elements, stack, localsHandler,
inTryStatement,
- allInlinedFunctionsCalledOnce && inferrer.isCalledOnce(function));
+ allInlinedFunctionsCalledOnce && isFunctionCalledOnce(function));
inliningStack.add(state);
// Setting up the state of the (AST) builder is performed even when the
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698