diff --git a/src/coreclr/tools/Common/InstructionSetHelpers.cs b/src/coreclr/tools/Common/InstructionSetHelpers.cs index 7dcf031a9e0131..b1ff24e8b804f7 100644 --- a/src/coreclr/tools/Common/InstructionSetHelpers.cs +++ b/src/coreclr/tools/Common/InstructionSetHelpers.cs @@ -31,7 +31,10 @@ public static InstructionSetSupport ConfigureInstructionSetSupport(string instru if ((targetArchitecture == TargetArchitecture.X86) || (targetArchitecture == TargetArchitecture.X64)) { - if (isReadyToRun && targetOS != TargetOS.OSX && targetOS != TargetOS.MacCatalyst) + bool isAppleOS = targetOS is TargetOS.OSX or TargetOS.MacCatalyst + or TargetOS.iOSSimulator or TargetOS.tvOSSimulator; + + if (isReadyToRun && !isAppleOS) { // ReadyToRun can presume AVX2, BMI1, BMI2, F16C, FMA, LZCNT, and MOVBE instructionSetSupportBuilder.AddSupportedInstructionSet("x86-64-v3"); diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index 620ccc1844f1aa..51e7e674c0eb93 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -3583,6 +3583,14 @@ void Module::RunEagerFixupsUnlocked() { _ASSERTE(IsReadyToRun()); GetReadyToRunInfo()->DisableAllR2RCode(); + +#ifndef FEATURE_DYNAMIC_CODE_COMPILED + if (GetReadyToRunInfo()->HasStrippedILBodies()) + { + EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, + W("ReadyToRun code was disabled by a failed eager fixup, but the image has stripped IL bodies and this runtime has no JIT fallback.")); + } +#endif // !FEATURE_DYNAMIC_CODE_COMPILED } else { diff --git a/src/coreclr/vm/codeman.cpp b/src/coreclr/vm/codeman.cpp index 0ae31afb30ebef..eda07ee2a9cbb8 100644 --- a/src/coreclr/vm/codeman.cpp +++ b/src/coreclr/vm/codeman.cpp @@ -1331,7 +1331,12 @@ void EEJitManager::SetCpuInfo() uint32_t maxVectorTBitWidth = (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_MaxVectorTBitWidth) / 128) * 128; #if defined(FEATURE_INTERPRETER) - if (maxVectorTBitWidth != 128 && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3) +#if defined(FEATURE_DYNAMIC_CODE_COMPILED) + bool interpreterOnly = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3; +#else + bool interpreterOnly = true; +#endif + if (maxVectorTBitWidth != 128 && interpreterOnly) { // Disable larger Vector sizes when interpreter is enabled maxVectorTBitWidth = 128; @@ -1701,14 +1706,6 @@ void EEJitManager::SetCpuInfo() uint32_t preferredVectorBitWidth = (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_PreferredVectorBitWidth) / 128) * 128; -#ifdef FEATURE_INTERPRETER - if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_InterpMode) == 3) - { - // Disable larger Vector sizes when interpreter is enabled, and not compiling S.P.Corelib - preferredVectorBitWidth = 128; - } -#endif - if ((preferredVectorBitWidth == 0) && throttleVector512) { preferredVectorBitWidth = 256; diff --git a/src/coreclr/vm/readytoruninfo.h b/src/coreclr/vm/readytoruninfo.h index e31a36b1234d35..8127e05f6385fd 100644 --- a/src/coreclr/vm/readytoruninfo.h +++ b/src/coreclr/vm/readytoruninfo.h @@ -249,6 +249,12 @@ class ReadyToRunInfo return m_pHeader->CoreHeader.Flags & READYTORUN_FLAG_PARTIAL; } + BOOL HasStrippedILBodies() + { + LIMITED_METHOD_CONTRACT; + return m_pHeader->CoreHeader.Flags & READYTORUN_FLAG_STRIPPED_IL_BODIES; + } + void DisableAllR2RCode() { LIMITED_METHOD_CONTRACT;