Fix ILStubCache allocation for collectible assemblies (dotnet/coreclr#21188)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 28 Nov 2018 05:36:59 +0000 (06:36 +0100)
committerJan Kotas <jkotas@microsoft.com>
Wed, 28 Nov 2018 05:36:59 +0000 (21:36 -0800)
commit5ed818e4301b0bf0a4cbcdffa12e7005dbdaca42
tree9eee7da06f85af0cea7da821e092eb18b1b78b47
parent90b675c38cb6d92e354f5134da48a64b8a2e6941
Fix ILStubCache allocation for collectible assemblies (dotnet/coreclr#21188)

The ILStubCache was being allocated per domain unless the domain was a
compilation AppDomain. This is wrong for collectible assemblies, since
after an assembly is collected, the cache keeps stale entries referring
to already deleted MethodTables.
The fix is to make ILStubChange per LoaderAllocator instead (and keep
the per module instances for compilation AppDomain).

Commit migrated from https://github.com/dotnet/coreclr/commit/8aa0869eb9153429091fdba49469d89ec33092cb
src/coreclr/src/vm/appdomain.cpp
src/coreclr/src/vm/appdomain.hpp
src/coreclr/src/vm/ceeload.cpp
src/coreclr/src/vm/ilstubcache.cpp
src/coreclr/src/vm/loaderallocator.cpp
src/coreclr/src/vm/loaderallocator.hpp