-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
The runtime does not load precompiled R2R code for methods like System.Collections.Concurrent.ConcurrentDictionary<int32,System.__Canon>.TryAddInternal
in case where assembly with entrypoint does not contain in it's manifest metadata a direct mentioning of System.Collections.Concurrent
assembly. In case where the method is used from assembly with entrypoint things work fine.
I have explored this issue on x64
and armel
machines.
All R2R NI assemblies were built using crossgen2
with "-O --compilebubblegenerics --inputbubble"
options.
In my minimal reproducing case the Manifest Metadata of entrypoint assembly contains mentioning of the second assembly, which in turn uses System.Collections.Concurrent
stuff. The second assembly's Manifest Metadata contains mentioning of System.Collections.Concurrent
assembly.
The runtime makes it's final decision to rejit existing method with this code:
runtime/src/coreclr/vm/prestub.cpp
Lines 591 to 597 in 5d2490e
pModule = SystemDomain::System()->DefaultDomain()->GetRootAssembly()->GetManifestModule(); | |
_ASSERT(pModule != NULL); | |
if (pModule->IsReadyToRun() && pModule->IsInSameVersionBubble(GetModule())) | |
{ | |
pCode = pModule->GetReadyToRunInfo()->GetEntryPoint(this, pConfig, TRUE /* fFixups */); | |
} |
IsInSameVersionBubble
returns false
for the ("clear" entrypoint) : (System.Collections.Concurrent)
pair and code goes to rejit when it returns true
for (entrypoint using Concurrent stuff) : (System.Collections.Concurrent)
pair, the runtime takes some valuable pCode and things work fine.
Should we consider such a behavior a bug?