Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: don't try fetching fields of ref classes as SPMI extra queries #75500

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
JIT: don't try fetching fields of ref classes as SPMI extra queries
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.
  • Loading branch information
AndyAyersMS committed Sep 13, 2022
commit 90cd5b5e8ae2903d5c719bdbf4045ce71db726b2
12 changes: 11 additions & 1 deletion src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3115,11 +3115,21 @@ void Compiler::makeExtraStructQueries(CORINFO_CLASS_HANDLE structHandle, int lev
// outside of the current version bubble.
return;
}
unsigned fieldCnt = info.compCompHnd->getClassNumInstanceFields(structHandle);

unsigned const fieldCnt = info.compCompHnd->getClassNumInstanceFields(structHandle);
impNormStructType(structHandle);
#ifdef TARGET_ARMARCH
GetHfaType(structHandle);
#endif

// Bypass fetching instance fields of ref classes for now,
// as it requires traversing the class hierarchy.
//
if ((typeFlags & CORINFO_FLG_VALUECLASS) == 0)
{
return;
}

for (unsigned int i = 0; i < fieldCnt; i++)
{
CORINFO_FIELD_HANDLE fieldHandle = info.compCompHnd->getFieldInClass(structHandle, i);
Expand Down