From d3392e5684483ae5518dcaa775c8f86dc1b08ec6 Mon Sep 17 00:00:00 2001 From: danmosemsft Date: Tue, 14 Feb 2017 21:34:56 -0800 Subject: [PATCH] Remove never defined FEATURE_REFLECTION_ONLY_LOAD --- clr.defines.targets | 2 - clr.props | 1 - src/mscorlib/src/System/AppDomain.cs | 50 ----- .../src/System/Reflection/Emit/AssemblyBuilder.cs | 3 - .../Reflection/Emit/AssemblyBuilderAccess.cs | 3 - .../WindowsRuntime/WindowsRuntimeMetadata.cs | 39 ---- src/vm/appdomain.cpp | 250 --------------------- src/vm/appdomain.hpp | 8 - src/vm/assemblynative.cpp | 20 -- src/vm/assemblyspec.cpp | 22 -- src/vm/ceeload.cpp | 16 -- src/vm/ecalllist.h | 8 - src/vm/mscorlib.cpp | 4 - src/vm/mscorlib.h | 10 - src/vm/object.h | 3 - 15 files changed, 439 deletions(-) diff --git a/clr.defines.targets b/clr.defines.targets index 61ee17a..9ed5603 100644 --- a/clr.defines.targets +++ b/clr.defines.targets @@ -57,7 +57,6 @@ $(CDefines);FEATURE_PERFMON $(CDefines);FEATURE_PREJIT $(CDefines);FEATURE_RANDOMIZED_STRING_HASHING - $(CDefines);FEATURE_REFLECTION_ONLY_LOAD $(CDefines);FEATURE_REJIT $(CDefines);FEATURE_REMOTING $(CDefines);FEATURE_SORT_TABLES @@ -116,7 +115,6 @@ $(DefineConstants);FEATURE_EVENTSOURCE_XPLAT $(DefineConstants);FEATURE_PERFMON $(DefineConstants);FEATURE_RANDOMIZED_STRING_HASHING - $(DefineConstants);FEATURE_REFLECTION_ONLY_LOAD $(DefineConstants);FEATURE_REMOTING $(DefineConstants);FEATURE_SORT_TABLES $(DefineConstants);FEATURE_TYPEEQUIVALENCE diff --git a/clr.props b/clr.props index b1d3618..e6169d1 100644 --- a/clr.props +++ b/clr.props @@ -132,7 +132,6 @@ false true false - false false false false diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 8e66871..c6fa7d4 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -246,9 +246,6 @@ namespace System } } -#if FEATURE_REFLECTION_ONLY_LOAD - public event ResolveEventHandler ReflectionOnlyAssemblyResolve; -#endif // FEATURE_REFLECTION_ONLY private ApplicationTrust _applicationTrust; private EventHandler _processExit; @@ -656,53 +653,6 @@ namespace System } } -#if FEATURE_REFLECTION_ONLY_LOAD - private Assembly ResolveAssemblyForIntrospection(Object sender, ResolveEventArgs args) - { - Contract.Requires(args != null); - return Assembly.ReflectionOnlyLoad(ApplyPolicy(args.Name)); - } - - // Helper class for method code:EnableResolveAssembliesForIntrospection - private class NamespaceResolverForIntrospection - { - private IEnumerable _packageGraphFilePaths; - public NamespaceResolverForIntrospection(IEnumerable packageGraphFilePaths) - { - _packageGraphFilePaths = packageGraphFilePaths; - } - - public void ResolveNamespace( - object sender, - System.Runtime.InteropServices.WindowsRuntime.NamespaceResolveEventArgs args) - { - Contract.Requires(args != null); - - IEnumerable fileNames = System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ResolveNamespace( - args.NamespaceName, - null, // windowsSdkFilePath ... Use OS installed .winmd files - _packageGraphFilePaths); - foreach (string fileName in fileNames) - { - args.ResolvedAssemblies.Add(Assembly.ReflectionOnlyLoadFrom(fileName)); - } - } - } - - // Called only by native function code:ValidateWorker - private void EnableResolveAssembliesForIntrospection(string verifiedFileDirectory) - { - CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(ResolveAssemblyForIntrospection); - - string[] packageGraphFilePaths = null; - if (verifiedFileDirectory != null) - packageGraphFilePaths = new string[] { verifiedFileDirectory }; - NamespaceResolverForIntrospection namespaceResolver = new NamespaceResolverForIntrospection(packageGraphFilePaths); - - System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeMetadata.ReflectionOnlyNamespaceResolve += - new EventHandler(namespaceResolver.ResolveNamespace); - } -#endif // FEATURE_REFLECTION_ONLY_LOAD public ObjectHandle CreateInstance(String assemblyName, String typeName) diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs index 3deef21..8ab5088 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -242,9 +242,6 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(name)); if (access != AssemblyBuilderAccess.Run -#if FEATURE_REFLECTION_ONLY_LOAD - && access != AssemblyBuilderAccess.ReflectionOnly -#endif // FEATURE_REFLECTION_ONLY_LOAD && access != AssemblyBuilderAccess.RunAndCollect ) { diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs index b3d1711..e52135e 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderAccess.cs @@ -14,9 +14,6 @@ namespace System.Reflection.Emit public enum AssemblyBuilderAccess { Run = 1, -#if FEATURE_REFLECTION_ONLY_LOAD - ReflectionOnly = 6, // 4 | Save, -#endif // FEATURE_REFLECTION_ONLY_LOAD RunAndCollect = 8 | Run } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs index f097c6a..429112c 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs @@ -57,45 +57,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime } } -#if FEATURE_REFLECTION_ONLY_LOAD - public class NamespaceResolveEventArgs : EventArgs - { - private string _NamespaceName; - private Assembly _RequestingAssembly; - private Collection _ResolvedAssemblies; - - public string NamespaceName - { - get - { - return _NamespaceName; - } - } - - public Assembly RequestingAssembly - { - get - { - return _RequestingAssembly; - } - } - - public Collection ResolvedAssemblies - { - get - { - return _ResolvedAssemblies; - } - } - - public NamespaceResolveEventArgs(string namespaceName, Assembly requestingAssembly) - { - _NamespaceName = namespaceName; - _RequestingAssembly = requestingAssembly; - _ResolvedAssemblies = new Collection(); - } - } -#endif //FEATURE_REFLECTION_ONLY internal class DesignerNamespaceResolveEventArgs : EventArgs { diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index 3b4be97..a02e9ed 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -4212,10 +4212,6 @@ AppDomain::AppDomain() #endif // FEATURE_TYPEEQUIVALENCE #ifdef FEATURE_COMINTEROP -#ifdef FEATURE_REFLECTION_ONLY_LOAD - m_pReflectionOnlyWinRtBinder = NULL; - m_pReflectionOnlyWinRtTypeCache = NULL; -#endif // FEATURE_REFLECTION_ONLY_LOAD m_pNameToTypeMap = NULL; m_vNameToTypeMapVersion = 0; m_nEpoch = 0; @@ -4278,16 +4274,6 @@ AppDomain::~AppDomain() #endif // FEATURE_REMOTING #ifdef FEATURE_COMINTEROP -#ifdef FEATURE_REFLECTION_ONLY_LOAD - if (m_pReflectionOnlyWinRtBinder != NULL) - { - m_pReflectionOnlyWinRtBinder->Release(); - } - if (m_pReflectionOnlyWinRtTypeCache != NULL) - { - m_pReflectionOnlyWinRtTypeCache->Release(); - } -#endif // FEATURE_REFLECTION_ONLY_LOAD if (m_pNameToTypeMap != nullptr) { delete m_pNameToTypeMap; @@ -4461,10 +4447,6 @@ void AppDomain::Init() #ifdef FEATURE_COMINTEROP if (!AppX::IsAppXProcess()) { -#ifdef FEATURE_REFLECTION_ONLY_LOAD - m_pReflectionOnlyWinRtTypeCache = clr::SafeAddRef(new CLRPrivTypeCacheReflectionOnlyWinRT()); - m_pReflectionOnlyWinRtBinder = clr::SafeAddRef(new CLRPrivBinderReflectionOnlyWinRT(m_pReflectionOnlyWinRtTypeCache)); -#endif } #endif //FEATURE_COMINTEROP @@ -7327,63 +7309,6 @@ EndTry2:; HRESULT hrBindResult = S_OK; PEAssemblyHolder result; -#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD) - // We want to keep this holder around to avoid closing and remapping the file again - calls to Fusion further down will open the file again - ReleaseHolder pMetaDataAssemblyImport; - - // Special case ReflectionOnlyLoadFrom on .winmd (WinRT) assemblies - if (pSpec->IsIntrospectionOnly() && (pSpec->m_wszCodeBase != NULL)) - { // This is a LoadFrom request - we need to find out if it is .winmd file or classic managed assembly - HRESULT hr = S_OK; - - StackSString sPath(pSpec->GetCodeBase()); - PEAssembly::UrlToPath(sPath); - - // Open MetaData of the file - hr = GetAssemblyMDInternalImportEx( - sPath, - IID_IMetaDataAssemblyImport, - MDInternalImport_Default, - (IUnknown **)&pMetaDataAssemblyImport); - if (SUCCEEDED(hr)) - { - DWORD dwAssemblyFlags = 0; - hr = pMetaDataAssemblyImport->GetAssemblyProps( - TokenFromRid(1, mdtAssembly), - nullptr, // ppbPublicKey - nullptr, // pcbPublicKey - nullptr, // pulHashAlgId - nullptr, // szName - 0, // cchName - nullptr, // pchName - nullptr, // pMetaData - &dwAssemblyFlags); - if (SUCCEEDED(hr) && IsAfContentType_WindowsRuntime(dwAssemblyFlags)) - { // It is .winmd file - _ASSERTE(!AppX::IsAppXProcess()); - - ReleaseHolder pPrivAssembly; - ReleaseHolder pAssembly; - - hr = m_pReflectionOnlyWinRtBinder->BindAssemblyExplicit(sPath, &pPrivAssembly); - if (SUCCEEDED(hr)) - { - hr = BindHostedPrivAssembly(nullptr, pPrivAssembly, nullptr, &pAssembly, TRUE); - _ASSERTE(FAILED(hr) || (pAssembly != nullptr)); - } - if (FAILED(hr)) - { - if (fThrowOnFileNotFound) - { - ThrowHR(hr); - } - return nullptr; - } - return pAssembly.Extract(); - } - } - } -#endif //FEATURE_COMINTEROP && FEATURE_REFLECTION_ONLY_LOAD EX_TRY { @@ -7427,28 +7352,6 @@ EndTry2:; if (fAddFileToCache) { -#ifdef FEATURE_REFLECTION_ONLY_LOAD - // PERF: This doesn't scale... - if (pSpec->IsIntrospectionOnly() && (pSpec->GetCodeBase() != NULL)) - { - IAssemblyName * pIAssemblyName = result->GetFusionAssemblyName(); - - AppDomain::AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)( - kIncludeLoaded | kIncludeIntrospection)); - CollectibleAssemblyHolder pCachedDomainAssembly; - while (i.Next(pCachedDomainAssembly.This())) - { - IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName(); - if (pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL) == S_OK) - { - if (!pCachedDomainAssembly->GetAssembly()->GetManifestModule()->GetFile()->Equals(result)) - { - COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFROM, pSpec->GetCodeBase()); - } - } - } - } -#endif //FEATURE_REFLECTION_ONLY_LOAD if (pSpec->CanUseWithBindingCache() && result->CanUseWithBindingCache()) { @@ -7614,139 +7517,6 @@ EndTry2:; } // AppDomain::BindAssemblySpec -#ifdef FEATURE_REFLECTION_ONLY_LOAD -DomainAssembly * -AppDomain::BindAssemblySpecForIntrospectionDependencies( - AssemblySpec * pSpec) -{ - STANDARD_VM_CONTRACT; - - PRECONDITION(CheckPointer(pSpec)); - PRECONDITION(pSpec->GetAppDomain() == this); - PRECONDITION(pSpec->IsIntrospectionOnly()); - PRECONDITION(this == ::GetAppDomain()); - - PEAssemblyHolder result; - HRESULT hr; - - if (!pSpec->HasUniqueIdentity()) - { - if (!pSpec->HasBindableIdentity()) - { - COMPlusThrowHR(E_UNEXPECTED); - } - - // In classic (non-AppX), this is initilized by AppDomain constructor - _ASSERTE(m_pReflectionOnlyWinRtBinder != NULL); - - ReleaseHolder pPrivAssembly; - hr = m_pReflectionOnlyWinRtBinder->BindWinRtType( - pSpec->GetWinRtTypeNamespace(), - pSpec->GetWinRtTypeClassName(), - pSpec->GetParentAssembly(), - &pPrivAssembly); - if (FAILED(hr)) - { - if (hr == CLR_E_BIND_TYPE_NOT_FOUND) - { // We could not find the type - throw TypeLoadException to give user type name for diagnostics - EX_THROW(EETypeLoadException, (pSpec->GetWinRtTypeNamespace(), pSpec->GetWinRtTypeClassName(), nullptr, nullptr, IDS_EE_REFLECTIONONLY_WINRT_LOADFAILURE)); - } - if (!Exception::IsTransient(hr)) - { // Throw the HRESULT as exception wrapped by TypeLoadException to give user type name for diagnostics - EEMessageException ex(hr); - EX_THROW_WITH_INNER(EETypeLoadException, (pSpec->GetWinRtTypeNamespace(), pSpec->GetWinRtTypeClassName(), nullptr, nullptr, IDS_EE_REFLECTIONONLY_WINRT_LOADFAILURE), &ex); - } - IfFailThrow(hr); - } - - IfFailThrow(BindHostedPrivAssembly(nullptr, pPrivAssembly, nullptr, &result, TRUE)); - _ASSERTE(result != nullptr); - return LoadDomainAssembly(pSpec, result, FILE_LOADED); - } - - EX_TRY - { - if (!IsCached(pSpec)) - { - result = TryResolveAssembly(pSpec, TRUE /*fPreBind*/); - if (result != NULL && result->CanUseWithBindingCache()) - { - // Failure to add simply means someone else beat us to it. In that case - // the FindCachedFile call below (after catch block) will update result - // to the cached value. - AddFileToCache(pSpec, result, TRUE /*fAllowFailure*/); - } - } - } - EX_CATCH - { - Exception *ex = GET_EXCEPTION(); - AssemblySpec NewSpec(this); - AssemblySpec *pFailedSpec = NULL; - - // Let transient exceptions propagate - if (ex->IsTransient()) - { - EX_RETHROW; - } - - // Non-"file not found" exception also propagate - BOOL fFailure = PostBindResolveAssembly(pSpec, &NewSpec, ex->GetHR(), &pFailedSpec); - if(fFailure) - { - if (AddExceptionToCache(pFailedSpec, ex)) - { - if ((pFailedSpec == pSpec) && EEFileLoadException::CheckType(ex)) - { - EX_RETHROW; //preserve the information - } - else - EEFileLoadException::Throw(pFailedSpec, ex->GetHR(), ex); - } - } - } - EX_END_CATCH(RethrowTerminalExceptions); - - result = FindCachedFile(pSpec); - result.SuppressRelease(); - - - if (result) - { - // It was either already in the spec cache or the prebind event returned a result. - return LoadDomainAssembly(pSpec, result, FILE_LOADED); - } - - - // Otherwise, look in the list of assemblies already loaded for reflectiononly. - IAssemblyName * ptmp = NULL; - hr = pSpec->CreateFusionName(&ptmp); - if (FAILED(hr)) - { - COMPlusThrowHR(hr); - } - SafeComHolder pIAssemblyName(ptmp); - - // Note: We do not support introspection-only collectible assemblies (yet) - AppDomain::AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)( - kIncludeLoaded | kIncludeIntrospection | kExcludeCollectible)); - CollectibleAssemblyHolder pCachedDomainAssembly; - - while (i.Next(pCachedDomainAssembly.This())) - { - _ASSERTE(!pCachedDomainAssembly->IsCollectible()); - IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName(); - if (pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL) == S_OK) - { - return pCachedDomainAssembly; - } - } - // If not found in that list, it is an ERROR. Yes, this is by design. - StackSString name; - pSpec->GetFileOrDisplayName(0, name); - COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFAILURE,name); -} // AppDomain::BindAssemblySpecForIntrospectionDependencies -#endif // FEATURE_REFLECTION_ONLY_LOAD PEAssembly *AppDomain::TryResolveAssembly(AssemblySpec *pSpec, BOOL fPreBind) { @@ -10561,25 +10331,6 @@ AppDomain::RaiseAssemblyResolveEvent( StackSString ssName; pSpec->GetFileOrDisplayName(0, ssName); -#ifdef FEATURE_REFLECTION_ONLY_LOAD - if ( (!fIntrospection) && (!fPreBind) ) - { - methodId = METHOD__APP_DOMAIN__ON_ASSEMBLY_RESOLVE; // post-bind execution event (the classic V1.0 event) - } - else if ((!fIntrospection) && fPreBind) - { - RETURN NULL; // There is currently no prebind execution resolve event - } - else if (fIntrospection && !fPreBind) - { - RETURN NULL; // There is currently no post-bind introspection resolve event - } - else - { - _ASSERTE( fIntrospection && fPreBind ); - methodId = METHOD__APP_DOMAIN__ON_REFLECTION_ONLY_ASSEMBLY_RESOLVE; // event for introspection assemblies - } -#else // FEATURE_REFLECTION_ONLY_LOAD if (!fPreBind) { methodId = METHOD__APP_DOMAIN__ON_ASSEMBLY_RESOLVE; // post-bind execution event (the classic V1.0 event) @@ -10589,7 +10340,6 @@ AppDomain::RaiseAssemblyResolveEvent( RETURN NULL; } -#endif // FEATURE_REFLECTION_ONLY_LOAD // 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 diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index c0d3bf1..525d934 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -2485,9 +2485,6 @@ public: PEAssembly ** ppAssembly, BOOL fIsIntrospectionOnly = FALSE) DAC_EMPTY_RET(S_OK); -#ifdef FEATURE_REFLECTION_ONLY_LOAD - virtual DomainAssembly *BindAssemblySpecForIntrospectionDependencies(AssemblySpec *pSpec) DAC_EMPTY_RET(NULL); -#endif PEAssembly *TryResolveAssembly(AssemblySpec *pSpec, BOOL fPreBind); @@ -3832,11 +3829,6 @@ public: #ifdef FEATURE_COMINTEROP private: -#ifdef FEATURE_REFLECTION_ONLY_LOAD - // ReflectionOnly WinRT binder and its TypeCache (only in classic = non-AppX; the scenario is not supported in AppX) - CLRPrivBinderReflectionOnlyWinRT * m_pReflectionOnlyWinRtBinder; - CLRPrivTypeCacheReflectionOnlyWinRT * m_pReflectionOnlyWinRtTypeCache; -#endif // FEATURE_REFLECTION_ONLY_LOAD #endif //FEATURE_COMINTEROP diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index 0a303bf..c9a15d3 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -313,26 +313,6 @@ Assembly* AssemblyNative::LoadFromBuffer(BOOL fForIntrospection, const BYTE* pAs // This applies to both Desktop CLR and CoreCLR, with or without fusion. BOOL fIsSameAssembly = (pAssembly->GetManifestFile()->GetILimage() == pFile->GetILimage()); -#ifdef FEATURE_REFLECTION_ONLY_LOAD - if (fForIntrospection) - { - IAssemblyName * pIAssemblyName = pAssembly->GetFusionAssemblyName(); - - AppDomain::AssemblyIterator i = GetAppDomain()->IterateAssembliesEx( - (AssemblyIterationFlags)(kIncludeLoaded | kIncludeIntrospection)); - CollectibleAssemblyHolder pDomainAssembly; - - while (i.Next(pDomainAssembly.This())) - { - Assembly * pCachedAssembly = pDomainAssembly->GetAssembly(); - IAssemblyName * pCachedAssemblyName = pCachedAssembly->GetFusionAssemblyName(); - if ((pAssembly != pCachedAssembly) && (S_OK == pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL))) - { - COMPlusThrow(kFileLoadException, IDS_EE_REFLECTIONONLY_LOADFROM, W("")); //@todo: need to fill in assemblyname - } - } - } -#endif // FEATURE_REFLECTION_ONLY_LOAD LOG((LF_CLASSLOADER, LL_INFO100, diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp index b60f957..b969e8d 100644 --- a/src/vm/assemblyspec.cpp +++ b/src/vm/assemblyspec.cpp @@ -921,28 +921,6 @@ DomainAssembly *AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel, RETURN pAssembly; } -#ifdef FEATURE_REFLECTION_ONLY_LOAD - if (IsIntrospectionOnly() && (GetCodeBase() == NULL)) - { - SafeComHolder pIAssemblyName; - IfFailThrow(CreateFusionName(&pIAssemblyName)); - - // Note: We do not support introspection-only collectible assemblies (yet) - AppDomain::AssemblyIterator i = pDomain->IterateAssembliesEx( - (AssemblyIterationFlags)(kIncludeLoaded | kIncludeIntrospection | kExcludeCollectible)); - CollectibleAssemblyHolder pCachedDomainAssembly; - - while (i.Next(pCachedDomainAssembly.This())) - { - _ASSERTE(!pCachedDomainAssembly->IsCollectible()); - IAssemblyName * pCachedAssemblyName = pCachedDomainAssembly->GetAssembly()->GetFusionAssemblyName(); - if (S_OK == pCachedAssemblyName->IsEqual(pIAssemblyName, ASM_CMPF_IL_ALL)) - { - RETURN pCachedDomainAssembly; - } - } - } -#endif // FEATURE_REFLECTION_ONLY_LOAD PEAssemblyHolder pFile(pDomain->BindAssemblySpec(this, fThrowOnFileNotFound, fRaisePrebindEvents, pCallerStackMark, pLoadSecurity)); if (pFile == NULL) diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index f90e06f..7ff6c38 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -5652,22 +5652,6 @@ DomainAssembly * Module::LoadAssembly( bool fHasBindableIdentity = HasBindableIdentity(kAssemblyRef); -#ifdef FEATURE_REFLECTION_ONLY_LOAD - if (IsIntrospectionOnly()) - { - // We will not get here on GC thread - GCX_PREEMP(); - - AssemblySpec spec; - spec.InitializeSpec(kAssemblyRef, GetMDImport(), GetDomainFile(GetAppDomain())->GetDomainAssembly(), IsIntrospectionOnly()); - if (szWinRtTypeClassName != NULL) - { - spec.SetWindowsRuntimeType(szWinRtTypeNamespace, szWinRtTypeClassName); - } - pDomainAssembly = GetAppDomain()->BindAssemblySpecForIntrospectionDependencies(&spec); - } - else -#endif //FEATURE_REFLECTION_ONLY_LOAD { PEAssemblyHolder pFile = GetDomainFile(GetAppDomain())->GetFile()->LoadAssembly( kAssemblyRef, diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 1dcab23..739c7dc 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -1422,11 +1422,6 @@ FCFuncStart(gStreamFuncs) FCFuncElement("HasOverriddenBeginEndWrite", StreamNative::HasOverriddenBeginEndWrite) FCFuncEnd() -#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD) -FCFuncStart(gWindowsRuntimeMetadata) - QCFuncElement("nResolveNamespace", CLRPrivTypeCacheReflectionOnlyWinRT::ResolveNamespace) -FCFuncEnd() -#endif //FEATURE_COMINTEROP && FEATURE_REFLECTION_ONLY_LOAD #ifdef FEATURE_COMINTEROP FCFuncStart(gWindowsRuntimeBufferHelperFuncs) @@ -1690,9 +1685,6 @@ FCClassElement("WindowsRuntimeBufferHelper", "System.Runtime.InteropServices.Win #endif -#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD) -FCClassElement("WindowsRuntimeMetadata", "System.Runtime.InteropServices.WindowsRuntime", gWindowsRuntimeMetadata) -#endif #if defined(FEATURE_EVENTSOURCE_XPLAT) FCClassElement("XplatEventLogger", "System.Diagnostics.Tracing", gEventLogger) diff --git a/src/vm/mscorlib.cpp b/src/vm/mscorlib.cpp index e19002e..dad0126 100644 --- a/src/vm/mscorlib.cpp +++ b/src/vm/mscorlib.cpp @@ -95,10 +95,6 @@ #include "multicorejit.h" #endif -#if defined(FEATURE_COMINTEROP) && defined(FEATURE_REFLECTION_ONLY_LOAD) -#include "clrprivtypecachereflectiononlywinrt.h" -#endif - #ifdef FEATURE_COMINTEROP #include "windowsruntimebufferhelper.h" #endif diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h index 97b0118..a824627 100644 --- a/src/vm/mscorlib.h +++ b/src/vm/mscorlib.h @@ -76,9 +76,6 @@ DEFINE_FIELD_U(AssemblyLoad, AppDomainBaseObject, m_pAssemblyEvent DEFINE_FIELD_U(_TypeResolve, AppDomainBaseObject, m_pTypeEventHandler) DEFINE_FIELD_U(_ResourceResolve, AppDomainBaseObject, m_pResourceEventHandler) DEFINE_FIELD_U(_AssemblyResolve, AppDomainBaseObject, m_pAsmResolveEventHandler) -#ifdef FEATURE_REFLECTION_ONLY_LOAD -DEFINE_FIELD_U(ReflectionOnlyAssemblyResolve, AppDomainBaseObject, m_pReflectionAsmResolveEventHandler) -#endif #ifdef FEATURE_REMOTING DEFINE_FIELD_U(_DefaultContext, AppDomainBaseObject, m_pDefaultContext) #endif @@ -103,13 +100,6 @@ DEFINE_METHOD(APP_DOMAIN, ON_ASSEMBLY_LOAD, OnAssemblyLoadEvent, DEFINE_METHOD(APP_DOMAIN, ON_RESOURCE_RESOLVE, OnResourceResolveEvent, IM_Assembly_Str_RetAssembly) DEFINE_METHOD(APP_DOMAIN, ON_TYPE_RESOLVE, OnTypeResolveEvent, IM_Assembly_Str_RetAssembly) DEFINE_METHOD(APP_DOMAIN, ON_ASSEMBLY_RESOLVE, OnAssemblyResolveEvent, IM_Assembly_Str_RetAssembly) -#ifdef FEATURE_REFLECTION_ONLY_LOAD -DEFINE_METHOD(APP_DOMAIN, ON_REFLECTION_ONLY_ASSEMBLY_RESOLVE, OnReflectionOnlyAssemblyResolveEvent, IM_Assembly_Str_RetAssembly) -#ifdef FEATURE_COMINTEROP -DEFINE_METHOD(APP_DOMAIN, ON_REFLECTION_ONLY_NAMESPACE_RESOLVE, OnReflectionOnlyNamespaceResolveEvent, IM_Assembly_Str_RetArrAssembly) -#endif //FEATURE_COMINTEROP -DEFINE_METHOD(APP_DOMAIN, ENABLE_RESOLVE_ASSEMBLIES_FOR_INTROSPECTION, EnableResolveAssembliesForIntrospection, IM_Str_RetVoid) -#endif //FEATURE_REFLECTION_ONLY_LOAD #ifdef FEATURE_COMINTEROP DEFINE_METHOD(APP_DOMAIN, ON_DESIGNER_NAMESPACE_RESOLVE, OnDesignerNamespaceResolveEvent, IM_Str_RetArrStr) #endif //FEATURE_COMINTEROP diff --git a/src/vm/object.h b/src/vm/object.h index b76d09b..d5fb903 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -2137,9 +2137,6 @@ class AppDomainBaseObject : public MarshalByRefObjectBaseObject OBJECTREF m_pTypeEventHandler; // Delegate for 'resolve type' event OBJECTREF m_pResourceEventHandler; // Delegate for 'resolve resource' event OBJECTREF m_pAsmResolveEventHandler; // Delegate for 'resolve assembly' event -#ifdef FEATURE_REFLECTION_ONLY_LOAD - OBJECTREF m_pReflectionAsmResolveEventHandler; //Delegate for 'reflection resolve assembly' event -#endif #ifdef FEATURE_REMOTING OBJECTREF m_pDefaultContext; // Default managed context for this AD. #endif -- 2.7.4