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

Unified Diff: pkg/compiler/lib/src/types/types.dart

Issue 2968743002: Use .callMethod instead of LocalFunctionElement as key in inference (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/ssa/builder.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/types.dart
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index b15a286ad13e8a6de71c309fe27c4762fd591ece..3aabff0cd02d1af1e26c6cebebc1a4fd2095d12f 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -4,7 +4,6 @@
library types;
-import '../closure.dart' show SynthesizedCallMethodElementX;
import '../common.dart' show failedAt;
import '../common/tasks.dart' show CompilerTask;
import '../compiler.dart' show Compiler;
@@ -198,34 +197,13 @@ class GlobalTypeInferenceElementData {
/// API to interact with the global type-inference engine.
abstract class TypesInferrer {
void analyzeMain(FunctionEntity element);
-
- // We are moving away from using LocalFunctionElement to represent closures,
- // but plan to use the <closure-class>.callMethod instead as the
- // representation. At that point, we should be able to use
- // getReturnTypeOfMember(callMethod).
- @deprecated
- TypeMask getReturnTypeOfLocalFunction(LocalFunctionElement element);
TypeMask getReturnTypeOfMember(MemberElement element);
TypeMask getReturnTypeOfParameter(ParameterElement element);
-
- // We are moving away from using LocalFunctionElement to represent closures,
- // but plan to use the <closure-class>.callMethod instead as the
- // representation. At that point, we should be able to use
- // getTypeOfMember(callMethod).
- @deprecated
- TypeMask getTypeOfLocalFunction(LocalFunctionElement element);
TypeMask getTypeOfMember(MemberElement element);
TypeMask getTypeOfParameter(ParameterElement element);
TypeMask getTypeForNewList(Node node);
TypeMask getTypeOfSelector(Selector selector, TypeMask mask);
void clear();
-
- // We are moving away from using LocalFunctionElement to represent closures,
- // but plan to use the <closure-class>.callMethod instead as the
- // representation. At that point, we should be able to use
- // isMemberCalledOnce(callMethod).
- @deprecated
- bool isLocalFunctionCalledOnce(LocalFunctionElement element);
bool isMemberCalledOnce(MemberElement element);
bool isParameterCalledOnce(ParameterElement element);
bool isFixedArrayCheckedForGrowable(Node node);
@@ -257,17 +235,14 @@ class GlobalTypeInferenceResults {
"unexpected input: ConstructorBodyElements are created"
" after global type inference, no data is avaiable for them."));
- // TODO(sigmund): store closure data directly in the closure element and
- // not in the context of the enclosing method?
- MemberElement key = (member is SynthesizedCallMethodElementX)
- ? member.memberContext
- : member;
bool isJsInterop = closedWorld.nativeData.isJsInteropMember(member);
return _memberResults.putIfAbsent(
member,
() => new GlobalTypeInferenceMemberResult(
member,
- _inferrer.inferrer.lookupDataOfMember(key),
+ // We store data in the context of the enclosing method, even
+ // for closure elements.
+ _inferrer.inferrer.lookupDataOfMember(member.memberContext),
_inferrer,
isJsInterop,
dynamicType));
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698