Skip to content

Commit d548f38

Browse files
authored
JIT: more anticipatory extra SPMI queries for array stack alloc (#111441)
Augment the set of extra queries added in #111293 with a few more that we might call when stack allocating arrays.
1 parent dda0d4e commit d548f38

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/coreclr/jit/importer.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9701,18 +9701,22 @@ void Compiler::impImportBlockCode(BasicBlock* block)
97019701
impPushOnStack(gtNewLclvNode(lclNum, TYP_REF), tiRetVal);
97029702

97039703
#ifdef DEBUG
9704-
// Under SPMI, look up the array element type class handle
9705-
// and layout info (for arrays of structs)
9704+
// Under SPMI, look up info we might ask for if we stack allocate this array
97069705
//
97079706
if (JitConfig.EnableExtraSuperPmiQueries())
97089707
{
9708+
void* pEmbedClsHnd;
9709+
info.compCompHnd->embedClassHandle(resolvedToken.hClass, &pEmbedClsHnd);
97099710
CORINFO_CLASS_HANDLE elemClsHnd = NO_CLASS_HANDLE;
97109711
CorInfoType elemCorType = info.compCompHnd->getChildType(resolvedToken.hClass, &elemClsHnd);
97119712
var_types elemType = JITtype2varType(elemCorType);
97129713
if (elemType == TYP_STRUCT)
97139714
{
97149715
typGetObjLayout(elemClsHnd);
9716+
info.compCompHnd->isValueClass(elemClsHnd);
97159717
}
9718+
void* pIndirection;
9719+
info.compCompHnd->getHelperFtn(CORINFO_HELP_MEMZERO, &pIndirection);
97169720
}
97179721
#endif
97189722
}

0 commit comments

Comments
 (0)