diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2018-11-28 06:36:59 +0100 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-11-27 21:36:59 -0800 |
commit | 8aa0869eb9153429091fdba49469d89ec33092cb (patch) | |
tree | 8d9caeb728ba245c9e311cd411e59aab9a21d30f /src/vm/loaderallocator.hpp | |
parent | c7c166e33c807d938367d0364850fe7af1c7b835 (diff) | |
download | coreclr-8aa0869eb9153429091fdba49469d89ec33092cb.tar.gz coreclr-8aa0869eb9153429091fdba49469d89ec33092cb.tar.bz2 coreclr-8aa0869eb9153429091fdba49469d89ec33092cb.zip |
Fix ILStubCache allocation for collectible assemblies (#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).
Diffstat (limited to 'src/vm/loaderallocator.hpp')
-rw-r--r-- | src/vm/loaderallocator.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vm/loaderallocator.hpp b/src/vm/loaderallocator.hpp index c560c14567..0dded91c02 100644 --- a/src/vm/loaderallocator.hpp +++ b/src/vm/loaderallocator.hpp @@ -18,6 +18,7 @@ class FuncPtrStubs; #include "qcall.h" +#include "ilstubcache.h" #define VPTRU_LoaderAllocator 0x3200 @@ -178,6 +179,9 @@ protected: // The cache is keyed by MethodDesc pointers. UMEntryThunkCache * m_pUMEntryThunkCache; + // IL stub cache with fabricated MethodTable parented by a random module in this LoaderAllocator. + ILStubCache m_ILStubCache; + public: BYTE *GetVSDHeapInitialBlock(DWORD *pSize); BYTE *GetCodeHeapInitialBlock(const BYTE * loAddr, const BYTE * hiAddr, DWORD minimumSize, DWORD *pSize); @@ -519,6 +523,17 @@ public: UMEntryThunkCache *GetUMEntryThunkCache(); #endif + + static LoaderAllocator* GetLoaderAllocator(ILStubCache* pILStubCache) + { + return CONTAINING_RECORD(pILStubCache, LoaderAllocator, m_ILStubCache); + } + + ILStubCache* GetILStubCache() + { + LIMITED_METHOD_CONTRACT; + return &m_ILStubCache; + } }; // class LoaderAllocator typedef VPTR(LoaderAllocator) PTR_LoaderAllocator; |