The result of the devirtualization for a method on a generic type should be an instantiating stub, but this doesn't seem to work right.
Fixing that is a perf issue (that can be triaged/punted - #15977). This commit is a correctness fix to avoid bad codegen for that case.
Resolves #15591.
{
return nullptr;
}
+
+ // If we devirtualized into a default interface method on a generic type, we should actually return an
+ // instantiating stub but this is not happening.
+ // Making this work is tracked by https://github.com/dotnet/coreclr/issues/15977
+ if (pDevirtMD->GetMethodTable()->IsInterface() && pDevirtMD->HasClassInstantiation())
+ {
+ return nullptr;
+ }
}
else
{
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\diamondshape\diamondshape\*">
<Issue>15591</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\sharedgenerics\sharedgenerics\*">
- <Issue>15591</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\constrainedcall\constrainedcall\*">
<Issue>15353</Issue>
</ExcludeList>
GC/Features/SustainedLowLatency/scenario/scenario.sh
GC/Regressions/dev10bugs/536168/536168/536168.sh
Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape/diamondshape.sh
-Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics/sharedgenerics.sh
Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall/constrainedcall.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612/Generated612.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613/Generated613.sh