Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1210d9a

Browse filesBrowse files
committed
superpmi
1 parent bb52b25 commit 1210d9a
Copy full SHA for 1210d9a

5 files changed

+44Lines changed: 44 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h‎

Copy file name to clipboardExpand all lines: src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ LWM(PrintMethodName, DWORDLONG, Agnostic_PrintResult)
158158
LWM(IsValueClass, DWORDLONG, DWORD)
159159
LWM(IsMoreSpecificType, DLDL, DWORD)
160160
LWM(IsExactType, DWORDLONG, DWORD)
161+
LWM(IsNullableType, DWORDLONG, DWORD)
161162
LWM(IsEnum, DWORDLONG, DLD)
162163
LWM(PInvokeMarshalingRequired, MethodOrSigInfoValue, DWORD)
163164
LWM(ResolveToken, Agnostic_CORINFO_RESOLVED_TOKENin, ResolveTokenValue)
Collapse file

‎src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp‎

Copy file name to clipboardExpand all lines: src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5920,6 +5920,28 @@ bool MethodContext::repIsExactType(CORINFO_CLASS_HANDLE cls)
59205920
return value != 0;
59215921
}
59225922

5923+
void MethodContext::recIsNullableType(CORINFO_CLASS_HANDLE cls, TypeCompareState result)
5924+
{
5925+
if (IsNullableType == nullptr)
5926+
IsNullableType = new LightWeightMap<DWORDLONG, DWORD>();
5927+
5928+
DWORDLONG key = CastHandle(cls);
5929+
DWORD value = (DWORD)result;
5930+
IsNullableType->Add(key, value);
5931+
DEBUG_REC(dmpIsNullableType(key, value));
5932+
}
5933+
void MethodContext::dmpIsNullableType(DWORDLONG key, DWORD value)
5934+
{
5935+
printf("IsNullableType key cls-%016" PRIX64 ", value res-%d", key, value);
5936+
}
5937+
TypeCompareState MethodContext::repIsNullableType(CORINFO_CLASS_HANDLE cls)
5938+
{
5939+
DWORDLONG key = CastHandle(cls);
5940+
DWORD value = LookupByKeyOrMiss(IsNullableType, key, ": key %016" PRIX64 "", key);
5941+
DEBUG_REP(dmpIsNullableType(key, value));
5942+
return (TypeCompareState)value;
5943+
}
5944+
59235945
void MethodContext::recIsEnum(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE underlyingType, TypeCompareState result)
59245946
{
59255947
if (IsEnum == nullptr)
Collapse file

‎src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h‎

Copy file name to clipboardExpand all lines: src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,10 @@ class MethodContext
723723
void dmpIsExactType(DWORDLONG key, DWORD value);
724724
bool repIsExactType(CORINFO_CLASS_HANDLE cls);
725725

726+
void recIsNullableType(CORINFO_CLASS_HANDLE cls, TypeCompareState result);
727+
void dmpIsNullableType(DWORDLONG key, DWORD value);
728+
TypeCompareState repIsNullableType(CORINFO_CLASS_HANDLE cls);
729+
726730
void recIsEnum(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE underlyingType, TypeCompareState result);
727731
void dmpIsEnum(DWORDLONG key, DLD value);
728732
TypeCompareState repIsEnum(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE* underlyingType);
@@ -1165,6 +1169,7 @@ enum mcPackets
11651169
Packet_NotifyMethodInfoUsage = 214,
11661170
Packet_IsExactType = 215,
11671171
Packet_GetSwiftLowering = 216,
1172+
Packet_IsNullableType = 217,
11681173
};
11691174

11701175
void SetDebugDumpVariables();
Collapse file

‎src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp‎

Copy file name to clipboardExpand all lines: src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,15 @@ bool interceptor_ICJI::isExactType(CORINFO_CLASS_HANDLE cls)
914914
return temp;
915915
}
916916

917+
// Returns whether a class handle represents a Nullable type, if that can be statically determined.
918+
TypeCompareState interceptor_ICJI::isNullableType(CORINFO_CLASS_HANDLE cls)
919+
{
920+
mc->cr->AddCall("isNullableType");
921+
TypeCompareState temp = original_ICorJitInfo->isNullableType(cls);
922+
mc->recIsNullableType(cls, temp);
923+
return temp;
924+
}
925+
917926
// Returns TypeCompareState::Must if cls is known to be an enum.
918927
// For enums with known exact type returns the underlying
919928
// type in underlyingType when the provided pointer is
Collapse file

‎src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp‎

Copy file name to clipboardExpand all lines: src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,13 @@ bool MyICJI::isExactType(CORINFO_CLASS_HANDLE cls)
764764
return jitInstance->mc->repIsExactType(cls);
765765
}
766766

767+
// Returns true if a class handle represents a Nullable type.
768+
TypeCompareState MyICJI::isNullableType(CORINFO_CLASS_HANDLE cls)
769+
{
770+
jitInstance->mc->cr->AddCall("isNullableType");
771+
return jitInstance->mc->repIsNullableType(cls);
772+
}
773+
767774
// Returns TypeCompareState::Must if cls is known to be an enum.
768775
// For enums with known exact type returns the underlying
769776
// type in underlyingType when the provided pointer is

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.