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

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

Issue 1881013002: Expand ResolvedAst to handle synthetic constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + fix test, cps and compilation units for injected members. Created 4 years, 8 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/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 e19436fb5372dfa700d311181312e848fc495ea8..65d8796549e18f271f534fd75b8996a84c6a1cb5 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -830,13 +830,13 @@ class TypeGraphInferrerEngine
processLoopInformation();
}
- void analyze(Element element, ArgumentsTypes arguments) {
+ void analyze(AstElement element, ArgumentsTypes arguments) {
element = element.implementation;
if (analyzedElements.contains(element)) return;
analyzedElements.add(element);
- SimpleTypeInferrerVisitor visitor =
- new SimpleTypeInferrerVisitor(element, compiler, this);
+ SimpleTypeInferrerVisitor visitor = new SimpleTypeInferrerVisitor(
+ element, element.resolvedAst, compiler, this);
TypeInformation type;
reporter.withCurrentElement(element, () {
type = visitor.run();
@@ -1239,7 +1239,7 @@ class TypeGraphInferrerEngine
// TODO(ngeoffray): Not sure why the resolver would put a null
// mapping.
if (!compiler.enqueuer.resolution.hasBeenProcessed(element)) return;
- TreeElementMapping mapping = element.resolvedAst.elements;
+ ResolvedAst resolvedAst = element.resolvedAst;
element = element.implementation;
if (element.impliesType) return;
assert(invariant(
@@ -1253,7 +1253,11 @@ class TypeGraphInferrerEngine
if (element.isAbstract) return;
// Put the other operators in buckets by length, later to be added in
// length order.
- int length = mapping.getSelectorCount();
+ int length = 0;
+ if (resolvedAst.kind == ResolvedAstKind.PARSED) {
+ TreeElementMapping mapping = resolvedAst.elements;
+ length = mapping.getSelectorCount();
+ }
max = length > max ? length : max;
Setlet<Element> set =
methodSizes.putIfAbsent(length, () => new Setlet<Element>());
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.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