Skip to content

Commit fb4772f

Browse files
authored
JIT: don't try fetching fields of ref classes as SPMI extra queries (#75500)
Enumeration of ref class fields requires walking up the type hierarchy. Since this is done in an optional query to extend the viability of an SPMI collection, skip for now. Fixes #74968.
1 parent b583258 commit fb4772f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/coreclr/jit/lclvars.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3115,11 +3115,21 @@ void Compiler::makeExtraStructQueries(CORINFO_CLASS_HANDLE structHandle, int lev
31153115
// outside of the current version bubble.
31163116
return;
31173117
}
3118-
unsigned fieldCnt = info.compCompHnd->getClassNumInstanceFields(structHandle);
3118+
3119+
unsigned const fieldCnt = info.compCompHnd->getClassNumInstanceFields(structHandle);
31193120
impNormStructType(structHandle);
31203121
#ifdef TARGET_ARMARCH
31213122
GetHfaType(structHandle);
31223123
#endif
3124+
3125+
// Bypass fetching instance fields of ref classes for now,
3126+
// as it requires traversing the class hierarchy.
3127+
//
3128+
if ((typeFlags & CORINFO_FLG_VALUECLASS) == 0)
3129+
{
3130+
return;
3131+
}
3132+
31233133
for (unsigned int i = 0; i < fieldCnt; i++)
31243134
{
31253135
CORINFO_FIELD_HANDLE fieldHandle = info.compCompHnd->getFieldInClass(structHandle, i);

0 commit comments

Comments
 (0)