From 248d54d6990677efcfcdeecd63539e72219c9d60 Mon Sep 17 00:00:00 2001 From: Steve MacLean Date: Tue, 4 Dec 2018 02:27:31 -0500 Subject: [PATCH] Remove *LoadContextHostBinder (#21342) --- src/vm/appdomain.hpp | 103 ---------------------------------------------- src/vm/assemblynative.cpp | 5 --- src/vm/ceeload.cpp | 29 ------------- src/vm/compile.cpp | 2 +- 4 files changed, 1 insertion(+), 138 deletions(-) diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index cb9cab2..389ce47 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -3234,109 +3234,6 @@ private: public: -private: - // This is the root-level default load context root binder. If null, then - // the Fusion binder is used; otherwise this binder is used. - ReleaseHolder m_pLoadContextHostBinder; - - // ------------------------- - // IMPORTANT! - // The shared and designer context binders are ONLY to be used in tool - // scenarios. There are known issues where use of these binders will - // cause application crashes, and interesting behaviors. - // ------------------------- - - // This is the default designer shared context root binder. - // This is used as the parent binder for ImmersiveDesignerContextBinders - ReleaseHolder m_pSharedContextHostBinder; - - // This is the current context root binder. - // Normally, this variable is immutable for appdomain lifetime, but in designer scenarios - // it may be replaced by designer context binders - Volatile m_pCurrentContextHostBinder; - -public: - // Returns the current hosted binder, or null if none available. - inline - ICLRPrivBinder * GetCurrentLoadContextHostBinder() const - { - LIMITED_METHOD_CONTRACT; - return m_pCurrentContextHostBinder; - } - - // Returns the shared context binder, or null if none available. - inline - ICLRPrivBinder * GetSharedContextHostBinder() const - { - LIMITED_METHOD_CONTRACT; - return m_pSharedContextHostBinder; - } - - // Returns the load context binder, or null if none available. - inline - ICLRPrivBinder * GetLoadContextHostBinder() const - { - LIMITED_METHOD_CONTRACT; - return m_pLoadContextHostBinder; - } - -#ifndef DACCESS_COMPILE - - // This is only called from the ImmersiveDesignerContext code - // It is protected with a managed monitor lock - inline - void SetSharedContextHostBinder(ICLRPrivBinder * pBinder) - { - LIMITED_METHOD_CONTRACT; - pBinder->AddRef(); - m_pSharedContextHostBinder = pBinder; - } - - // This is called from CorHost2's implementation of ICLRPrivRuntime::CreateAppDomain. - // Should only be called during AppDomain creation. - inline - void SetLoadContextHostBinder(ICLRPrivBinder * pBinder) - { - LIMITED_METHOD_CONTRACT; - pBinder->AddRef(); - m_pLoadContextHostBinder = m_pCurrentContextHostBinder = pBinder; - } - - inline - void SetCurrentContextHostBinder(ICLRPrivBinder * pBinder) - { - CONTRACTL - { - THROWS; - GC_TRIGGERS; - } - CONTRACTL_END; - - LockHolder lh(this); - -#ifdef FEATURE_COMINTEROP - if (m_pNameToTypeMap != nullptr) - { - delete m_pNameToTypeMap; - m_pNameToTypeMap = nullptr; - } - - m_vNameToTypeMapVersion++; -#endif - - m_pCurrentContextHostBinder = pBinder; - } - -#endif // DACCESS_COMPILE - - // Indicates that a hosted binder is present. - inline - bool HasLoadContextHostBinder() - { - LIMITED_METHOD_CONTRACT; - return m_pLoadContextHostBinder != nullptr; - } - class ComInterfaceReleaseList { SArray m_objects; diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index 1672240..2f89be1 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -75,10 +75,6 @@ FCIMPL7(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF } else { - // name specified, if immersive ignore the codebase - if (GetThread()->GetDomain()->HasLoadContextHostBinder()) - gc.codeBase = NULL; - // Compute parent assembly if (gc.requestingAssembly == NULL) { @@ -95,7 +91,6 @@ FCIMPL7(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF { pParentAssembly= pRefAssembly->GetDomainAssembly(); } - } // Initialize spec diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index 058f4a4..ec8e3ae 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -5032,35 +5032,6 @@ Module::GetAssemblyIfLoaded( _ASSERTE(szWinRtClassName != NULL); CLRPrivBinderWinRT * pWinRtBinder = pAppDomainExamine->GetWinRtBinder(); - if (pWinRtBinder == nullptr) - { // We are most likely in AppX mode (calling AppX::IsAppXProcess() for verification is painful in DACCESS) -#ifndef DACCESS_COMPILE - // Note: We should also look - // Check designer binding context present (only in AppXDesignMode) - ICLRPrivBinder * pCurrentBinder = pAppDomainExamine->GetLoadContextHostBinder(); - if (pCurrentBinder != nullptr) - { // We have designer binding context, look for the type in it - ReleaseHolder pCurrentWinRtTypeBinder; - HRESULT hr = pCurrentBinder->QueryInterface(__uuidof(ICLRPrivWinRtTypeBinder), (void **)&pCurrentWinRtTypeBinder); - - // The binder should be an instance of code:CLRPrivBinderAppX class that implements the interface - _ASSERTE(SUCCEEDED(hr) && (pCurrentWinRtTypeBinder != nullptr)); - - if (SUCCEEDED(hr)) - { - ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE(); - pAssembly = (Assembly *)pCurrentWinRtTypeBinder->FindAssemblyForWinRtTypeIfLoaded( - (void *)pAppDomainExamine, - szWinRtNamespace, - szWinRtClassName); - } - } -#endif //!DACCESS_COMPILE - if (pAssembly == nullptr) - { - } - } - if (pWinRtBinder != nullptr) { ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE(); diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp index 721f354..1bd75fc 100644 --- a/src/vm/compile.cpp +++ b/src/vm/compile.cpp @@ -363,7 +363,7 @@ HRESULT CEECompileInfo::LoadAssemblyByPath( #endif //FEATURE_COMINTEROP // If there is a host binder then use it to bind the assembly. - if (pDomain->HasLoadContextHostBinder() || isWinRT) + if (isWinRT) { pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE, FALSE); } -- 2.7.4