summaryrefslogtreecommitdiff
path: root/src/vm/jithelpers.cpp
diff options
context:
space:
mode:
authorDavid Wrighton <davidwr@microsoft.com>2019-04-24 17:01:31 -0700
committerGitHub <noreply@github.com>2019-04-24 17:01:31 -0700
commit4a2654124ecf38300a717db79926334703abeb70 (patch)
tree3a1ef48777671541574388420eb3411c38795205 /src/vm/jithelpers.cpp
parente9691546d308fde4e56cc821f8c9bfda7e9a8b91 (diff)
downloadcoreclr-4a2654124ecf38300a717db79926334703abeb70.tar.gz
coreclr-4a2654124ecf38300a717db79926334703abeb70.tar.bz2
coreclr-4a2654124ecf38300a717db79926334703abeb70.zip
More multi-appdomain support removal (#23921)
More multi-appdomain support removal - Remove DomainLocalBlock - Remove DomainModule - Remove FindDomain(File/Module/Assembly) - Remove GetDomainModule - Remove variants of GetDomain(File/Assembly) that take AppDomain parameter - Adjust contracts to be less strict - GetDomainFile/Assembly no longer need a complex contract as multi-domain support does not exist - Eliminiate uses of encoded ModuleID
Diffstat (limited to 'src/vm/jithelpers.cpp')
-rw-r--r--src/vm/jithelpers.cpp126
1 files changed, 13 insertions, 113 deletions
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp
index 7d0b5a0b3c..11d07e6296 100644
--- a/src/vm/jithelpers.cpp
+++ b/src/vm/jithelpers.cpp
@@ -1337,20 +1337,10 @@ HCIMPLEND
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedNonGCStaticBase_Portable, SIZE_T moduleDomainID, DWORD dwClassDomainID)
+HCIMPL2(void*, JIT_GetSharedNonGCStaticBase_Portable, DomainLocalModule *pLocalModule, DWORD dwClassDomainID)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule = NULL;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
// If type doesn't have a class constructor, the contents of this if statement may
// still get executed. JIT_GetSharedNonGCStaticBaseNoCtor should be used in this case.
if (pLocalModule->IsPrecomputedClassInitialized(dwClassDomainID))
@@ -1366,38 +1356,18 @@ HCIMPLEND
// No constructor version of JIT_GetSharedNonGCStaticBase. Does not check if class has
// been initialized.
-HCIMPL1(void*, JIT_GetSharedNonGCStaticBaseNoCtor_Portable, SIZE_T moduleDomainID)
+HCIMPL1(void*, JIT_GetSharedNonGCStaticBaseNoCtor_Portable, DomainLocalModule *pLocalModule)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule = NULL;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
return (void*)pLocalModule->GetPrecomputedNonGCStaticsBasePointer();
}
HCIMPLEND
-HCIMPL2(void*, JIT_GetSharedGCStaticBase_Portable, SIZE_T moduleDomainID, DWORD dwClassDomainID)
+HCIMPL2(void*, JIT_GetSharedGCStaticBase_Portable, DomainLocalModule *pLocalModule, DWORD dwClassDomainID)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule = NULL;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
// If type doesn't have a class constructor, the contents of this if statement may
// still get executed. JIT_GetSharedGCStaticBaseNoCtor should be used in this case.
if (pLocalModule->IsPrecomputedClassInitialized(dwClassDomainID))
@@ -1413,20 +1383,10 @@ HCIMPLEND
// No constructor version of JIT_GetSharedGCStaticBase. Does not check if class has been
// initialized.
-HCIMPL1(void*, JIT_GetSharedGCStaticBaseNoCtor_Portable, SIZE_T moduleDomainID)
+HCIMPL1(void*, JIT_GetSharedGCStaticBaseNoCtor_Portable, DomainLocalModule *pLocalModule)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule = NULL;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
return (void*)pLocalModule->GetPrecomputedGCStaticsBasePointer();
}
HCIMPLEND
@@ -1494,20 +1454,10 @@ HCIMPLEND
/*************************************************************/
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedNonGCStaticBaseDynamicClass, SIZE_T moduleDomainID, DWORD dwDynamicClassDomainID)
+HCIMPL2(void*, JIT_GetSharedNonGCStaticBaseDynamicClass, DomainLocalModule *pLocalModule, DWORD dwDynamicClassDomainID)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
DomainLocalModule::PTR_DynamicClassInfo pLocalInfo = pLocalModule->GetDynamicClassInfoIfInitialized(dwDynamicClassDomainID);
if (pLocalInfo != NULL)
{
@@ -1546,20 +1496,10 @@ HCIMPL2(void, JIT_ClassInitDynamicClass_Helper, DomainLocalModule *pLocalModule,
HCIMPLEND
#include <optsmallperfcritical.h>
-HCIMPL2(void, JIT_ClassInitDynamicClass, SIZE_T moduleDomainID, DWORD dwDynamicClassDomainID)
+HCIMPL2(void, JIT_ClassInitDynamicClass, DomainLocalModule *pLocalModule, DWORD dwDynamicClassDomainID)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
DomainLocalModule::PTR_DynamicClassInfo pLocalInfo = pLocalModule->GetDynamicClassInfoIfInitialized(dwDynamicClassDomainID);
if (pLocalInfo != NULL)
{
@@ -1597,20 +1537,10 @@ HCIMPLEND
/*************************************************************/
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedGCStaticBaseDynamicClass, SIZE_T moduleDomainID, DWORD dwDynamicClassDomainID)
+HCIMPL2(void*, JIT_GetSharedGCStaticBaseDynamicClass, DomainLocalModule *pLocalModule, DWORD dwDynamicClassDomainID)
{
FCALL_CONTRACT;
- DomainLocalModule *pLocalModule;
-
- if (!Module::IsEncodedModuleIndex(moduleDomainID))
- pLocalModule = (DomainLocalModule *) moduleDomainID;
- else
- {
- DomainLocalBlock *pLocalBlock = GetAppDomain()->GetDomainLocalBlock();
- pLocalModule = pLocalBlock->GetModuleSlot(Module::IDToIndex(moduleDomainID));
- }
-
DomainLocalModule::PTR_DynamicClassInfo pLocalInfo = pLocalModule->GetDynamicClassInfoIfInitialized(dwDynamicClassDomainID);
if (pLocalInfo != NULL)
{
@@ -1845,15 +1775,12 @@ HCIMPLEND
// possible.
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedNonGCThreadStaticBase, SIZE_T moduleDomainID, DWORD dwClassDomainID)
+HCIMPL2(void*, JIT_GetSharedNonGCThreadStaticBase, DomainLocalModule *pDomainLocalModule, DWORD dwClassDomainID)
{
FCALL_CONTRACT;
// Get the ModuleIndex
- ModuleIndex index =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- Module::IDToIndex(moduleDomainID) :
- ((DomainLocalModule *)moduleDomainID)->GetModuleIndex();
+ ModuleIndex index = pDomainLocalModule->GetModuleIndex();
// Get the relevant ThreadLocalModule
ThreadLocalModule * pThreadLocalModule = ThreadStatics::GetTLMIfExists(index);
@@ -1866,12 +1793,6 @@ HCIMPL2(void*, JIT_GetSharedNonGCThreadStaticBase, SIZE_T moduleDomainID, DWORD
// If the TLM was not allocated or if the class was not marked as initialized
// then we have to go through the slow path
- // Get the DomainLocalModule
- DomainLocalModule *pDomainLocalModule =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- GetAppDomain()->GetDomainLocalBlock()->GetModuleSlot(Module::IDToIndex(moduleDomainID)) :
- (DomainLocalModule *) moduleDomainID;
-
// Obtain the MethodTable
MethodTable * pMT = pDomainLocalModule->GetMethodTableFromClassDomainID(dwClassDomainID);
_ASSERTE(!pMT->HasGenericsStaticsInfo());
@@ -1889,15 +1810,12 @@ HCIMPLEND
// possible.
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedGCThreadStaticBase, SIZE_T moduleDomainID, DWORD dwClassDomainID)
+HCIMPL2(void*, JIT_GetSharedGCThreadStaticBase, DomainLocalModule *pDomainLocalModule, DWORD dwClassDomainID)
{
FCALL_CONTRACT;
// Get the ModuleIndex
- ModuleIndex index =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- Module::IDToIndex(moduleDomainID) :
- ((DomainLocalModule *)moduleDomainID)->GetModuleIndex();
+ ModuleIndex index = pDomainLocalModule->GetModuleIndex();
// Get the relevant ThreadLocalModule
ThreadLocalModule * pThreadLocalModule = ThreadStatics::GetTLMIfExists(index);
@@ -1910,12 +1828,6 @@ HCIMPL2(void*, JIT_GetSharedGCThreadStaticBase, SIZE_T moduleDomainID, DWORD dwC
// If the TLM was not allocated or if the class was not marked as initialized
// then we have to go through the slow path
- // Get the DomainLocalModule
- DomainLocalModule *pDomainLocalModule =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- GetAppDomain()->GetDomainLocalBlock()->GetModuleSlot(Module::IDToIndex(moduleDomainID)) :
- (DomainLocalModule *) moduleDomainID;
-
// Obtain the MethodTable
MethodTable * pMT = pDomainLocalModule->GetMethodTableFromClassDomainID(dwClassDomainID);
_ASSERTE(!pMT->HasGenericsStaticsInfo());
@@ -1929,16 +1841,10 @@ HCIMPLEND
// *** This helper corresponds to CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedNonGCThreadStaticBaseDynamicClass, SIZE_T moduleDomainID, DWORD dwDynamicClassDomainID)
+HCIMPL2(void*, JIT_GetSharedNonGCThreadStaticBaseDynamicClass, DomainLocalModule *pDomainLocalModule, DWORD dwDynamicClassDomainID)
{
FCALL_CONTRACT;
- // Obtain the DomainLocalModule
- DomainLocalModule *pDomainLocalModule =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- GetAppDomain()->GetDomainLocalBlock()->GetModuleSlot(Module::IDToIndex(moduleDomainID)) :
- (DomainLocalModule *)moduleDomainID;
-
// Get the ModuleIndex
ModuleIndex index = pDomainLocalModule->GetModuleIndex();
@@ -1983,16 +1889,10 @@ HCIMPLEND
// *** This helper corresponds to CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_DYNAMICCLASS
#include <optsmallperfcritical.h>
-HCIMPL2(void*, JIT_GetSharedGCThreadStaticBaseDynamicClass, SIZE_T moduleDomainID, DWORD dwDynamicClassDomainID)
+HCIMPL2(void*, JIT_GetSharedGCThreadStaticBaseDynamicClass, DomainLocalModule *pDomainLocalModule, DWORD dwDynamicClassDomainID)
{
FCALL_CONTRACT;
- // Obtain the DomainLocalModule
- DomainLocalModule *pDomainLocalModule =
- (Module::IsEncodedModuleIndex(moduleDomainID)) ?
- GetAppDomain()->GetDomainLocalBlock()->GetModuleSlot(Module::IDToIndex(moduleDomainID)) :
- (DomainLocalModule *)moduleDomainID;
-
// Get the ModuleIndex
ModuleIndex index = pDomainLocalModule->GetModuleIndex();