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

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

Issue 2963983002: Further splitting of inference type-info (Closed)
Patch Set: Updated cf. comments. Created 3 years, 6 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 | « no previous file | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 41de26471bc0bb92e18d3688c47dce9ebb313144..ffe037b850d738b5ae80a580717ce40fd32a1bae 100644
--- a/pkg/compiler/lib/src/inferrer/builder.dart
+++ b/pkg/compiler/lib/src/inferrer/builder.dart
@@ -87,7 +87,9 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
: this.analyzedElement = analyzedElement,
this.inferrer = inferrer,
this.types = inferrer.types,
- this.inTreeData = inferrer.dataOf(analyzedElement) {
+ this.inTreeData = analyzedElement.isLocal
+ ? inferrer.dataOfLocalFunction(analyzedElement)
+ : inferrer.dataOfMember(analyzedElement) {
assert(outermostElement != null);
if (locals != null) return;
ast.Node node;
@@ -1115,7 +1117,7 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
});
return inferrer.concreteTypes.putIfAbsent(node, () {
- return types.allocateClosure(node, element);
+ return types.allocateClosureForLocalFunction(node, element);
});
}
@@ -1124,7 +1126,7 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
elements.getFunctionDefinition(node.function);
TypeInformation type =
inferrer.concreteTypes.putIfAbsent(node.function, () {
- return types.allocateClosure(node.function, element);
+ return types.allocateClosureForLocalFunction(node.function, element);
});
locals.update(element, type, node);
visit(node.function);
@@ -2735,7 +2737,12 @@ class ElementGraphBuilder extends ast.Visitor<TypeInformation>
mask = receiverType == types.dynamicType
? null
: types.newTypedSelector(receiverType, mask);
- inferrer.updateSelectorInTree(analyzedElement, node, selector, mask);
+ if (analyzedElement.isLocal) {
+ inferrer.updateSelectorInLocalFunction(
+ analyzedElement, node, selector, mask);
+ } else {
+ inferrer.updateSelectorInMember(analyzedElement, node, selector, mask);
+ }
}
// If the receiver of the call is a local, we may know more about
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698