Skip to content

Commit 5fa4788

Browse files
committed
JIT/EE interface cleanups
- Convert RuntimeHelpers.InitializeArray to new style intrinsic - Delete unused isStructRequiringStackAllocRetBuf JIT/EE method and related optimization - Delete unused CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT jit helper
1 parent 3efb476 commit 5fa4788

32 files changed

+169
-435
lines changed

src/coreclr/ToolBox/superpmi/superpmi-shared/lwmlist.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ LWM(IsDelegateCreationAllowed, DLDL, DWORD)
144144
LWM(IsFieldStatic, DWORDLONG, DWORD)
145145
LWM(IsIntrinsicType, DWORDLONG, DWORD)
146146
LWM(IsSDArray, DWORDLONG, DWORD)
147-
LWM(IsStructRequiringStackAllocRetBuf, DWORDLONG, DWORD)
148147
LWM(IsValidStringRef, DLD, DWORD)
149148
LWM(GetStringLiteral, DLD, DD)
150149
LWM(IsValidToken, DLD, DWORD)

src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,29 +1813,6 @@ bool MethodContext::repIsValueClass(CORINFO_CLASS_HANDLE cls)
18131813
return value != 0;
18141814
}
18151815

1816-
void MethodContext::recIsStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls, bool result)
1817-
{
1818-
if (IsStructRequiringStackAllocRetBuf == nullptr)
1819-
IsStructRequiringStackAllocRetBuf = new LightWeightMap<DWORDLONG, DWORD>();
1820-
1821-
DWORDLONG key = CastHandle(cls);
1822-
DWORD value = result ? 1 : 0;
1823-
IsStructRequiringStackAllocRetBuf->Add(key, value);
1824-
DEBUG_REC(dmpIsStructRequiringStackAllocRetBuf(key, value));
1825-
}
1826-
void MethodContext::dmpIsStructRequiringStackAllocRetBuf(DWORDLONG key, DWORD value)
1827-
{
1828-
printf("IsStructRequiringStackAllocRetBuf key cls-%016llX, value res-%u", key, value);
1829-
}
1830-
bool MethodContext::repIsStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls)
1831-
{
1832-
DWORDLONG key = CastHandle(cls);
1833-
AssertMapAndKeyExist(IsStructRequiringStackAllocRetBuf, key, ": key %016llX", key);
1834-
DWORD value = IsStructRequiringStackAllocRetBuf->Get(key);
1835-
DEBUG_REP(dmpIsStructRequiringStackAllocRetBuf(key, value));
1836-
return value != 0;
1837-
}
1838-
18391816
void MethodContext::recGetClassSize(CORINFO_CLASS_HANDLE cls, unsigned result)
18401817
{
18411818
if (GetClassSize == nullptr)

src/coreclr/ToolBox/superpmi/superpmi-shared/methodcontext.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ class MethodContext
237237
void dmpIsValueClass(DWORDLONG key, DWORD value);
238238
bool repIsValueClass(CORINFO_CLASS_HANDLE cls);
239239

240-
void recIsStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls, bool result);
241-
void dmpIsStructRequiringStackAllocRetBuf(DWORDLONG key, DWORD value);
242-
bool repIsStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls);
243-
244240
void recGetClassSize(CORINFO_CLASS_HANDLE cls, unsigned result);
245241
void dmpGetClassSize(DWORDLONG key, DWORD val);
246242
unsigned repGetClassSize(CORINFO_CLASS_HANDLE cls);
@@ -1009,7 +1005,7 @@ enum mcPackets
10091005
Packet_IsCompatibleDelegate = 99,
10101006
//Packet_IsInstantiationOfVerifiedGeneric = 100,
10111007
Packet_IsSDArray = 101,
1012-
Packet_IsStructRequiringStackAllocRetBuf = 102,
1008+
//Packet_IsStructRequiringStackAllocRetBuf = 102,
10131009
Packet_IsValidStringRef = 103,
10141010
//Retired6 = 104,
10151011
Packet_IsValueClass = 105,

src/coreclr/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -550,20 +550,6 @@ uint32_t interceptor_ICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
550550
return temp;
551551
}
552552

553-
// Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
554-
// of this type must be stack-allocated. This will generally be true only if the struct
555-
// contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
556-
// an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
557-
// returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
558-
// buffers do not require GC write barriers.
559-
bool interceptor_ICJI::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls)
560-
{
561-
mc->cr->AddCall("isStructRequiringStackAllocRetBuf");
562-
bool temp = original_ICorJitInfo->isStructRequiringStackAllocRetBuf(cls);
563-
mc->recIsStructRequiringStackAllocRetBuf(cls, temp);
564-
return temp;
565-
}
566-
567553
CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule(CORINFO_CLASS_HANDLE cls)
568554
{
569555
mc->cr->AddCall("getClassModule");

src/coreclr/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,6 @@ uint32_t interceptor_ICJI::getClassAttribs(
378378
return original_ICorJitInfo->getClassAttribs(cls);
379379
}
380380

381-
bool interceptor_ICJI::isStructRequiringStackAllocRetBuf(
382-
CORINFO_CLASS_HANDLE cls)
383-
{
384-
mcs->AddCall("isStructRequiringStackAllocRetBuf");
385-
return original_ICorJitInfo->isStructRequiringStackAllocRetBuf(cls);
386-
}
387-
388381
CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule(
389382
CORINFO_CLASS_HANDLE cls)
390383
{

src/coreclr/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,6 @@ uint32_t interceptor_ICJI::getClassAttribs(
333333
return original_ICorJitInfo->getClassAttribs(cls);
334334
}
335335

336-
bool interceptor_ICJI::isStructRequiringStackAllocRetBuf(
337-
CORINFO_CLASS_HANDLE cls)
338-
{
339-
return original_ICorJitInfo->isStructRequiringStackAllocRetBuf(cls);
340-
}
341-
342336
CORINFO_MODULE_HANDLE interceptor_ICJI::getClassModule(
343337
CORINFO_CLASS_HANDLE cls)
344338
{

src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -482,18 +482,6 @@ uint32_t MyICJI::getClassAttribs(CORINFO_CLASS_HANDLE cls)
482482
return jitInstance->mc->repGetClassAttribs(cls);
483483
}
484484

485-
// Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
486-
// of this type must be stack-allocated. This will generally be true only if the struct
487-
// contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
488-
// an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
489-
// returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
490-
// buffers do not require GC write barriers.
491-
bool MyICJI::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls)
492-
{
493-
jitInstance->mc->cr->AddCall("isStructRequiringStackAllocRetBuf");
494-
return jitInstance->mc->repIsStructRequiringStackAllocRetBuf(cls);
495-
}
496-
497485
CORINFO_MODULE_HANDLE MyICJI::getClassModule(CORINFO_CLASS_HANDLE cls)
498486
{
499487
jitInstance->mc->cr->AddCall("getClassModule");

src/coreclr/inc/corinfo.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ enum CorInfoHelpFunc
472472

473473
CORINFO_HELP_GETFIELDADDR,
474474

475-
CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT, // Helper for context-static fields
476475
CORINFO_HELP_GETSTATICFIELDADDR_TLS, // Helper for PE TLS fields
477476

478477
// There are a variety of specialized helpers for accessing static fields. The JIT should use
@@ -886,7 +885,6 @@ enum CorInfoIntrinsics
886885
CORINFO_INTRINSIC_Array_Get, // Get the value of an element in an array
887886
CORINFO_INTRINSIC_Array_Address, // Get the address of an element in an array
888887
CORINFO_INTRINSIC_Array_Set, // Set the value of an element in an array
889-
CORINFO_INTRINSIC_InitializeArray, // initialize an array from static data
890888
CORINFO_INTRINSIC_RTH_GetValueInternal,
891889
CORINFO_INTRINSIC_Object_GetType,
892890
CORINFO_INTRINSIC_StubHelpers_GetStubContext,
@@ -2302,14 +2300,6 @@ class ICorStaticInfo
23022300
CORINFO_CLASS_HANDLE cls
23032301
) = 0;
23042302

2305-
// Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
2306-
// of this type must be stack-allocated. This will generally be true only if the struct
2307-
// contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
2308-
// an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
2309-
// returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
2310-
// buffers do not require GC write barriers.
2311-
virtual bool isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) = 0;
2312-
23132303
virtual CORINFO_MODULE_HANDLE getClassModule (
23142304
CORINFO_CLASS_HANDLE cls
23152305
) = 0;

src/coreclr/inc/icorjitinfoimpl_generated.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ CorInfoInlineTypeCheck canInlineTypeCheck(
207207
uint32_t getClassAttribs(
208208
CORINFO_CLASS_HANDLE cls) override;
209209

210-
bool isStructRequiringStackAllocRetBuf(
211-
CORINFO_CLASS_HANDLE cls) override;
212-
213210
CORINFO_MODULE_HANDLE getClassModule(
214211
CORINFO_CLASS_HANDLE cls) override;
215212

src/coreclr/inc/jiteeversionguid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
4343
#define GUID_DEFINED
4444
#endif // !GUID_DEFINED
4545

46-
constexpr GUID JITEEVersionIdentifier = { /* 3df3e3ec-b1f6-4e6d-8439-2e7f3f7fa2ac */
47-
0x3df3e3ec,
48-
0xb1f6,
49-
0x4e6d,
50-
{0x84, 0x39, 0x2e, 0x7f, 0x3f, 0x7f, 0xa2, 0xac}
46+
constexpr GUID JITEEVersionIdentifier = { /* 0c6f2d8d-f1b7-4c28-bbe8-36c8f6b35fbf */
47+
0xc6f2d8d,
48+
0xf1b7,
49+
0x4c28,
50+
{ 0xbb, 0xe8, 0x36, 0xc8, 0xf6, 0xb3, 0x5f, 0xbf}
5151
};
5252

5353
//////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)