-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
I'm learning the code behind devirtualization and stumbled upon this one:
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/jit/importer.cpp#L20539-L20547
For some reason this doesn't embeds, so here are lines under question:
CORINFO_CLASS_HANDLE uniqueImplementingClass = NO_CLASS_HANDLE;
// info.compCompHnd->getUniqueImplementingClass(objClass);
if (uniqueImplementingClass == NO_CLASS_HANDLE)
{
JITDUMP("No unique implementor of interface %p (%s), sorry\n", dspPtr(objClass), objClassName);
return;
}This was introduced in dotnet/coreclr#21270 and never changed afterwards
What my guesses are:
There is no implementation (yet) for getUniqueImplementingClass, so commented out getUniqueImplementingClass(objClass); makes sense. And I guess this stub meant to produce value for uniqueImplementingClass.
What surprised me is the following logic ending with the call to addGuardedDevirtualizationCandidate which will never be reached due to if (uniqueImplementingClass == NO_CLASS_HANDLE).
I found no mention of this in dotnet/coreclr#21270
Github search for getUniqueImplementingClass gives me nothing as well.