Skip to content

Commit 2253c7e

Browse files
authored
Introduce DOTNET_JITAllowOptionalRelocs (#88008)
1 parent a0964f9 commit 2253c7e

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/coreclr/inc/clrconfigvalues.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ CONFIG_DWORD_INFO(INTERNAL_JitGCStress, W("JitGCStress"), 0, "GC stress mode for
310310
CONFIG_DWORD_INFO(INTERNAL_JitHeartbeat, W("JitHeartbeat"), 0, "")
311311
CONFIG_DWORD_INFO(INTERNAL_JitHelperLogging, W("JitHelperLogging"), 0, "")
312312
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JITMinOpts, W("JITMinOpts"), 0, "Forces MinOpts")
313+
RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JITAllowOptionalRelocs, W("JITAllowOptionalRelocs"), 1, "Allow optional relocs")
313314
RETAIL_CONFIG_STRING_INFO(EXTERNAL_JitName, W("JitName"), "Primary jit to use")
314315
CONFIG_STRING_INFO(INTERNAL_JitPath, W("JitPath"), "Full path to primary jit to use")
315316
#if defined(ALLOW_SXS_JIT)

src/coreclr/vm/eeconfig.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ HRESULT EEConfig::Init()
111111
iJitOptimizeType = OPT_DEFAULT;
112112
fJitFramed = false;
113113
fJitMinOpts = false;
114+
fJitAllowOptionalRelocs = false;
114115
fPInvokeRestoreEsp = (DWORD)-1;
115116

116117
fNgenBindOptimizeNonGac = false;
@@ -543,6 +544,7 @@ HRESULT EEConfig::sync()
543544

544545
fJitFramed = (CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_JitFramed) != 0);
545546
fJitMinOpts = (CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_JITMinOpts) == 1);
547+
fJitAllowOptionalRelocs = (CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_JITAllowOptionalRelocs) == 1);
546548
iJitOptimizeType = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_JitOptimizeType);
547549
if (iJitOptimizeType > OPT_RANDOM) iJitOptimizeType = OPT_DEFAULT;
548550

src/coreclr/vm/eeconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class EEConfig
7676
unsigned int GenOptimizeType(void) const {LIMITED_METHOD_CONTRACT; return iJitOptimizeType; }
7777
bool JitFramed(void) const {LIMITED_METHOD_CONTRACT; return fJitFramed; }
7878
bool JitMinOpts(void) const {LIMITED_METHOD_CONTRACT; return fJitMinOpts; }
79+
bool JitAllowOptionalRelocs(void) const {LIMITED_METHOD_CONTRACT; return fJitAllowOptionalRelocs; }
7980

8081
// Tiered Compilation config
8182
#if defined(FEATURE_TIERED_COMPILATION)
@@ -478,6 +479,7 @@ class EEConfig
478479
bool fTrackDynamicMethodDebugInfo; // Enable/Disable tracking dynamic method debug info
479480
bool fJitFramed; // Enable/Disable EBP based frames
480481
bool fJitMinOpts; // Enable MinOpts for all jitted methods
482+
bool fJitAllowOptionalRelocs; // Allow optional relocs
481483

482484
unsigned iJitOptimizeType; // 0=Blended,1=SmallCode,2=FastCode, default is 0=Blended
483485

src/coreclr/vm/jitinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12666,7 +12666,7 @@ PCODE UnsafeJitFunction(PrepareCodeConfig* config,
1266612666
#endif
1266712667

1266812668
#if defined(TARGET_AMD64)
12669-
BOOL fAllowRel32 = (g_fAllowRel32 | fForceJumpStubOverflow);
12669+
BOOL fAllowRel32 = (g_fAllowRel32 | fForceJumpStubOverflow) && g_pConfig->JitAllowOptionalRelocs();
1267012670
#endif
1267112671

1267212672
size_t reserveForJumpStubs = 0;

0 commit comments

Comments
 (0)