Only register composite R2R native image code range once (#65623)
authorTomáš Rylek <trylek@microsoft.com>
Fri, 4 Mar 2022 10:51:57 +0000 (11:51 +0100)
committerGitHub <noreply@github.com>
Fri, 4 Mar 2022 10:51:57 +0000 (11:51 +0100)
commit4e9ff76d3bc5cd04e2413105f867239b3e694b37
tree40cb63d1706686cb16e5d7508688c1faeb1174ad
parentaaa2388d8e27bee8f19c37473a862cffa1f8aea4
Only register composite R2R native image code range once (#65623)

As David Wrighton noticed during an independent investigation,
today CoreCLR runtime logic ends up registering composite image
code range with the execution manager the number of times equal
to the number of component modules of the composite image
accessed at runtime, i.e. ultimately up to over 200 times in case
of the composite framework. This change fixes that by slightly
shuffling the initialization housekeeping chores.

Thanks

Tomas

Fixes: https://github.com/dotnet/runtime/issues/65481
src/coreclr/inc/CrstTypes.def
src/coreclr/inc/crsttypes.h
src/coreclr/vm/ceeload.cpp
src/coreclr/vm/domainassembly.cpp