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

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

Issue 2961313002: Always store GlobalTypeInferenceElementData on the member context (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 | « pkg/compiler/lib/src/inferrer/builder.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/inferrer_engine.dart
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
index 439d838e84a8f840805fb7e4bc36c8a8169f4dbf..40f80e43295a88dcdb94edc279c4f7ff9ff01718 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
@@ -77,8 +77,8 @@ class InferrerEngine {
/// Data computed internally within elements, like the type-mask of a send a
/// list allocation, or a for-in loop.
- final Map<Element, GlobalTypeInferenceElementData> inTreeData =
- new Map<Element, GlobalTypeInferenceElementData>();
+ final Map<MemberElement, GlobalTypeInferenceElementData> _memberData =
+ new Map<MemberElement, GlobalTypeInferenceElementData>();
InferrerEngine(this.compiler, ClosedWorld closedWorld,
this.closedWorldRefiner, this.mainElement)
@@ -110,16 +110,13 @@ class InferrerEngine {
}
}
- GlobalTypeInferenceElementData dataOfLocalFunction(
- LocalFunctionElement element) =>
- _dataOf(element);
-
// TODO(johnniwinther): Make this private again.
GlobalTypeInferenceElementData dataOfMember(MemberElement element) =>
- _dataOf(element);
+ _memberData.putIfAbsent(
+ element, () => new GlobalTypeInferenceElementData());
- GlobalTypeInferenceElementData _dataOf(AstElement element) => inTreeData
- .putIfAbsent(element, () => new GlobalTypeInferenceElementData());
+ GlobalTypeInferenceElementData lookupDataOfMember(MemberElement element) =>
+ _memberData[element];
/**
* Update [sideEffects] with the side effects of [callee] being
@@ -198,21 +195,9 @@ class InferrerEngine {
return returnType;
}
- @deprecated
- void updateSelectorInLocalFunction(LocalFunctionElement owner, Spannable node,
- Selector selector, TypeMask mask) {
- GlobalTypeInferenceElementData data = dataOfLocalFunction(owner);
- _updateSelectorInTree(data, node, selector, mask);
- }
-
void updateSelectorInMember(
MemberElement owner, Spannable node, Selector selector, TypeMask mask) {
GlobalTypeInferenceElementData data = dataOfMember(owner);
- _updateSelectorInTree(data, node, selector, mask);
- }
-
- void _updateSelectorInTree(GlobalTypeInferenceElementData data,
- Spannable node, Selector selector, TypeMask mask) {
ast.Node astNode = node;
if (astNode.asSendSet() != null) {
if (selector.isSetter || selector.isIndexSet) {
@@ -922,7 +907,7 @@ class InferrerEngine {
Spannable node,
Selector selector,
TypeMask mask,
- Element caller,
+ MemberElement caller,
LocalFunctionElement callee,
ArgumentsTypes arguments,
SideEffects sideEffects,
@@ -953,7 +938,7 @@ class InferrerEngine {
Spannable node,
Selector selector,
TypeMask mask,
- Element caller,
+ MemberElement caller,
MemberElement callee,
ArgumentsTypes arguments,
SideEffects sideEffects,
@@ -1013,7 +998,7 @@ class InferrerEngine {
Selector selector,
TypeMask mask,
TypeInformation receiverType,
- Element caller,
+ MemberElement caller,
ArgumentsTypes arguments,
SideEffects sideEffects,
bool inLoop) {
@@ -1079,7 +1064,7 @@ class InferrerEngine {
Selector selector,
TypeMask mask,
TypeInformation closure,
- Element caller,
+ MemberElement caller,
ArgumentsTypes arguments,
SideEffects sideEffects,
bool inLoop) {
« no previous file with comments | « pkg/compiler/lib/src/inferrer/builder.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698