diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/debug/daccess/stdafx.h | 3 | ||||
-rw-r--r-- | src/inc/dacvars.h | 3 | ||||
-rw-r--r-- | src/vm/appdomain.cpp | 167 | ||||
-rw-r--r-- | src/vm/appdomainnative.cpp | 55 | ||||
-rw-r--r-- | src/vm/appdomainnative.hpp | 7 | ||||
-rw-r--r-- | src/vm/assembly.cpp | 23 | ||||
-rw-r--r-- | src/vm/assemblyspec.cpp | 12 | ||||
-rw-r--r-- | src/vm/assemblyspec.hpp | 4 | ||||
-rw-r--r-- | src/vm/callhelpers.cpp | 11 | ||||
-rw-r--r-- | src/vm/ceeload.cpp | 25 | ||||
-rw-r--r-- | src/vm/clrprivbinderutil.cpp | 97 | ||||
-rw-r--r-- | src/vm/clrprivbinderwinrt.cpp | 3 | ||||
-rw-r--r-- | src/vm/codeman.cpp | 17 | ||||
-rw-r--r-- | src/vm/compile.cpp | 18 | ||||
-rw-r--r-- | src/vm/corhost.cpp | 14 | ||||
-rw-r--r-- | src/vm/domainfile.cpp | 4 | ||||
-rw-r--r-- | src/vm/excep.cpp | 23 | ||||
-rw-r--r-- | src/vm/multicorejit.cpp | 167 | ||||
-rw-r--r-- | src/vm/multicorejit.h | 11 | ||||
-rw-r--r-- | src/vm/multicorejitimpl.h | 4 | ||||
-rw-r--r-- | src/vm/multicorejitplayer.cpp | 11 | ||||
-rw-r--r-- | src/vm/pefile.cpp | 10 | ||||
-rw-r--r-- | src/vm/pefile.h | 4 |
23 files changed, 0 insertions, 693 deletions
diff --git a/src/debug/daccess/stdafx.h b/src/debug/daccess/stdafx.h index 5c2d37688b..1c19ebff10 100644 --- a/src/debug/daccess/stdafx.h +++ b/src/debug/daccess/stdafx.h @@ -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> diff --git a/src/inc/dacvars.h b/src/inc/dacvars.h index 7465866c7a..7289533e1b 100644 --- a/src/inc/dacvars.h +++ b/src/inc/dacvars.h @@ -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) diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index b40dba4ce8..8efb3c5692 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -94,10 +94,6 @@ #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); } diff --git a/src/vm/appdomainnative.cpp b/src/vm/appdomainnative.cpp index 5a1efc015f..0c32baf3c4 100644 --- a/src/vm/appdomainnative.cpp +++ b/src/vm/appdomainnative.cpp @@ -19,10 +19,6 @@ #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) diff --git a/src/vm/appdomainnative.hpp b/src/vm/appdomainnative.hpp index a2faff068c..6f6c564869 100644 --- a/src/vm/appdomainnative.hpp +++ b/src/vm/appdomainnative.hpp @@ -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 diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp index 093de2ed25..2249dec6a2 100644 --- a/src/vm/assembly.cpp +++ b/src/vm/assembly.cpp @@ -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 diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp index ec42f1e15b..00f0efd18f 100644 --- a/src/vm/assemblyspec.cpp +++ b/src/vm/assemblyspec.cpp @@ -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())) diff --git a/src/vm/assemblyspec.hpp b/src/vm/assemblyspec.hpp index d6f54445b3..94a7844464 100644 --- a/src/vm/assemblyspec.hpp +++ b/src/vm/assemblyspec.hpp @@ -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 diff --git a/src/vm/callhelpers.cpp b/src/vm/callhelpers.cpp index addd5192da..18c935a5b4 100644 --- a/src/vm/callhelpers.cpp +++ b/src/vm/callhelpers.cpp @@ -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()); } diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index c89e7a641e..605c014d41 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -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*/); } diff --git a/src/vm/clrprivbinderutil.cpp b/src/vm/clrprivbinderutil.cpp index b6871123d9..46d50f1552 100644 --- a/src/vm/clrprivbinderutil.cpp +++ b/src/vm/clrprivbinderutil.cpp @@ -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 diff --git a/src/vm/clrprivbinderwinrt.cpp b/src/vm/clrprivbinderwinrt.cpp index 5da5ed2967..c98317bb20 100644 --- a/src/vm/clrprivbinderwinrt.cpp +++ b/src/vm/clrprivbinderwinrt.cpp @@ -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) { diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp index 0ae75ecaa6..94bae80c7e 100644 --- a/src/vm/codeman.cpp +++ b/src/vm/codeman.cpp @@ -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) { diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp index 8eaab5e222..dffe7a6581 100644 --- a/src/vm/compile.cpp +++ b/src/vm/compile.cpp @@ -48,11 +48,6 @@ #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 { diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp index 7bedffed05..26bb237363 100644 --- a/src/vm/corhost.cpp +++ b/src/vm/corhost.cpp @@ -49,10 +49,6 @@ #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); diff --git a/src/vm/domainfile.cpp b/src/vm/domainfile.cpp index e4d9bfc158..627239c487 100644 --- a/src/vm/domainfile.cpp +++ b/src/vm/domainfile.cpp @@ -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) { diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index a62eb29d7e..922b14df45 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -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()) { diff --git a/src/vm/multicorejit.cpp b/src/vm/multicorejit.cpp index 98b290ec82..fccfd98aa7 100644 --- a/src/vm/multicorejit.cpp +++ b/src/vm/multicorejit.cpp @@ -33,49 +33,6 @@ 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 diff --git a/src/vm/multicorejit.h b/src/vm/multicorejit.h index 19458944bb..b7a0951ee1 100644 --- a/src/vm/multicorejit.h +++ b/src/vm/multicorejit.h @@ -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 }; diff --git a/src/vm/multicorejitimpl.h b/src/vm/multicorejitimpl.h index d7152a729b..9d20adceef 100644 --- a/src/vm/multicorejitimpl.h +++ b/src/vm/multicorejitimpl.h @@ -392,10 +392,6 @@ public: m_fAborted = false; m_fAppxMode = fAppxMode; -#if defined(FEATURE_APPX_BINDER) - - s_delayedWriteTimer = NULL; -#endif m_stats.Clear(); } diff --git a/src/vm/multicorejitplayer.cpp b/src/vm/multicorejitplayer.cpp index adf7a381f4..290cc8b076 100644 --- a/src/vm/multicorejitplayer.cpp +++ b/src/vm/multicorejitplayer.cpp @@ -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)); diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp index afe5730c6f..c02dc2b281 100644 --- a/src/vm/pefile.cpp +++ b/src/vm/pefile.cpp @@ -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 diff --git a/src/vm/pefile.h b/src/vm/pefile.h index 0681b3e4a9..31b7925dc3 100644 --- a/src/vm/pefile.h +++ b/src/vm/pefile.h @@ -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 } }; |