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

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

Issue 2967003002: Split TypeSystem.typeInformations into member/parameter info (Closed)
Patch Set: Created 3 years, 5 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/type_system.dart ('k') | no next file » | 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 3aabff0cd02d1af1e26c6cebebc1a4fd2095d12f..97d357f18860aea478e33ee1ba901382408befe4 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -33,10 +33,6 @@ abstract class GlobalTypeInferenceElementResult {
/// Whether the method element associated with this result always throws.
bool get throwsAlways;
- /// Whether the element associated with this result is only called once in one
- /// location in the entire program.
- bool get isCalledOnce;
-
/// The inferred type when this result belongs to a parameter or field
/// element, null otherwise.
TypeMask get type;
@@ -71,6 +67,13 @@ abstract class GlobalTypeInferenceElementResult {
TypeMask typeOfIteratorCurrent(ForIn node);
}
+abstract class GlobalTypeInferenceMemberResult
+ extends GlobalTypeInferenceElementResult {
+ /// Whether the member associated with this result is only called once in one
+ /// location in the entire program.
+ bool get isCalledOnce;
+}
+
abstract class GlobalTypeInferenceElementResultImpl
implements GlobalTypeInferenceElementResult {
// TODO(sigmund): delete, store data directly here.
@@ -108,9 +111,10 @@ abstract class GlobalTypeInferenceElementResultImpl
_data?.typeOfIteratorCurrent(node);
}
-class GlobalTypeInferenceMemberResult
- extends GlobalTypeInferenceElementResultImpl {
- GlobalTypeInferenceMemberResult(
+class GlobalTypeInferenceMemberResultImpl
+ extends GlobalTypeInferenceElementResultImpl
+ implements GlobalTypeInferenceMemberResult {
+ GlobalTypeInferenceMemberResultImpl(
MemberElement owner,
GlobalTypeInferenceElementData data,
TypesInferrer inferrer,
@@ -133,8 +137,6 @@ class GlobalTypeInferenceParameterResult
ParameterElement owner, TypesInferrer inferrer, TypeMask _dynamic)
: super.internal(owner, null, inferrer, false, _dynamic);
- bool get isCalledOnce => _inferrer.isParameterCalledOnce(_owner);
-
TypeMask get returnType =>
_isJsInterop ? _dynamic : _inferrer.getReturnTypeOfParameter(_owner);
@@ -205,7 +207,6 @@ abstract class TypesInferrer {
TypeMask getTypeOfSelector(Selector selector, TypeMask mask);
void clear();
bool isMemberCalledOnce(MemberElement element);
- bool isParameterCalledOnce(ParameterElement element);
bool isFixedArrayCheckedForGrowable(Node node);
}
@@ -227,7 +228,7 @@ class GlobalTypeInferenceResults {
// TODO(sigmund,johnniwinther): compute result objects eagerly and make it an
// error to query for results that don't exist.
- GlobalTypeInferenceElementResult resultOfMember(MemberElement member) {
+ GlobalTypeInferenceMemberResult resultOfMember(MemberElement member) {
assert(
!member.isGenerativeConstructorBody,
failedAt(
@@ -238,7 +239,7 @@ class GlobalTypeInferenceResults {
bool isJsInterop = closedWorld.nativeData.isJsInteropMember(member);
return _memberResults.putIfAbsent(
member,
- () => new GlobalTypeInferenceMemberResult(
+ () => new GlobalTypeInferenceMemberResultImpl(
member,
// We store data in the context of the enclosing method, even
// for closure elements.
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_system.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698