summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorSteve MacLean <stmaclea@microsoft.com>2018-12-03 12:49:31 -0500
committerGitHub <noreply@github.com>2018-12-03 12:49:31 -0500
commit411f9787617f6bdc64c8393a51ac3b7a0d6e35f4 (patch)
tree618cf332ea7a4daf5feb802b4672a19bdd84a16b /src/vm
parentf54494af07aec0d927962846eb4394c118a2fef8 (diff)
downloadcoreclr-411f9787617f6bdc64c8393a51ac3b7a0d6e35f4.tar.gz
coreclr-411f9787617f6bdc64c8393a51ac3b7a0d6e35f4.tar.bz2
coreclr-411f9787617f6bdc64c8393a51ac3b7a0d6e35f4.zip
Remove IsNeutralDomain() (#21318)
* Remove IsNeutralDomain() * PR feedback
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/appdomain.cpp7
-rw-r--r--src/vm/assembly.cpp23
-rw-r--r--src/vm/assembly.hpp2
-rw-r--r--src/vm/assemblynative.cpp2
-rw-r--r--src/vm/ceeload.cpp53
-rw-r--r--src/vm/ceeload.inl2
-rw-r--r--src/vm/clsload.cpp52
-rw-r--r--src/vm/comdynamic.cpp3
-rw-r--r--src/vm/custommarshalerinfo.cpp8
-rw-r--r--src/vm/custommarshalerinfo.h10
-rw-r--r--src/vm/domainfile.cpp6
-rw-r--r--src/vm/encee.cpp2
-rw-r--r--src/vm/eventtrace.cpp12
-rw-r--r--src/vm/generics.cpp1
-rw-r--r--src/vm/jitinterface.cpp9
-rw-r--r--src/vm/loaderallocator.cpp6
-rw-r--r--src/vm/loaderallocator.hpp1
-rw-r--r--src/vm/method.hpp2
-rw-r--r--src/vm/methodtable.cpp15
-rw-r--r--src/vm/methodtable.h3
-rw-r--r--src/vm/mlinfo.cpp37
-rw-r--r--src/vm/object.cpp37
-rw-r--r--src/vm/object.inl5
-rw-r--r--src/vm/profilingenumerators.cpp6
-rw-r--r--src/vm/reflectioninvocation.cpp4
-rw-r--r--src/vm/syncblk.cpp13
-rw-r--r--src/vm/threads.cpp7
-rw-r--r--src/vm/threads.h18
-rw-r--r--src/vm/typedesc.h1
-rw-r--r--src/vm/typehandle.h2
-rw-r--r--src/vm/typeparse.cpp2
31 files changed, 79 insertions, 272 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 1f978256fa..509b4849bf 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -1001,7 +1001,7 @@ void AppDomain::DeleteNativeCodeRanges()
while (i.Next(pDomainAssembly.This()))
{
Assembly * assembly = pDomainAssembly->m_pAssembly;
- if ((assembly != NULL) && !assembly->IsDomainNeutral())
+ if ((assembly != NULL))
assembly->DeleteNativeCodeRanges();
}
}
@@ -1036,7 +1036,7 @@ void AppDomain::ShutdownAssemblies()
// loaded to at least the FILE_LOAD_ALLOCATE level. Since domain shutdown can take place
// asynchronously this property cannot be guaranteed. Access the m_pAssembly field directly instead.
Assembly * assembly = pDomainAssembly->m_pAssembly;
- if (assembly && !assembly->IsDomainNeutral())
+ if (assembly)
assembly->Terminate();
}
@@ -1178,8 +1178,7 @@ void AppDomain::ReleaseFiles()
}
else
{
- if (!pAsm->GetCurrentAssembly()->IsDomainNeutral())
- pAsm->ReleaseFiles();
+ pAsm->ReleaseFiles();
}
}
} // AppDomain::ReleaseFiles
diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp
index d263e37f62..ecba83456d 100644
--- a/src/vm/assembly.cpp
+++ b/src/vm/assembly.cpp
@@ -154,26 +154,17 @@ void Assembly::Init(AllocMemTracker *pamTracker, LoaderAllocator *pLoaderAllocat
}
else
{
- if (!IsDomainNeutral())
+ if (!IsCollectible())
{
- if (!IsCollectible())
- {
- // pLoaderAllocator will only be non-null for reflection emit assemblies
- _ASSERTE((pLoaderAllocator == NULL) || (pLoaderAllocator == GetDomain()->AsAppDomain()->GetLoaderAllocator()));
- m_pLoaderAllocator = GetDomain()->AsAppDomain()->GetLoaderAllocator();
- }
- else
- {
- _ASSERTE(pLoaderAllocator != NULL); // ppLoaderAllocator must be non-null for collectible assemblies
-
- m_pLoaderAllocator = pLoaderAllocator;
- }
+ // pLoaderAllocator will only be non-null for reflection emit assemblies
+ _ASSERTE((pLoaderAllocator == NULL) || (pLoaderAllocator == GetDomain()->AsAppDomain()->GetLoaderAllocator()));
+ m_pLoaderAllocator = GetDomain()->AsAppDomain()->GetLoaderAllocator();
}
else
{
- _ASSERTE(pLoaderAllocator == NULL); // pLoaderAllocator may only be non-null for collectible types
- // use global loader heaps
- m_pLoaderAllocator = SystemDomain::GetGlobalLoaderAllocator();
+ _ASSERTE(pLoaderAllocator != NULL); // ppLoaderAllocator must be non-null for collectible assemblies
+
+ m_pLoaderAllocator = pLoaderAllocator;
}
}
_ASSERTE(m_pLoaderAllocator != NULL);
diff --git a/src/vm/assembly.hpp b/src/vm/assembly.hpp
index 83d7ee698d..24f2547bde 100644
--- a/src/vm/assembly.hpp
+++ b/src/vm/assembly.hpp
@@ -448,8 +448,6 @@ public:
OBJECTHANDLE GetLoaderAllocatorObjectHandle() { WRAPPER_NO_CONTRACT; return GetLoaderAllocator()->GetLoaderAllocatorObjectHandle(); }
#endif // FEATURE_COLLECTIBLE_TYPES
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
-
BOOL IsSIMDVectorAssembly() { LIMITED_METHOD_DAC_CONTRACT; return m_fIsSIMDVectorAssembly; }
#ifdef FEATURE_PREJIT
diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp
index b89351f36a..1672240b79 100644
--- a/src/vm/assemblynative.cpp
+++ b/src/vm/assemblynative.cpp
@@ -91,7 +91,7 @@ FCIMPL7(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF
// Shared or collectible assemblies should not be used for the parent in the
// late-bound case.
- if (pRefAssembly && (!pRefAssembly->IsDomainNeutral()) && (!pRefAssembly->IsCollectible()))
+ if (pRefAssembly && (!pRefAssembly->IsCollectible()))
{
pParentAssembly= pRefAssembly->GetDomainAssembly();
}
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp
index eb54b95a4e..058f4a4017 100644
--- a/src/vm/ceeload.cpp
+++ b/src/vm/ceeload.cpp
@@ -1098,9 +1098,6 @@ void Module::SetDebuggerInfoBits(DebuggerAssemblyControlFlags newBits)
#ifdef DEBUGGING_SUPPORTED
BOOL setEnC = ((newBits & DACF_ENC_ENABLED) != 0) && IsEditAndContinueCapable();
- // IsEditAndContinueCapable should already check !GetAssembly()->IsDomainNeutral
- _ASSERTE(!setEnC || !GetAssembly()->IsDomainNeutral());
-
// The only way can change Enc is through debugger override.
if (setEnC)
{
@@ -1165,9 +1162,6 @@ Module *Module::Create(Assembly *pAssembly, mdFile moduleRef, PEFile *file, Allo
#ifdef EnC_SUPPORTED
if (IsEditAndContinueCapable(pAssembly, file))
{
- // IsEditAndContinueCapable should already check !pAssembly->IsDomainNeutral
- _ASSERTE(!pAssembly->IsDomainNeutral());
-
// if file is EnCCapable, always create an EnC-module, but EnC won't necessarily be enabled.
// Debugger enables this by calling SetJITCompilerFlags on LoadModule callback.
@@ -1830,7 +1824,6 @@ BOOL Module::IsEditAndContinueCapable(Assembly *pAssembly, PEFile *file)
// Some modules are never EnC-capable
return ! (pAssembly->GetDebuggerInfoBits() & DACF_ALLOW_JIT_OPTS ||
- pAssembly->IsDomainNeutral() ||
file->IsSystem() ||
file->IsResource() ||
file->HasNativeImage() ||
@@ -2877,39 +2870,32 @@ void Module::FreeModuleIndex()
MODE_ANY;
}
CONTRACTL_END;
- if (GetAssembly()->IsDomainNeutral())
- {
- // We do not recycle ModuleIndexes used by domain neutral Modules.
- }
- else
+ if (m_ModuleID != NULL)
{
- if (m_ModuleID != NULL)
- {
- // Module's m_ModuleID should not contain the ID, it should
- // contain a pointer to the DLM
- _ASSERTE(!Module::IsEncodedModuleIndex((SIZE_T)m_ModuleID));
- _ASSERTE(m_ModuleIndex == m_ModuleID->GetModuleIndex());
+ // Module's m_ModuleID should not contain the ID, it should
+ // contain a pointer to the DLM
+ _ASSERTE(!Module::IsEncodedModuleIndex((SIZE_T)m_ModuleID));
+ _ASSERTE(m_ModuleIndex == m_ModuleID->GetModuleIndex());
#ifndef CROSSGEN_COMPILE
- if (IsCollectible())
+ if (IsCollectible())
+ {
+ ThreadStoreLockHolder tsLock;
+ Thread *pThread = NULL;
+ while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL)
{
- ThreadStoreLockHolder tsLock;
- Thread *pThread = NULL;
- while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL)
- {
- pThread->DeleteThreadStaticData(m_ModuleIndex);
- }
+ pThread->DeleteThreadStaticData(m_ModuleIndex);
}
+ }
#endif // CROSSGEN_COMPILE
- // Get the ModuleIndex from the DLM and free it
- Module::FreeModuleIndex(m_ModuleIndex);
- }
- else
- {
- // This was an empty, short-lived Module object that
- // was never assigned a ModuleIndex...
- }
+ // Get the ModuleIndex from the DLM and free it
+ Module::FreeModuleIndex(m_ModuleIndex);
+ }
+ else
+ {
+ // This was an empty, short-lived Module object that
+ // was never assigned a ModuleIndex...
}
}
@@ -4698,7 +4684,6 @@ void Module::AddActiveDependency(Module *pModule, BOOL unconditional)
PRECONDITION(CheckPointer(pModule));
PRECONDITION(pModule != this);
PRECONDITION(!IsSystem());
- PRECONDITION(!GetAssembly()->IsDomainNeutral() || pModule->GetAssembly()->IsDomainNeutral() || GetAppDomain()->IsDefaultDomain());
// Postcondition about activation
}
CONTRACT_END;
diff --git a/src/vm/ceeload.inl b/src/vm/ceeload.inl
index c961c1fdc7..07d657bcaa 100644
--- a/src/vm/ceeload.inl
+++ b/src/vm/ceeload.inl
@@ -469,7 +469,7 @@ inline BOOL Module::IsEditAndContinueCapable()
// for now, Module::IsReflection is equivalent to m_file->IsDynamic,
// which is checked by IsEditAndContinueCapable(m_pAssembly, m_file)
- _ASSERTE(!isEnCCapable || (!this->IsReflection() && !GetAssembly()->IsDomainNeutral()));
+ _ASSERTE(!isEnCCapable || (!this->IsReflection()));
return isEnCCapable;
}
diff --git a/src/vm/clsload.cpp b/src/vm/clsload.cpp
index 91b9dd5092..90fb070518 100644
--- a/src/vm/clsload.cpp
+++ b/src/vm/clsload.cpp
@@ -110,23 +110,13 @@ PTR_Module ClassLoader::ComputeLoaderModuleWorker(
#endif // FEATURE_PREJIT
#endif // #ifndef DACCESS_COMPILE
- Module *pFirstNonSharedLoaderModule = NULL;
- Module *pFirstNonSystemSharedModule = NULL;
Module *pLoaderModule = NULL;
if (pDefinitionModule)
{
if (pDefinitionModule->IsCollectible())
goto ComputeCollectibleLoaderModule;
- if (!pDefinitionModule->GetAssembly()->IsDomainNeutral())
- {
- pFirstNonSharedLoaderModule = pDefinitionModule;
- }
- else
- if (!pDefinitionModule->IsSystem())
- {
- pFirstNonSystemSharedModule = pDefinitionModule;
- }
+ pLoaderModule = pDefinitionModule;
}
for (DWORD i = 0; i < classInst.GetNumArgs(); i++)
@@ -136,17 +126,8 @@ PTR_Module ClassLoader::ComputeLoaderModuleWorker(
Module* pModule = classArg.GetLoaderModule();
if (pModule->IsCollectible())
goto ComputeCollectibleLoaderModule;
- if (!pModule->GetAssembly()->IsDomainNeutral())
- {
- if (pFirstNonSharedLoaderModule == NULL)
- pFirstNonSharedLoaderModule = pModule;
- }
- else
- if (!pModule->IsSystem())
- {
- if (pFirstNonSystemSharedModule == NULL)
- pFirstNonSystemSharedModule = pModule;
- }
+ if (pLoaderModule == NULL)
+ pLoaderModule = pModule;
}
for (DWORD i = 0; i < methodInst.GetNumArgs(); i++)
@@ -156,32 +137,11 @@ PTR_Module ClassLoader::ComputeLoaderModuleWorker(
Module *pModule = methodArg.GetLoaderModule();
if (pModule->IsCollectible())
goto ComputeCollectibleLoaderModule;
- if (!pModule->GetAssembly()->IsDomainNeutral())
- {
- if (pFirstNonSharedLoaderModule == NULL)
- pFirstNonSharedLoaderModule = pModule;
- }
- else
- if (!pModule->IsSystem())
- {
- if (pFirstNonSystemSharedModule == NULL)
- pFirstNonSystemSharedModule = pModule;
- }
+ if (pLoaderModule == NULL)
+ pLoaderModule = pModule;
}
- // RULE: Prefer modules in non-shared assemblies.
- // This ensures safety of app-domain unloading.
- if (pFirstNonSharedLoaderModule != NULL)
- {
- pLoaderModule = pFirstNonSharedLoaderModule;
- }
- else if (pFirstNonSystemSharedModule != NULL)
- {
- // Use pFirstNonSystemSharedModule just so C<object> ends up in module C - it
- // shouldn't actually matter at all though.
- pLoaderModule = pFirstNonSystemSharedModule;
- }
- else
+ if (pLoaderModule == NULL)
{
CONSISTENCY_CHECK(MscorlibBinder::GetModule() && MscorlibBinder::GetModule()->IsSystem());
diff --git a/src/vm/comdynamic.cpp b/src/vm/comdynamic.cpp
index 432555917e..a8e8b5fa4a 100644
--- a/src/vm/comdynamic.cpp
+++ b/src/vm/comdynamic.cpp
@@ -897,9 +897,6 @@ void QCALLTYPE COMDynamicWrite::DefineCustomAttribute(QCall::ModuleHandle pModul
Assembly* pAssembly = pModule->GetAssembly();
DomainAssembly* pDomainAssembly = pAssembly->GetDomainAssembly();
- // Dynamic assemblies should be 1:1 with DomainAssemblies.
- _ASSERTE(!pAssembly->IsDomainNeutral());
-
DWORD actualFlags;
actualFlags = ((DWORD)pDomainAssembly->GetDebuggerInfoBits() & mask) | flags;
pDomainAssembly->SetDebuggerInfoBits((DebuggerAssemblyControlFlags)actualFlags);
diff --git a/src/vm/custommarshalerinfo.cpp b/src/vm/custommarshalerinfo.cpp
index 7201e106b8..98484876cc 100644
--- a/src/vm/custommarshalerinfo.cpp
+++ b/src/vm/custommarshalerinfo.cpp
@@ -383,7 +383,6 @@ EEHashEntry_t * EECMHelperHashtableHelper::AllocateEntry(EECMHelperHashtableKey
pEntryKey->m_Instantiation = Instantiation(
(TypeHandle *) (pEntryKey->m_strCookie + pEntryKey->m_cCookieStrBytes),
pKey->GetMarshalerInstantiation().GetNumArgs());
- pEntryKey->m_bSharedHelper = pKey->IsSharedHelper();
memcpy((void*)pEntryKey->m_strMarshalerTypeName, pKey->GetMarshalerTypeName(), pKey->GetMarshalerTypeNameByteCount());
memcpy((void*)pEntryKey->m_strCookie, pKey->GetCookieString(), pKey->GetCookieStringByteCount());
memcpy((void*)pEntryKey->m_Instantiation.GetRawArgs(), pKey->GetMarshalerInstantiation().GetRawArgs(),
@@ -402,7 +401,6 @@ EEHashEntry_t * EECMHelperHashtableHelper::AllocateEntry(EECMHelperHashtableKey
pEntryKey->m_cCookieStrBytes = pKey->GetCookieStringByteCount();
pEntryKey->m_strCookie = pKey->GetCookieString();
pEntryKey->m_Instantiation = Instantiation(pKey->GetMarshalerInstantiation());
- pEntryKey->m_bSharedHelper = pKey->IsSharedHelper();
}
return pEntry;
@@ -438,9 +436,6 @@ BOOL EECMHelperHashtableHelper::CompareKeys(EEHashEntry_t *pEntry, EECMHelperHas
EECMHelperHashtableKey *pEntryKey = (EECMHelperHashtableKey *) pEntry->Key;
- if (pEntryKey->IsSharedHelper() != pKey->IsSharedHelper())
- return FALSE;
-
if (pEntryKey->GetMarshalerTypeNameByteCount() != pKey->GetMarshalerTypeNameByteCount())
return FALSE;
@@ -474,8 +469,7 @@ DWORD EECMHelperHashtableHelper::Hash(EECMHelperHashtableKey *pKey)
return (DWORD)
(HashBytes((const BYTE *) pKey->GetMarshalerTypeName(), pKey->GetMarshalerTypeNameByteCount()) +
HashBytes((const BYTE *) pKey->GetCookieString(), pKey->GetCookieStringByteCount()) +
- HashBytes((const BYTE *) pKey->GetMarshalerInstantiation().GetRawArgs(), pKey->GetMarshalerInstantiation().GetNumArgs() * sizeof(LPVOID)) +
- (pKey->IsSharedHelper() ? 1 : 0));
+ HashBytes((const BYTE *) pKey->GetMarshalerInstantiation().GetRawArgs(), pKey->GetMarshalerInstantiation().GetNumArgs() * sizeof(LPVOID)));
}
diff --git a/src/vm/custommarshalerinfo.h b/src/vm/custommarshalerinfo.h
index 01af33cc0e..aecedf4201 100644
--- a/src/vm/custommarshalerinfo.h
+++ b/src/vm/custommarshalerinfo.h
@@ -118,13 +118,12 @@ typedef SList<CustomMarshalerInfo, true> CMINFOLIST;
class EECMHelperHashtableKey
{
public:
- EECMHelperHashtableKey(DWORD cMarshalerTypeNameBytes, LPCSTR strMarshalerTypeName, DWORD cCookieStrBytes, LPCSTR strCookie, Instantiation instantiation, BOOL bSharedHelper)
+ EECMHelperHashtableKey(DWORD cMarshalerTypeNameBytes, LPCSTR strMarshalerTypeName, DWORD cCookieStrBytes, LPCSTR strCookie, Instantiation instantiation)
: m_cMarshalerTypeNameBytes(cMarshalerTypeNameBytes)
, m_strMarshalerTypeName(strMarshalerTypeName)
, m_cCookieStrBytes(cCookieStrBytes)
, m_strCookie(strCookie)
, m_Instantiation(instantiation)
- , m_bSharedHelper(bSharedHelper)
{
LIMITED_METHOD_CONTRACT;
}
@@ -154,19 +153,12 @@ public:
LIMITED_METHOD_CONTRACT;
return m_Instantiation;
}
- inline BOOL IsSharedHelper() const
- {
- LIMITED_METHOD_CONTRACT;
- return m_bSharedHelper;
- }
-
DWORD m_cMarshalerTypeNameBytes;
LPCSTR m_strMarshalerTypeName;
DWORD m_cCookieStrBytes;
LPCSTR m_strCookie;
Instantiation m_Instantiation;
- BOOL m_bSharedHelper;
};
diff --git a/src/vm/domainfile.cpp b/src/vm/domainfile.cpp
index 664d10e690..19adf33ce1 100644
--- a/src/vm/domainfile.cpp
+++ b/src/vm/domainfile.cpp
@@ -274,8 +274,7 @@ void DomainFile::SetError(Exception *ex)
SetProfilerNotified();
#ifdef PROFILING_SUPPORTED
- if (GetCurrentModule() != NULL
- && !GetCurrentModule()->GetAssembly()->IsDomainNeutral())
+ if (GetCurrentModule() != NULL)
{
// Only send errors for non-shared assemblies; other assemblies might be successfully completed
// in another app domain later.
@@ -1314,7 +1313,7 @@ DomainAssembly::~DomainAssembly()
delete i.GetDomainFile();
}
- if (m_pAssembly != NULL && !m_pAssembly->IsDomainNeutral())
+ if (m_pAssembly != NULL)
{
delete m_pAssembly;
}
@@ -1605,7 +1604,6 @@ void DomainAssembly::FindNativeImage()
}
#endif // FEATURE_PREJIT
-// This is where the decision whether an assembly is DomainNeutral (shared) nor not is made.
void DomainAssembly::Allocate()
{
CONTRACTL
diff --git a/src/vm/encee.cpp b/src/vm/encee.cpp
index 2c484c624e..86d9736e65 100644
--- a/src/vm/encee.cpp
+++ b/src/vm/encee.cpp
@@ -1088,7 +1088,6 @@ EnCAddedField *EnCAddedField::Allocate(OBJECTREF thisPointer, EnCFieldDesc *pFD)
EnCAddedField *pEntry = new EnCAddedField;
pEntry->m_pFieldDesc = pFD;
- _ASSERTE(!pFD->GetApproxEnclosingMethodTable()->IsDomainNeutral());
AppDomain *pDomain = (AppDomain*) pFD->GetApproxEnclosingMethodTable()->GetDomain();
// We need to associate the contents of the new field with the object it is attached to
@@ -1398,7 +1397,6 @@ EnCAddedStaticField *EnCAddedStaticField::Allocate(EnCFieldDesc *pFD)
}
CONTRACTL_END;
- _ASSERTE(!pFD->GetEnclosingMethodTable()->IsDomainNeutral());
AppDomain *pDomain = (AppDomain*) pFD->GetApproxEnclosingMethodTable()->GetDomain();
// Compute the size of the fieldData entry
diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp
index 7a45cb17fb..7b3c6aedcf 100644
--- a/src/vm/eventtrace.cpp
+++ b/src/vm/eventtrace.cpp
@@ -5720,15 +5720,13 @@ VOID ETW::LoaderLog::SendAssemblyEvent(Assembly *pAssembly, DWORD dwEventOptions
PCWSTR szDtraceOutput1=W("");
BOOL bIsDynamicAssembly = pAssembly->IsDynamic();
BOOL bIsCollectibleAssembly = pAssembly->IsCollectible();
- BOOL bIsDomainNeutral = pAssembly->IsDomainNeutral() ;
BOOL bHasNativeImage = pAssembly->GetManifestFile()->HasNativeImage();
BOOL bIsReadyToRun = pAssembly->GetManifestFile()->IsILImageReadyToRun();
ULONGLONG ullAssemblyId = (ULONGLONG)pAssembly;
ULONGLONG ullDomainId = (ULONGLONG)pAssembly->GetDomain();
ULONGLONG ullBindingID = 0;
- ULONG ulAssemblyFlags = ((bIsDomainNeutral ? ETW::LoaderLog::LoaderStructs::DomainNeutralAssembly : 0) |
- (bIsDynamicAssembly ? ETW::LoaderLog::LoaderStructs::DynamicAssembly : 0) |
+ ULONG ulAssemblyFlags = ((bIsDynamicAssembly ? ETW::LoaderLog::LoaderStructs::DynamicAssembly : 0) |
(bHasNativeImage ? ETW::LoaderLog::LoaderStructs::NativeAssembly : 0) |
(bIsCollectibleAssembly ? ETW::LoaderLog::LoaderStructs::CollectibleAssembly : 0) |
(bIsReadyToRun ? ETW::LoaderLog::LoaderStructs::ReadyToRunAssembly : 0));
@@ -6042,7 +6040,6 @@ VOID ETW::LoaderLog::SendModuleEvent(Module *pModule, DWORD dwEventOptions, BOOL
ULONGLONG ullAppDomainId = 0; // This is used only with DomainModule events
ULONGLONG ullModuleId = (ULONGLONG)(TADDR) pModule;
ULONGLONG ullAssemblyId = (ULONGLONG)pModule->GetAssembly();
- BOOL bIsDomainNeutral = pModule->GetAssembly()->IsDomainNeutral();
BOOL bIsIbcOptimized = FALSE;
if(bHasNativeImage)
{
@@ -6050,8 +6047,7 @@ VOID ETW::LoaderLog::SendModuleEvent(Module *pModule, DWORD dwEventOptions, BOOL
}
BOOL bIsReadyToRun = pModule->IsReadyToRun();
ULONG ulReservedFlags = 0;
- ULONG ulFlags = ((bIsDomainNeutral ? ETW::LoaderLog::LoaderStructs::DomainNeutralModule : 0) |
- (bHasNativeImage ? ETW::LoaderLog::LoaderStructs::NativeModule : 0) |
+ ULONG ulFlags = ((bHasNativeImage ? ETW::LoaderLog::LoaderStructs::NativeModule : 0) |
(bIsDynamicAssembly ? ETW::LoaderLog::LoaderStructs::DynamicModule : 0) |
(bIsManifestModule ? ETW::LoaderLog::LoaderStructs::ManifestModule : 0) |
(bIsIbcOptimized ? ETW::LoaderLog::LoaderStructs::IbcOptimized : 0) |
@@ -7042,9 +7038,6 @@ VOID ETW::EnumerationLog::IterateDomain(BaseDomain *pDomain, DWORD enumerationOp
while (assemblyIterator.Next(pDomainAssembly.This()))
{
CollectibleAssemblyHolder<Assembly *> pAssembly = pDomainAssembly->GetLoadedAssembly();
- BOOL bIsDomainNeutral = pAssembly->IsDomainNeutral();
- if (bIsDomainNeutral)
- continue;
if (enumerationOptions & ETW::EnumerationLog::EnumerationStructs::DomainAssemblyModuleDCStart)
{
ETW::EnumerationLog::IterateAssembly(pAssembly, enumerationOptions);
@@ -7110,7 +7103,6 @@ VOID ETW::EnumerationLog::IterateCollectibleLoaderAllocator(AssemblyLoaderAlloca
while (!domainAssemblyIt.end())
{
Assembly *pAssembly = domainAssemblyIt->GetAssembly(); // TODO: handle iterator
- _ASSERTE(!pAssembly->IsDomainNeutral()); // Collectible Assemblies are not domain neutral.
DomainModuleIterator domainModuleIterator = domainAssemblyIt->IterateModules(kModIterIncludeLoaded);
while (domainModuleIterator.Next())
diff --git a/src/vm/generics.cpp b/src/vm/generics.cpp
index 06cde91394..1d98d98d0e 100644
--- a/src/vm/generics.cpp
+++ b/src/vm/generics.cpp
@@ -590,7 +590,6 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
// Check we've set up the flags correctly on the new method table
_ASSERTE(!fContainsGenericVariables == !pMT->ContainsGenericVariables());
_ASSERTE(!fHasGenericsStaticsInfo == !pMT->HasGenericsStaticsInfo());
- _ASSERTE(!pLoaderModule->GetAssembly()->IsDomainNeutral() == !pMT->IsDomainNeutral());
#ifdef FEATURE_COMINTEROP
_ASSERTE(!fHasDynamicInterfaceMap == !pMT->HasDynamicInterfaceMap());
_ASSERTE(!fHasRCWPerTypeData == !pMT->HasRCWPerTypeData());
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 77054f9782..376bc2a260 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -1582,8 +1582,7 @@ void CEEInfo::getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
fieldAccessor = intrinsicAccessor;
}
else
- if (// Domain neutral access.
- m_pMethodBeingCompiled->IsDomainNeutral() || m_pMethodBeingCompiled->IsZapped() || IsCompilingForNGen() ||
+ if (m_pMethodBeingCompiled->IsZapped() || IsCompilingForNGen() ||
// Static fields are not pinned in collectible types. We will always access
// them using a helper since the address cannot be embeded into the code.
pFieldMT->Collectible() ||
@@ -4120,12 +4119,12 @@ CorInfoInitClassResult CEEInfo::initClass(
MethodDesc *methodBeingCompiled = m_pMethodBeingCompiled;
- BOOL fMethodDomainNeutral = methodBeingCompiled->IsDomainNeutral() || methodBeingCompiled->IsZapped() || IsCompilingForNGen();
+ BOOL fMethodZappedOrNGen = methodBeingCompiled->IsZapped() || IsCompilingForNGen();
MethodTable *pTypeToInitMT = typeToInitTH.AsMethodTable();
// This should be the most common early-out case.
- if (fMethodDomainNeutral)
+ if (fMethodZappedOrNGen)
{
if (pTypeToInitMT->IsClassPreInited())
{
@@ -4242,7 +4241,7 @@ CorInfoInitClassResult CEEInfo::initClass(
}
}
- if (fMethodDomainNeutral)
+ if (fMethodZappedOrNGen)
{
// Well, because of code sharing we can't do anything at coge generation time.
// We have to do it at runtime.
diff --git a/src/vm/loaderallocator.cpp b/src/vm/loaderallocator.cpp
index d51af51347..e3092ff9f3 100644
--- a/src/vm/loaderallocator.cpp
+++ b/src/vm/loaderallocator.cpp
@@ -849,7 +849,7 @@ LOADERHANDLE LoaderAllocator::AllocateHandle(OBJECTREF value)
else
{
OBJECTREF* pRef = GetDomain()->AllocateObjRefPtrsInLargeTable(1);
- SetObjectReference(pRef, gc.value, IsDomainNeutral() ? NULL : GetDomain()->AsAppDomain());
+ SetObjectReference(pRef, gc.value, GetDomain()->AsAppDomain());
retVal = (((UINT_PTR)pRef) + 1);
}
@@ -934,7 +934,7 @@ OBJECTREF LoaderAllocator::CompareExchangeValueInHandle(LOADERHANDLE handle, OBJ
gc.previous = *ptr;
if ((*ptr) == gc.compare)
{
- SetObjectReference(ptr, gc.value, IsDomainNeutral() ? NULL : GetDomain()->AsAppDomain());
+ SetObjectReference(ptr, gc.value, GetDomain()->AsAppDomain());
}
}
else
@@ -981,7 +981,7 @@ void LoaderAllocator::SetHandleValue(LOADERHANDLE handle, OBJECTREF value)
if ((((UINT_PTR)handle) & 1) != 0)
{
OBJECTREF *ptr = (OBJECTREF *)(((UINT_PTR)handle) - 1);
- SetObjectReference(ptr, value, IsDomainNeutral() ? NULL : GetDomain()->AsAppDomain());
+ SetObjectReference(ptr, value, GetDomain()->AsAppDomain());
}
else
{
diff --git a/src/vm/loaderallocator.hpp b/src/vm/loaderallocator.hpp
index a283721c37..7237359666 100644
--- a/src/vm/loaderallocator.hpp
+++ b/src/vm/loaderallocator.hpp
@@ -485,7 +485,6 @@ public:
virtual ~LoaderAllocator();
BaseDomain *GetDomain() { LIMITED_METHOD_CONTRACT; return m_pDomain; }
virtual BOOL CanUnload() = 0;
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
void Init(BaseDomain *pDomain, BYTE *pExecutableHeapMemory = NULL);
void Terminate();
virtual void ReleaseManagedAssemblyLoadContext() {}
diff --git a/src/vm/method.hpp b/src/vm/method.hpp
index 8b136e6fd3..1821b2aed4 100644
--- a/src/vm/method.hpp
+++ b/src/vm/method.hpp
@@ -508,8 +508,6 @@ public:
// and the loader allocator in the current domain for non-collectable types
LoaderAllocator * GetDomainSpecificLoaderAllocator();
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
-
Module* GetLoaderModule();
Module* GetZapModule();
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp
index cf7ddccfc7..fe4a18ba4b 100644
--- a/src/vm/methodtable.cpp
+++ b/src/vm/methodtable.cpp
@@ -6133,20 +6133,7 @@ void MethodTable::Restore()
EnsureWritablePages(pWriteableData, sizeof(MethodTableWriteableData) + sizeof(CrossModuleGenericsStaticsInfo));
- if (IsDomainNeutral())
- {
- // If we are domain neutral, we have to use constituent of the instantiation to store
- // statics. We need to ensure that we can create DomainModule in all domains
- // that this instantiations may get activated in. PZM is good approximation of such constituent.
- Module * pModuleForStatics = Module::GetPreferredZapModuleForMethodTable(this);
-
- pInfo->m_pModuleForStatics = pModuleForStatics;
- pInfo->m_DynamicTypeID = pModuleForStatics->AllocateDynamicEntry(this);
- }
- else
- {
- pInfo->m_pModuleForStatics = GetLoaderModule();
- }
+ pInfo->m_pModuleForStatics = GetLoaderModule();
}
LOG((LF_ZAP, LL_INFO10000,
diff --git a/src/vm/methodtable.h b/src/vm/methodtable.h
index 72482f29fe..c80384da79 100644
--- a/src/vm/methodtable.h
+++ b/src/vm/methodtable.h
@@ -699,9 +699,6 @@ public:
PTR_DomainLocalModule GetDomainLocalModule();
#endif
- // Return whether the type lives in the shared domain.
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
-
MethodTable *LoadEnclosingMethodTable(ClassLoadLevel targetLevel = CLASS_DEPENDENCIES_LOADED);
LPCWSTR GetPathForErrorMessages();
diff --git a/src/vm/mlinfo.cpp b/src/vm/mlinfo.cpp
index 608d2b7fc6..f9439e7396 100644
--- a/src/vm/mlinfo.cpp
+++ b/src/vm/mlinfo.cpp
@@ -428,22 +428,8 @@ CustomMarshalerHelper *SetupCustomMarshalerHelper(LPCUTF8 strMarshalerTypeName,
EEMarshalingData *pMarshalingData = NULL;
- // Retrieve the marshalling data for the current app domain.
- if (pAssembly->IsDomainNeutral())
- {
- // If the assembly is shared, then it should only reference other domain neutral assemblies.
- // This assumption MUST be true for the current custom marshaling scheme to work.
- // This implies that the type of the managed parameter must be a shared type.
- _ASSERTE(hndManagedType.GetAssembly()->IsDomainNeutral());
-
- // The assembly is shared so we need to use the system domain's marshaling data.
- pMarshalingData = SystemDomain::System()->GetMarshalingData();
- }
- else
- {
- // The assembly is not shared so we use the current app domain's marshaling data.
- pMarshalingData = GetThread()->GetDomain()->GetMarshalingData();
- }
+ // The assembly is not shared so we use the current app domain's marshaling data.
+ pMarshalingData = GetThread()->GetDomain()->GetMarshalingData();
// Retrieve the custom marshaler helper from the EE marshaling data.
RETURN pMarshalingData->GetCustomMarshalerHelper(pAssembly, hndManagedType, strMarshalerTypeName, cMarshalerTypeNameBytes, strCookie, cCookieStrBytes);
@@ -1188,11 +1174,10 @@ CustomMarshalerHelper *EEMarshalingData::GetCustomMarshalerHelper(Assembly *pAss
CustomMarshalerHelper* pNewCMHelper = NULL;
NewHolder<CustomMarshalerInfo> pNewCMInfo(NULL);
- BOOL bSharedHelper = pAssembly->IsDomainNeutral();
TypeHandle hndCustomMarshalerType;
// Create the key that will be used to lookup in the hashtable.
- EECMHelperHashtableKey Key(cMarshalerTypeNameBytes, strMarshalerTypeName, cCookieStrBytes, strCookie, hndManagedType.GetInstantiation(), bSharedHelper);
+ EECMHelperHashtableKey Key(cMarshalerTypeNameBytes, strMarshalerTypeName, cCookieStrBytes, strCookie, hndManagedType.GetInstantiation());
// Lookup the custom marshaler helper in the hashtable.
if (m_CMHelperHashtable.GetValue(&Key, (HashDatum*)&pCMHelper))
@@ -1223,19 +1208,11 @@ CustomMarshalerHelper *EEMarshalingData::GetCustomMarshalerHelper(Assembly *pAss
pAssembly = NULL;
- if (bSharedHelper)
- {
- // Create the custom marshaler helper in the specified heap.
- pNewCMHelper = new (m_pHeap) SharedCustomMarshalerHelper(pAssembly, hndManagedType, strMarshalerTypeName, cMarshalerTypeNameBytes, strCookie, cCookieStrBytes);
- }
- else
- {
- // Create the custom marshaler info in the specified heap.
- pNewCMInfo = new (m_pHeap) CustomMarshalerInfo(m_pDomain, hndCustomMarshalerType, hndManagedType, strCookie, cCookieStrBytes);
+ // Create the custom marshaler info in the specified heap.
+ pNewCMInfo = new (m_pHeap) CustomMarshalerInfo(m_pDomain, hndCustomMarshalerType, hndManagedType, strCookie, cCookieStrBytes);
- // Create the custom marshaler helper in the specified heap.
- pNewCMHelper = new (m_pHeap) NonSharedCustomMarshalerHelper(pNewCMInfo);
- }
+ // Create the custom marshaler helper in the specified heap.
+ pNewCMHelper = new (m_pHeap) NonSharedCustomMarshalerHelper(pNewCMInfo);
}
// Take the app domain lock before we insert the custom marshaler info into the hashtable.
diff --git a/src/vm/object.cpp b/src/vm/object.cpp
index 0d0d2de1a3..d497b59c12 100644
--- a/src/vm/object.cpp
+++ b/src/vm/object.cpp
@@ -326,27 +326,21 @@ void Object::SetAppDomain(AppDomain *pDomain)
CONTRACTL_END;
#ifndef _DEBUG
- if (!GetMethodTable()->IsDomainNeutral())
- {
- //
- // If we have a per-app-domain method table, we can
- // infer the app domain from the method table, so
- // there is no reason to mark the object.
- //
- // But we don't do this in a debug build, because
- // we want to be able to detect the case when the
- // domain was unloaded from underneath an object (and
- // the MethodTable will be toast in that case.)
- //
-
- _ASSERTE(pDomain == GetMethodTable()->GetDomain());
- }
- else
+ //
+ // If we have a per-app-domain method table, we can
+ // infer the app domain from the method table, so
+ // there is no reason to mark the object.
+ //
+ // But we don't do this in a debug build, because
+ // we want to be able to detect the case when the
+ // domain was unloaded from underneath an object (and
+ // the MethodTable will be toast in that case.)
+ //
+ _ASSERTE(pDomain == GetMethodTable()->GetDomain());
+#else
+ ADIndex index = pDomain->GetIndex();
+ GetHeader()->SetAppDomainIndex(index);
#endif
- {
- ADIndex index = pDomain->GetIndex();
- GetHeader()->SetAppDomainIndex(index);
- }
_ASSERTE(GetHeader()->GetAppDomainIndex().m_dwIndex != 0);
}
@@ -388,8 +382,7 @@ AppDomain *Object::GetAppDomain()
}
CONTRACTL_END;
#ifndef _DEBUG
- if (!GetMethodTable()->IsDomainNeutral())
- return (AppDomain*) GetMethodTable()->GetDomain();
+ return (AppDomain*) GetMethodTable()->GetDomain();
#endif
ADIndex index = GetHeader()->GetAppDomainIndex();
diff --git a/src/vm/object.inl b/src/vm/object.inl
index dd167d806c..c9b7abd9b0 100644
--- a/src/vm/object.inl
+++ b/src/vm/object.inl
@@ -27,10 +27,9 @@ inline ADIndex Object::GetAppDomainIndex()
WRAPPER_NO_CONTRACT;
#ifndef _DEBUG
// ok to cast to AppDomain because we know it's a real AppDomain if it's not shared
- if (!GetGCSafeMethodTable()->IsDomainNeutral())
- return (dac_cast<PTR_AppDomain>(GetGCSafeMethodTable()->GetDomain())->GetIndex());
+ return (dac_cast<PTR_AppDomain>(GetGCSafeMethodTable()->GetDomain())->GetIndex());
#endif
- return GetHeader()->GetAppDomainIndex();
+ return GetHeader()->GetAppDomainIndex();
}
inline DWORD Object::GetNumComponents()
diff --git a/src/vm/profilingenumerators.cpp b/src/vm/profilingenumerators.cpp
index b0f0c1ac21..14305bdd5d 100644
--- a/src/vm/profilingenumerators.cpp
+++ b/src/vm/profilingenumerators.cpp
@@ -282,12 +282,6 @@ HRESULT IterateUnsharedModules(AppDomain * pAppDomain,
_ASSERTE(pDomainAssembly != NULL);
_ASSERTE(pDomainAssembly->GetAssembly() != NULL);
- // We're only adding unshared assemblies / modules
- if (pDomainAssembly->GetAssembly()->IsDomainNeutral())
- {
- continue;
- }
-
// #ProfilerEnumModules (See also code:#ProfilerEnumGeneral)
//
// When enumerating modules, ensure this timeline:
diff --git a/src/vm/reflectioninvocation.cpp b/src/vm/reflectioninvocation.cpp
index 09dd119de4..d2d2180cd2 100644
--- a/src/vm/reflectioninvocation.cpp
+++ b/src/vm/reflectioninvocation.cpp
@@ -731,10 +731,6 @@ static BOOL IsActivationNeededForMethodInvoke(MethodDesc * pMD)
if (!pMD->IsStatic() && !pMD->HasMethodInstantiation() && !pMD->IsInterface())
return FALSE;
- // We need to activate each time for domain neutral types
- if (pMD->IsDomainNeutral())
- return TRUE;
-
// We need to activate the instance at least once
pMD->EnsureActive();
return FALSE;
diff --git a/src/vm/syncblk.cpp b/src/vm/syncblk.cpp
index 47922c2277..98742c945f 100644
--- a/src/vm/syncblk.cpp
+++ b/src/vm/syncblk.cpp
@@ -2591,18 +2591,11 @@ BOOL ObjHeader::Validate (BOOL bVerifySyncBlkIndex)
//but thread ID doesn't have to be valid because the lock could be orphanend
ASSERT_AND_CHECK (lockThreadId != 0 || recursionLevel == 0 );
+#ifndef _DEBUG
DWORD adIndex = (bits >> SBLK_APPDOMAIN_SHIFT) & SBLK_MASK_APPDOMAININDEX;
- if (adIndex!= 0)
- {
-#ifndef _DEBUG
- //in non debug build, only objects of domain neutral type have appdomain index in header
- ASSERT_AND_CHECK (obj->GetGCSafeMethodTable()->IsDomainNeutral());
+ //in non debug build, objects do not have appdomain index in header
+ ASSERT_AND_CHECK (adIndex == 0);
#endif //!_DEBUG
- //todo: validate the AD index.
- //The trick here is agile objects could have a invalid AD index. Ideally we should call
- //Object::GetAppDomain to do all the agile validation but it has side effects like mark the object to
- //be agile and it only does the check if g_pConfig->AppDomainLeaks() is on
- }
}
return TRUE;
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp
index fbd917186f..ec383ecd62 100644
--- a/src/vm/threads.cpp
+++ b/src/vm/threads.cpp
@@ -1540,13 +1540,6 @@ Thread::Thread()
m_State = (ThreadState) (m_State | TS_GCOnTransitions);
}
- //m_pSharedStaticData = NULL;
- //m_pUnsharedStaticData = NULL;
- //m_pStaticDataHash = NULL;
- //m_pSDHCrst = NULL;
-
- m_fSecurityStackwalk = FALSE;
-
m_AbortType = EEPolicy::TA_None;
m_AbortInfo = 0;
m_AbortEndTime = MAXULONGLONG;
diff --git a/src/vm/threads.h b/src/vm/threads.h
index c57d8487e5..630a21eb21 100644
--- a/src/vm/threads.h
+++ b/src/vm/threads.h
@@ -2482,19 +2482,6 @@ public:
// ClearContext are to be called only during shutdown
void ClearContext();
- // Used by security to prevent recursive stackwalking.
- BOOL IsSecurityStackwalkInProgess()
- {
- LIMITED_METHOD_CONTRACT;
- return m_fSecurityStackwalk;
- }
-
- void SetSecurityStackwalkInProgress(BOOL fSecurityStackwalk)
- {
- LIMITED_METHOD_CONTRACT;
- m_fSecurityStackwalk = fSecurityStackwalk;
- }
-
private:
void ReturnToContextAndThrow(ContextTransitionFrame* pFrame, EEException* pEx, BOOL* pContextSwitched);
void ReturnToContextAndOOM(ContextTransitionFrame* pFrame);
@@ -2503,8 +2490,6 @@ private:
// don't ever call these except when creating thread!!!!!
void InitContext();
- BOOL m_fSecurityStackwalk;
-
public:
PTR_AppDomain GetDomain(INDEBUG(BOOL fMidContextTransitionOK = FALSE))
{
@@ -2516,9 +2501,6 @@ public:
Frame *IsRunningIn(AppDomain* pDomain, int *count);
Frame *GetFirstTransitionInto(AppDomain *pDomain, int *count);
- // Get outermost (oldest) AppDomain for this thread.
- AppDomain *GetInitialDomain();
-
//---------------------------------------------------------------
// Track use of the thread block. See the general comments on
// thread destruction in threads.cpp, for details.
diff --git a/src/vm/typedesc.h b/src/vm/typedesc.h
index f901f523d8..06b544b79c 100644
--- a/src/vm/typedesc.h
+++ b/src/vm/typedesc.h
@@ -201,7 +201,6 @@ public:
// i.e. are domain-bound. If any of the parts are domain-bound
// then they will all belong to the same domain.
PTR_BaseDomain GetDomain();
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
PTR_LoaderAllocator GetLoaderAllocator()
{
diff --git a/src/vm/typehandle.h b/src/vm/typehandle.h
index 15b99ca18c..f704c3e487 100644
--- a/src/vm/typehandle.h
+++ b/src/vm/typehandle.h
@@ -470,8 +470,6 @@ public:
PTR_LoaderAllocator GetLoaderAllocator() const;
- BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; }
-
// Get the class token, assuming the type handle represents a named type,
// i.e. a class, a value type, a generic instantiation etc.
inline mdTypeDef GetCl() const;
diff --git a/src/vm/typeparse.cpp b/src/vm/typeparse.cpp
index a6190dd668..dd7ce535de 100644
--- a/src/vm/typeparse.cpp
+++ b/src/vm/typeparse.cpp
@@ -1823,7 +1823,7 @@ DomainAssembly * LoadDomainAssembly(
{
spec.SetHostBinder(pPrivHostBinder);
}
- else if (pRequestingAssembly && (!pRequestingAssembly->IsDomainNeutral()) && (!pRequestingAssembly->IsCollectible()))
+ else if (pRequestingAssembly && (!pRequestingAssembly->IsCollectible()))
{
GCX_PREEMP();
spec.SetParentAssembly(pRequestingAssembly->GetDomainAssembly());