Remove never defined FEATURE_APPX_BINDER
authordanmosemsft <danmose@microsoft.com>
Sun, 12 Feb 2017 20:08:12 +0000 (12:08 -0800)
committerdanmosemsft <danmose@microsoft.com>
Mon, 13 Feb 2017 00:58:48 +0000 (16:58 -0800)
23 files changed:
src/debug/daccess/stdafx.h
src/inc/dacvars.h
src/vm/appdomain.cpp
src/vm/appdomainnative.cpp
src/vm/appdomainnative.hpp
src/vm/assembly.cpp
src/vm/assemblyspec.cpp
src/vm/assemblyspec.hpp
src/vm/callhelpers.cpp
src/vm/ceeload.cpp
src/vm/clrprivbinderutil.cpp
src/vm/clrprivbinderwinrt.cpp
src/vm/codeman.cpp
src/vm/compile.cpp
src/vm/corhost.cpp
src/vm/domainfile.cpp
src/vm/excep.cpp
src/vm/multicorejit.cpp
src/vm/multicorejit.h
src/vm/multicorejitimpl.h
src/vm/multicorejitplayer.cpp
src/vm/pefile.cpp
src/vm/pefile.h

index 5c2d376..1c19ebf 100644 (file)
@@ -47,9 +47,6 @@
 #include <xcordebug.h>
 #include "dacimpl.h"
 
-#if defined(FEATURE_APPX_BINDER)
-#include <clrprivbinderappx.h>
-#endif // defined(FEATURE_APPX)
 
 #define STRSAFE_NO_DEPRECATE
 #include <strsafe.h>
index 7465866..7289533 100644 (file)
@@ -319,9 +319,6 @@ DEFINE_DACVAR(ULONG, HRESULT, dac__g_hrFatalError, ::g_hrFatalError)
 #endif //defined(DEBUGGING_SUPPORTED) && defined (FEATURE_PREJIT)
 
 
-#if defined(FEATURE_APPX_BINDER)
-DEFINE_DACVAR(ULONG, PTR_CLRPrivBinderAppX, CLRPrivBinderAppX__s_pSingleton, CLRPrivBinderAppX::s_pSingleton)
-#endif //defined(FEATURE_APPX)
 
 #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
 DEFINE_DACVAR(ULONG, DWORD, dac__g_MiniMetaDataBuffMaxSize, ::g_MiniMetaDataBuffMaxSize)
index b40dba4..8efb3c5 100644 (file)
 
 #include "../binder/inc/clrprivbindercoreclr.h"
 
-#if defined(FEATURE_APPX_BINDER)
-#include "appxutil.h"
-#include "clrprivbinderappx.h"
-#endif
 
 #include "clrprivtypecachewinrt.h"
 
@@ -852,9 +848,6 @@ void BaseDomain::Init()
     // Allocate the managed standard interfaces information.
     m_pMngStdInterfacesInfo = new MngStdInterfacesInfo();
     
-#if defined(FEATURE_APPX_BINDER)
-    if (!AppX::IsAppXProcess())
-#endif
     {
         CLRPrivBinderWinRT::NamespaceResolutionKind fNamespaceResolutionKind = CLRPrivBinderWinRT::NamespaceResolutionKind_WindowsAPI;
         if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DesignerNamespaceResolutionEnabled) != FALSE)
@@ -3462,13 +3455,6 @@ void SystemDomain::InitializeDefaultDomain(
     {
         pDefaultDomain->SetLoadContextHostBinder(pBinder);
     }
-    #ifdef FEATURE_APPX_BINDER
-        else if (AppX::IsAppXProcess())
-        {
-            CLRPrivBinderAppX * pAppXBinder = CLRPrivBinderAppX::GetOrCreateBinder();
-            pDefaultDomain->SetLoadContextHostBinder(pAppXBinder);
-        }
-    #endif
 
     {
         GCX_COOP();
@@ -4834,18 +4820,6 @@ void AppDomain::Init()
         m_pReflectionOnlyWinRtBinder = clr::SafeAddRef(new CLRPrivBinderReflectionOnlyWinRT(m_pReflectionOnlyWinRtTypeCache));
 #endif
     }
-#ifdef FEATURE_APPX_BINDER
-    else if (g_fEEStarted && !IsDefaultDomain())
-    {   // Non-default domain in an AppX process. This exists only for designers and we'd better be in dev mode.
-        _ASSERTE(IsCompilationProcess() || AppX::IsAppXDesignMode());
-
-        // Inherit AppX binder from default domain.
-        SetLoadContextHostBinder(SystemDomain::System()->DefaultDomain()->GetLoadContextHostBinder());
-
-        // Note: LoadFrom, LoadFile, Load(byte[], ...), ReflectionOnlyLoad, LoadWithPartialName,
-        /// etc. are not supported and are actively blocked.
-    }
-#endif //FEATURE_APPX_BINDER
 #endif //FEATURE_COMINTEROP
 
 #endif // CROSSGEN_COMPILE
@@ -7943,144 +7917,11 @@ PEAssembly * AppDomain::BindAssemblySpec(
 
     BOOL fForceReThrow = FALSE;
 
-#if defined(FEATURE_APPX_BINDER)
-    //
-    // If there is a host binder available and this is an unparented bind within the
-    // default load context, then the bind will be delegated to the domain-wide host
-    // binder. If there is a parent assembly, then a bind will occur only if it has
-    // an associated ICLRPrivAssembly to serve as the binder.
-    //
-    // fUseHostBinderIfAvailable can be false if this method is called by
-    // CLRPrivBinderFusion::BindAssemblyByName, which explicitly indicates that it
-    // wants to use the fusion binder.
-    //
-
-    if (AppX::IsAppXProcess() &&
-        fUseHostBinderIfAvailable &&
-        (
-         ( pSpec->HasParentAssembly()
-           ? // Parent assembly is hosted
-             pSpec->GetParentAssembly()->GetFile()->HasHostAssembly()
-           : // Non-parented default context bind
-             ( HasLoadContextHostBinder() &&
-               !pSpec->IsIntrospectionOnly() 
-             )
-         ) ||
-         (pSpec->GetHostBinder() != nullptr)
-         )
-       )
-    {
-        HRESULT hr = S_OK;
-
-        if (pSpec->GetCodeBase() != nullptr)
-        {   // LoadFrom is not supported in AppX (we should never even get here)
-            IfFailThrow(E_INVALIDARG);
-        }
-        
-        // Get the assembly display name.
-        ReleaseHolder<IAssemblyName> pAssemblyName;
-        IfFailThrow(pSpec->CreateFusionName(&pAssemblyName, TRUE, TRUE));
-        
-        // Create new binding scope for fusion logging.
-        fusion::logging::BindingScope defaultScope(pAssemblyName, FUSION_BIND_LOG_CATEGORY_DEFAULT);
-        
-        PEAssemblyHolder pAssembly;
-        EX_TRY
-        {
-            // If there is a specified binder, then it is used.
-            // Otherwise if there exist a parent assembly, then it provides the binding context
-            // Otherwise the domain's root-level binder is used.
-            ICLRPrivBinder * pBinder = nullptr;
-
-            if (pSpec->GetHostBinder() != nullptr)
-            {
-                pBinder = pSpec->GetHostBinder();
-            }
-            else
-            {
-                PEAssembly * pParentAssembly =
-                    (pSpec->GetParentAssembly() == nullptr) ? nullptr : pSpec->GetParentAssembly()->GetFile();
-
-                if ((pParentAssembly != nullptr) && (pParentAssembly->HasHostAssembly()))
-                {
-                    BOOL fMustUseOriginalLoadContextBinder = FALSE;
-                    if (pSpec->IsContentType_WindowsRuntime())
-                    {
-                        // Ugly, but we need to handle Framework assemblies that contain WinRT type references,
-                        // and the Fusion binder won't resolve these in AppX processes. The shareable flag is currently
-                        // a reasonable proxy for these cases. (It also catches first party WinMD files, but depedencies
-                        // from those can also be resolved by the original load context binder).
-                        // TODO! Update the fusion binder to resolve WinMD references correctly.
-                        IfFailThrow(pParentAssembly->GetHostAssembly()->IsShareable(&fMustUseOriginalLoadContextBinder));
-                    }
-
-                    if (fMustUseOriginalLoadContextBinder)
-                    {
-                        pBinder = GetLoadContextHostBinder();
-                    }
-                    else
-                    {
-                        pBinder = pParentAssembly->GetHostAssembly();
-                    }
-                }
-                else
-                {
-                    pBinder = GetCurrentLoadContextHostBinder();
-                }
-            }
-            _ASSERTE(pBinder != nullptr);
-            
-            hr = BindAssemblySpecForHostedBinder(pSpec, pAssemblyName, pBinder, &pAssembly);
-            if (FAILED(hr))
-            {
-                goto EndTry1;
-            }
-EndTry1:;
-        }
-        // The combination of this conditional catch/ the following if statement which will throw reduces the count of exceptions 
-        // thrown in scenarios where the exception does not escape the method. We cannot get rid of the try/catch block, as
-        // there are cases within some of the clrpriv binder's which throw.
-        // Note: In theory, FileNotFound should always come here as HRESULT, never as exception.
-        EX_CATCH_HRESULT_IF(hr,
-            !fThrowOnFileNotFound && Assembly::FileNotFound(hr))
-
-        if (FAILED(hr) && (fThrowOnFileNotFound || !Assembly::FileNotFound(hr)))
-        {
-            if (Assembly::FileNotFound(hr))
-            {
-                _ASSERTE(fThrowOnFileNotFound);
-                // Uses defaultScope
-                EEFileLoadException::Throw(pSpec, fusion::logging::GetCurrentFusionBindLog(), hr);
-            }
-            if ((hr == CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT) && pSpec->IsContentType_WindowsRuntime())
-            {   // Error returned e.g. for WinRT type name without namespace
-                if (fThrowOnFileNotFound)
-                {   // Throw ArgumentException (with the HRESULT) wrapped by TypeLoadException to give user type name for diagnostics
-                    // Note: TypeLoadException is equivalent of FileNotFound in WinRT world
-                    EEMessageException ex(hr);
-                    EX_THROW_WITH_INNER(EETypeLoadException, (pSpec->GetWinRtTypeNamespace(), pSpec->GetWinRtTypeClassName(), nullptr, nullptr, IDS_EE_WINRT_LOADFAILURE), &ex);
-                }
-            }
-            else
-            {
-                IfFailThrow(hr);
-            }
-        }
-
-        _ASSERTE((pAssembly != nullptr) || (FAILED(hr) && !fThrowOnFileNotFound));
-        return pAssembly.Extract();
-    }
-    else
-#endif // FEATURE_APPX_BINDER
 #if defined(FEATURE_COMINTEROP)
     // Handle WinRT assemblies in the classic/hybrid scenario. If this is an AppX process,
     // then this case will be handled by the previous block as part of the full set of
     // available binding hosts.
-#ifndef FEATURE_APPX_BINDER
     if (pSpec->IsContentType_WindowsRuntime())
-#else
-    if (!AppX::IsAppXProcess() && pSpec->IsContentType_WindowsRuntime())
-#endif
     {
         HRESULT hr = S_OK;
 
@@ -13811,10 +13652,6 @@ void AppDomain::PublishHostedAssembly(
     }
     else
     {
-#ifdef FEATURE_APPX_BINDER
-        // In AppX processes, all PEAssemblies that are reach this stage should have host binders.
-        _ASSERTE(!AppX::IsAppXProcess());
-#endif
     }
 }
 
@@ -13882,10 +13719,6 @@ void AppDomain::UpdatePublishHostedAssembly(
     }
     else
     {
-#ifdef FEATURE_APPX_BINDER
-        // In AppX processes, all PEAssemblies that are reach this stage should have host binders.
-        _ASSERTE(!AppX::IsAppXProcess());
-#endif
 
         pAssembly->UpdatePEFileWorker(pFile);
     }
index 5a1efc0..0c32baf 100644 (file)
 #if defined(FEATURE_APPX)
 #include "appxutil.h"
 #endif // FEATURE_APPX
-#if defined(FEATURE_APPX_BINDER)
-#include "clrprivbinderappx.h"
-#include "clrprivtypecachewinrt.h"
-#endif // FEATURE_APPX_BINDER
 #include "../binder/inc/clrprivbindercoreclr.h"
 
 #include "clr/fs/path.h"
@@ -1412,55 +1408,4 @@ FCIMPL0(INT64, AppDomainNative::GetLastSurvivedProcessMemorySize)
 FCIMPLEND
 #endif // FEATURE_APPDOMAIN_RESOURCE_MONITORING
 
-#if defined(FEATURE_APPX_BINDER)
-ICLRPrivBinder * QCALLTYPE AppDomainNative::CreateDesignerContext(LPCWSTR *rgPaths, 
-                                                            UINT cPaths,
-                                                            BOOL fShared)
-{
-    QCALL_CONTRACT;
-
-    ICLRPrivBinder *pRetVal = nullptr;
-
-    BEGIN_QCALL;
-    ReleaseHolder<ICLRPrivBinder> pBinder;
-
-     // The runtime check is done on the managed side to enable the debugger to use
-     // FuncEval to create designer contexts outside of DesignMode.
-    _ASSERTE(AppX::IsAppXDesignMode() || (AppX::IsAppXProcess() && CORDebuggerAttached()));
-
-    AppDomain *pAppDomain = GetAppDomain();
-
-    pBinder = CLRPrivBinderAppX::CreateParentedBinder(fShared ? pAppDomain->GetLoadContextHostBinder() : pAppDomain->GetSharedContextHostBinder(), CLRPrivTypeCacheWinRT::GetOrCreateTypeCache(), rgPaths, cPaths, fShared /* fCanUseNativeImages */);
-
-    {
-        BaseDomain::LockHolder lh(pAppDomain);
-        pAppDomain->AppDomainInterfaceReleaseList.Append(pRetVal);
-    }
-    pBinder.SuppressRelease();
-    pRetVal = pBinder;
-    
-    END_QCALL;
-
-    return pRetVal;
-}
-
-void QCALLTYPE AppDomainNative::SetCurrentDesignerContext(BOOL fDesignerContext, ICLRPrivBinder *newContext)
-{
-    QCALL_CONTRACT;
-
-    BEGIN_QCALL;
-
-    if (fDesignerContext)
-    {
-        GetAppDomain()->SetCurrentContextHostBinder(newContext);
-    }
-    else
-    {
-        // Managed code is responsible for ensuring this isn't called more than once per AppDomain.
-        GetAppDomain()->SetSharedContextHostBinder(newContext);
-    }
-
-    END_QCALL;
-}
-#endif // defined(FEATURE_APPX_BINDER)
 
index a2faff0..6f6c564 100644 (file)
@@ -117,13 +117,6 @@ public:
 
 
 
-#if defined(FEATURE_APPX_BINDER)
-    static
-    ICLRPrivBinder * QCALLTYPE CreateDesignerContext(LPCWSTR *rgPaths, UINT cPaths, BOOL fShared);
-
-    static
-    void QCALLTYPE SetCurrentDesignerContext(BOOL fDesignerContext, ICLRPrivBinder *newContext);
-#endif
 };
 
 #endif
index 093de2e..2249dec 100644 (file)
@@ -2486,29 +2486,6 @@ INT32 Assembly::ExecuteMainMethod(PTRARRAYREF *stringArgs, BOOL waitForOtherThre
         if (pMeth) {
             RunMainPre();
 
-#if defined(FEATURE_APPX_BINDER) && defined(FEATURE_MULTICOREJIT)
-            if (AppX::IsAppXProcess())
-            {
-                GCX_PREEMP();
-                
-                // we call this to obtain and cache the PRAID value which is used
-                // by multicore JIT manager and watson bucket params generation.
-
-                // NOTE: this makes a COM call into WinRT so we must do this after we've
-                //       set the thread's apartment state which will do CoInitializeEx().
-                LPCWSTR praid;
-                hr = AppX::GetApplicationId(praid);
-                _ASSERTE(SUCCEEDED(hr));
-
-                if (!pMeth->GetModule()->HasNativeImage())
-                {
-                    // For Appx, multicore JIT is only needed when root assembly does not have NI image
-                    // When it has NI image, we can't generate profile, and do not need to playback profile
-                    AppDomain * pDomain = pThread->GetDomain();
-                    pDomain->GetMulticoreJitManager().AutoStartProfileAppx(pDomain);
-                }
-            }
-#endif // FEATURE_APPX_BINDER && FEATURE_MULTICOREJIT
             
             // Set the root assembly as the assembly that is containing the main method
             // The root assembly is used in the GetEntryAssembly method that on CoreCLR is used
index ec42f1e..00f0efd 100644 (file)
@@ -1358,13 +1358,6 @@ DomainAssembly *AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel,
         pBinder = GetBindingContextFromParentAssembly(pDomain);
     }
 
-#ifdef FEATURE_APPX_BINDER
-    // If no explicit or parent binder, check domain.
-    if (pBinder == nullptr && AppX::IsAppXProcess())
-    {
-        pBinder = pDomain->GetCurrentLoadContextHostBinder();
-    }
-#endif
 
     if (pBinder != nullptr)
     {
@@ -2231,11 +2224,6 @@ BOOL AssemblySpecBindingCache::CompareSpecs(UPTR u1, UPTR u2)
     AssemblySpec *a1 = (AssemblySpec *) (u1 << 1);
     AssemblySpec *a2 = (AssemblySpec *) u2;
 
-#if defined(FEATURE_APPX_BINDER)
-    _ASSERTE(a1->GetAppDomain() == a2->GetAppDomain());
-    if (a1->GetAppDomain()->HasLoadContextHostBinder())
-        return (CLRPrivBinderUtil::CompareHostBinderSpecs(a1,a2));
-#endif
 
     if ((!a1->CompareEx(a2)) ||
         (a1->IsIntrospectionOnly() != a2->IsIntrospectionOnly()))
index d6f5444..94a7844 100644 (file)
@@ -369,11 +369,7 @@ class AssemblySpec  : public BaseAssemblySpec
     inline BOOL CanUseWithBindingCache() const
     {
         STATIC_CONTRACT_LIMITED_METHOD;
-#if defined(FEATURE_APPX_BINDER)
-        return (GetHostBinder() == nullptr) && HasUniqueIdentity();
-#else
         return HasUniqueIdentity(); 
-#endif
     }
 
     inline ICLRPrivBinder *GetHostBinder() const
index addd519..18c935a 100644 (file)
@@ -35,17 +35,6 @@ void AssertMulticoreJitAllowedModule(PCODE pTarget)
 
     Module * pModule = pMethod->GetModule_NoLogging();
 
-#if defined(FEATURE_APPX_BINDER)
-    
-    // For Appx process, allow certain modules to load on background thread
-    if (AppX::IsAppXProcess())
-    {
-        if (MulticoreJitManager::IsLoadOkay(pModule))
-        {
-            return;
-        }
-    }
-#endif
 
     _ASSERTE(pModule->IsSystem());
 }
index c89e7a6..605c014 100644 (file)
@@ -83,9 +83,6 @@
 #include "peimagelayout.inl"
 #include "ildbsymlib.h"
 
-#if defined(FEATURE_APPX_BINDER)
-#include "clrprivbinderappx.h"
-#endif // defined(FEATURE_APPX_BINDER)
 
 #if defined(PROFILING_SUPPORTED)
 #include "profilermetadataemitvalidator.h"
@@ -5782,14 +5779,6 @@ Module::GetAssemblyIfLoaded(
 #endif //!DACCESS_COMPILE
                     if (pAssembly == nullptr)
                     {   
-#if defined(FEATURE_APPX_BINDER)
-                        // Use WinRT binder from "global" AppX binder (there's only 1 AppDomain in non-design mode)
-                        CLRPrivBinderAppX * pAppXBinder = CLRPrivBinderAppX::GetBinderOrNull();
-                        if (pAppXBinder != nullptr)
-                        {
-                            pWinRtBinder = pAppXBinder->GetWinRtBinder();
-                        }
-#endif // defined(FEATURE_APPX_BINDER)
                     }
                 }
                 
@@ -5839,20 +5828,6 @@ Module::GetAssemblyIfLoaded(
                 }
                 DomainAssembly * pDomainAssembly = nullptr;
 
-#ifdef FEATURE_APPX_BINDER
-                if (AppX::IsAppXProcess_Initialized_NoFault() && GetAssembly()->GetManifestFile()->HasHostAssembly())
-                {
-                    ICLRPrivAssembly * pPrivBinder = GetAssembly()->GetManifestFile()->GetHostAssembly();
-                    ReleaseHolder<ICLRPrivAssembly> pPrivAssembly;
-                    HRESULT hrCachedResult;
-                    if (SUCCEEDED(pPrivBinder->FindAssemblyBySpec(pAppDomainExamine, &spec, &hrCachedResult, &pPrivAssembly)) &&
-                        SUCCEEDED(hrCachedResult))
-                    {
-                        pDomainAssembly = pAppDomainExamine->FindAssembly(pPrivAssembly);
-                    }
-                }
-                else
-#endif // FEATURE_APPX_BINDER
                 {
                     pDomainAssembly = pAppDomainExamine->FindCachedAssembly(&spec, FALSE /*fThrow*/);
                 }
index b687112..46d50f1 100644 (file)
@@ -731,101 +731,4 @@ namespace CLRPrivBinderUtil
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 ///// ----------------------------- Direct calls to VM  -------------------------------------------
 ////////////////////////////////////////////////////////////////////////////////////////////////////
-#if defined(FEATURE_APPX_BINDER)
-    ICLRPrivAssembly* RaiseAssemblyResolveEvent(IAssemblyName *pAssemblyName, ICLRPrivAssembly* pRequestingAssembly)
-    {
-        CONTRACT(ICLRPrivAssembly*)
-        {
-            THROWS;
-            GC_TRIGGERS;
-            MODE_ANY;
-            PRECONDITION(AppX::IsAppXProcess());
-            PRECONDITION(AppDomain::GetCurrentDomain()->IsDefaultDomain());
-            POSTCONDITION(CheckPointer(RETVAL, NULL_OK));
-            INJECT_FAULT(COMPlusThrowOM(););
-        }
-        CONTRACT_END;
-
-        BinderMethodID methodId;
-
-        methodId = METHOD__APP_DOMAIN__ON_ASSEMBLY_RESOLVE;  // post-bind execution event (the classic V1.0 event)
-
-        // Elevate threads allowed loading level.  This allows the host to load an assembly even in a restricted
-        // condition.  Note, however, that this exposes us to possible recursion failures, if the host tries to
-        // load the assemblies currently being loaded.  (Such cases would then throw an exception.)
-
-        OVERRIDE_LOAD_LEVEL_LIMIT(FILE_ACTIVE);
-        OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
-
-        DomainAssembly* pDomainAssembly = AppDomain::GetCurrentDomain()->FindAssembly(pRequestingAssembly);
-
-        GCX_COOP();
-
-        Assembly* pAssembly = NULL;
-
-        struct _gc {
-            OBJECTREF AppDomainRef;
-            OBJECTREF AssemblyRef;
-            STRINGREF str;
-        } gc;
-        ZeroMemory(&gc, sizeof(gc));
-
-        SString ssAssemblyName;
-        FusionBind::GetAssemblyNameDisplayName(pAssemblyName, ssAssemblyName);
-
-        GCPROTECT_BEGIN(gc);
-        if ((gc.AppDomainRef = GetAppDomain()->GetRawExposedObject()) != NULL)
-        {
-            gc.AssemblyRef = pDomainAssembly->GetExposedAssemblyObject();
-
-            MethodDescCallSite onAssemblyResolve(methodId, &gc.AppDomainRef);
-
-            gc.str = StringObject::NewString(ssAssemblyName.GetUnicode());
-            ARG_SLOT args[3] = {
-                ObjToArgSlot(gc.AppDomainRef),
-                ObjToArgSlot(gc.AssemblyRef),
-                ObjToArgSlot(gc.str)
-            };
-            ASSEMBLYREF ResultingAssemblyRef = (ASSEMBLYREF) onAssemblyResolve.Call_RetOBJECTREF(args);
-            if (ResultingAssemblyRef != NULL)
-            {
-                pAssembly = ResultingAssemblyRef->GetAssembly();
-            }
-        }
-        GCPROTECT_END();
-
-        if (pAssembly != NULL)
-        {
-            if (pAssembly->IsIntrospectionOnly())
-            {
-                // Cannot return an introspection assembly from an execution callback or vice-versa
-                COMPlusThrow(kFileLoadException, IDS_CLASSLOAD_ASSEMBLY_RESOLVE_RETURNED_INTROSPECTION );
-            }
-            if (pAssembly->IsCollectible())
-            {
-                COMPlusThrow(kNotSupportedException, W("NotSupported_CollectibleAssemblyResolve"));
-            }
-
-            // Check that the public key token matches the one specified in the spec
-            // MatchPublicKeys throws as appropriate.
-            
-            StackScratchBuffer ssBuffer;
-            AssemblySpec spec;
-            IfFailThrow(spec.Init(ssAssemblyName.GetUTF8(ssBuffer)));
-            spec.MatchPublicKeys(pAssembly);
-
-        }
-
-        if (pAssembly == nullptr)
-            ThrowHR(COR_E_FILENOTFOUND);
-
-        RETURN  pAssembly->GetManifestFile()->GetHostAssembly();
-    }
-
-    BOOL CompareHostBinderSpecs(AssemblySpec * a1, AssemblySpec * a2)
-    {
-        WRAPPER_NO_CONTRACT;
-        return a1->CompareEx(a2, AssemblySpec::ASC_Default);
-    }
-#endif // FEATURE_APPX
 } // namespace CLRPrivBinderUtil
index 5da5ed2..c98317b 100644 (file)
@@ -198,9 +198,6 @@ CLRPrivBinderWinRT::GetOrCreateBinder(
     HRESULT hr = S_OK;
 
     // This should be allocated directly by CLRPrivBinderAppX in the AppX scenario.
-#ifdef FEATURE_APPX_BINDER
-       _ASSERTE(!AppX::IsAppXProcess());
-#endif
 
     if (s_pSingleton == nullptr)
     {
index 0ae75ec..94bae80 100644 (file)
@@ -1669,23 +1669,6 @@ BOOL EEJitManager::LoadJIT()
             }
         }
 
-#if defined(FEATURE_APPX_BINDER)
-        if (!fUsingCompatJit)
-        {
-            // AppX applications don't have a .config file for per-app configuration. So, we allow the placement of a single
-            // distinguished file, "UseLegacyJit.txt" in the root of the app's package to indicate that the app should fall
-            // back to JIT64. This same file is also used to prevent this app from participating in AutoNgen.
-            if (AppX::IsAppXProcess())
-            {
-                WCHAR szPathName[MAX_LONGPATH];
-                UINT32 cchPathName = MAX_LONGPATH;
-                if (AppX::FindFileInCurrentPackage(L"UseLegacyJit.txt", &cchPathName, szPathName, PACKAGE_FILTER_HEAD) == S_OK)
-                {
-                    fUsingCompatJit = TRUE;
-                }
-            }
-        }
-#endif // FEATURE_APPX_BINDER
 
         if (fUsingCompatJit)
         {
index 8eaab5e..dffe7a6 100644 (file)
 #include "cgensys.h"
 #include "peimagelayout.inl"
 
-#if defined(FEATURE_APPX_BINDER)
-#include "appxutil.h"
-#include "clrprivbinderappx.h"
-#include "clrprivtypecachewinrt.h"
-#endif // defined(FEATURE_APPX_BINDER)
 
 #ifdef FEATURE_COMINTEROP
 #include "clrprivbinderwinrt.h"
@@ -160,17 +155,6 @@ HRESULT CEECompileInfo::CreateDomain(ICorCompilationDomain **ppDomain,
     if (pEmitter)
         pCompilationDomain->SetDependencyEmitter(pEmitter);
     
-#if defined(FEATURE_APPX_BINDER)
-    if (AppX::IsAppXProcess())
-    {
-        HRESULT hr = S_OK;
-        ReleaseHolder<ICLRPrivBinder> pBinderInterface;
-        CLRPrivBinderAppX * pBinder = CLRPrivBinderAppX::GetOrCreateBinder();
-        
-        IfFailThrow(pBinder->QueryInterface(IID_ICLRPrivBinder, &pBinderInterface));
-        pCompilationDomain->SetLoadContextHostBinder(pBinderInterface);
-    }
-#endif // defined(FEATURE_APPX_BINDER)
 
 #ifdef DEBUGGING_SUPPORTED 
     // Notify the debugger here, before the thread transitions into the
@@ -498,10 +482,8 @@ HRESULT CEECompileInfo::LoadAssemblyByPath(
             // Now load assembly into domain.
             DomainAssembly * pDomainAssembly = pDomain->LoadDomainAssembly(&spec, pAssemblyHolder, FILE_LOAD_BEGIN);
 
-#ifndef FEATURE_APPX_BINDER
             if (spec.CanUseWithBindingCache() && pDomainAssembly->CanUseWithBindingCache())
                 pDomain->AddAssemblyToCache(&spec, pDomainAssembly);
-#endif
 
 
             {
index 7bedffe..26bb237 100644 (file)
 #include "winrttypenameconverter.h"
 #endif
 
-#if defined(FEATURE_APPX_BINDER)
-#include "clrprivbinderappx.h"
-#include "clrprivtypecachewinrt.h"
-#endif
 
 GVAL_IMPL_INIT(DWORD, g_fHostConfig, 0);
 
@@ -5198,16 +5194,6 @@ HRESULT STDMETHODCALLTYPE DllGetActivationFactoryImpl(LPCWSTR wszAssemblyName,
             } gc;
             memset(&gc, 0, sizeof(gc));
 
-#if defined(FEATURE_MULTICOREJIT) && defined(FEATURE_APPX_BINDER)
-            // For Appx, multicore JIT is only needed when root assembly does not have NI image
-            // When it has NI image, we can't generate profile, and do not need to playback profile
-            if (AppX::IsAppXProcess() && ! typeHandle.IsZapped())
-            {
-                GCX_PREEMP();
-
-                pDomain->GetMulticoreJitManager().AutoStartProfileAppx(pDomain);
-            }
-#endif
 
             IActivationFactory* activationFactory;
             GCPROTECT_BEGIN(gc);
index e4d9bfc..627239c 100644 (file)
@@ -2617,11 +2617,7 @@ Retry:
     fInsertIntoAssemblySpecBindingCache = GetFile()->GetLoadContext() == LOADCTX_TYPE_DEFAULT;
 #endif
     
-#if defined(FEATURE_APPX_BINDER)
-    fInsertIntoAssemblySpecBindingCache = fInsertIntoAssemblySpecBindingCache && !GetFile()->HasHostAssembly();
-#else
     fInsertIntoAssemblySpecBindingCache = fInsertIntoAssemblySpecBindingCache && GetFile()->CanUseWithBindingCache();
-#endif
 
     if (fInsertIntoAssemblySpecBindingCache)
     {
index a62eb29..922b14d 100644 (file)
@@ -58,10 +58,6 @@ IUEFManager * g_pUEFManager = NULL;
 // Support for extracting MethodDesc of a delegate.
 #include "comdelegate.h"
 
-#if defined(FEATURE_APPX_BINDER) && !defined(DACCESS_COMPILE)
-// For determining if we have a framework assembly trying to handle a corrupted state exception
-#include "policy.h"
-#endif // FEATURE_APPX && !DACCESS_COMPILE
 
 #ifndef FEATURE_PAL
 // Windows uses 64kB as the null-reference area
@@ -11554,25 +11550,6 @@ BOOL CEHelper::CanMethodHandleCE(PTR_MethodDesc pMethodDesc, CorruptionSeverity
     }
     CONTRACTL_END;
 
-#ifdef FEATURE_APPX_BINDER
-    // In an Metro application, disallow application code to catch any corrupted state exception
-    if (AppX::IsAppXProcess())
-    {
-        // This call to GetFusionAssemblyNameNoCreate will return a valid fusion assembly name
-        // in the second pass of exception dispatch as the name would have been created in the first pass,
-        // if not already existent.
-        IAssemblyName *pIAssemblyName = pMethodDesc->GetAssembly()->GetFusionAssemblyNameNoCreate();
-        if (!pIAssemblyName)
-        {
-            pIAssemblyName = pMethodDesc->GetAssembly()->GetFusionAssemblyName();
-        }
-        
-        if (Fusion::Util::IsAnyFrameworkAssembly(pIAssemblyName) != S_OK)
-        {
-            return FALSE;
-        }
-    }
-#endif // FEATURE_APPX
 
     if (g_pConfig->LegacyCorruptedStateExceptionsPolicy())
     {
index 98b290e..fccfd98 100644 (file)
 
 const wchar_t * AppxProfile    = W("Application.Profile");
 
-#if defined(FEATURE_APPX_BINDER)
-
-//static 
-bool MulticoreJitManager::IsLoadOkay(Module * pModule)
-{
-    CONTRACTL
-    {
-        THROWS;
-        SO_INTOLERANT;
-        MODE_ANY;
-    }
-    CONTRACTL_END;
-
-    if (pModule->GetAssembly()->GetManifestFile()->IsWindowsRuntime())
-    {
-        PEFile * pFile = pModule->GetFile();
-    
-        ICLRPrivAssembly * pHostAsm = pFile->GetHostAssembly();
-
-        // Allow first party WinMD to load in multicore JIT background thread
-        if (pHostAsm != NULL)
-        {
-            BOOL shared = FALSE;
-
-            if (SUCCEEDED(pHostAsm->IsShareable(& shared)))
-            {
-                if (shared)
-                {
-                    LPCUTF8 simpleName = pModule->GetSimpleName();
-
-                    if (IsWindowsNamespace(simpleName))
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-    }
-
-    return false;
-}
-
-#endif
 
 
 void MulticoreJitFireEtw(const wchar_t * pAction, const wchar_t * pTarget, int p1, int p2, int p3)
@@ -379,15 +336,6 @@ bool RecorderModuleInfo::SetModule(Module * pMod)
     unsigned lenAssemblyName = sAssemblyName.GetCount();
     assemblyName.Set((const BYTE *) pAssemblyName, lenAssemblyName);
 
-#if defined(FEATURE_APPX_BINDER)
-
-    // Allow certain modules to load on background thread
-    if (AppX::IsAppXProcess() && MulticoreJitManager::IsLoadOkay(pMod))
-    {
-        flags |= FLAG_LOADOKAY;
-    }
-
-#endif
 
     return  moduleVersion.GetModuleVersion(pMod);
 }
@@ -716,60 +664,6 @@ HRESULT MulticoreJitModuleEnumerator::EnumerateLoadedModules(AppDomain * pDomain
 }
 
 
-#if defined(FEATURE_APPX_BINDER)
-// ProfileName = ProcessName_CoreAppId.Profile   ; for server process, always use it for output
-//               ProcessName.Profile
-
-void AppendAppxProfileName(SString & name)
-{
-    CONTRACTL
-    {
-        THROWS;
-        GC_TRIGGERS;
-    } CONTRACTL_END;
-
-    {
-        WCHAR wszProcessName[_MAX_PATH];
-
-        if (WszGetModuleFileName(NULL, wszProcessName, _MAX_PATH) != 0)
-        {
-            WCHAR * pNameOnly = wcsrchr(wszProcessName, W('\\'));
-     
-            if (pNameOnly == NULL)
-            {
-                pNameOnly = wszProcessName;
-            }
-            else
-            {
-                pNameOnly ++;
-            }
-
-            WCHAR * pExt = wcsrchr(pNameOnly, W('.')); // last .
-
-            if (pExt != NULL)
-            {
-                * pExt = 0;
-            }
-
-            // Use process name only
-            name.Append(pNameOnly);
-            name.Append(W("_"));
-        }
-    }
-
-    LPCWSTR pAppId = NULL;
-    if (SUCCEEDED(AppX::GetApplicationId(pAppId)))
-    {
-        name.Append(pAppId);
-        name.Append(W(".Profile"));
-
-        return;
-    }
-
-    // default name
-    name.Append(AppxProfile);
-}
-#endif
 
 // static: single instace within a process
 
@@ -796,25 +690,6 @@ MulticoreJitRecorder::WriteMulticoreJitProfiler(PTP_CALLBACK_INSTANCE pInstance,
 
     if (pRecorder != NULL)
     {
-#if defined(FEATURE_APPX_BINDER)
-        if (pRecorder->m_fAppxMode)
-        {
-            const wchar_t * pOutputDir = NULL;
-
-            HRESULT hr = Clr::Util::GetLocalAppDataDirectory(&pOutputDir);
-
-            if (SUCCEEDED(hr))
-            {
-                pRecorder->m_fullFileName = pOutputDir;
-                pRecorder->m_fullFileName.Append(W("\\"));
-
-                AppendAppxProfileName(pRecorder->m_fullFileName);
-
-                pRecorder->StopProfile(false);
-            }
-        }
-        else
-#endif
         {
             pRecorder->StopProfile(false);
         }
@@ -1360,48 +1235,6 @@ void MulticoreJitManager::AutoStartProfile(AppDomain * pDomain)
     }
 }
 
-#if defined(FEATURE_APPX_BINDER)
-
-// Called from CorHost2::ExecuteMain
-void MulticoreJitManager::AutoStartProfileAppx(AppDomain * pDomain)
-{
-    CONTRACTL
-    {
-        THROWS;
-        GC_TRIGGERS;
-        MODE_PREEMPTIVE;
-        INJECT_FAULT(COMPlusThrowOM(););
-    }
-    CONTRACTL_END;
-
-    if (InterlockedCompareExchange(& m_fAutoStartCalled, SETPROFILEROOTCALLED, 0) == 0) // Only allow the first call
-    {
-        WCHAR wzFilePath[_MAX_PATH];
-
-        UINT32 cchFilePath = NumItems(wzFilePath);
-
-        SString profileName;
-
-        // Try to find ProcessName_AppId.Profile
-        AppendAppxProfileName(profileName);
-
-        // Search for Application.Profile within the package
-        HRESULT hr = AppX::FindFileInCurrentPackage(profileName, &cchFilePath, wzFilePath);
-
-        if (SUCCEEDED(hr))
-        {
-            m_fAppxMode = true;
-            SetProfileRoot(pDomain, W("")); // Fake a SetProfileRoot call
-            StartProfile(pDomain, NULL, wzFilePath);
-        }
-        else
-        {
-            _FireEtwMulticoreJit(W("AUTOSTARTPROFILEAPPX"), profileName, hr, 0, 0);
-        }
-    }
-}
-
-#endif
 
 // Constructor
 
index 1945894..b7a0951 100644 (file)
@@ -200,12 +200,6 @@ public:
         return m_fSetProfileRootCalled == 0;
     }
 
-#if defined(FEATURE_APPX_BINDER)
-
-    // Check for file appx.prof to automatically start multicore JIT
-    void AutoStartProfileAppx(AppDomain * pDomain);
-
-#endif
 
     // Check for environment variable to automatically start multicore JIT
     void AutoStartProfile(AppDomain * pDomain);
@@ -255,11 +249,6 @@ public:
 
     static bool ModuleHasNoCode(Module * pModule);
 
-#if defined(FEATURE_APPX_BINDER)
-
-    static bool IsLoadOkay(Module * pModule);
-
-#endif
 
 };
 
index d7152a7..9d20adc 100644 (file)
@@ -392,10 +392,6 @@ public:
         m_fAborted          = false;
         m_fAppxMode         = fAppxMode;
 
-#if defined(FEATURE_APPX_BINDER)
-
-        s_delayedWriteTimer = NULL;
-#endif
 
         m_stats.Clear();
     }
index adf7a38..290cc8b 100644 (file)
@@ -482,17 +482,6 @@ bool MulticoreJitManager::IsSupportedModule(Module * pModule, bool fMethodJit, b
     
     LOADCTX_TYPE context = pAssembly->GetManifestFile()->GetLoadContext();
 
-#if defined(FEATURE_APPX_BINDER)
-
-    if (fAppx)
-    {
-        if (context == LOADCTX_TYPE_HOSTED)
-        {
-            return true;
-        }
-    }
-
-#endif
 
     return ((context == LOADCTX_TYPE_DEFAULT) || (context == LOADCTX_TYPE_LOADFROM));
 
index afe5730..c02dc2b 100644 (file)
@@ -2803,16 +2803,6 @@ PEAssembly *PEAssembly::DoOpenSystem(IUnknown * pAppCtx)
 
     PEAssembly* pPEAssembly = new PEAssembly(image, NULL, pIAssembly,pNativeFusionAssembly, NULL, pFusionLog, NULL, NULL, TRUE, FALSE);
 
-#ifdef FEATURE_APPX_BINDER
-    if (AppX::IsAppXProcess())
-    {
-        // Since mscorlib is loaded as a special case, create and assign an ICLRPrivAssembly for the new PEAssembly here.
-        CLRPrivBinderAppX *   pBinder = CLRPrivBinderAppX::GetOrCreateBinder();
-        CLRPrivBinderFusion * pFusionBinder = pBinder->GetFusionBinder();
-        
-        pFusionBinder->BindMscorlib(pPEAssembly);
-    }
-#endif
     
     RETURN pPEAssembly;
 #else // FEATURE_FUSION
index 0681b3e..31b7925 100644 (file)
@@ -1039,11 +1039,7 @@ class PEAssembly : public PEFile
     inline bool CanUseWithBindingCache()
     {
             STATIC_CONTRACT_WRAPPER;
-#if !defined(FEATURE_APPX_BINDER)
             return (HasBindableIdentity());
-#else
-            return (PEFile::CanUseWithBindingCache() && HasBindableIdentity());
-#endif // FEATURE_CORECLR
     }
 };