diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2017-04-26 16:01:52 -0700 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2017-04-27 15:33:31 -0700 |
commit | abd76724643106cfdbd7b6ae80f1551a6d6db511 (patch) | |
tree | 45b66850ba2752be53f3b6c330c62774ca4db4a5 /src/vm | |
parent | 58b0918464bc68345371e81df0cbac07bafb8058 (diff) | |
download | coreclr-abd76724643106cfdbd7b6ae80f1551a6d6db511.tar.gz coreclr-abd76724643106cfdbd7b6ae80f1551a6d6db511.tar.bz2 coreclr-abd76724643106cfdbd7b6ae80f1551a6d6db511.zip |
Remove support for the x86 compat JIT from .NET Core.
These changes remove support for the x86 compat JIT from the build, the
runtime, and the various perf/test scripts.
Fixes #10733, #10734.
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/codeman.cpp | 79 | ||||
-rw-r--r-- | src/vm/codeman.h | 6 | ||||
-rw-r--r-- | src/vm/eeconfig.cpp | 31 | ||||
-rw-r--r-- | src/vm/eeconfig.h | 15 | ||||
-rw-r--r-- | src/vm/jitinterface.cpp | 7 |
5 files changed, 2 insertions, 136 deletions
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp index a30e70e7fa..d934b824f6 100644 --- a/src/vm/codeman.cpp +++ b/src/vm/codeman.cpp @@ -1219,7 +1219,6 @@ EEJitManager::EEJitManager() #if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) m_JITCompilerOther = NULL; #endif - m_fLegacyJitUsed = FALSE; #ifdef ALLOW_SXS_JIT m_alternateJit = NULL; @@ -1371,8 +1370,8 @@ void EEJitManager::SetCpuInfo() enum JIT_LOAD_JIT_ID { JIT_LOAD_MAIN = 500, // The "main" JIT. Normally, this is named "clrjit.dll". Start at a number that is somewhat uncommon (i.e., not zero or 1) to help distinguish from garbage, in process dumps. - JIT_LOAD_LEGACY, // The "legacy" JIT. Normally, this is named "compatjit.dll". This applies to AMD64 on Windows desktop, or x86 on Windows .NET Core. - JIT_LOAD_ALTJIT // An "altjit". By default, named "protojit.dll". Used both internally, as well as externally for JIT CTP builds. + // 501 is JIT_LOAD_LEGACY on some platforms; please do not reuse this value. + JIT_LOAD_ALTJIT = 502 // An "altjit". By default, named "protojit.dll". Used both internally, as well as externally for JIT CTP builds. }; enum JIT_LOAD_STATUS @@ -1628,80 +1627,6 @@ BOOL EEJitManager::LoadJIT() // Set as a courtesy to code:CorCompileGetRuntimeDll s_ngenCompilerDll = m_JITCompiler; - -#if defined(_TARGET_X86_) - // If COMPlus_UseLegacyJit=1, then we fall back to compatjit.dll. - // - // This fallback mechanism was introduced for Visual Studio "14" Preview, when JIT64 (the legacy JIT) was replaced with - // RyuJIT. It was desired to provide a fallback mechanism in case comptibility problems (or other bugs) - // were discovered by customers. Setting this COMPLUS variable to 1 does not affect NGEN: existing NGEN images continue - // to be used, and all subsequent NGEN compilations continue to use the new JIT. - // - // If this is a compilation process, then we don't allow specifying a fallback JIT. This is a case where, when NGEN'ing, - // we sometimes need to JIT some things (such as when we are NGEN'ing mscorlib). In that case, we want to use exactly - // the same JIT as NGEN uses. And NGEN doesn't follow the COMPlus_UseLegacyJit=1 switch -- it always uses clrjit.dll. - // - // Note that we always load and initialize the default JIT. This is to handle cases where obfuscators rely on - // LoadLibrary("clrjit.dll") returning the module handle of the JIT, and then they call GetProcAddress("getJit") to get - // the EE-JIT interface. They also do this without also calling sxsJitStartup()! - // - // In addition, for reasons related to servicing, we only use RyuJIT when the registry value UseRyuJIT (type DWORD), under - // key HKLM\SOFTWARE\Microsoft\.NETFramework, is set to 1. Otherwise, we fall back to JIT64. Note that if this value - // is set, we also must use JIT64 for all NGEN compilations as well. - // - // See the document "RyuJIT Compatibility Fallback Specification.docx" for details. - // - // For .NET Core 1.2, RyuJIT for x86 is the primary jit (clrjit.dll) and JIT32 for x86 is the fallback, legacy JIT (compatjit.dll). - // Thus, the COMPlus_useLegacyJit=1 mechanism has been enabled for x86 CoreCLR. This scenario does not have the UseRyuJIT - // registry key, nor the AppX binder mode. - - bool fUseRyuJit = true; - - if ((!IsCompilationProcess() || !fUseRyuJit) && // Use RyuJIT for all NGEN, unless we're falling back to JIT64 for everything. - (newJitCompiler != nullptr)) // the main JIT must successfully load before we try loading the fallback JIT - { - BOOL fUsingCompatJit = FALSE; - - if (!fUseRyuJit) - { - fUsingCompatJit = TRUE; - } - - if (!fUsingCompatJit) - { - DWORD useLegacyJit = Configuration::GetKnobBooleanValue(W("System.JIT.UseWindowsX86CoreLegacyJit"), CLRConfig::EXTERNAL_UseWindowsX86CoreLegacyJit); - if (useLegacyJit == 1) - { - fUsingCompatJit = TRUE; - } - } - - - if (fUsingCompatJit) - { - // Now, load the compat jit and initialize it. - - LPCWSTR pwzJitName = MAKEDLLNAME_W(W("compatjit")); - - // Note: if the compatjit fails to load, we ignore it, and continue to use the main JIT for - // everything. You can imagine a policy where if the user requests the compatjit, and we fail - // to load it, that we fail noisily. We don't do that currently. - ICorJitCompiler* fallbackICorJitCompiler; - g_JitLoadData.jld_id = JIT_LOAD_LEGACY; - LoadAndInitializeJIT(pwzJitName, &m_JITCompilerOther, &fallbackICorJitCompiler, &g_JitLoadData); - if (fallbackICorJitCompiler != nullptr) - { - // Tell the main JIT to fall back to the "fallback" JIT compiler, in case some - // obfuscator tries to directly call the main JIT's getJit() function. - newJitCompiler->setRealJit(fallbackICorJitCompiler); - - // Now, the compat JIT will be used. - m_fLegacyJitUsed = TRUE; - } - } - } -#endif // (defined(_TARGET_AMD64_) && !defined(CROSSGEN_COMPILE)) || (defined(_TARGET_X86_) ) - #endif // !FEATURE_MERGE_JIT_AND_ENGINE #ifdef ALLOW_SXS_JIT diff --git a/src/vm/codeman.h b/src/vm/codeman.h index 9d7ed4d62f..cca5f5e2d2 100644 --- a/src/vm/codeman.h +++ b/src/vm/codeman.h @@ -1201,12 +1201,6 @@ public: HINSTANCE m_JITCompilerOther; // Stores the handle of the legacy JIT, if one is loaded. #endif - // TRUE if the legacy/compat JIT was loaded successfully and will be used. - // This is available in all builds so if COMPlus_RequireLegacyJit=1 is set in a test, - // the test will fail in any build where the legacy JIT is not loaded, even if legacy - // fallback is not available in that build. This prevents unexpected silent successes. - BOOL m_fLegacyJitUsed; - #ifdef ALLOW_SXS_JIT //put these at the end so that we don't mess up the offsets in the DAC. ICorJitCompiler * m_alternateJit; diff --git a/src/vm/eeconfig.cpp b/src/vm/eeconfig.cpp index 812d1df671..81f3957951 100644 --- a/src/vm/eeconfig.cpp +++ b/src/vm/eeconfig.cpp @@ -327,10 +327,6 @@ HRESULT EEConfig::Init() iRequireZaps = REQUIRE_ZAPS_NONE; -#ifdef _TARGET_AMD64_ - pDisableNativeImageLoadList = NULL; -#endif - // new loader behavior switches m_fDeveloperInstallation = false; @@ -489,11 +485,6 @@ HRESULT EEConfig::Cleanup() delete pForbidZapsExcludeList; #endif -#ifdef _TARGET_AMD64_ - if (pDisableNativeImageLoadList) - delete pDisableNativeImageLoadList; -#endif - #ifdef FEATURE_COMINTEROP if (pszLogCCWRefCountChange) delete [] pszLogCCWRefCountChange; @@ -996,16 +987,6 @@ HRESULT EEConfig::sync() } #endif -#ifdef _TARGET_AMD64_ - if (!IsCompilationProcess()) - { - NewArrayHolder<WCHAR> wszDisableNativeImageLoadList; - IfFailRet(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DisableNativeImageLoadList, &wszDisableNativeImageLoadList)); - if (wszDisableNativeImageLoadList) - pDisableNativeImageLoadList = new AssemblyNamesList(wszDisableNativeImageLoadList); - } -#endif - #ifdef FEATURE_LOADER_OPTIMIZATION dwSharePolicy = GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LoaderOptimization, dwSharePolicy); #endif @@ -1455,18 +1436,6 @@ bool EEConfig::ExcludeReadyToRun(LPCUTF8 assemblyName) const return false; } -#ifdef _TARGET_AMD64_ -bool EEConfig::DisableNativeImageLoad(LPCUTF8 assemblyName) const -{ - LIMITED_METHOD_CONTRACT; - - if (pDisableNativeImageLoadList != NULL && pDisableNativeImageLoadList->IsInList(assemblyName)) - return true; - - return false; -} -#endif - /**************************************************************/ #ifdef _DEBUG /**************************************************************/ diff --git a/src/vm/eeconfig.h b/src/vm/eeconfig.h index e97385e3da..ae23f74755 100644 --- a/src/vm/eeconfig.h +++ b/src/vm/eeconfig.h @@ -758,11 +758,6 @@ public: bool ForbidZap(LPCUTF8 assemblyName) const; #endif bool ExcludeReadyToRun(LPCUTF8 assemblyName) const; - -#ifdef _TARGET_AMD64_ - bool DisableNativeImageLoad(LPCUTF8 assemblyName) const; - bool IsDisableNativeImageLoadListNonEmpty() const { LIMITED_METHOD_CONTRACT; return (pDisableNativeImageLoadList != NULL); } -#endif LPCWSTR ZapSet() const { LIMITED_METHOD_CONTRACT; return pZapSet; } @@ -1122,16 +1117,6 @@ private: //---------------------------------------------------------------- AssemblyNamesList * pForbidZapsExcludeList; #endif -#ifdef _TARGET_AMD64_ - // Assemblies for which we will not load a native image. This is from the COMPlus_DisableNativeImageLoadList - // variable / reg key. It performs the same function as the config file key "<disableNativeImageLoad>" (except - // that is it just a list of assembly names, which the config file key can specify full assembly identities). - // This was added to support COMPlus_UseLegacyJit, to support the rollout of RyuJIT to replace JIT64, where - // the user can cause the CLR to fall back to JIT64 for JITting but not for NGEN. This allows the user to - // force JITting for a specified list of NGEN assemblies. - AssemblyNamesList * pDisableNativeImageLoadList; -#endif - LPCWSTR pZapSet; bool fNgenBindOptimizeNonGac; diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index 5ef7700896..da803badcf 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -12614,13 +12614,6 @@ PCODE UnsafeJitFunction(MethodDesc* ftn, COR_ILMETHOD_DECODER* ILHeader, CORJIT_ EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, W("Failed to load JIT compiler")); #endif // ALLOW_SXS_JIT } - - // If no compatjit wasn't used, but the user (normally a test case) requires that one is used, then fail. - // This is analogous to ZapRequire. - if (!jitMgr->m_fLegacyJitUsed && (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_RequireLegacyJit) == 1)) - { - EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, W("Failed to use legacy JIT compiler with RequireLegacyJit set")); - } #endif // CROSSGEN_COMPILE #ifdef _DEBUG |