diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-11-26 17:55:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 17:55:10 -0800 |
commit | c928bf4f3cf411bc775d5ec5098a122eada48ba9 (patch) | |
tree | 5aa410575413bbe481b10e6ad939a5ecfeda89d3 /src | |
parent | 19b6763f5dd71aee1d99d129f6009aee398aaf60 (diff) | |
download | coreclr-c928bf4f3cf411bc775d5ec5098a122eada48ba9.tar.gz coreclr-c928bf4f3cf411bc775d5ec5098a122eada48ba9.tar.bz2 coreclr-c928bf4f3cf411bc775d5ec5098a122eada48ba9.zip |
Disable domain neutral loading (#21156)
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/appdomain.cpp | 30 | ||||
-rw-r--r-- | src/vm/appdomain.hpp | 31 | ||||
-rw-r--r-- | src/vm/assembly.cpp | 34 | ||||
-rw-r--r-- | src/vm/assembly.hpp | 7 | ||||
-rw-r--r-- | src/vm/ceeload.cpp | 2 | ||||
-rw-r--r-- | src/vm/domainfile.cpp | 162 | ||||
-rw-r--r-- | src/vm/domainfile.h | 7 | ||||
-rw-r--r-- | src/vm/eventtrace.cpp | 2 | ||||
-rw-r--r-- | src/vm/ilstubcache.cpp | 2 | ||||
-rw-r--r-- | src/vm/loaderallocator.cpp | 12 | ||||
-rw-r--r-- | src/vm/loaderallocator.hpp | 2 | ||||
-rw-r--r-- | src/vm/method.hpp | 2 | ||||
-rw-r--r-- | src/vm/method.inl | 6 | ||||
-rw-r--r-- | src/vm/methodtable.cpp | 17 | ||||
-rw-r--r-- | src/vm/methodtable.h | 2 | ||||
-rw-r--r-- | src/vm/typedesc.cpp | 13 | ||||
-rw-r--r-- | src/vm/typedesc.h | 2 | ||||
-rw-r--r-- | src/vm/typehandle.cpp | 10 | ||||
-rw-r--r-- | src/vm/typehandle.h | 2 |
19 files changed, 17 insertions, 328 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index 8516f296c5..ce57ee0c5f 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -2971,17 +2971,6 @@ void SystemDomain::SetThreadAptState (Thread::ApartmentState state) } #endif // defined(FEATURE_COMINTEROP_APARTMENT_SUPPORT) && !defined(CROSSGEN_COMPILE) -// Looks in all the modules for the DefaultDomain attribute -// The order is assembly and then the modules. It is first -// come, first serve. -BOOL SystemDomain::SetGlobalSharePolicyUsingAttribute(IMDInternalImport* pScope, mdMethodDef mdMethod) -{ - STANDARD_VM_CONTRACT; - - - return FALSE; -} - // Helper function to load an assembly. This is called from LoadCOMClass. /* static */ @@ -3665,12 +3654,6 @@ AppDomain::AppDomain() m_cRef=1; - // Initialize Shared state. Assemblies are loaded - // into each domain by default. -#ifdef FEATURE_LOADER_OPTIMIZATION - m_SharePolicy = SHARE_POLICY_UNSPECIFIED; -#endif - m_pRootAssembly = NULL; m_pwDynamicDir = NULL; @@ -5563,12 +5546,6 @@ DomainFile *AppDomain::LoadDomainNeutralModuleDependency(Module *pModule, FileLo RETURN pDomainFile; } -AppDomain::SharePolicy AppDomain::GetSharePolicy() -{ - LIMITED_METHOD_CONTRACT; - - return SHARE_POLICY_NEVER; -} #endif // FEATURE_LOADER_OPTIMIZATION @@ -7800,12 +7777,7 @@ BOOL SharedDomain::CompareSharedAssembly(UPTR u1, UPTR u2) // This is the value stored in the table Assembly *pAssembly = (Assembly *) u2; if (pLocator->GetType()==SharedAssemblyLocator::DOMAINASSEMBLY) - { - if (!pAssembly->GetManifestFile()->Equals(pLocator->GetDomainAssembly()->GetFile())) - return FALSE; - - return pAssembly->CanBeShared(pLocator->GetDomainAssembly()); - } + return FALSE; else if (pLocator->GetType()==SharedAssemblyLocator::PEASSEMBLY) return pAssembly->GetManifestFile()->Equals(pLocator->GetPEAssembly()); diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index 3c60748df9..fd28316c40 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -2355,26 +2355,6 @@ public: BOOL ContainsAssembly(Assembly * assem); -#ifdef FEATURE_LOADER_OPTIMIZATION - enum SharePolicy - { - // Attributes to control when to use domain neutral assemblies - SHARE_POLICY_UNSPECIFIED, // Use the current default policy (LoaderOptimization.NotSpecified) - SHARE_POLICY_NEVER, // Do not share anything, except the system assembly (LoaderOptimization.SingleDomain) - SHARE_POLICY_ALWAYS, // Share everything possible (LoaderOptimization.MultiDomain) - SHARE_POLICY_GAC, // Share only GAC-bound assemblies (LoaderOptimization.MultiDomainHost) - - SHARE_POLICY_COUNT, - SHARE_POLICY_MASK = 0x3, - - // NOTE that previously defined was a bit 0x40 which might be set on this value - // in custom attributes. - SHARE_POLICY_DEFAULT = SHARE_POLICY_NEVER, - }; - - SharePolicy GetSharePolicy(); -#endif // FEATURE_LOADER_OPTIMIZATION - //**************************************************************************************** // // Reference count. When an appdomain is first created the reference is bump @@ -3304,15 +3284,6 @@ private: OBJECTHANDLE m_ExposedObject; -#ifdef FEATURE_LOADER_OPTIMIZATION - // Indicates where assemblies will be loaded for - // this domain. By default all assemblies are loaded into the domain. - // There are two additional settings, all - // assemblies can be loaded into the shared domain or assemblies - // that are strong named are loaded into the shared area. - SharePolicy m_SharePolicy; -#endif - IUnknown *m_pComIPForExposedObject; // Hash table that maps a clsid to a type @@ -3918,8 +3889,6 @@ public: static Thread::ApartmentState GetEntryPointThreadAptState(IMDInternalImport* pScope, mdMethodDef mdMethod); static void SetThreadAptState(Thread::ApartmentState state); #endif - static BOOL SetGlobalSharePolicyUsingAttribute(IMDInternalImport* pScope, mdMethodDef mdMethod); - //**************************************************************************************** // diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp index 0f1253931e..d263e37f62 100644 --- a/src/vm/assembly.cpp +++ b/src/vm/assembly.cpp @@ -121,7 +121,6 @@ Assembly::Assembly(BaseDomain *pDomain, PEAssembly* pFile, DebuggerAssemblyContr m_winMDStatus(WinMDStatus_Unknown), m_pManifestWinMDImport(NULL), #endif // FEATURE_COMINTEROP - m_fIsDomainNeutral(pDomain == SharedDomain::GetDomain()), m_debuggerFlags(debuggerFlags), m_fTerminated(FALSE) #ifdef FEATURE_COMINTEROP @@ -2131,39 +2130,6 @@ GetAssembliesByName(LPCWSTR szAppBase, return hr; }// Used by the IMetadata API's to access an assemblies metadata. -#ifdef FEATURE_LOADER_OPTIMIZATION - -BOOL Assembly::CanBeShared(DomainAssembly *pDomainAssembly) -{ - PTR_PEAssembly pFile=pDomainAssembly->GetFile(); - - if(pFile == NULL) - return FALSE; - - if(pFile->IsDynamic()) - return FALSE; - - if(IsSystem() && pFile->IsSystem()) - return TRUE; - - if ((pDomainAssembly->GetDebuggerInfoBits()&~(DACF_PDBS_COPIED|DACF_IGNORE_PDBS|DACF_OBSOLETE_TRACK_JIT_INFO)) - != (m_debuggerFlags&~(DACF_PDBS_COPIED|DACF_IGNORE_PDBS|DACF_OBSOLETE_TRACK_JIT_INFO))) - { - LOG((LF_CODESHARING, - LL_INFO100, - "We can't share it, desired debugging flags %x are different than %x\n", - pDomainAssembly->GetDebuggerInfoBits(), (m_debuggerFlags&~(DACF_PDBS_COPIED|DACF_IGNORE_PDBS|DACF_OBSOLETE_TRACK_JIT_INFO)))); - STRESS_LOG2(LF_CODESHARING, LL_INFO100,"Flags diff= %08x [%08x/%08x]",pDomainAssembly->GetDebuggerInfoBits(), - m_debuggerFlags); - return FALSE; - } - - return TRUE; -} - - -#endif // FEATURE_LOADER_OPTIMIZATION - void DECLSPEC_NORETURN Assembly::ThrowTypeLoadException(LPCUTF8 pszFullName, UINT resIDWhy) { WRAPPER_NO_CONTRACT; diff --git a/src/vm/assembly.hpp b/src/vm/assembly.hpp index d55d31e88c..83d7ee698d 100644 --- a/src/vm/assembly.hpp +++ b/src/vm/assembly.hpp @@ -448,10 +448,7 @@ public: OBJECTHANDLE GetLoaderAllocatorObjectHandle() { WRAPPER_NO_CONTRACT; return GetLoaderAllocator()->GetLoaderAllocatorObjectHandle(); } #endif // FEATURE_COLLECTIBLE_TYPES - BOOL CanBeShared(DomainAssembly *pAsAssembly); - - void SetDomainNeutral() { LIMITED_METHOD_CONTRACT; m_fIsDomainNeutral = TRUE; } - BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return m_fIsDomainNeutral; } + BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; } BOOL IsSIMDVectorAssembly() { LIMITED_METHOD_DAC_CONTRACT; return m_fIsSIMDVectorAssembly; } @@ -615,8 +612,6 @@ private: IWinMDImport *m_pManifestWinMDImport; #endif // FEATURE_COMINTEROP - BOOL m_fIsDomainNeutral; - DebuggerAssemblyControlFlags m_debuggerFlags; BOOL m_fTerminated; diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index bebd400f5c..9124013fa7 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -4078,7 +4078,7 @@ ILStubCache* Module::GetILStubCache() // Use per-AD cache for domain specific modules when not NGENing BaseDomain *pDomain = GetDomain(); - if (!pDomain->IsSharedDomain() && !pDomain->AsAppDomain()->IsCompilationDomain()) + if (!IsSystem() && !pDomain->IsSharedDomain() && !pDomain->AsAppDomain()->IsCompilationDomain()) return pDomain->AsAppDomain()->GetILStubCache(); if (m_pILStubCache == NULL) diff --git a/src/vm/domainfile.cpp b/src/vm/domainfile.cpp index a5b7a7730c..8f19137ec6 100644 --- a/src/vm/domainfile.cpp +++ b/src/vm/domainfile.cpp @@ -1452,8 +1452,6 @@ DomainAssembly::DomainAssembly(AppDomain *pDomain, PEFile *pFile, LoaderAllocato m_fDebuggerUnloadStarted(FALSE), m_fCollectible(pLoaderAllocator->IsCollectible()), m_fHostAssemblyPublished(false), - m_fCalculatedShouldLoadDomainNeutral(false), - m_fShouldLoadDomainNeutral(false), m_pLoaderAllocator(pLoaderAllocator), m_NextDomainAssemblyInSameALC(NULL) { @@ -1790,18 +1788,13 @@ void DomainAssembly::FindNativeImage() Module * pNativeModule = pNativeImage->GetLoadedLayout()->GetPersistedModuleImage(); EnsureWritablePages(pNativeModule); PEFile ** ppNativeFile = (PEFile **) (PBYTE(pNativeModule) + Module::GetFileOffset()); - BOOL bExpectedToBeShared= ShouldLoadDomainNeutral(); - if (!bExpectedToBeShared) - { - GetFile()->SetNativeImageUsedExclusively(); - } + GetFile()->SetNativeImageUsedExclusively(); PEAssembly * pFile = (PEAssembly *)FastInterlockCompareExchangePointer((void **)ppNativeFile, (void *)GetFile(), (void *)NULL); STRESS_LOG3(LF_ZAP,LL_INFO100,"Attempted to set new native file %p, old file was %p, location in the image=%p\n",GetFile(),pFile,ppNativeFile); if (pFile!=NULL && !IsSystem() && - ( !bExpectedToBeShared || - pFile == PEFile::Dummy() || + ( pFile == PEFile::Dummy() || pFile->IsNativeImageUsedExclusively() || !(GetFile()->GetPath().Equals(pFile->GetPath()))) @@ -1858,63 +1851,6 @@ void DomainAssembly::FindNativeImage() } #endif // FEATURE_PREJIT -BOOL DomainAssembly::ShouldLoadDomainNeutral() -{ - STANDARD_VM_CONTRACT; - - if (m_fCalculatedShouldLoadDomainNeutral) - return m_fShouldLoadDomainNeutral; - - m_fShouldLoadDomainNeutral = !!ShouldLoadDomainNeutralHelper(); - m_fCalculatedShouldLoadDomainNeutral = true; - - return m_fShouldLoadDomainNeutral; -} - -BOOL DomainAssembly::ShouldLoadDomainNeutralHelper() -{ - STANDARD_VM_CONTRACT; - -#ifdef FEATURE_LOADER_OPTIMIZATION - - - if (IsSystem()) - return TRUE; - - if (IsSingleAppDomain()) - return FALSE; - - if (GetFile()->IsDynamic()) - return FALSE; - -#ifdef FEATURE_COMINTEROP - if (GetFile()->IsWindowsRuntime()) - return FALSE; -#endif - - switch(this->GetAppDomain()->GetSharePolicy()) { - case AppDomain::SHARE_POLICY_ALWAYS: - return TRUE; - - case AppDomain::SHARE_POLICY_GAC: - return IsSystem(); - - case AppDomain::SHARE_POLICY_NEVER: - return FALSE; - - case AppDomain::SHARE_POLICY_UNSPECIFIED: - case AppDomain::SHARE_POLICY_COUNT: - break; - } - - return FALSE; // No meaning in doing costly closure walk for CoreCLR. - - -#else // FEATURE_LOADER_OPTIMIZATION - return IsSystem(); -#endif // FEATURE_LOADER_OPTIMIZATION -} - // This is where the decision whether an assembly is DomainNeutral (shared) nor not is made. void DomainAssembly::Allocate() { @@ -1936,97 +1872,13 @@ void DomainAssembly::Allocate() //! If you decide to remove "if" do not remove this brace: order is important here - in the case of an exception, //! the Assembly holder must destruct before the AllocMemTracker declared above. - NewHolder<Assembly> assemblyHolder(NULL); - - // Determine whether we are supposed to load the assembly as a shared - // assembly or into the app domain. - if (ShouldLoadDomainNeutral()) - { - -#ifdef FEATURE_LOADER_OPTIMIZATION - - - // Try to find an existing shared version of the assembly which - // is compatible with our domain. - - SharedDomain * pSharedDomain = SharedDomain::GetDomain(); + // We can now rely on the fact that our MDImport will not change so we can stop refcounting it. + GetFile()->MakeMDImportPersistent(); - SIZE_T nInitialShareableAssemblyCount = pSharedDomain->GetShareableAssemblyCount(); - DWORD dwSwitchCount = 0; - - SharedFileLockHolder pFileLock(pSharedDomain, GetFile(), FALSE); - - if (IsSystem()) - { - pAssembly=SystemDomain::SystemAssembly(); - } - else - { - SharedAssemblyLocator locator(this); - pAssembly = pSharedDomain->FindShareableAssembly(&locator); - - if (pAssembly == NULL) - { - pFileLock.Acquire(); - pAssembly = pSharedDomain->FindShareableAssembly(&locator); - } - } - - if (pAssembly == NULL) - { - - // We can now rely on the fact that our MDImport will not change so we can stop refcounting it. - GetFile()->MakeMDImportPersistent(); - - // Go ahead and create new shared version of the assembly if possible - // <TODO> We will need to pass a valid OBJECREF* here in the future when we implement SCU </TODO> - assemblyHolder = pAssembly = Assembly::Create(pSharedDomain, GetFile(), GetDebuggerInfoBits(), this->IsCollectible(), pamTracker, this->IsCollectible() ? this->GetLoaderAllocator() : NULL); - - // Compute the closure assembly dependencies - // of the code & layout of given assembly. - // - // An assembly has direct dependencies listed in its manifest. - // - // We do not in general also have all of those dependencies' dependencies in the manifest. - // After all, we may be only using a small portion of the assembly. - // - // However, since all dependent assemblies must also be shared (so that - // the shared data in this assembly can refer to it), we are in - // effect forced to behave as though we do have all of their dependencies. - // This is because the resulting shared assembly that we will depend on - // DOES have those dependencies, but we won't be able to validly share that - // assembly unless we match all of ITS dependencies, too. - // Sets the tenured bit atomically with the hash insert. - pSharedDomain->AddShareableAssembly(pAssembly); - } -#else // FEATURE_LOADER_OPTIMIZATION - _ASSERTE(IsSystem()); - if (SystemDomain::SystemAssembly()) - { - pAssembly = SystemDomain::SystemAssembly(); - } - else - { - // We can now rely on the fact that our MDImport will not change so we can stop refcounting it. - GetFile()->MakeMDImportPersistent(); - - // <TODO> We will need to pass a valid OBJECTREF* here in the future when we implement SCU </TODO> - SharedDomain * pSharedDomain = SharedDomain::GetDomain(); - assemblyHolder = pAssembly = Assembly::Create(pSharedDomain, GetFile(), GetDebuggerInfoBits(), this->IsCollectible(), pamTracker, this->IsCollectible() ? this->GetLoaderAllocator() : NULL); - pAssembly->SetIsTenured(); - } -#endif // FEATURE_LOADER_OPTIMIZATION - } - else - { - // We can now rely on the fact that our MDImport will not change so we can stop refcounting it. - GetFile()->MakeMDImportPersistent(); - - // <TODO> We will need to pass a valid OBJECTREF* here in the future when we implement SCU </TODO> - assemblyHolder = pAssembly = Assembly::Create(m_pDomain, GetFile(), GetDebuggerInfoBits(), this->IsCollectible(), pamTracker, this->IsCollectible() ? this->GetLoaderAllocator() : NULL); - assemblyHolder->SetIsTenured(); - } + NewHolder<Assembly> assemblyHolder(NULL); + assemblyHolder = pAssembly = Assembly::Create(m_pDomain, GetFile(), GetDebuggerInfoBits(), this->IsCollectible(), pamTracker, this->IsCollectible() ? this->GetLoaderAllocator() : NULL); + assemblyHolder->SetIsTenured(); //@todo! This is too early to be calling SuppressRelease. The right place to call it is below after // the CANNOTTHROWCOMPLUSEXCEPTION. Right now, we have to do this to unblock OOM injection testing quickly diff --git a/src/vm/domainfile.h b/src/vm/domainfile.h index 58706518c7..9673c653aa 100644 --- a/src/vm/domainfile.h +++ b/src/vm/domainfile.h @@ -761,11 +761,6 @@ private: public: ULONG HashIdentity(); - private: - - BOOL ShouldLoadDomainNeutral(); - BOOL ShouldLoadDomainNeutralHelper(); - // ------------------------------------------------------------ // Instance data // ------------------------------------------------------------ @@ -779,8 +774,6 @@ private: BOOL m_fDebuggerUnloadStarted; BOOL m_fCollectible; Volatile<bool> m_fHostAssemblyPublished; - Volatile<bool> m_fCalculatedShouldLoadDomainNeutral; - Volatile<bool> m_fShouldLoadDomainNeutral; PTR_LoaderAllocator m_pLoaderAllocator; DomainAssembly* m_NextDomainAssemblyInSameALC; diff --git a/src/vm/eventtrace.cpp b/src/vm/eventtrace.cpp index 59925f320c..7528322796 100644 --- a/src/vm/eventtrace.cpp +++ b/src/vm/eventtrace.cpp @@ -5637,7 +5637,7 @@ VOID ETW::LoaderLog::SendDomainEvent(BaseDomain *pBaseDomain, DWORD dwEventOptio BOOL bIsAppDomain = pBaseDomain->IsAppDomain(); BOOL bIsExecutable = bIsAppDomain ? !(pBaseDomain->AsAppDomain()->IsPassiveDomain()) : FALSE; BOOL bIsSharedDomain = pBaseDomain->IsSharedDomain(); - UINT32 uSharingPolicy = bIsAppDomain?(pBaseDomain->AsAppDomain()->GetSharePolicy()):0; + UINT32 uSharingPolicy = 0; ULONGLONG ullDomainId = (ULONGLONG)pBaseDomain; ULONG ulDomainFlags = ((bIsDefaultDomain ? ETW::LoaderLog::LoaderStructs::DefaultDomain : 0) | diff --git a/src/vm/ilstubcache.cpp b/src/vm/ilstubcache.cpp index 4e5ce12bca..93eb3304a9 100644 --- a/src/vm/ilstubcache.cpp +++ b/src/vm/ilstubcache.cpp @@ -337,7 +337,7 @@ MethodTable* ILStubCache::GetOrCreateStubMethodTable(Module* pModule) CONTRACT_END; #ifdef _DEBUG - if (pModule->GetDomain()->IsSharedDomain() || pModule->GetDomain()->AsAppDomain()->IsCompilationDomain()) + if (pModule->IsSystem() || pModule->GetDomain()->IsSharedDomain() || pModule->GetDomain()->AsAppDomain()->IsCompilationDomain()) { // in the shared domain and compilation AD we are associated with the module CONSISTENCY_CHECK(pModule->GetILStubCache() == this); diff --git a/src/vm/loaderallocator.cpp b/src/vm/loaderallocator.cpp index fd065e52ab..d9af29995f 100644 --- a/src/vm/loaderallocator.cpp +++ b/src/vm/loaderallocator.cpp @@ -1604,18 +1604,6 @@ BOOL AssemblyLoaderAllocator::CanUnload() return TRUE; } -BOOL LoaderAllocator::IsDomainNeutral() -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - SO_TOLERANT; - } CONTRACTL_END; - - return GetDomain()->IsSharedDomain(); -} - DomainAssemblyIterator::DomainAssemblyIterator(DomainAssembly* pFirstAssembly) { pCurrentAssembly = pFirstAssembly; diff --git a/src/vm/loaderallocator.hpp b/src/vm/loaderallocator.hpp index beaa3e818a..c560c14567 100644 --- a/src/vm/loaderallocator.hpp +++ b/src/vm/loaderallocator.hpp @@ -469,7 +469,7 @@ public: virtual ~LoaderAllocator(); BaseDomain *GetDomain() { LIMITED_METHOD_CONTRACT; return m_pDomain; } virtual BOOL CanUnload() = 0; - BOOL IsDomainNeutral(); + 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 fe552177c9..529064d0ea 100644 --- a/src/vm/method.hpp +++ b/src/vm/method.hpp @@ -508,7 +508,7 @@ public: // and the loader allocator in the current domain for non-collectable types LoaderAllocator * GetDomainSpecificLoaderAllocator(); - inline BOOL IsDomainNeutral(); + BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; } Module* GetLoaderModule(); diff --git a/src/vm/method.inl b/src/vm/method.inl index 88491f5ab9..ca9a17a715 100644 --- a/src/vm/method.inl +++ b/src/vm/method.inl @@ -22,12 +22,6 @@ inline InstantiatedMethodDesc* MethodDesc::AsInstantiatedMethodDesc() const return dac_cast<PTR_InstantiatedMethodDesc>(this); } -inline BOOL MethodDesc::IsDomainNeutral() -{ - WRAPPER_NO_CONTRACT; - return !IsLCGMethod() && GetDomain()->IsSharedDomain(); -} - inline BOOL MethodDesc::IsZapped() { WRAPPER_NO_CONTRACT; diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp index 7491bfd45c..7b1974c6a5 100644 --- a/src/vm/methodtable.cpp +++ b/src/vm/methodtable.cpp @@ -649,23 +649,6 @@ PTR_BaseDomain MethodTable::GetDomain() } //========================================================================================== -BOOL MethodTable::IsDomainNeutral() -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_SO_TOLERANT; - STATIC_CONTRACT_FORBID_FAULT; - STATIC_CONTRACT_SUPPORTS_DAC; - - BOOL ret = GetLoaderModule()->GetAssembly()->IsDomainNeutral(); -#ifndef DACCESS_COMPILE - _ASSERTE(!ret == !GetLoaderAllocator()->IsDomainNeutral()); -#endif - - return ret; -} - -//========================================================================================== BOOL MethodTable::HasSameTypeDefAs(MethodTable *pMT) { LIMITED_METHOD_DAC_CONTRACT; diff --git a/src/vm/methodtable.h b/src/vm/methodtable.h index 557c2fbc10..b0dc5e7575 100644 --- a/src/vm/methodtable.h +++ b/src/vm/methodtable.h @@ -700,7 +700,7 @@ public: #endif // Return whether the type lives in the shared domain. - BOOL IsDomainNeutral(); + BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; } MethodTable *LoadEnclosingMethodTable(ClassLoadLevel targetLevel = CLASS_DEPENDENCIES_LOADED); diff --git a/src/vm/typedesc.cpp b/src/vm/typedesc.cpp index 1b3d5f5783..d547905e26 100644 --- a/src/vm/typedesc.cpp +++ b/src/vm/typedesc.cpp @@ -189,19 +189,6 @@ PTR_Module TypeDesc::GetModule() { return GetLoaderModule(); } -BOOL TypeDesc::IsDomainNeutral() -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - } - CONTRACTL_END - - return GetDomain()->IsSharedDomain(); -} - BOOL ParamTypeDesc::OwnsTemplateMethodTable() { CONTRACTL diff --git a/src/vm/typedesc.h b/src/vm/typedesc.h index 81cc34048b..f901f523d8 100644 --- a/src/vm/typedesc.h +++ b/src/vm/typedesc.h @@ -201,7 +201,7 @@ 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(); + BOOL IsDomainNeutral() { LIMITED_METHOD_DAC_CONTRACT; return FALSE; } PTR_LoaderAllocator GetLoaderAllocator() { diff --git a/src/vm/typehandle.cpp b/src/vm/typehandle.cpp index 1d34f07890..5004ab9c3d 100644 --- a/src/vm/typehandle.cpp +++ b/src/vm/typehandle.cpp @@ -1364,16 +1364,6 @@ CorElementType TypeHandle::GetInternalCorElementType() const return AsMethodTable()->GetInternalCorElementType(); } -BOOL TypeHandle::IsDomainNeutral() const -{ - LIMITED_METHOD_CONTRACT; - - if (IsTypeDesc()) - return AsTypeDesc()->IsDomainNeutral(); - else - return AsMethodTable()->IsDomainNeutral(); -} - BOOL TypeHandle::HasInstantiation() const { LIMITED_METHOD_DAC_CONTRACT; diff --git a/src/vm/typehandle.h b/src/vm/typehandle.h index 3ac1f304cf..15b99ca18c 100644 --- a/src/vm/typehandle.h +++ b/src/vm/typehandle.h @@ -470,7 +470,7 @@ public: PTR_LoaderAllocator GetLoaderAllocator() const; - BOOL IsDomainNeutral() 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. |