diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index a47e5a04a585..ba59930653e3 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -5029,8 +5029,7 @@ AppDomain::BindHostedPrivAssembly( //--------------------------------------------------------------------------------------------------------------------- PEAssembly * AppDomain::BindAssemblySpec( AssemblySpec * pSpec, - BOOL fThrowOnFileNotFound, - BOOL fUseHostBinderIfAvailable) + BOOL fThrowOnFileNotFound) { STATIC_CONTRACT_THROWS; STATIC_CONTRACT_GC_TRIGGERS; @@ -5065,7 +5064,7 @@ PEAssembly * AppDomain::BindAssemblySpec( goto EndTry2; // Goto end of try block. PTR_CLRPrivAssemblyWinRT assem = dac_cast(pAssembly->GetHostAssembly()); - assem->SetFallbackBinder(pSpec->GetHostBinder()); + assem->SetFallbackBinder(pSpec->GetFallbackLoadContextBinderForRequestingAssembly()); EndTry2:; } // The combination of this conditional catch/ the following if statement which will throw reduces the count of exceptions diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index 1e5ee8d90c01..1ead56637752 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -2097,8 +2097,7 @@ class AppDomain : public BaseDomain // static binding goes through this path. virtual PEAssembly * BindAssemblySpec( AssemblySpec *pSpec, - BOOL fThrowOnFileNotFound, - BOOL fUseHostBinderIfAvailable = TRUE) DAC_EMPTY_RET(NULL); + BOOL fThrowOnFileNotFound) DAC_EMPTY_RET(NULL); HRESULT BindAssemblySpecForHostedBinder( AssemblySpec * pSpec, diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp index 1d14d55eb348..795261dd620c 100644 --- a/src/vm/assemblyspec.cpp +++ b/src/vm/assemblyspec.cpp @@ -908,14 +908,6 @@ DomainAssembly *AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel, ETWOnStartup (LoaderCatchCall_V1, LoaderCatchCallEnd_V1); AppDomain* pDomain = GetAppDomain(); - - ICLRPrivBinder* pBinder = GetHostBinder(); - - // If no binder was explicitly set, check if parent assembly has a binder. - if (pBinder == nullptr) - { - pBinder = GetBindingContextFromParentAssembly(pDomain); - } DomainAssembly* pAssembly = nullptr; if (CanUseWithBindingCache()) @@ -1494,8 +1486,6 @@ BOOL AssemblySpecBindingCache::StoreAssembly(AssemblySpec *pSpec, DomainAssembly THROWS; GC_TRIGGERS; MODE_ANY; - // Host binder based assembly spec's cannot currently be safely inserted into caches. - PRECONDITION(pSpec->GetHostBinder() == nullptr); POSTCONDITION(UnsafeContains(this, pSpec)); POSTCONDITION(UnsafeVerifyLookupAssembly(this, pSpec, pAssembly)); INJECT_FAULT(COMPlusThrowOM();); @@ -1582,8 +1572,6 @@ BOOL AssemblySpecBindingCache::StoreFile(AssemblySpec *pSpec, PEAssembly *pFile) THROWS; GC_TRIGGERS; MODE_ANY; - // Host binder based assembly spec's cannot currently be safely inserted into caches. - PRECONDITION(pSpec->GetHostBinder() == nullptr); POSTCONDITION((!RETVAL) || (UnsafeContains(this, pSpec) && UnsafeVerifyLookupFile(this, pSpec, pFile))); INJECT_FAULT(COMPlusThrowOM();); } @@ -1672,8 +1660,6 @@ BOOL AssemblySpecBindingCache::StoreException(AssemblySpec *pSpec, Exception* pE THROWS; GC_TRIGGERS; MODE_ANY; - // Host binder based assembly spec's cannot currently be safely inserted into caches. - PRECONDITION(pSpec->GetHostBinder() == nullptr); DISABLED(POSTCONDITION(UnsafeContains(this, pSpec))); //@todo: Getting violations here - StoreExceptions could happen anywhere so this is possibly too aggressive. INJECT_FAULT(COMPlusThrowOM();); } diff --git a/src/vm/assemblyspec.hpp b/src/vm/assemblyspec.hpp index 2d2493c2fe4e..822c37653076 100644 --- a/src/vm/assemblyspec.hpp +++ b/src/vm/assemblyspec.hpp @@ -281,19 +281,6 @@ class AssemblySpec : public BaseAssemblySpec STATIC_CONTRACT_LIMITED_METHOD; return HasUniqueIdentity(); } - - inline ICLRPrivBinder *GetHostBinder() const - { - LIMITED_METHOD_CONTRACT; - return m_pHostBinder; - } - - inline void SetHostBinder(ICLRPrivBinder *pHostBinder) - { - LIMITED_METHOD_CONTRACT; - m_pHostBinder = pHostBinder; - } - }; #define INITIAL_ASM_SPEC_HASH_SIZE 7 diff --git a/src/vm/baseassemblyspec.h b/src/vm/baseassemblyspec.h index ba244608c5e1..68172459aaa8 100644 --- a/src/vm/baseassemblyspec.h +++ b/src/vm/baseassemblyspec.h @@ -29,7 +29,6 @@ class BaseAssemblySpec LPCWSTR m_wszCodeBase; // URL to the code LPCSTR m_szWinRtTypeNamespace; LPCSTR m_szWinRtTypeClassName; - ICLRPrivBinder *m_pHostBinder; int m_ownedFlags; ICLRPrivBinder *m_pBindingContext; diff --git a/src/vm/baseassemblyspec.inl b/src/vm/baseassemblyspec.inl index 468d604ff380..9a4f70e713df 100644 --- a/src/vm/baseassemblyspec.inl +++ b/src/vm/baseassemblyspec.inl @@ -256,8 +256,6 @@ inline void BaseAssemblySpec::CopyFrom(const BaseAssemblySpec *pSpec) m_context = pSpec->m_context; - m_pHostBinder = pSpec->m_pHostBinder; - if ((pSpec->m_ownedFlags & BAD_NAME_OWNED) != 0) { m_ownedFlags |= BAD_NAME_OWNED; diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp index 0cad9730e196..9fa26b9b229b 100644 --- a/src/vm/compile.cpp +++ b/src/vm/compile.cpp @@ -317,7 +317,7 @@ HRESULT CEECompileInfo::LoadAssemblyByPath( // If there is a host binder then use it to bind the assembly. if (isWinRT) { - pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE, FALSE); + pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE); } else { @@ -531,7 +531,7 @@ HRESULT CEECompileInfo::SetCompilationTarget(CORINFO_ASSEMBLY_HANDLE assembl AssemblySpec mscorlib; mscorlib.InitializeSpec(SystemDomain::SystemFile()); - GetAppDomain()->BindAssemblySpec(&mscorlib,TRUE,FALSE); + GetAppDomain()->BindAssemblySpec(&mscorlib,TRUE); if (!IsReadyToRunCompilation() && !SystemDomain::SystemFile()->HasNativeImage()) { @@ -7178,8 +7178,7 @@ void ReportMissingDependency(Exception * e) PEAssembly *CompilationDomain::BindAssemblySpec( AssemblySpec *pSpec, - BOOL fThrowOnFileNotFound, - BOOL fUseHostBinderIfAvailable) + BOOL fThrowOnFileNotFound) { PEAssembly *pFile = NULL; // @@ -7194,8 +7193,7 @@ PEAssembly *CompilationDomain::BindAssemblySpec( // pFile = AppDomain::BindAssemblySpec( pSpec, - fThrowOnFileNotFound, - fUseHostBinderIfAvailable); + fThrowOnFileNotFound); } EX_HOOK { diff --git a/src/vm/compile.h b/src/vm/compile.h index 5a4468c56421..decdc841bfc9 100644 --- a/src/vm/compile.h +++ b/src/vm/compile.h @@ -789,8 +789,7 @@ class CompilationDomain : public AppDomain, PEAssembly *BindAssemblySpec( AssemblySpec *pSpec, - BOOL fThrowOnFileNotFound, - BOOL fUseHostBinderIfAvailable = TRUE) DAC_EMPTY_RET(NULL); + BOOL fThrowOnFileNotFound) DAC_EMPTY_RET(NULL); BOOL CanEagerBindToZapFile(Module *targetModule, BOOL limitToHardBindList = TRUE);