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

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

Issue 2991313002: Split ast based parts from InferrerEngineImpl (Closed)
Patch Set: Created 3 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/inferrer/builder.dart
diff --git a/pkg/compiler/lib/src/inferrer/builder.dart b/pkg/compiler/lib/src/inferrer/builder.dart
index 7d3685d7b8d51a28e2ecbed9a50f6a950b8f4c55..1c6bbe299e1c24a395a99d38d32c04b9391c9395 100644
--- a/pkg/compiler/lib/src/inferrer/builder.dart
+++ b/pkg/compiler/lib/src/inferrer/builder.dart
@@ -104,10 +104,11 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
new LocalsHandler(inferrer, types, compiler.options, node, fieldScope);
}
- ElementGraphBuilder(MemberElement element, ResolvedAst resolvedAst,
- Compiler compiler, InferrerEngine inferrer, [LocalsHandler handler])
- : this.internal(element, resolvedAst, element.memberContext.declaration,
- inferrer, compiler, handler);
+ ElementGraphBuilder(
+ MemberElement element, Compiler compiler, InferrerEngine inferrer,
+ [LocalsHandler handler])
+ : this.internal(element, element.resolvedAst,
+ element.memberContext.declaration, inferrer, compiler, handler);
TreeElements get elements => resolvedAst.elements;
@@ -892,8 +893,13 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
void analyzeSuperConstructorCall(
ConstructorElement target, ArgumentsTypes arguments) {
+ assert(target.isDeclaration);
ResolvedAst resolvedAst = target.resolvedAst;
- inferrer.analyze(resolvedAst, arguments);
+ ast.Node body;
+ if (resolvedAst.kind == ResolvedAstKind.PARSED) {
+ body = resolvedAst.node;
+ }
+ inferrer.analyze(target, body, arguments);
isThisExposed = isThisExposed || inferrer.checkIfExposesThis(target);
}
@@ -956,8 +962,8 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
parameter,
"Unexpected function declaration "
"${declarationMethod}, expected ${analyzedElement}."));
- visitor = new ElementGraphBuilder(declarationMethod,
- parameter.functionDeclaration.resolvedAst, compiler, inferrer);
+ visitor =
+ new ElementGraphBuilder(declarationMethod, compiler, inferrer);
}
TypeInformation type =
(defaultValue == null) ? types.nullType : visitor.visit(defaultValue);
@@ -1104,8 +1110,8 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
// method, like for example the types of local variables.
LocalsHandler closureLocals =
new LocalsHandler.from(locals, node, useOtherTryBlock: false);
- ElementGraphBuilder visitor = new ElementGraphBuilder(element.callMethod,
- element.resolvedAst, compiler, inferrer, closureLocals);
+ ElementGraphBuilder visitor = new ElementGraphBuilder(
+ element.callMethod, compiler, inferrer, closureLocals);
visitor.run();
inferrer.recordReturnType(element.callMethod, visitor.returnType);
« no previous file with comments | « pkg/compiler/lib/src/inferrer/ast_inferrer_engine.dart ('k') | pkg/compiler/lib/src/inferrer/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698