Skip to content

Commit

Permalink
Disallow InstParam
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Feb 10, 2025
1 parent fe5cc42 commit 4b809c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8234,17 +8234,17 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,

if (dvInfo.isInstantiatingStub)
{
// We should only end up with generic methods for array interface devirt.
// We should only end up with generic methods for array interface or GVM devirt.
//
assert(dvInfo.wasArrayInterfaceOrGvmDevirt);

// We don't expect NAOT to end up here, since it has Array<T>
// and normal devirtualization.
// and normal devirtualization, and it does not (yet) support GVM devirtualization.
//
assert(!IsTargetAbi(CORINFO_NATIVEAOT_ABI));

// We don't expect R2R to end up here, since it does not (yet) support
// array interface devirtualization.
// array interface or GVM devirtualization.
//
assert(!opts.IsReadyToRun());

Expand Down
16 changes: 4 additions & 12 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8750,7 +8750,7 @@ bool CEEInfo::resolveVirtualMethodHelper(CORINFO_DEVIRTUALIZATION_INFO * info)

if (pDevirtMD->HasMethodInstantiation())
{
pDevirtMD = pDevirtMD->FindOrCreateAssociatedMethodDesc(pDevirtMD, pDevirtMD->GetMethodTable(), false, pBaseMD->GetMethodInstantiation(), true);
pDevirtMD = pDevirtMD->FindOrCreateAssociatedMethodDesc(pDevirtMD, pDevirtMD->GetMethodTable(), false, pBaseMD->GetMethodInstantiation(), false);
}

// Determine the exact class.
Expand Down Expand Up @@ -8783,7 +8783,7 @@ bool CEEInfo::resolveVirtualMethodHelper(CORINFO_DEVIRTUALIZATION_INFO * info)

// Success! Pass back the results.
//
if (isArray)
if (isArray || pDevirtMD->HasMethodInstantiation())
{
// Note if array devirtualization produced an instantiation stub
// so jit can try and inline it.
Expand All @@ -8794,16 +8794,8 @@ bool CEEInfo::resolveVirtualMethodHelper(CORINFO_DEVIRTUALIZATION_INFO * info)
}
else
{
if (pDevirtMD->HasMethodInstantiation())
{
info->exactContext = MAKE_METHODCONTEXT((CORINFO_METHOD_HANDLE) pDevirtMD);
info->wasArrayInterfaceOrGvmDevirt = true;
}
else
{
info->exactContext = MAKE_CLASSCONTEXT((CORINFO_CLASS_HANDLE) pExactMT);
info->wasArrayInterfaceOrGvmDevirt = false;
}
info->exactContext = MAKE_CLASSCONTEXT((CORINFO_CLASS_HANDLE) pExactMT);
info->wasArrayInterfaceOrGvmDevirt = false;
info->isInstantiatingStub = false;
}

Expand Down

0 comments on commit 4b809c8

Please sign in to comment.