diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2016-02-25 11:41:31 -0800 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2016-02-25 11:41:31 -0800 |
commit | 8ce6630f106425cf6064cfbb7f633af39b3c7973 (patch) | |
tree | e3f2ed0cd3448128dba3eacc6f6c21a65a08b506 | |
parent | 97545d6f772546e4737c112007d687c6fbc640b4 (diff) | |
download | coreclr-8ce6630f106425cf6064cfbb7f633af39b3c7973.tar.gz coreclr-8ce6630f106425cf6064cfbb7f633af39b3c7973.tar.bz2 coreclr-8ce6630f106425cf6064cfbb7f633af39b3c7973.zip |
Roll back change 1578859 on behalf of pagavlin. Change broke SuperPMI.
[tfs-changeset: 1578925]
41 files changed, 394 insertions, 785 deletions
diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index c781dcedb3..a9cb0077fc 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -1181,8 +1181,6 @@ void SplitPath(__in SString const &path, __inout_opt SString *fname, __inout_opt SString *ext); -#if !defined(NO_CLRCONFIG) - //***************************************************************************** // // **** REGUTIL - Static helper functions for reading/writing to Windows registry. @@ -1517,8 +1515,6 @@ private: LPWSTR m_wszString; }; -#endif // defined(NO_CLRCONFIG) - #include "ostype.h" #define CLRGetTickCount64() GetTickCount64() @@ -4171,8 +4167,6 @@ public: } }; -#if !defined(NO_CLRCONFIG) - /**************************************************************************/ /* simple wrappers around the REGUTIL and MethodNameList routines that make the lookup lazy */ @@ -4279,8 +4273,6 @@ private: BYTE m_inited; }; -#endif // !defined(NO_CLRCONFIG) - //***************************************************************************** // Convert a pointer to a string into a GUID. //***************************************************************************** diff --git a/src/jit/CMakeLists.txt b/src/jit/CMakeLists.txt index 305c54a1c6..e8c7204715 100644 --- a/src/jit/CMakeLists.txt +++ b/src/jit/CMakeLists.txt @@ -31,7 +31,6 @@ set( JIT_SOURCES hashbv.cpp importer.cpp instr.cpp - jitconfig.cpp jittelemetry.cpp lclvars.cpp liveness.cpp diff --git a/src/jit/alloc.cpp b/src/jit/alloc.cpp index cc27c83fd0..4ca13cdbd4 100644 --- a/src/jit/alloc.cpp +++ b/src/jit/alloc.cpp @@ -65,7 +65,8 @@ bool norls_allocator::nraInit(IEEMemoryManager* pMemoryManager, size_t pageSiz nraPageSize = pageSize ? pageSize : THE_ALLOCATOR_BASE_SIZE; #ifdef DEBUG - nraShouldInjectFault = JitConfig.ShouldInjectFault() != 0; + static ConfigDWORD fShouldInjectFault; + nraShouldInjectFault = fShouldInjectFault.val(CLRConfig::INTERNAL_InjectFault) != 0; #endif if (preAlloc) diff --git a/src/jit/alloc.h b/src/jit/alloc.h index 11bb1f8d72..601b98455f 100644 --- a/src/jit/alloc.h +++ b/src/jit/alloc.h @@ -208,7 +208,8 @@ inline bool norls_allocator::nraDirectAlloc() // directly to the OS. This allows taking advantage of pageheap and other gflag // knobs for ensuring that we do not have buffer overruns in the JIT. - return JitConfig.JitDirectAlloc() != 0; + static ConfigDWORD fJitDirectAlloc; + return (fJitDirectAlloc.val(CLRConfig::INTERNAL_JitDirectAlloc) != 0); } #else // RELEASE diff --git a/src/jit/block.cpp b/src/jit/block.cpp index 0103988318..30211d6a9f 100644 --- a/src/jit/block.cpp +++ b/src/jit/block.cpp @@ -37,7 +37,8 @@ flowList* ShuffleHelper(unsigned hash, flowList* res) unsigned SsaStressHashHelper() { // hash = 0: turned off, hash = 1: use method hash, hash = *: use custom hash. - unsigned hash = JitConfig.JitSsaStress(); + static ConfigDWORD fJitSsaStress; + unsigned hash = fJitSsaStress.val(CLRConfig::INTERNAL_JitSsaStress); if (hash == 0) { diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp index 06df590c75..b8eee4dbba 100644 --- a/src/jit/codegencommon.cpp +++ b/src/jit/codegencommon.cpp @@ -3035,9 +3035,11 @@ void CodeGen::genGenerateCode(void * * codePtr, { // Use COMPLUS_JitNoForceFallback=1 to prevent NOWAY assert testing from happening, // especially that caused by enabling JIT stress. - if (!JitConfig.JitNoForceFallback()) + static ConfigDWORD fJitNoForceFallback; + if (!fJitNoForceFallback.val(CLRConfig::INTERNAL_JitNoForceFallback)) { - if (JitConfig.JitForceFallback() || + static ConfigDWORD fJitForceFallback; + if (fJitForceFallback.val(CLRConfig::INTERNAL_JitForceFallback) || compiler->compStressCompile(Compiler::STRESS_GENERIC_VARN, 5) ) { NO_WAY_NOASSERT("Stress failure"); diff --git a/src/jit/codegenlegacy.cpp b/src/jit/codegenlegacy.cpp index 846f51df05..57807fb846 100644 --- a/src/jit/codegenlegacy.cpp +++ b/src/jit/codegenlegacy.cpp @@ -6209,7 +6209,8 @@ bool CodeGen::genCodeForQmarkWithCMOV(GenTreePtr tree, noway_assert(colon->gtOper == GT_COLON); #ifdef DEBUG - if (JitConfig.JitNoCMOV()) + static ConfigDWORD fJitNoCMOV; + if (fJitNoCMOV.val(CLRConfig::INTERNAL_JitNoCMOV)) { return false; } @@ -12253,7 +12254,8 @@ void CodeGen::genCodeForTreeSpecialOp(GenTreePtr tree, #ifdef FEATURE_ENABLE_NO_RANGE_CHECKS // MUST NEVER CHECK-IN WITH THIS ENABLED. // This is just for convenience in doing performance investigations and requires x86ret builds - if (!JitConfig.JitNoRngChk()) + static ConfigDWORD fJitNoRngChk; + if (!fJitNoRngChk.val(CLRConfig::PRIVATE_JitNoRangeChks)) #endif genRangeCheck(tree); } diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp index 074540b00b..71312bc61f 100644 --- a/src/jit/compiler.cpp +++ b/src/jit/compiler.cpp @@ -58,7 +58,6 @@ LONG Compiler::jitNestingLevel = 0; #ifdef ALT_JIT // static -bool Compiler::s_pAltJitExcludeAssembliesListInitialized = false; AssemblyNamesList2* Compiler::s_pAltJitExcludeAssembliesList = nullptr; #endif // ALT_JIT @@ -759,7 +758,8 @@ void Compiler::compShutdown() #if defined(DEBUG) || MEASURE_INLINING #ifdef DEBUG - if ((unsigned)JitConfig.JitInlinePrintStats() == 1) + static ConfigDWORD fJitInlinePrintStats; + if ((unsigned)fJitInlinePrintStats.val(CLRConfig::INTERNAL_JitInlinePrintStats) == 1) #endif // DEBUG { fprintf(fout, "\n"); @@ -1023,7 +1023,8 @@ void Compiler::compShutdown() #if LOOP_HOIST_STATS #ifdef DEBUG // Always display loop stats in retail - if (JitConfig.DisplayLoopHoistStats() != 0) + static ConfigDWORD fDisplayLoopHoistStats; + if (fDisplayLoopHoistStats.val(CLRConfig::INTERNAL_JitLoopHoistStats) != 0) #endif // DEBUG { PrintAggregateLoopHoistStats(stdout); @@ -1525,7 +1526,8 @@ static bool DidComponentUnitTests = false; void Compiler::compDoComponentUnitTestsOnce() { - if (!JitConfig.RunComponentUnitTests()) + static ConfigDWORD fRunComponentUnitTests; + if (!fRunComponentUnitTests.val(CLRConfig::INTERNAL_JitComponentUnitTests)) return; if (!DidComponentUnitTests) @@ -1851,7 +1853,8 @@ void Compiler::compSetProcessor() if (((compileFlags & CORJIT_FLG_PREJIT) == 0) && ((compileFlags & CORJIT_FLG_USE_AVX2) != 0)) { - if (JitConfig.EnableAVX() != 0) + static ConfigDWORD fEnableAVX; + if (fEnableAVX.val(CLRConfig::EXTERNAL_EnableAVX) != 0) { opts.compCanUseAVX = true; if (!compIsForInlining()) @@ -1882,9 +1885,11 @@ void Compiler::compSetProcessor() SSE2_FORCE_INVALID = -1 }; - if (JitConfig.JitCanUseSSE2() == SSE2_FORCE_DISABLE) + static ConfigDWORD fJitCanUseSSE2; + + if (fJitCanUseSSE2.val_DontUse_(CLRConfig::INTERNAL_JitCanUseSSE2, (unsigned) SSE2_FORCE_INVALID) == SSE2_FORCE_DISABLE) opts.compCanUseSSE2 = false; - else if (JitConfig.JitCanUseSSE2() == SSE2_FORCE_USE) + else if (fJitCanUseSSE2.val_DontUse_(CLRConfig::INTERNAL_JitCanUseSSE2, (unsigned) SSE2_FORCE_INVALID) == SSE2_FORCE_USE) opts.compCanUseSSE2 = true; else if (opts.compCanUseSSE2) opts.compCanUseSSE2 = !compStressCompile(STRESS_GENERIC_VARN, 50); @@ -1933,8 +1938,8 @@ bool Compiler::compShouldThrowOnNoway( return !opts.MinOpts() || !compIsFullTrust(); } -// ConfigInteger does not offer an option for decimal flags. Any numbers are interpreted as hex. -// I could add the decimal option to ConfigInteger or I could write a function to reinterpret this +// ConfigDWORD does not offer an option for decimal flags. Any numbers are interpreted as hex. +// I could add the decimal option to ConfigDWORD or I could write a function to reinterpret this // value as the user intended. unsigned ReinterpretHexAsDecimal(unsigned in) { @@ -2054,14 +2059,20 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) #ifdef DEBUG - const JitConfigValues::MethodSet* pfAltJit; + ConfigMethodSet* pfAltJit; if (opts.eeFlags & CORJIT_FLG_PREJIT) { - pfAltJit = &JitConfig.AltJitNgen(); + static ConfigMethodSet fAltJitNgen; + fAltJitNgen.ensureInit(CLRConfig::INTERNAL_AltJitNgen); + + pfAltJit = &fAltJitNgen; } else { - pfAltJit = &JitConfig.AltJit(); + static ConfigMethodSet fAltJit; + fAltJit.ensureInit(CLRConfig::EXTERNAL_AltJit); + + pfAltJit = &fAltJit; } #ifdef ALT_JIT @@ -2070,7 +2081,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) opts.altJit = true; } - unsigned altJitLimit = ReinterpretHexAsDecimal(JitConfig.AltJitLimit()); + static ConfigDWORD fAltJitLimit; + unsigned altJitLimit = ReinterpretHexAsDecimal(fAltJitLimit.val(CLRConfig::INTERNAL_AltJitLimit)); if (altJitLimit > 0 && Compiler::jitTotalMethodCompiled >= altJitLimit) { opts.altJit = false; @@ -2079,14 +2091,16 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) #else // !DEBUG - const char* altJitVal; + LPWSTR altJitVal; if (opts.eeFlags & CORJIT_FLG_PREJIT) { - altJitVal = JitConfig.AltJitNgen().list(); + static ConfigString fAltJitNgen; + altJitVal = fAltJitNgen.val(CLRConfig::INTERNAL_AltJitNgen); } else { - altJitVal = JitConfig.AltJit().list(); + static ConfigString fAltJit; + altJitVal = fAltJit.val(CLRConfig::EXTERNAL_AltJit); } #ifdef ALT_JIT @@ -2094,7 +2108,7 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) // You don't get to give a regular expression of methods to match. // (Partially, this is because we haven't computed and stored the method and class name except in debug, and it // might be expensive to do so.) - if ((altJitVal != nullptr) && (strcmp(altJitVal, "*") == 0)) + if ((altJitVal != NULL) && (wcscmp(altJitVal, W("*")) == 0)) { opts.altJit = true; } @@ -2107,16 +2121,16 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) if (opts.altJit) { // First, initialize the AltJitExcludeAssemblies list, but only do it once. - if (!s_pAltJitExcludeAssembliesListInitialized) + static ConfigString fAltJitExcludeAssemblies; + if (!fAltJitExcludeAssemblies.isInitialized()) { - const wchar_t* wszAltJitExcludeAssemblyList = JitConfig.AltJitExcludeAssemblies(); + LPWSTR wszAltJitExcludeAssemblyList = fAltJitExcludeAssemblies.val(CLRConfig::EXTERNAL_AltJitExcludeAssemblies); if (wszAltJitExcludeAssemblyList != nullptr) { // NOTE: The Assembly name list is allocated in the process heap, not in the no-release heap, which is reclaimed // for every compilation. This is ok because we only allocate once, due to the static. s_pAltJitExcludeAssembliesList = new (ProcessHeapAllocator::Singleton()) AssemblyNamesList2(wszAltJitExcludeAssemblyList, ProcessHeapAllocator::Singleton()); } - s_pAltJitExcludeAssembliesListInitialized = true; } if (s_pAltJitExcludeAssembliesList != nullptr) @@ -2144,7 +2158,9 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) // if (compIsForImportOnly() && (!altJitConfig || opts.altJit)) { - if (JitConfig.JitImportBreak().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitImportBreak; + fJitImportBreak.ensureInit(CLRConfig::INTERNAL_JitImportBreak); + if (fJitImportBreak.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) assert(!"JitImportBreak reached"); } @@ -2176,41 +2192,63 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) if (opts.eeFlags & CORJIT_FLG_PREJIT) { - if (JitConfig.NgenDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenDump; + fNgenDump.ensureInit(CLRConfig::INTERNAL_NgenDump); + + if (fNgenDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) verboseDump = true; - unsigned ngenHashDumpVal = (unsigned) JitConfig.NgenHashDump(); + static ConfigDWORD fNgenHashDump; + unsigned ngenHashDumpVal = (unsigned) fNgenHashDump.val(CLRConfig::INTERNAL_NgenHashDump); if ((ngenHashDumpVal != (DWORD)-1) && (ngenHashDumpVal == info.compMethodHash())) verboseDump = true; - if (JitConfig.NgenDumpIR().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenDumpIR; + fNgenDumpIR.ensureInit(CLRConfig::INTERNAL_NgenDumpIR); + + if (fNgenDumpIR.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) dumpIR = true; - unsigned ngenHashDumpIRVal = (unsigned) JitConfig.NgenHashDumpIR(); + static ConfigDWORD fNgenHashDumpIR; + unsigned ngenHashDumpIRVal = (unsigned) fNgenHashDumpIR.val(CLRConfig::INTERNAL_NgenHashDumpIR); if ((ngenHashDumpIRVal != (DWORD)-1) && (ngenHashDumpIRVal == info.compMethodHash())) dumpIR = true; - dumpIRFormat = JitConfig.NgenDumpIRFormat(); - dumpIRPhase = JitConfig.NgenDumpIRPhase(); + static ConfigString ngenDumpIRFormat; + dumpIRFormat = ngenDumpIRFormat.val(CLRConfig::INTERNAL_NgenDumpIRFormat); + + static ConfigString ngenDumpIRPhase; + dumpIRPhase = ngenDumpIRPhase.val(CLRConfig::INTERNAL_NgenDumpIRPhase); } else { - if (JitConfig.JitDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitDump; + fJitDump.ensureInit(CLRConfig::INTERNAL_JitDump); + + if (fJitDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) verboseDump = true; - unsigned jitHashDumpVal = (unsigned) JitConfig.JitHashDump(); + static ConfigDWORD fJitHashDump; + unsigned jitHashDumpVal = (unsigned) fJitHashDump.val(CLRConfig::INTERNAL_JitHashDump); if ((jitHashDumpVal != (DWORD)-1) && (jitHashDumpVal == info.compMethodHash())) verboseDump = true; - if (JitConfig.JitDumpIR().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitDumpIR; + fJitDumpIR.ensureInit(CLRConfig::INTERNAL_JitDumpIR); + + if (fJitDumpIR.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) dumpIR = true; - unsigned jitHashDumpIRVal = (unsigned) JitConfig.JitHashDumpIR(); + static ConfigDWORD fJitHashDumpIR; + unsigned jitHashDumpIRVal = (unsigned) fJitHashDumpIR.val(CLRConfig::INTERNAL_JitHashDumpIR); if ((jitHashDumpIRVal != (DWORD)-1) && (jitHashDumpIRVal == info.compMethodHash())) dumpIR = true; - dumpIRFormat = JitConfig.JitDumpIRFormat(); - dumpIRPhase = JitConfig.JitDumpIRPhase(); + static ConfigString jitDumpIRFormat; + dumpIRFormat = jitDumpIRFormat.val(CLRConfig::INTERNAL_JitDumpIRFormat); + + static ConfigString jitDumpIRPhase; + dumpIRPhase = jitDumpIRPhase.val(CLRConfig::INTERNAL_JitDumpIRPhase); } if (dumpIRPhase == nullptr) @@ -2576,60 +2614,83 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) { if (opts.eeFlags & CORJIT_FLG_PREJIT) { - if ((JitConfig.NgenOrder() & 1) == 1) + static ConfigDWORD fNgenOrder; + if ((fNgenOrder.val(CLRConfig::INTERNAL_NgenOrder) & 1) == 1) opts.dspOrder = true; - if (JitConfig.NgenGCDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenGCDump; + fNgenGCDump.ensureInit(CLRConfig::INTERNAL_NgenGCDump); + if (fNgenGCDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspGCtbls = true; - if (JitConfig.NgenDisasm().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenDisasm; + fNgenDisasm.ensureInit(CLRConfig::INTERNAL_NgenDisasm); + if (fNgenDisasm.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.disAsm = true; - if (JitConfig.NgenDisasm().contains("SPILLED", NULL, NULL)) + if (fNgenDisasm.contains("SPILLED", NULL)) opts.disAsmSpilled = true; - if (JitConfig.NgenUnwindDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenUnwindDump; + fNgenUnwindDump.ensureInit(CLRConfig::INTERNAL_NgenUnwindDump); + if (fNgenUnwindDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspUnwind = true; - if (JitConfig.NgenEHDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fNgenEHDump; + fNgenEHDump.ensureInit(CLRConfig::INTERNAL_NgenEHDump); + if (fNgenEHDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspEHTable = true; } else { - if ((JitConfig.JitOrder() & 1) == 1) + static ConfigDWORD fJitOrder; + if ((fJitOrder.val(CLRConfig::INTERNAL_JitOrder) & 1) == 1) opts.dspOrder = true; - if (JitConfig.JitGCDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitGCDump; + fJitGCDump.ensureInit(CLRConfig::INTERNAL_JitGCDump); + if (fJitGCDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspGCtbls = true; - if (JitConfig.JitDisasm().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitDisasm; + fJitDisasm.ensureInit(CLRConfig::INTERNAL_JitDisasm); + if (fJitDisasm.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.disAsm = true; - if (JitConfig.JitDisasm().contains("SPILLED", NULL, NULL)) + if (fJitDisasm.contains("SPILLED", NULL)) opts.disAsmSpilled = true; - if (JitConfig.JitUnwindDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitUnwindDump; + fJitUnwindDump.ensureInit(CLRConfig::INTERNAL_JitUnwindDump); + if (fJitUnwindDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspUnwind = true; - if (JitConfig.JitEHDump().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitEHDump; + fJitEHDump.ensureInit(CLRConfig::INTERNAL_JitEHDump); + if (fJitEHDump.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.dspEHTable = true; } #ifdef LATE_DISASM - if (JitConfig.JitLateDisasm().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitLateDisasm; + fJitLateDisasm.ensureInit(CLRConfig::INTERNAL_JitLateDisasm); + if (fJitLateDisasm.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.doLateDisasm = true; #endif // LATE_DISASM // This one applies to both Ngen/Jit Disasm output: COMPLUS_JitDiffableDasm=1 - if (JitConfig.DiffableDasm() != 0) + static ConfigDWORD fDiffableDasm; + if (fDiffableDasm.val(CLRConfig::INTERNAL_JitDiffableDasm) != 0) { opts.disDiffable = true; opts.dspDiffable = true; } - if (JitConfig.DisplayMemStats() != 0) + static ConfigDWORD fDisplayMemStats; + if (fDisplayMemStats.val(CLRConfig::INTERNAL_JitMemStats) != 0) s_dspMemStats = true; - if (JitConfig.JitLargeBranches() != 0) + static ConfigDWORD fJitLargeBranches; + if (fJitLargeBranches.val(CLRConfig::INTERNAL_JitLargeBranches) != 0) opts.compLargeBranches = true; } @@ -2646,10 +2707,12 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) codeGen->setVerbose(true); } - treesBeforeAfterMorph = (JitConfig.TreesBeforeAfterMorph() == 1); + static ConfigDWORD fTreesBeforeAfterMorph; + treesBeforeAfterMorph = (fTreesBeforeAfterMorph.val(CLRConfig::INTERNAL_JitDumpBeforeAfterMorph) == 1); morphNum = 0; // Initialize the morphed-trees counting. - expensiveDebugCheckLevel = JitConfig.JitExpensiveDebugCheckLevel(); + static ConfigDWORD fJitExpensiveDebugCheckLevel; + expensiveDebugCheckLevel = fJitExpensiveDebugCheckLevel.val(CLRConfig::INTERNAL_JitExpensiveDebugCheckLevel); if (expensiveDebugCheckLevel == 0) { // If we're in a stress mode that modifies the flowgraph, make 1 the default. @@ -2666,16 +2729,21 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) printf(""); // in our logic this causes a flush } - if (JitConfig.JitBreak().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitBreak; + fJitBreak.ensureInit(CLRConfig::INTERNAL_JitBreak); + if (fJitBreak.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) assert(!"JitBreak reached"); - unsigned jitHashBreakVal = (unsigned)JitConfig.JitHashBreak(); + static ConfigDWORD fJitHashBreak; + unsigned jitHashBreakVal = (unsigned)fJitHashBreak.val(CLRConfig::INTERNAL_JitHashBreak); if ((jitHashBreakVal != (DWORD)-1) && (jitHashBreakVal == info.compMethodHash())) assert(!"JitHashBreak reached"); + static ConfigMethodSet fJitDebugBreak; + fJitDebugBreak.ensureInit(CLRConfig::INTERNAL_JitDebugBreak); if (verbose || - JitConfig.JitDebugBreak().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args) || - JitConfig.JitBreak().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + fJitDebugBreak.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args) || + fJitBreak.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) { compDebugBreak = true; } @@ -2689,7 +2757,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) #ifdef DEBUGGING_SUPPORT #ifdef DEBUG assert(!codeGen->isGCTypeFixed()); - opts.compGcChecks = (JitConfig.JitGCChecks() != 0) || + static ConfigDWORD fJitGCChecks; + opts.compGcChecks = (fJitGCChecks.val_DontUse_(CLRConfig::INTERNAL_JitGCChecks) != 0) || compStressCompile(STRESS_GENERIC_VARN, 5); enum @@ -2699,7 +2768,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) STACK_CHECK_ALL = 0x3, }; - DWORD dwJitStackChecks = JitConfig.JitStackChecks(); + static ConfigDWORD fJitStackChecks; + DWORD dwJitStackChecks = fJitStackChecks.val_DontUse_(CLRConfig::INTERNAL_JitStackChecks); if (compStressCompile(STRESS_GENERIC_VARN, 5)) dwJitStackChecks = STACK_CHECK_ALL; opts.compStackCheckOnRet = (dwJitStackChecks & DWORD(STACK_CHECK_ON_RETURN)) != 0; opts.compStackCheckOnCall = (dwJitStackChecks & DWORD(STACK_CHECK_ON_CALL)) != 0; @@ -2730,7 +2800,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) // Honour complus_JitELTHookEnabled only if VM has not asked us to generate profiler // hooks in the first place. That is, Override VM only if it hasn't asked for a // profiler callback for this method. - if (!compProfilerHookNeeded && (JitConfig.JitELTHookEnabled() != 0)) + static ConfigDWORD fJitELTHookEnabled; + if (!compProfilerHookNeeded && (fJitELTHookEnabled.val(CLRConfig::INTERNAL_JitELTHookEnabled) != 0)) { opts.compJitELTHookEnabled = true; } @@ -2746,13 +2817,14 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) #endif // PROFILING_SUPPORTED #if FEATURE_TAILCALL_OPT - const wchar_t* strTailCallOpt = JitConfig.TailCallOpt(); + static ConfigString fTailCallOpt; + LPWSTR strTailCallOpt = fTailCallOpt.val(CLRConfig::EXTERNAL_TailCallOpt); if (strTailCallOpt != nullptr) { opts.compTailCallOpt = (UINT)_wtoi(strTailCallOpt) != 0; } - - if (JitConfig.TailCallLoopOpt() == 0) + static ConfigDWORD fTailCallLoopOpt; + if (fTailCallLoopOpt.val(CLRConfig::EXTERNAL_TailCallLoopOpt) == 0) { opts.compTailCallLoopOpt = false; } @@ -2776,7 +2848,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) #ifdef DEBUG #if defined(_TARGET_XARCH_) && !defined(LEGACY_BACKEND) // Whether encoding of absolute addr as PC-rel offset is enabled in RyuJIT - opts.compEnablePCRelAddr = (JitConfig.EnablePCRelAddr() != 0); + static ConfigDWORD fEnablePCRelAddr; + opts.compEnablePCRelAddr = (fEnablePCRelAddr.val(CLRConfig::INTERNAL_JitEnablePCRelAddr) != 0); #endif #endif //DEBUG @@ -2800,15 +2873,21 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) // JitForceProcedureSplitting is used to force procedure splitting on checked assemblies. // This is useful for debugging on a checked build. Note that we still only do procedure // splitting in the zapper. - if (JitConfig.JitForceProcedureSplitting().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitForceProcedureSplitting; + fJitForceProcedureSplitting.ensureInit(CLRConfig::INTERNAL_JitForceProcedureSplitting); + if (fJitForceProcedureSplitting.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.compProcedureSplitting = true; // JitNoProcedureSplitting will always disable procedure splitting. - if (JitConfig.JitNoProcedureSplitting().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitNoProcedureSplitting; + fJitNoProcedureSplitting.ensureInit(CLRConfig::INTERNAL_JitNoProcedureSplitting); + if (fJitNoProcedureSplitting.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.compProcedureSplitting = false; // // JitNoProcedureSplittingEH will disable procedure splitting in functions with EH. - if (JitConfig.JitNoProcedureSplittingEH().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitNoProcedureSplittingEH; + fJitNoProcedureSplittingEH.ensureInit(CLRConfig::INTERNAL_JitNoProcedureSplittingEH); + if (fJitNoProcedureSplittingEH.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) opts.compProcedureSplittingEH = false; #endif } @@ -2854,7 +2933,8 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) opts.compNeedStackProbes = false; #ifdef DEBUG - if (JitConfig.StackProbesOverride() != 0 || + static ConfigDWORD fStackProbesOverride; + if (fStackProbesOverride.val_DontUse_(CLRConfig::INTERNAL_JitStackProbes) != 0 || compStressCompile(STRESS_GENERIC_VARN, 5)) { opts.compNeedStackProbes = true; @@ -2865,8 +2945,9 @@ void Compiler::compInitOptions(CORJIT_FLAGS* jitFlags) // Now, set compMaxUncheckedOffsetForNullObject for STRESS_NULL_OBJECT_CHECK if (compStressCompile(STRESS_NULL_OBJECT_CHECK, 30)) { + static ConfigDWORD fJitMaxUncheckedOffset; compMaxUncheckedOffsetForNullObject = - (unsigned) JitConfig.JitMaxUncheckedOffset(); + (unsigned) fJitMaxUncheckedOffset.val(CLRConfig::INTERNAL_JitMaxUncheckedOffset); if (verbose) { printf("STRESS_NULL_OBJECT_CHECK: compMaxUncheckedOffsetForNullObject=0x%X\n", compMaxUncheckedOffsetForNullObject); } @@ -2930,14 +3011,17 @@ bool Compiler::compJitHaltMethod() /* This method returns true when we use an INS_BREAKPOINT to allow us to step into the generated native code */ /* Note that this these two "Jit" environment variables also work for ngen images */ - if (JitConfig.JitHalt().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitHalt; + fJitHalt.ensureInit(CLRConfig::INTERNAL_JitHalt); + if (fJitHalt.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) { return true; } /* Use this Hash variant when there are a lot of method with the same name and different signatures */ - unsigned fJitHashHaltVal = (unsigned)JitConfig.JitHashHalt(); + static ConfigDWORD fJitHashHalt; + unsigned fJitHashHaltVal = (unsigned)fJitHashHalt.val(CLRConfig::INTERNAL_JitHashHalt); if ((fJitHashHaltVal != (unsigned)-1) && (fJitHashHaltVal == info.compMethodHash())) { return true; @@ -2972,17 +3056,21 @@ bool Compiler::compStressCompile(compStressArea stressArea, return false; } - if (!JitConfig.JitStressOnly().isEmpty() && - !JitConfig.JitStressOnly().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitStressOnly; + fJitStressOnly.ensureInit(CLRConfig::INTERNAL_JitStressOnly); + if (!fJitStressOnly.isEmpty() && + !fJitStressOnly.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) { return false; } bool doStress = false; - const wchar_t* strStressModeNames; + static ConfigString fJitStressModeNames; + LPWSTR strStressModeNames; // Does user explicitly prevent using this STRESS_MODE through the command line? - const wchar_t* strStressModeNamesNot = JitConfig.JitStressModeNamesNot(); + static ConfigString fJitStressModeNamesNot; + LPWSTR strStressModeNamesNot = fJitStressModeNamesNot.val(CLRConfig::INTERNAL_JitStressModeNamesNot); if ((strStressModeNamesNot != NULL) && (wcsstr(strStressModeNamesNot, s_compStressModeNames[stressArea]) != NULL)) { @@ -2995,7 +3083,7 @@ bool Compiler::compStressCompile(compStressArea stressArea, } // Does user explicitly set this STRESS_MODE through the command line? - strStressModeNames = JitConfig.JitStressModeNames(); + strStressModeNames = fJitStressModeNames.val(CLRConfig::INTERNAL_JitStressModeNames); if ((strStressModeNames != NULL) && (wcsstr(strStressModeNames, s_compStressModeNames[stressArea]) != NULL)) { @@ -3170,7 +3258,9 @@ void Compiler::compSetOptimizationLevel() } #ifdef DEBUG - jitMinOpts = JitConfig.JitMinOpts(); + static ConfigDWORD fJitMinOpts; + + jitMinOpts = fJitMinOpts.val_DontUse_(CLRConfig::UNSUPPORTED_JITMinOpts, 0); if (!theMinOptsValue && (jitMinOpts > 0)) { @@ -3234,7 +3324,10 @@ void Compiler::compSetOptimizationLevel() if (!theMinOptsValue) { - if (JitConfig.JitMinOptsName().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet jitMinOptsName; + jitMinOptsName.ensureInit(CLRConfig::INTERNAL_JITMinOptsName); + + if (jitMinOptsName.contains(info.compMethodName, info.compClassName, info.compMethodInfo->args.pSig)) theMinOptsValue = true; } @@ -3246,27 +3339,34 @@ void Compiler::compSetOptimizationLevel() // unless unless CLFLG_MINOPT is set else if (!(compileFlags & CORJIT_FLG_PREJIT)) { - if ((unsigned)JitConfig.JitMinOptsCodeSize() < info.compILCodeSize) + static ConfigDWORD fJitMinOptsCodeSize; + static ConfigDWORD fJitMinOptsInstrCount; + static ConfigDWORD fJitMinOptsBbCount; + static ConfigDWORD fJitMinOptsLvNumCount; + static ConfigDWORD fJitMinOptsLvRefCount; + static ConfigDWORD fJitBreakOnMinOpts; + + if (fJitMinOptsCodeSize.val_DontUse_(CLRConfig::INTERNAL_JITMinOptsCodeSize, DEFAULT_MIN_OPTS_CODE_SIZE) < info.compILCodeSize) { JITLOG((LL_INFO10, "IL Code Size exceeded, using MinOpts for method %s\n", info.compFullName)); theMinOptsValue = true; } - else if ((unsigned)JitConfig.JitMinOptsInstrCount() < opts.instrCount) + else if (fJitMinOptsInstrCount.val_DontUse_(CLRConfig::INTERNAL_JITMinOptsInstrCount, DEFAULT_MIN_OPTS_INSTR_COUNT) < opts.instrCount) { JITLOG((LL_INFO10, "IL instruction count exceeded, using MinOpts for method %s\n", info.compFullName)); theMinOptsValue = true; } - else if ((unsigned)JitConfig.JitMinOptsBbCount() < fgBBcount) + else if (fJitMinOptsBbCount.val_DontUse_(CLRConfig::INTERNAL_JITMinOptsBbCount, DEFAULT_MIN_OPTS_BB_COUNT) < fgBBcount) { JITLOG((LL_INFO10, "Basic Block count exceeded, using MinOpts for method %s\n", info.compFullName)); theMinOptsValue = true; } - else if ((unsigned)JitConfig.JitMinOptsLvNumCount() < lvaCount) + else if (fJitMinOptsLvNumCount.val_DontUse_(CLRConfig::INTERNAL_JITMinOptsLvNumcount, DEFAULT_MIN_OPTS_LV_NUM_COUNT) < lvaCount) { JITLOG((LL_INFO10, "Local Variable Num count exceeded, using MinOpts for method %s\n", info.compFullName)); theMinOptsValue = true; } - else if ((unsigned)JitConfig.JitMinOptsLvRefCount() < opts.lvRefCount) + else if (fJitMinOptsLvRefCount.val_DontUse_(CLRConfig::INTERNAL_JITMinOptsLvRefcount, DEFAULT_MIN_OPTS_LV_REF_COUNT) < opts.lvRefCount) { JITLOG((LL_INFO10, "Local Variable Ref count exceeded, using MinOpts for method %s\n", info.compFullName)); theMinOptsValue = true; @@ -3275,7 +3375,7 @@ void Compiler::compSetOptimizationLevel() { JITLOG((LL_INFO10000, "IL Code Size,Instr %4d,%4d, Basic Block count %3d, Local Variable Num,Ref count %3d,%3d for method %s\n", info.compILCodeSize, opts.instrCount, fgBBcount, lvaCount, opts.lvRefCount, info.compFullName)); - if (JitConfig.JitBreakOnMinOpts() != 0) + if (fJitBreakOnMinOpts.val_DontUse_(CLRConfig::INTERNAL_JITBreakOnMinOpts, 0) != 0) { assert(!"MinOpts enabled"); } @@ -3524,7 +3624,7 @@ void Compiler::compCompile(void * * methodCodePtr, EndPhase(PHASE_PRE_IMPORT); #ifdef DEBUG - bool funcTrace = JitConfig.JitFunctionTrace() != 0; + bool funcTrace = (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_JitFunctionTrace) != 0); if (!compIsForInlining()) { @@ -3764,13 +3864,14 @@ void Compiler::compCompile(void * * methodCodePtr, bool doRangeAnalysis = true; #ifdef DEBUG - doSsa = (JitConfig.JitDoSsa() != 0); - doEarlyProp = doSsa && (JitConfig.JitDoEarlyProp() != 0); - doValueNum = doSsa && (JitConfig.JitDoValueNumber() != 0); - doLoopHoisting = doValueNum && (JitConfig.JitDoLoopHoisting() != 0); - doCopyProp = doValueNum && (JitConfig.JitDoCopyProp() != 0); - doAssertionProp = doValueNum && (JitConfig.JitDoAssertionProp() != 0); - doRangeAnalysis = doAssertionProp && (JitConfig.JitDoRangeAnalysis() != 0); + static ConfigDWORD fJitDoOptConfig[7]; + doSsa = (fJitDoOptConfig[0].val(CLRConfig::INTERNAL_JitDoSsa) != 0); + doEarlyProp = doSsa && (fJitDoOptConfig[1].val(CLRConfig::INTERNAL_JitDoEarlyProp) != 0); + doValueNum = doSsa && (fJitDoOptConfig[2].val(CLRConfig::INTERNAL_JitDoValueNumber) != 0); + doLoopHoisting = doValueNum && (fJitDoOptConfig[3].val(CLRConfig::INTERNAL_JitDoLoopHoisting) != 0); + doCopyProp = doValueNum && (fJitDoOptConfig[4].val(CLRConfig::INTERNAL_JitDoCopyProp) != 0); + doAssertionProp = doValueNum && (fJitDoOptConfig[5].val(CLRConfig::INTERNAL_JitDoAssertionProp) != 0); + doRangeAnalysis = doAssertionProp && (fJitDoOptConfig[6].val(CLRConfig::INTERNAL_JitDoRangeAnalysis) != 0); #endif if (doSsa) @@ -4098,14 +4199,18 @@ void* forceFrameJIT; // used to force to frame &useful for fastchecked deb bool Compiler::skipMethod() { static ConfigMethodRange fJitRange; - fJitRange.ensureInit(JitConfig.JitRange()); + fJitRange.ensureInit(CLRConfig::INTERNAL_JitRange); if (!fJitRange.contains(info.compCompHnd, info.compMethodHnd)) return true; - if (JitConfig.JitExclude().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitExclude; + fJitExclude.ensureInit(CLRConfig::INTERNAL_JitExclude); + if (fJitExclude.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) return true; - if (!JitConfig.JitInclude().isEmpty() && !JitConfig.JitInclude().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) + static ConfigMethodSet fJitInclude; + fJitInclude.ensureInit(CLRConfig::INTERNAL_JitInclude); + if (!fJitInclude.isEmpty() && !fJitInclude.contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) return true; return false; @@ -4180,7 +4285,8 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd, #endif #if FUNC_INFO_LOGGING - LPCWSTR tmpJitFuncInfoFilename = JitConfig.JitFuncInfoFile(); + static ConfigString jitFuncInfoFile; + LPCWSTR tmpJitFuncInfoFilename = jitFuncInfoFile.val(CLRConfig::INTERNAL_JitFuncInfoLogFile); if (tmpJitFuncInfoFilename != NULL) { @@ -4262,7 +4368,7 @@ int Compiler::compCompile(CORINFO_METHOD_HANDLE methodHnd, } static ConfigMethodRange fJitStressRange; - fJitStressRange.ensureInit(JitConfig.JitStressRange()); + fJitStressRange.ensureInit(CLRConfig::INTERNAL_JitStressRange); if (fJitStressRange.contains(info.compCompHnd, info.compMethodHnd)) { bRangeAllowStress = true; @@ -4724,7 +4830,8 @@ int Compiler::compCompileHelper (CORINFO_MODULE_HANDLE clas #endif // Check for COMPLUS_AgressiveInlining - if (JitConfig.JitAggressiveInlining()) + static ConfigDWORD fJitAggressiveInlining; + if (fJitAggressiveInlining.val(CLRConfig::INTERNAL_JitAggressiveInlining)) { compDoAggressiveInlining = true; } @@ -4750,7 +4857,8 @@ int Compiler::compCompileHelper (CORINFO_MODULE_HANDLE clas } // Force verification if asked to do so - if (JitConfig.JitForceVer()) + static ConfigDWORD fJitForceVer; + if (fJitForceVer.val(CLRConfig::INTERNAL_JitForceVer)) tiVerificationNeeded = (instVerInfo == INSTVER_NOT_INSTANTIATION); if (tiVerificationNeeded) @@ -4980,7 +5088,8 @@ int Compiler::compCompileHelper (CORINFO_MODULE_HANDLE clas } #ifdef DEBUG - if (JitConfig.DumpJittedMethods() == 1 && !compIsForInlining()) + static ConfigDWORD fDumpJittedMethods; + if (fDumpJittedMethods.val(CLRConfig::INTERNAL_DumpJittedMethods) == 1 && !compIsForInlining()) { printf("Compiling %4d %s::%s, IL size = %u, hsh=0x%x\n", Compiler::jitTotalMethodCompiled, @@ -5027,7 +5136,8 @@ _Next: #ifdef ALT_JIT #ifdef DEBUG - if (JitConfig.RunAltJitCode() == 0) + static ConfigDWORD fRunAltJitCode; + if (fRunAltJitCode.val(CLRConfig::INTERNAL_RunAltJitCode) == 0) { return CORJIT_SKIPPED; } @@ -6600,7 +6710,8 @@ CritSecObject JitTimer::s_csvLock; LPCWSTR Compiler::JitTimeLogCsv() { - LPCWSTR jitTimeLogCsv = JitConfig.JitTimeLogCsv(); + static ConfigString jitConfigTimeLogCsv; + LPCWSTR jitTimeLogCsv = jitConfigTimeLogCsv.val(CLRConfig::INTERNAL_JitTimeLogCsv); return jitTimeLogCsv; } diff --git a/src/jit/compiler.h b/src/jit/compiler.h index bb302ee623..7925602c0c 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -4323,7 +4323,8 @@ protected : unsigned fgStressBBProf() { #ifdef DEBUG - unsigned result = JitConfig.JitStressBBProf(); + static ConfigDWORD fJitStressBBProf; + unsigned result = fJitStressBBProf.val(CLRConfig::INTERNAL_JitStressBBProf); if (result == 0) { if (compStressCompile(STRESS_BB_PROFILE, 15)) @@ -7548,7 +7549,6 @@ public : opts; #ifdef ALT_JIT - static bool s_pAltJitExcludeAssembliesListInitialized; static AssemblyNamesList2* s_pAltJitExcludeAssembliesList; #endif // ALT_JIT @@ -7641,7 +7641,8 @@ public : bool compTailCallStress() { #ifdef DEBUG - return (JitConfig.TailcallStress() !=0 + static ConfigDWORD fTailcallStress; + return (fTailcallStress.val(CLRConfig::INTERNAL_TailcallStress) !=0 || compStressCompile(STRESS_TAILCALL, 5) ); #else diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp index 882cf51381..6637891523 100644 --- a/src/jit/compiler.hpp +++ b/src/jit/compiler.hpp @@ -38,7 +38,10 @@ inline bool getInlinePInvokeEnabled() { #ifdef DEBUG - return JitConfig.JitPInvokeEnabled() && !JitConfig.StressCOMCall(); + static ConfigDWORD fJITPInvokeEnabled; + static ConfigDWORD fStressCOMCall; + + return fJITPInvokeEnabled.val(CLRConfig::INTERNAL_JITPInvokeEnabled) && !fStressCOMCall.val(CLRConfig::INTERNAL_StressCOMCall); #else return true; #endif @@ -48,7 +51,8 @@ inline bool getInlinePInvokeCheckEnabled() { #ifdef DEBUG - return JitConfig.JitPInvokeCheckEnabled() != 0; + static ConfigDWORD fJITPInvokeCheckEnabled; + return fJITPInvokeCheckEnabled.val(CLRConfig::INTERNAL_JITPInvokeCheckEnabled) != 0; #else return false; #endif @@ -85,7 +89,8 @@ inline RoundLevel getRoundFloatLevel() { #ifdef DEBUG - return (RoundLevel) JitConfig.JitRoundFloat(); + static ConfigDWORD fJITRoundFloat; + return (RoundLevel) fJITRoundFloat.val_DontUse_(CLRConfig::INTERNAL_JITRoundFloat, DEFAULT_ROUND_LEVEL); #else return DEFAULT_ROUND_LEVEL; #endif @@ -3087,13 +3092,15 @@ void Compiler::tmpDone() inline bool Compiler::shouldUseVerboseTrees() { - return (JitConfig.JitDumpVerboseTrees() == 1); + static ConfigDWORD fVerboseTrees; + return (fVerboseTrees.val(CLRConfig::INTERNAL_JitDumpVerboseTrees) == 1); } inline bool Compiler::shouldUseVerboseSsa() { - return (JitConfig.JitDumpVerboseSsa() == 1); + static ConfigDWORD fVerboseSsa; + return (fVerboseSsa.val(CLRConfig::INTERNAL_JitDumpVerboseSsa) == 1); } //------------------------------------------------------------------------ @@ -3105,7 +3112,8 @@ bool Compiler::shouldUseVerboseSsa() inline bool Compiler::shouldDumpASCIITrees() { - return (JitConfig.JitDumpASCII() == 1); + static ConfigDWORD fASCIITrees; + return (fASCIITrees.val(CLRConfig::INTERNAL_JitDumpASCII) == 1); } /***************************************************************************** @@ -3118,7 +3126,8 @@ bool Compiler::shouldDumpASCIITrees() inline DWORD getJitStressLevel() { - return JitConfig.JitStress(); + static ConfigDWORD fJitStress; + return fJitStress.val(CLRConfig::INTERNAL_JitStress); } /***************************************************************************** @@ -3128,7 +3137,9 @@ DWORD getJitStressLevel() inline DWORD StrictCheckForNonVirtualCallToVirtualMethod() { - return JitConfig.JitStrictCheckForNonVirtualCallToVirtualMethod() == 1; + static ConfigDWORD fJitStrictCheckForNonVirtualCallToVirtualMethod; + return fJitStrictCheckForNonVirtualCallToVirtualMethod.val( + CLRConfig::INTERNAL_JitStrictCheckForNonVirtualCallToVirtualMethod) == 1; } #endif // DEBUG diff --git a/src/jit/disasm.cpp b/src/jit/disasm.cpp index 9b8e0c3c47..3a3e0230f1 100644 --- a/src/jit/disasm.cpp +++ b/src/jit/disasm.cpp @@ -1531,7 +1531,9 @@ void DisAssembler::disAsmCode(BYTE* hotCodePtr, size_t hotCodeSize, BYTE* col #endif // !DEBUG #ifdef DEBUG - const wchar_t* fileName = JitConfig.JitLateDisasmTo(); + static ConfigString fJITLateDisasmTo; + + LPWSTR fileName = fJITLateDisasmTo.val(CLRConfig::INTERNAL_JITLateDisasmTo); if (fileName != nullptr) { errno_t ec = _wfopen_s(&disAsmFile, fileName, W("a+")); diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp index 46cdb6b43e..f0da62d153 100644 --- a/src/jit/ee_il_dll.cpp +++ b/src/jit/ee_il_dll.cpp @@ -52,14 +52,6 @@ void __stdcall jitStartup(ICorJitHost* jitHost) { g_jitHost = jitHost; - // `jitStartup` may be called multiple times - // when pre-jitting. We should not reinitialize - // config values each time. - if (!JitConfig.isInitialized()) - { - JitConfig.initialize(jitHost); - } - #ifdef FEATURE_TRACELOGGING JitTelemetry::NotifyDllProcessAttach(); #endif @@ -293,7 +285,8 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags) ((cpuCompileFlags & CORJIT_FLG_FEATURE_SIMD) != 0) && ((cpuCompileFlags & CORJIT_FLG_USE_AVX2) != 0)) { - if (JitConfig.EnableAVX() != 0) + static ConfigDWORD fEnableAVX; + if (fEnableAVX.val(CLRConfig::EXTERNAL_EnableAVX) != 0) { return 32; } diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp index 5af7adeffc..35b16b679a 100644 --- a/src/jit/emit.cpp +++ b/src/jit/emit.cpp @@ -924,7 +924,8 @@ void emitter::emitTmpSizeChanged(unsigned tmpSize) #ifdef DEBUG // Workaround for FP code - bool bAssert = JitConfig.JitMaxTempAssert()?true:false; + static ConfigDWORD fMaxTempAssert; + bool bAssert = fMaxTempAssert.val(CLRConfig::INTERNAL_JITMaxTempAssert)?true:false; if (tmpSize > emitMaxTmpSize && bAssert) { diff --git a/src/jit/emitarm.cpp b/src/jit/emitarm.cpp index 99049e4b0e..a405246d24 100644 --- a/src/jit/emitarm.cpp +++ b/src/jit/emitarm.cpp @@ -6620,7 +6620,8 @@ DONE_CALL: { // set JitEmitPrintRefRegs=1 will print out emitThisGCrefRegs and emitThisByrefRegs // at the beginning of this method. - if (JitConfig.JitEmitPrintRefRegs() != 0) { + static ConfigDWORD fJitEmitPrintRefRegs; + if (fJitEmitPrintRefRegs.val(CLRConfig::INTERNAL_JitEmitPrintRefRegs) != 0) { printf("Before emitOutputInstr for id->idDebugOnlyInfo()->idNum=0x%02x\n", id->idDebugOnlyInfo()->idNum); printf(" emitThisGCrefRegs(0x%p)=", dspPtr(&emitThisGCrefRegs)); printRegMaskInt(emitThisGCrefRegs); @@ -6634,7 +6635,8 @@ DONE_CALL: // For example, set JitBreakEmitOutputInstr=a6 will break when this method is called for // emitting instruction a6, (i.e. IN00a6 in jitdump). - if ((unsigned)JitConfig.JitBreakEmitOutputInstr() == id->idDebugOnlyInfo()->idNum) + static ConfigDWORD fJitBreakEmitOutputInstr; + if ((unsigned)fJitBreakEmitOutputInstr.val(CLRConfig::INTERNAL_JitBreakEmitOutputInstr) == id->idDebugOnlyInfo()->idNum) { assert(!"JitBreakEmitOutputInstr reached"); } diff --git a/src/jit/emitarm64.cpp b/src/jit/emitarm64.cpp index 7421f0dcd7..2b203499b4 100644 --- a/src/jit/emitarm64.cpp +++ b/src/jit/emitarm64.cpp @@ -9167,7 +9167,8 @@ size_t emitter::emitOutputInstr(insGroup *ig, { // For example, set JitBreakEmitOutputInstr=a6 will break when this method is called for // emitting instruction a6, (i.e. IN00a6 in jitdump). - if ((unsigned)JitConfig.JitBreakEmitOutputInstr() == id->idDebugOnlyInfo()->idNum) + static ConfigDWORD fJitBreakEmitOutputInstr; + if ((unsigned)fJitBreakEmitOutputInstr.val(CLRConfig::INTERNAL_JitBreakEmitOutputInstr) == id->idDebugOnlyInfo()->idNum) { assert(!"JitBreakEmitOutputInstr reached"); } diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp index 343e00f182..4bf0affe4c 100644 --- a/src/jit/emitxarch.cpp +++ b/src/jit/emitxarch.cpp @@ -11159,7 +11159,8 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** { // set JitEmitPrintRefRegs=1 will print out emitThisGCrefRegs and emitThisByrefRegs // at the beginning of this method. - if (JitConfig.JitEmitPrintRefRegs() != 0) + static ConfigDWORD fJitEmitPrintRefRegs; + if (fJitEmitPrintRefRegs.val(CLRConfig::INTERNAL_JitEmitPrintRefRegs) != 0) { printf("Before emitOutputInstr for id->idDebugOnlyInfo()->idNum=0x%02x\n", id->idDebugOnlyInfo()->idNum); printf(" emitThisGCrefRegs(0x%p)=", emitComp->dspPtr(&emitThisGCrefRegs)); @@ -11174,7 +11175,8 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** // For example, set JitBreakEmitOutputInstr=a6 will break when this method is called for // emitting instruction a6, (i.e. IN00a6 in jitdump). - if ((unsigned)JitConfig.JitBreakEmitOutputInstr() == id->idDebugOnlyInfo()->idNum) + static ConfigDWORD fJitBreakEmitOutputInstr; + if ((unsigned)fJitBreakEmitOutputInstr.val(CLRConfig::INTERNAL_JitBreakEmitOutputInstr) == id->idDebugOnlyInfo()->idNum) { assert(!"JitBreakEmitOutputInstr reached"); } diff --git a/src/jit/error.cpp b/src/jit/error.cpp index b853b9f8ef..2f30227cf3 100644 --- a/src/jit/error.cpp +++ b/src/jit/error.cpp @@ -34,7 +34,8 @@ void DECLSPEC_NORETURN fatal(int errCode) #ifdef DEBUG if (errCode != CORJIT_SKIPPED) // Don't stop on NYI: use COMPLUS_AltJitAssertOnNYI for that. { - if (JitConfig.DebugBreakOnVerificationFailure()) + static ConfigDWORD fDebugBreakOnVerificationFailure; + if (fDebugBreakOnVerificationFailure.val(CLRConfig::INTERNAL_DebugBreakOnVerificationFailure)) { DebugBreak(); } @@ -89,7 +90,8 @@ void DECLSPEC_NORETURN noWayAssertBody() // have the assert code to fall back on here. // The debug path goes through this function also, to do the call to 'fatal'. // This kind of noway is hit for unreached(). - if (JitConfig.JitEnableNoWayAssert()) + static ConfigDWORD fJitEnableNoWayAssert; + if (fJitEnableNoWayAssert.val(CLRConfig::INTERNAL_JitEnableNoWayAssert)) { DebugBreak(); } @@ -170,7 +172,9 @@ void notYetImplemented(const char * msg, const char * filename, unsigned line) #endif // !DEBUG #endif // FUNC_INFO_LOGGING - DWORD value = JitConfig.AltJitAssertOnNYI(); + static ConfigDWORD fAltJitAssertOnNYI; + + DWORD value = fAltJitAssertOnNYI.val(CLRConfig::INTERNAL_AltJitAssertOnNYI); // 0 means just silently skip // If we are in retail builds, assume ignore @@ -233,7 +237,8 @@ LONG __JITfilter(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam) DWORD getBreakOnBadCode() { - return JitConfig.JitBreakOnBadCode(); + static ConfigDWORD fBreakOnBadCode; + return fBreakOnBadCode.val_DontUse_(CLRConfig::INTERNAL_JitBreakOnBadCode, false); } /*****************************************************************************/ @@ -246,9 +251,10 @@ void debugError(const char* msg, const char* file, unsigned line) logf(LL_ERROR, "COMPILATION FAILED: file: %s:%d compiling method %s reason %s\n", file, line, env->compiler->info.compFullName, msg); + static ConfigDWORD fJitRequired; // We now only assert when user explicitly set ComPlus_JitRequired=1 // If ComPlus_JitRequired is 0 or is not set, we will not assert. - if (JitConfig.JitRequired() == 1 || getBreakOnBadCode()) + if (fJitRequired.val(CLRConfig::INTERNAL_JITRequired) == 1 || getBreakOnBadCode()) { // Don't assert if verification is done. if (!env->compiler->tiVerificationNeeded || getBreakOnBadCode()) @@ -317,7 +323,8 @@ void __cdecl assertAbort(const char *why, const char *file, unsigned line) // to the fallback JIT behavior. This is useful when doing ASM diffs, where we only want to see // the first assert for any function, but we don't want to kill the whole ngen process on the // first assert (which would happen if you used COMPLUS_NoGuiOnAssert=1 for example). - if (JitConfig.AltJitSkipOnAssert() != 0) + static ConfigDWORD fAltJitSkipOnAssert; + if (fAltJitSkipOnAssert.val(CLRConfig::INTERNAL_AltJitSkipOnAssert) != 0) { fatal(CORJIT_SKIPPED); } @@ -327,7 +334,9 @@ void __cdecl assertAbort(const char *why, const char *file, unsigned line) // When we are bringing up the new Arm64 JIT we set COMPLUS_ContinueOnAssert=1 // We only want to hit one assert then we will fall back to the interpreter. // - bool interpreterFallback = (JitConfig.InterpreterFallback() != 0); + static ConfigDWORD s_InterpreterFallback; + + bool interpreterFallback = (s_InterpreterFallback.val(CLRConfig::INTERNAL_InterpreterFallback) != 0); if (interpreterFallback) { @@ -351,7 +360,8 @@ int logf_stdout(const char* fmt, va_list args) char buffer[BUFF_SIZE]; int written = _vsnprintf_s(&buffer[0], BUFF_SIZE, _TRUNCATE, fmt, args); - if (JitConfig.JitDumpToDebugger()) + static ConfigDWORD fJitDumpToDebugger; + if (fJitDumpToDebugger.val(CLRConfig::INTERNAL_JitDumpToDebugger)) { OutputDebugStringA(buffer); } @@ -526,7 +536,8 @@ void DECLSPEC_NORETURN badCode3(const char* msg, const char* msg2, int arg, void noWayAssertAbortHelper(const char * cond, const char * file, unsigned line) { // Show the assert UI. - if (JitConfig.JitEnableNoWayAssert()) + static ConfigDWORD fJitEnableNoWayAssert; + if (fJitEnableNoWayAssert.val(CLRConfig::INTERNAL_JitEnableNoWayAssert)) { assertAbort(cond, file, line); } diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index 0dc9fe67bf..3af856f153 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -31,7 +31,8 @@ void Compiler::fgInit() #ifdef DEBUG fgInlinedCount = 0; - fgPrintInlinedMethods = JitConfig.JitPrintInlinedMethods() == 1; + static ConfigDWORD fJitPrintInlinedMethods; + fgPrintInlinedMethods = fJitPrintInlinedMethods.val(CLRConfig::EXTERNAL_JitPrintInlinedMethods) == 1; #endif // DEBUG /* We haven't yet computed the bbPreds lists */ @@ -162,11 +163,12 @@ void Compiler::fgInit() #ifdef DEBUG if (!compIsForInlining()) { - if ((JitConfig.JitNoStructPromotion() & 1) == 1) + static ConfigDWORD fJitNoStructPromotion; + if ((fJitNoStructPromotion.val(CLRConfig::INTERNAL_JitNoStructPromotion) & 1) == 1) { fgNoStructPromotion = true; } - if ((JitConfig.JitNoStructPromotion() & 2) == 2) + if ((fJitNoStructPromotion.val(CLRConfig::INTERNAL_JitNoStructPromotion) & 2) == 2) { fgNoStructParamPromotion = true; } @@ -10047,7 +10049,8 @@ void Compiler::fgCompactBlocks(BasicBlock* block, BasicBlock* bNe #endif #if DEBUG - if (JitConfig.JitSlowDebugChecksEnabled() != 0) + static ConfigDWORD fSlowDebugChecksEnabled; + if (fSlowDebugChecksEnabled.val(CLRConfig::INTERNAL_JitSlowDebugChecksEnabled) != 0) { // Make sure that the predecessor lists are accurate fgDebugCheckBBlist(); @@ -18911,15 +18914,21 @@ FILE* Compiler::fgOpenFlowGraphFile(bool* wbDontClose, Phases phas #ifdef DEBUG if (opts.eeFlags & CORJIT_FLG_PREJIT) { - pattern = JitConfig.NgenDumpFg(); - filename = JitConfig.NgenDumpFgFile(); - pathname = JitConfig.NgenDumpFgDir(); + static ConfigString sNgenDumpFg; + pattern = sNgenDumpFg.val(CLRConfig::INTERNAL_NgenDumpFg); + static ConfigString sNgenDumpFgFile; + filename = sNgenDumpFgFile.val(CLRConfig::INTERNAL_NgenDumpFgFile); + static ConfigString sNgenDumpFgDir; + pathname = sNgenDumpFgDir.val(CLRConfig::INTERNAL_NgenDumpFgDir); } else { - pattern = JitConfig.JitDumpFg(); - filename = JitConfig.JitDumpFgFile(); - pathname = JitConfig.JitDumpFgDir(); + static ConfigString sJitDumpFg; + pattern = sJitDumpFg.val(CLRConfig::INTERNAL_JitDumpFg); + static ConfigString sJitDumpFgFile; + filename = sJitDumpFgFile.val(CLRConfig::INTERNAL_JitDumpFgFile); + static ConfigString sJitDumpFgDir; + pathname = sJitDumpFgDir.val(CLRConfig::INTERNAL_JitDumpFgDir); } #endif // DEBUG @@ -18932,7 +18941,8 @@ FILE* Compiler::fgOpenFlowGraphFile(bool* wbDontClose, Phases phas if (wcslen(pattern) == 0) return NULL; - LPCWSTR phasePattern = JitConfig.JitDumpFgPhase(); + static ConfigString sJitDumpFgPhase; + LPCWSTR phasePattern = sJitDumpFgPhase.val(CLRConfig::INTERNAL_JitDumpFgPhase); LPCWSTR phaseName = PhaseShortNames[phase]; if (phasePattern == 0) { @@ -19194,8 +19204,9 @@ bool Compiler::fgDumpFlowGraph(Phases phase) { bool result = false; bool dontClose = false; + static ConfigDWORD fJitDumpFgDot; bool createDotFile = false; - if (JitConfig.JitDumpFgDot()) + if (fJitDumpFgDot.val(CLRConfig::INTERNAL_JitDumpFgDot)) { createDotFile = true; } diff --git a/src/jit/gcencode.cpp b/src/jit/gcencode.cpp index d5fff4833f..cae78c4df5 100644 --- a/src/jit/gcencode.cpp +++ b/src/jit/gcencode.cpp @@ -3325,12 +3325,13 @@ class GcInfoEncoderWithLogging { GcInfoEncoder* m_gcInfoEncoder; bool m_doLogging; + static ConfigDWORD s_fJitGCInfoLogging; public: GcInfoEncoderWithLogging(GcInfoEncoder* gcInfoEncoder, bool verbose) : m_gcInfoEncoder(gcInfoEncoder), - m_doLogging(verbose || JitConfig.JitGCInfoLogging() != 0) + m_doLogging(verbose || s_fJitGCInfoLogging.val(CLRConfig::INTERNAL_JitGCInfoLogging) != 0) {} GcSlotId GetStackSlotId( INT32 spOffset, GcSlotFlags flags, GcStackSlotBase spBase = GC_CALLER_SP_REL ) @@ -3483,6 +3484,8 @@ public: }; +ConfigDWORD GcInfoEncoderWithLogging::s_fJitGCInfoLogging; + #define GCENCODER_WITH_LOGGING(withLog, realEncoder) \ GcInfoEncoderWithLogging withLog ## Var(realEncoder, compiler->verbose || compiler->opts.dspGCtbls); \ GcInfoEncoderWithLogging * withLog = &withLog ## Var; diff --git a/src/jit/gentree.h b/src/jit/gentree.h index 01878a1768..08cc26473f 100644 --- a/src/jit/gentree.h +++ b/src/jit/gentree.h @@ -2649,7 +2649,8 @@ struct GenTreeIndex: public GenTreeOp gtStructElemClass(nullptr) // We always initialize this after construction. { #ifdef DEBUG - if (JitConfig.JitSkipArrayBoundCheck() == 1) + static ConfigDWORD fJitSkipArrayBoundCheck; + if (fJitSkipArrayBoundCheck.val(CLRConfig::INTERNAL_JitSkipArrayBoundCheck) == 1) { // Skip bounds check } diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index c865fb0f1d..0ad5dc2948 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -71,7 +71,8 @@ void Compiler::impInit() #ifndef DEBUG impInlineSize = DEFAULT_MAX_INLINE_SIZE; #else - impInlineSize = JitConfig.JitInlineSize(); + static ConfigDWORD fJitInlineSize; + impInlineSize = fJitInlineSize.val_DontUse_(CLRConfig::INTERNAL_JITInlineSize, DEFAULT_MAX_INLINE_SIZE); if (compStressCompile(STRESS_INLINE, 50)) impInlineSize *= 10; @@ -190,7 +191,8 @@ inline void Compiler::verRaiseVerifyExceptionIfNeeded(INDEBUG(const char* msg) D const char* tail = strrchr(file, '\\'); if (tail) file = tail+1; - if (JitConfig.JitBreakOnUnsafeCode()) + static ConfigDWORD fJitBreakOnUnsafeCode; + if (fJitBreakOnUnsafeCode.val(CLRConfig::INTERNAL_JitBreakOnUnsafeCode)) assert(!"Unsafe code detected"); #endif @@ -3460,7 +3462,8 @@ void Compiler::verConvertBBToThrowVerificationException(BasicBlock* block printf("\n\nVerification failure: %s near IL %xh \n", info.compFullName, block->bbCodeOffs); } - if (JitConfig.DebugBreakOnVerificationFailure()) + static ConfigDWORD fDebugBreakOnVerificationFailure; + if (fDebugBreakOnVerificationFailure.val(CLRConfig::INTERNAL_DebugBreakOnVerificationFailure)) { DebugBreak(); } @@ -15618,7 +15621,8 @@ void Compiler::impCanInlineNative(int callsiteNativeEstima // effect of different values was within the standard deviation. This may be a place where future tuning // (with additional benchmarks) would be valuable. - int simdMultiplier = JitConfig.JitInlineSIMDMultiplier(); + static ConfigDWORD fJitInlineSIMDMultiplier; + int simdMultiplier = fJitInlineSIMDMultiplier.val(CLRConfig::INTERNAL_JitInlineSIMDMultiplier); multiplier += simdMultiplier; JITDUMP("\nInline candidate has SIMD type args, locals or return value. Multipler increased to %g.", multiplier); @@ -15707,7 +15711,8 @@ void Compiler::impCanInlineNative(int callsiteNativeEstima } #ifdef DEBUG - int additionalMultiplier = JitConfig.JitInlineAdditionalMultiplier(); + static ConfigDWORD fJitInlineAdditionalMultiplier; + int additionalMultiplier = fJitInlineAdditionalMultiplier.val(CLRConfig::EXTERNAL_JitInlineAdditionalMultiplier); if (additionalMultiplier!=0) { @@ -15925,7 +15930,8 @@ void Compiler::impCheckCanInline(GenTreePtr call, const char * className; methodName = pParam->pThis->eeGetMethodName(pParam->fncHandle, &className); - if (JitConfig.JitNoInline()) + static ConfigDWORD fJitNoInline; + if (fJitNoInline.val(CLRConfig::INTERNAL_JitNoInline)) { pParam->result->noteFatal(InlineObservation::CALLEE_IS_JIT_NOINLINE); goto _exit; diff --git a/src/jit/instr.cpp b/src/jit/instr.cpp index aca8b57ee4..c6ca9d35c5 100644 --- a/src/jit/instr.cpp +++ b/src/jit/instr.cpp @@ -3905,7 +3905,8 @@ void CodeGen::instGen_Return(unsigned stkArgSize) void CodeGen::instGen_MemoryBarrier() { #ifdef DEBUG - if (JitConfig.JitNoMemoryBarriers() == 1) + static ConfigDWORD fJitNoMemoryBarriers; + if (fJitNoMemoryBarriers.val(CLRConfig::INTERNAL_JitNoMemoryBarriers) == 1) return; #endif // DEBUG diff --git a/src/jit/jit.h b/src/jit/jit.h index 2b7fdf1357..af78504aa0 100644 --- a/src/jit/jit.h +++ b/src/jit/jit.h @@ -199,18 +199,6 @@ #define __PLACEMENT_NEW_INLINE // don't bring in the global placement new, it is easy to make a mistake // with our new(compiler*) pattern. -#if COR_JIT_EE_VER > 460 -#define NO_CLRCONFIG // Don't bring in the usual CLRConfig infrastructure, since the JIT uses the JIT/EE - // interface to retrieve config values. - -// This is needed for contract.inl when FEATURE_STACK_PROBE is enabled. -struct CLRConfig -{ - static struct ConfigKey { } EXTERNAL_NO_SO_NOT_MAINLINE; - static DWORD GetConfigValue(const ConfigKey& key) { return 0; } -}; -#endif - #include "utilcode.h" // this defines assert as _ASSERTE #include "host.h" // this redefines assert for the JIT to use assertAbort #include "utils.h" @@ -532,7 +520,8 @@ extern JitOptions jitOpts; template<typename T> inline T UninitializedWord() { - __int64 word = 0x0101010101010101LL * (JitConfig.JitDefaultFill() & 0xFF); + static ConfigDWORD fDefaultFill; + __int64 word = 0x0101010101010101LL * (fDefaultFill.val(CLRConfig::INTERNAL_JitDefaultFill) & 0xFF); return (T)word; } diff --git a/src/jit/jit.settings.targets b/src/jit/jit.settings.targets index 0f3e9e4deb..5f93c539ea 100644 --- a/src/jit/jit.settings.targets +++ b/src/jit/jit.settings.targets @@ -81,7 +81,6 @@ <CppCompile Include="..\RangeCheck.cpp" /> <CppCompile Include="..\LoopCloning.cpp" /> <CppCompile Include="..\inline.cpp" /> - <CppCompile Include="..\jitconfig.cpp" /> <CppCompile Condition="'$(ClDefines.Contains(`LEGACY_BACKEND`))'=='True'" Include="..\CodeGenLegacy.cpp" /> <CppCompile Condition="'$(ClDefines.Contains(`LEGACY_BACKEND`))'=='False'" Include="..\Lower.cpp" /> <CppCompile Condition="'$(ClDefines.Contains(`LEGACY_BACKEND`))'=='False'" Include="..\LSRA.cpp" /> diff --git a/src/jit/jitconfig.cpp b/src/jit/jitconfig.cpp deleted file mode 100644 index da1875ca0e..0000000000 --- a/src/jit/jitconfig.cpp +++ /dev/null @@ -1,298 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#include "jitpch.h" -#ifdef _MSC_VER -#pragma hdrstop -#endif - -#include "jitconfig.h" - -JitConfigValues JitConfig; - -void JitConfigValues::MethodSet::initialize(const wchar_t* list, ICorJitHost* host) -{ - _ASSERTE(m_list == nullptr); - - enum State { NO_NAME, CLS_NAME, FUNC_NAME, ARG_LIST }; // parsing state machine - - const char SEP_CHAR = ' '; // current character use to separate each entry - - wchar_t lastChar = '?'; // dummy - int nameStart = -1; // Index of the start of the current class or method name - MethodName currentName; // Buffer used while parsing the current entry - MethodName** lastName = &m_names; // Last entry inserted into the list - bool isQuoted = false; - - currentName.m_next = nullptr; - currentName.m_methodNameStart = -1; - currentName.m_methodNameLen = -1; - currentName.m_classNameStart = -1; - currentName.m_classNameLen = -1; - currentName.m_numArgs = -1; - - // Convert the input list to UTF-8 - int utf8ListLen = WszWideCharToMultiByte(CP_UTF8, 0, list, -1, NULL, 0, NULL, NULL); - m_list = (char*)host->allocateMemory(utf8ListLen); - if (WszWideCharToMultiByte(CP_UTF8, 0, list, -1, const_cast<LPSTR>(m_list), utf8ListLen, NULL, NULL) == 0) - { - // Failed to convert the list. Free the memory and ignore the list. - host->freeMemory(reinterpret_cast<void*>(const_cast<char*>(m_list))); - m_list = ""; - return; - } - - State state = NO_NAME; - for (int i = 0; lastChar != '\0'; i++) - { - lastChar = m_list[i]; - - switch(state) - { - case NO_NAME: - if (m_list[i] != SEP_CHAR) - { - nameStart = i; - state = CLS_NAME; // we have found the start of the next entry - } - break; - - case CLS_NAME: - if (m_list[nameStart] == '"') - { - for (; m_list[i] != '\0' && m_list[i] != '"'; i++) - ; - - nameStart++; - isQuoted = true; - } - - if (m_list[i] == ':') - { - if (m_list[nameStart] == '*' && !isQuoted) - { - // The class name is a wildcard; mark it invalid. - currentName.m_classNameStart = -1; - currentName.m_classNameLen = -1; - } - else - { - currentName.m_classNameStart = nameStart; - currentName.m_classNameLen = i - nameStart; - - // Remove the trailing quote, if any - if (isQuoted) - { - currentName.m_classNameLen--; - isQuoted = false; - } - } - - // Accept class::name syntax as well - if (m_list[i + 1] == ':') - { - i++; - } - - nameStart = i + 1; - state = FUNC_NAME; - } - else if (m_list[i] == '\0' || m_list[i] == SEP_CHAR || m_list[i] == '(') - { - // Treat this as a method name without a class name. - currentName.m_classNameStart = -1; - currentName.m_classNameLen = -1; - goto DONE_FUNC_NAME; - } - break; - - case FUNC_NAME: - if (m_list[nameStart] == '"') - { - // The first half of the outer contdition handles the case where the - // class name is valid. - for (; nameStart == i || (m_list[i] != '\0' && m_list[i] != '"'); i++) - ; - - nameStart++; - isQuoted = true; - } - - if (m_list[i] == '\0' || m_list[i] == SEP_CHAR || m_list[i] == '(') - { - DONE_FUNC_NAME: - _ASSERTE(m_list[i] == '\0' || m_list[i] == SEP_CHAR || m_list[i] == '('); - - if (m_list[nameStart] == '*' && !isQuoted) - { - // The method name is a wildcard; mark it invalid. - currentName.m_methodNameStart = -1; - currentName.m_methodNameLen = -1; - } - else - { - currentName.m_methodNameStart = nameStart; - currentName.m_methodNameLen = i - nameStart; - - // Remove the trailing quote, if any - if (isQuoted) - { - currentName.m_classNameLen--; - isQuoted = false; - } - } - - if (m_list[i] == '\0' || m_list[i] == SEP_CHAR) - { - currentName.m_numArgs = -1; - goto DONE_ARG_LIST; - } - else - { - _ASSERTE(m_list[i] == '('); - currentName.m_numArgs = -1; - state = ARG_LIST; - } - } - break; - - case ARG_LIST: - if (m_list[i] == '\0' || m_list[i] == ')') - { - if (currentName.m_numArgs == -1) - { - currentName.m_numArgs = 0; - } - - DONE_ARG_LIST: - _ASSERTE(m_list[i] == '\0' || m_list[i] == SEP_CHAR || m_list[i] == ')'); - - // We have parsed an entire method name; create a new entry in the list for it. - MethodName* name = (MethodName*)host->allocateMemory(sizeof(MethodName)); - *name = currentName; - - _ASSERTE(name->m_next == nullptr); - *lastName = name; - lastName = &name->m_next; - - state = NO_NAME; - - // Skip anything after the argument list until we find the next - // separator character. Otherwise if we see "func(a,b):foo" we - // create entries for "func(a,b)" as well as ":foo". - if (m_list[i] == ')') - { - for (; m_list[i] && m_list[i] != SEP_CHAR; i++) - ; - - lastChar = m_list[i]; - } - } - else - { - if (m_list[i] != SEP_CHAR && currentName.m_numArgs == -1) - { - currentName.m_numArgs = 1; - } - - if (m_list[i] == ',') - { - currentName.m_numArgs++; - } - } - break; - - default: - _ASSERTE(!"Bad state"); - break; - } - } -} - -static bool matchesName(const char* const name, int nameLen, const char* const s2) -{ - return strncmp(name, s2, nameLen) == 0 && s2[nameLen] == '\0'; -} - -bool JitConfigValues::MethodSet::contains(const char* methodName, const char* className, CORINFO_SIG_INFO* sigInfo) const -{ - int numArgs = sigInfo != nullptr ? sigInfo->numArgs : -1; - - // Try to match any the entries in the list. - for (MethodName* name = m_names; name != nullptr; name = name->m_next) - { - // If m_numArgs is valid, check for a mismatch - if (name->m_numArgs != -1 && name->m_numArgs != numArgs) - { - continue; - } - - // If m_methodNameStart is valid, check for a mismatch - if (name->m_methodNameStart != -1) - { - const char* expectedMethodName = &m_list[name->m_methodNameStart]; - if (!matchesName(expectedMethodName, name->m_methodNameLen, methodName)) - { - // C++ embeds the class name into the method name; deal with that here. - const char* colon = strchr(methodName, ':'); - if (colon != nullptr && colon[1] == ':' && matchesName(expectedMethodName, name->m_methodNameLen, methodName)) - { - int classLen = (int)(colon - methodName); - if (name->m_classNameStart == -1 || - (classLen == name->m_classNameLen && - strncmp(&m_list[name->m_classNameStart], methodName, classLen) == 0)) - { - return true; - } - } - continue; - } - } - - // If m_classNameStart is valid, check for a mismatch - if (className == nullptr || name->m_classNameStart == -1 || matchesName(&m_list[name->m_classNameStart], name->m_classNameLen, className)) - { - return true; - } - - // Check for suffix wildcard like System.* - if (name->m_classNameLen > 0 && - m_list[name->m_classNameStart + name->m_classNameLen - 1] == '*' && - strncmp(&m_list[name->m_classNameStart], className, name->m_classNameLen - 1) == 0) - { - return true; - } - -#ifdef _DEBUG - // Maybe className doesn't include the namespace. Try to match that - const char* nsSep = strrchr(className, '.'); - if (nsSep != nullptr && nsSep != className) - { - const char* onlyClass = nsSep[-1] == '.' ? nsSep : &nsSep[1]; - if (matchesName(&m_list[name->m_classNameStart], name->m_classNameLen, onlyClass)) - { - return true; - } - } -#endif - } - - return false; -} - -void JitConfigValues::initialize(ICorJitHost* host) -{ - _ASSERTE(!m_isInitialized); - -#define CONFIG_INTEGER(name, key, defaultValue) m_##name = host->getIntConfigValue(key, defaultValue); -#define CONFIG_STRING(name, key) m_##name = host->getStringConfigValue(key); -#define CONFIG_METHODSET(name, key) \ - const wchar_t* name##value = host->getStringConfigValue(key); \ - m_##name.initialize(name##value, host); \ - host->freeStringConfigValue(name##value); - -#include "jitconfigvalues.h" - - m_isInitialized = true; -} diff --git a/src/jit/jitconfig.h b/src/jit/jitconfig.h deleted file mode 100644 index 9da5808a5a..0000000000 --- a/src/jit/jitconfig.h +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#ifndef _JITCONFIG_H_ -#define _JITCONFIG_H_ - -struct CORINFO_SIG_INFO; -class ICorJitHost; - -class JitConfigValues -{ -public: - class MethodSet - { - private: - struct MethodName - { - MethodName* m_next; - int m_methodNameStart; - int m_methodNameLen; - int m_classNameStart; - int m_classNameLen; - int m_numArgs; - }; - - const char* m_list; - MethodName* m_names; - - MethodSet(const MethodSet& other) = delete; - MethodSet& operator=(const MethodSet& other) = delete; - - public: - MethodSet() { } - inline const char* list() const { return m_list; } - - void initialize(const wchar_t* list, ICorJitHost* host); - - inline bool isEmpty() const { return m_names == nullptr; } - bool contains(const char* methodName, const char* className, CORINFO_SIG_INFO* sigInfo) const; - }; - -private: -#define CONFIG_INTEGER(name, key, defaultValue) int m_##name; -#define CONFIG_STRING(name, key) const wchar_t* m_##name; -#define CONFIG_METHODSET(name, key) MethodSet m_##name; -#include "jitconfigvalues.h" - -public: -#define CONFIG_INTEGER(name, key, defaultValue) inline int name() const { return m_##name; } -#define CONFIG_STRING(name, key) inline const wchar_t* name() const { return m_##name; } -#define CONFIG_METHODSET(name, key) inline const MethodSet& name() const { return m_##name; } -#include "jitconfigvalues.h" - -private: - bool m_isInitialized; - - JitConfigValues(const JitConfigValues& other) = delete; - JitConfigValues& operator=(const JitConfigValues& other) = delete; - -public: - JitConfigValues() {} - - inline bool isInitialized() const { return m_isInitialized != 0; } - void initialize(ICorJitHost* host); -}; - -extern JitConfigValues JitConfig; - -#endif diff --git a/src/jit/jitconfigvalues.h b/src/jit/jitconfigvalues.h deleted file mode 100644 index 8136517078..0000000000 --- a/src/jit/jitconfigvalues.h +++ /dev/null @@ -1,193 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if !defined(CONFIG_INTEGER) || !defined(CONFIG_STRING) || !defined(CONFIG_METHODSET) -#error CONFIG_INTEGER, CONFIG_STRING, and CONFIG_METHODSET must be defined before including this file. -#endif // !defined(CONFIG_INTEGER) || !defined(CONFIG_STRING) || !defined(CONFIG_METHODSET) - -#if defined(DEBUG) -CONFIG_INTEGER(AltJitLimit, W("AltJitLimit"), 0) // Max number of functions to use altjit for (decimal) -CONFIG_INTEGER(AltJitSkipOnAssert, W("AltJitSkipOnAssert"), 0) // If AltJit hits an assert, fall back to the fallback JIT. Useful in conjunction with COMPLUS_ContinueOnAssert=1 -CONFIG_INTEGER(BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff) // Breaks when using internal logging on a particular token value. -CONFIG_INTEGER(DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0) // Halts the jit on verification failure -CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able -CONFIG_INTEGER(DisplayLoopHoistStats, W("JitLoopHoistStats"), 0) // Display JIT loop hoisting statistics -CONFIG_INTEGER(DisplayMemStats, W("JitMemStats"), 0) // Display JIT memory usage statistics -CONFIG_INTEGER(DumpJittedMethods, W("DumpJittedMethods"), 0) // Prints all jitted methods to the console -CONFIG_INTEGER(EnablePCRelAddr, W("JitEnablePCRelAddr"), 1) // Whether absolute addr be encoded as PC-rel offset by RyuJIT where possible -CONFIG_INTEGER(InterpreterFallback, W("InterpreterFallback"), 0) // Fallback to the interpreter when the JIT compiler fails -CONFIG_INTEGER(JitAssertOnMaxRAPasses, W("JitAssertOnMaxRAPasses"), 0) -CONFIG_INTEGER(JitBreakEmitOutputInstr, W("JitBreakEmitOutputInstr"), -1) -CONFIG_INTEGER(JitBreakMorphTree, W("JitBreakMorphTree"), 0xffffffff) -CONFIG_INTEGER(JitBreakOnBadCode, W("JitBreakOnBadCode"), 0) -CONFIG_INTEGER(JitBreakOnMinOpts, W("JITBreakOnMinOpts"), 0) // Halt if jit switches to MinOpts -CONFIG_INTEGER(JitBreakOnUnsafeCode, W("JitBreakOnUnsafeCode"), 0) -CONFIG_INTEGER(JitCanUseSSE2, W("JitCanUseSSE2"), -1) -CONFIG_INTEGER(JitCloneLoops, W("JitCloneLoops"), 1) // If 0, don't clone. Otherwise clone loops for optimizations. -CONFIG_INTEGER(JitDebugLogLoopCloning, W("JitDebugLogLoopCloning"), 0) // In debug builds log places where loop cloning optimizations are performed on the fast path. -CONFIG_INTEGER(JitDefaultFill, W("JitDefaultFill"), 0xff) // In debug builds, initialize the memory allocated by the nra with this byte. -CONFIG_INTEGER(JitDirectAlloc, W("JitDirectAlloc"), 0) -CONFIG_INTEGER(JitDoAssertionProp, W("JitDoAssertionProp"), 1) // Perform assertion propagation optimization -CONFIG_INTEGER(JitDoCopyProp, W("JitDoCopyProp"), 1) // Perform copy propagation on variables that appear redundant -CONFIG_INTEGER(JitDoEarlyProp, W("JitDoEarlyProp"), 1) // Perform Early Value Propagataion -CONFIG_INTEGER(JitDoLoopHoisting, W("JitDoLoopHoisting"), 1) // Perform loop hoisting on loop invariant values -CONFIG_INTEGER(JitDoRangeAnalysis, W("JitDoRangeAnalysis"), 1) // Perform range check analysis -CONFIG_INTEGER(JitDoSsa, W("JitDoSsa"), 1) // Perform Static Single Assignment (SSA) numbering on the variables -CONFIG_INTEGER(JitDoValueNumber, W("JitDoValueNumber"), 1) // Perform value numbering on method expressions -CONFIG_INTEGER(JitDoubleAlign, W("JitDoubleAlign"), 1) -CONFIG_INTEGER(JitDumpASCII, W("JitDumpASCII"), 1) // Uses only ASCII characters in tree dumps -CONFIG_INTEGER(JitDumpFgDot, W("JitDumpFgDot"), 0) // Set to non-zero to emit Dot instead of Xml Flowgraph dump -CONFIG_INTEGER(JitDumpTerseLsra, W("JitDumpTerseLsra"), 1) // Produce terse dump output for LSRA -CONFIG_INTEGER(JitDumpToDebugger, W("JitDumpToDebugger"), 0) // Output JitDump output to the debugger -CONFIG_INTEGER(JitDumpVerboseSsa, W("JitDumpVerboseSsa"), 0) // Produce especially verbose dump output for SSA -CONFIG_INTEGER(JitDumpVerboseTrees, W("JitDumpVerboseTrees"), 0) // Enable more verbose tree dumps -CONFIG_INTEGER(JitEmitPrintRefRegs, W("JitEmitPrintRefRegs"), 0) -CONFIG_INTEGER(JitExpensiveDebugCheckLevel, W("JitExpensiveDebugCheckLevel"), 0) // Level indicates how much checking beyond the default to do in debug builds (currently 1-2) -CONFIG_INTEGER(JitForceFallback, W("JitForceFallback"), 0) // Set to non-zero to test NOWAY assert by forcing a retry -CONFIG_INTEGER(JitForceVer, W("JitForceVer"), 0) -CONFIG_INTEGER(JitFullyInt, W("JitFullyInt"), 0) // Forces Fully interruptable code -CONFIG_INTEGER(JitFunctionTrace, W("JitFunctionTrace"), 0) // If non-zero, print JIT start/end logging -CONFIG_INTEGER(JitGCChecks, W("JitGCChecks"), 0) -CONFIG_INTEGER(JitGCInfoLogging, W("JitGCInfoLogging"), 0) // If true, prints GCInfo-related output to standard output. -CONFIG_INTEGER(JitHashBreak, W("JitHashBreak"), -1) // Same as JitBreak, but for a method hash -CONFIG_INTEGER(JitHashDump, W("JitHashDump"), -1) // Same as JitDump, but for a method hash -CONFIG_INTEGER(JitHashDumpIR, W("JitHashDumpIR"), -1) // Same as JitDumpIR, but for a method hash -CONFIG_INTEGER(JitHashHalt, W("JitHashHalt"), -1) // Same as JitHalt, but for a method hash -CONFIG_INTEGER(JitInlineAdditionalMultiplier, W("JitInlineAdditionalMultiplier"), 0) -CONFIG_INTEGER(JitInlinePrintStats, W("JitInlinePrintStats"), 0) -CONFIG_INTEGER(JitInlineSize, W("JITInlineSize"), DEFAULT_MAX_INLINE_SIZE) -CONFIG_INTEGER(JitLargeBranches, W("JitLargeBranches"), 0) // Force using the largest conditional branch format -CONFIG_INTEGER(JitMaxTempAssert, W("JITMaxTempAssert"), 1) -CONFIG_INTEGER(JitMaxUncheckedOffset, W("JitMaxUncheckedOffset"), 8) -CONFIG_INTEGER(JitMinOpts, W("JITMinOpts"), 0) // Forces MinOpts -CONFIG_INTEGER(JitMinOptsBbCount, W("JITMinOptsBbCount"), DEFAULT_MIN_OPTS_BB_COUNT) // Internal jit control of MinOpts -CONFIG_INTEGER(JitMinOptsCodeSize, W("JITMinOptsCodeSize"), DEFAULT_MIN_OPTS_CODE_SIZE) // Internal jit control of MinOpts -CONFIG_INTEGER(JitMinOptsInstrCount, W("JITMinOptsInstrCount"), DEFAULT_MIN_OPTS_INSTR_COUNT) // Internal jit control of MinOpts -CONFIG_INTEGER(JitMinOptsLvNumCount, W("JITMinOptsLvNumcount"), DEFAULT_MIN_OPTS_LV_NUM_COUNT) // Internal jit control of MinOpts -CONFIG_INTEGER(JitMinOptsLvRefCount, W("JITMinOptsLvRefcount"), DEFAULT_MIN_OPTS_LV_REF_COUNT) // Internal jit control of MinOpts -CONFIG_INTEGER(JitNoCMOV, W("JitNoCMOV"), 0) -CONFIG_INTEGER(JitNoCSE, W("JitNoCSE"), 0) -CONFIG_INTEGER(JitNoCSE2, W("JitNoCSE2"), 0) -CONFIG_INTEGER(JitNoForceFallback, W("JitNoForceFallback"), 0) // Set to non-zero to prevent NOWAY assert testing. Overrides COMPLUS_JitForceFallback and JIT stress flags. -CONFIG_INTEGER(JitNoHoist, W("JitNoHoist"), 0) -CONFIG_INTEGER(JitNoInline, W("JitNoInline"), 0) // Disables inlining of all methods -CONFIG_INTEGER(JitNoMemoryBarriers, W("JitNoMemoryBarriers"), 0) // If 1, don't generate memory barriers -CONFIG_INTEGER(JitNoRegLoc, W("JitNoRegLoc"), 0) -CONFIG_INTEGER(JitNoStructPromotion, W("JitNoStructPromotion"), 0) // Disables struct promotion in Jit32 -CONFIG_INTEGER(JitNoUnroll, W("JitNoUnroll"), 0) -CONFIG_INTEGER(JitOrder, W("JitOrder"), 0) -CONFIG_INTEGER(JitPInvokeCheckEnabled, W("JITPInvokeCheckEnabled"), 0) -CONFIG_INTEGER(JitPInvokeEnabled, W("JITPInvokeEnabled"), 1) -CONFIG_INTEGER(JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0) -CONFIG_INTEGER(JitRequired, W("JITRequired"), -1) -CONFIG_INTEGER(JitRoundFloat, W("JITRoundFloat"), DEFAULT_ROUND_LEVEL) -CONFIG_INTEGER(JitSkipArrayBoundCheck, W("JitSkipArrayBoundCheck"), 0) -CONFIG_INTEGER(JitSlowDebugChecksEnabled, W("JitSlowDebugChecksEnabled"), 1) // Turn on slow debug checks -CONFIG_INTEGER(JitSplitFunctionSize, W("JitSplitFunctionSize"), 0) // On ARM, use this as the maximum function/funclet size for creating function fragments (and creating multiple RUNTIME_FUNCTION entries) -CONFIG_INTEGER(JitSsaStress, W("JitSsaStress"), 0) // Perturb order of processing of blocks in SSA; 0 = no stress; 1 = use method hash; * = supplied value as random hash -CONFIG_INTEGER(JitStackChecks, W("JitStackChecks"), 0) -CONFIG_INTEGER(JitStress, W("JitStress"), 0) // Internal Jit stress mode: 0 = no stress, 2 = all stress, other = vary stress based on a hash of the method and this value -CONFIG_INTEGER(JitStressBBProf, W("JitStressBBProf"), 0) // Internal Jit stress mode -CONFIG_INTEGER(JitStressBiasedCSE, W("JitStressBiasedCSE"), 0x101) // Internal Jit stress mode: decimal bias value between (0,100) to perform CSE on a candidate. 100% = All CSEs. 0% = 0 CSE. (> 100) means no stress. -CONFIG_INTEGER(JitStressFP, W("JitStressFP"), 0) // Internal Jit stress mode -CONFIG_INTEGER(JitStressRegs, W("JitStressRegs"), 0) -CONFIG_INTEGER(JitStrictCheckForNonVirtualCallToVirtualMethod, W("JitStrictCheckForNonVirtualCallToVirtualMethod"), 1) -CONFIG_INTEGER(JitVNMapSelLimit, W("JitVNMapSelLimit"), 0) // If non-zero, assert if # of VNF_MapSelect applications considered reaches this -CONFIG_INTEGER(NgenHashDump, W("NgenHashDump"), -1) // same as JitHashDump, but for ngen -CONFIG_INTEGER(NgenHashDumpIR, W("NgenHashDumpIR"), -1) // same as JitHashDumpIR, but for ngen -CONFIG_INTEGER(NgenOrder, W("NgenOrder"), 0) -CONFIG_INTEGER(RunAltJitCode, W("RunAltJitCode"), 1) // If non-zero, and the compilation succeeds for an AltJit, then use the code. If zero, then we always throw away the generated code and fall back to the default compiler. -CONFIG_INTEGER(RunComponentUnitTests, W("JitComponentUnitTests"), 0) // Run JIT component unit tests -CONFIG_INTEGER(ShouldInjectFault, W("InjectFault"), 0) -CONFIG_INTEGER(StackProbesOverride, W("JitStackProbes"), 0) -CONFIG_INTEGER(StressCOMCall, W("StressCOMCall"), 0) -CONFIG_INTEGER(TailcallStress, W("TailcallStress"), 0) -CONFIG_INTEGER(TreesBeforeAfterMorph, W("JitDumpBeforeAfterMorph"), 0) // If 1, display each tree before/after morphing -CONFIG_METHODSET(JitBreak, W("JitBreak")) // Stops in the importer when compiling a specified method -CONFIG_METHODSET(JitDebugBreak, W("JitDebugBreak")) -CONFIG_METHODSET(JitDisasm, W("JitDisasm")) // Dumps disassembly for specified method -CONFIG_METHODSET(JitDump, W("JitDump")) // Dumps trees for specified method -CONFIG_METHODSET(JitDumpIR, W("JitDumpIR")) // Dumps trees (in linear IR form) for specified method -CONFIG_METHODSET(JitEHDump, W("JitEHDump")) // Dump the EH table for the method, as reported to the VM -CONFIG_METHODSET(JitExclude, W("JitExclude")) -CONFIG_METHODSET(JitForceProcedureSplitting, W("JitForceProcedureSplitting")) -CONFIG_METHODSET(JitGCDump, W("JitGCDump")) -CONFIG_METHODSET(JitHalt, W("JitHalt")) // Emits break instruction into jitted code -CONFIG_METHODSET(JitImportBreak, W("JitImportBreak")) -CONFIG_METHODSET(JitInclude, W("JitInclude")) -CONFIG_METHODSET(JitLateDisasm, W("JitLateDisasm")) -CONFIG_METHODSET(JitMinOptsName, W("JITMinOptsName")) // Forces MinOpts for a named function -CONFIG_METHODSET(JitNoProcedureSplitting, W("JitNoProcedureSplitting")) // Disallow procedure splitting for specified methods -CONFIG_METHODSET(JitNoProcedureSplittingEH, W("JitNoProcedureSplittingEH")) // Disallow procedure splitting for specified methods if they contain exception handling -CONFIG_METHODSET(JitStressOnly, W("JitStressOnly")) // Internal Jit stress mode: stress only the specified method(s) -CONFIG_METHODSET(JitUnwindDump, W("JitUnwindDump")) // Dump the unwind codes for the method -CONFIG_METHODSET(NgenDisasm, W("NgenDisasm")) // Same as JitDisasm, but for ngen -CONFIG_METHODSET(NgenDump, W("NgenDump")) // Same as JitDump, but for ngen -CONFIG_METHODSET(NgenDumpIR, W("NgenDumpIR")) // Same as JitDumpIR, but for ngen -CONFIG_METHODSET(NgenEHDump, W("NgenEHDump")) // Dump the EH table for the method, as reported to the VM -CONFIG_METHODSET(NgenGCDump, W("NgenGCDump")) -CONFIG_METHODSET(NgenUnwindDump, W("NgenUnwindDump")) // Dump the unwind codes for the method -CONFIG_STRING(JitDumpFg, W("JitDumpFg")) // Dumps Xml/Dot Flowgraph for specified method -CONFIG_STRING(JitDumpFgDir, W("JitDumpFgDir")) // Directory for Xml/Dot flowgraph dump(s) -CONFIG_STRING(JitDumpFgFile, W("JitDumpFgFile")) // Filename for Xml/Dot flowgraph dump(s) -CONFIG_STRING(JitDumpFgPhase, W("JitDumpFgPhase")) // Phase-based Xml/Dot flowgraph support. Set to the short name of a phase to see the flowgraph after that phase. Leave unset to dump after COLD-BLK (determine first cold block) or set to * for all phases -CONFIG_STRING(JitDumpIRFormat, W("JitDumpIRFormat")) // Comma separated format control for JitDumpIR, values = {types | locals | ssa | valnums | kinds | flags | nodes | nolists | nostmts | noleafs | trees | dataflow} -CONFIG_STRING(JitDumpIRPhase, W("JitDumpIRPhase")) // Phase control for JitDumpIR, values = {* | phasename} -CONFIG_STRING(JitLateDisasmTo, W("JITLateDisasmTo")) -CONFIG_STRING(JitRange, W("JitRange")) -CONFIG_STRING(JitStressModeNames, W("JitStressModeNames")) // Internal Jit stress mode: stress using the given set of stress mode names, e.g. STRESS_REGS, STRESS_TAILCALL -CONFIG_STRING(JitStressModeNamesNot, W("JitStressModeNamesNot")) // Internal Jit stress mode: do NOT stress using the given set of stress mode names, e.g. STRESS_REGS, STRESS_TAILCALL -CONFIG_STRING(JitStressRange, W("JitStressRange")) // Internal Jit stress mode -CONFIG_STRING(NgenDumpFg, W("NgenDumpFg")) // Ngen Xml Flowgraph support -CONFIG_STRING(NgenDumpFgDir, W("NgenDumpFgDir")) // Ngen Xml Flowgraph support -CONFIG_STRING(NgenDumpFgFile, W("NgenDumpFgFile")) // Ngen Xml Flowgraph support -CONFIG_STRING(NgenDumpIRFormat, W("NgenDumpIRFormat")) // Same as JitDumpIRFormat, but for ngen -CONFIG_STRING(NgenDumpIRPhase, W("NgenDumpIRPhase")) // Same as JitDumpIRPhase, but for ngen -#endif // defined(DEBUG) - -// AltJitAssertOnNYI should be 0 on targets where JIT is under developement or bring up stage, so as to facilitate fallback to main JIT on hitting a NYI. -#if defined(_TARGET_ARM64_) || defined(_TARGET_X86_) -CONFIG_INTEGER(AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 0) // Controls the AltJit behavior of NYI stuff -#else // !defined(_TARGET_ARM64_) && !defined(_TARGET_X86_) -CONFIG_INTEGER(AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 1) // Controls the AltJit behavior of NYI stuff -#endif // defined(_TARGET_ARM64_) || defined(_TARGET_X86_) - -#if defined(_TARGET_AMD64_) -CONFIG_INTEGER(EnableAVX, W("EnableAVX"), 1) // Enable AVX instruction set for wide operations as default -#else // !defined(_TARGET_AMD64_) -CONFIG_INTEGER(EnableAVX, W("EnableAVX"), 0) // Enable AVX instruction set for wide operations as default -#endif // defined(_TARGET_AMD64_) - -#if (!defined(DEBUG) && !defined(_DEBUG)) || (defined(CROSSGEN_COMPILE) && !defined(FEATURE_CORECLR)) -CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 0) -#else // (defined(DEBUG) || defined(_DEBUG)) && (!defined(CROSSGEN_COMPILE) || defined(FEATURE_CORECLR)) -CONFIG_INTEGER(JitEnableNoWayAssert, W("JitEnableNoWayAssert"), 1) -#endif // (!defined(DEBUG) && !defined(_DEBUG)) || (defined(CROSSGEN_COMPILE) && !defined(FEATURE_CORECLR)) - -CONFIG_INTEGER(JitAggressiveInlining, W("JitAggressiveInlining"), 0) // Aggressive inlining of all methods -CONFIG_INTEGER(JitELTHookEnabled, W("JitELTHookEnabled"), 0) // On ARM, setting this will emit Enter/Leave/TailCall callbacks -CONFIG_INTEGER(JitInlineSIMDMultiplier, W("JitInlineSIMDMultiplier"), 3) - -#if defined(FEATURE_ENABLE_NO_RANGE_CHECKS) -CONFIG_INTEGER(JitNoRngChks, W("JitNoRngChks"), 0) // If 1, don't generate range checks -#endif // defined(FEATURE_ENABLE_NO_RANGE_CHECKS) - -CONFIG_INTEGER(JitRegisterFP, W("JitRegisterFP"), 3) // Control FP enregistration -CONFIG_INTEGER(JitTelemetry, W("JitTelemetry"), 1) // If non-zero, gather JIT telemetry data -CONFIG_INTEGER(JitVNMapSelBudget, W("JitVNMapSelBudget"), 100) // Max # of MapSelect's considered for a particular top-level invocation. -CONFIG_INTEGER(TailCallLoopOpt, W("TailCallLoopOpt"), 1) // Convert recursive tail calls to loops -CONFIG_METHODSET(AltJit, W("AltJit")) // Enables AltJit and selectively limits it to the specified methods. -CONFIG_METHODSET(AltJitNgen, W("AltJitNgen")) // Enables AltJit for NGEN and selectively limits it to the specified methods. - -#if defined(ALT_JIT) -CONFIG_STRING(AltJitExcludeAssemblies, W("AltJitExcludeAssemblies")) // Do not use AltJit on this semicolon-delimited list of assemblies. -#endif // defined(ALT_JIT) - -CONFIG_STRING(JitFuncInfoFile, W("JitFuncInfoLogFile")) // If set, gather JIT function info and write to this file. -CONFIG_STRING(JitTimeLogCsv, W("JitTimeLogCsv")) // If set, gather JIT throughput data and write to a CSV file. This mode must be used in internal retail builds. -CONFIG_STRING(TailCallOpt, W("TailCallOpt")) - -#undef CONFIG_INTEGER -#undef CONFIG_STRING -#undef CONFIG_METHODSET diff --git a/src/jit/jitpch.h b/src/jit/jitpch.h index 58c9c6bd95..a3c7e24464 100644 --- a/src/jit/jitpch.h +++ b/src/jit/jitpch.h @@ -20,7 +20,6 @@ #include "corjithost.h" #include "jithost.h" #endif -#include "jitconfig.h" #include "jit.h" #include "iallocator.h" #include "hashbv.h" diff --git a/src/jit/jittelemetry.cpp b/src/jit/jittelemetry.cpp index 1b79272991..cac324f6b2 100644 --- a/src/jit/jittelemetry.cpp +++ b/src/jit/jittelemetry.cpp @@ -158,7 +158,8 @@ void JitTelemetry::Initialize(Compiler* c) /* static */ bool JitTelemetry::IsTelemetryEnabled() { - return JitConfig.JitTelemetry() != 0; + static ConfigDWORD fJitTelemetry; + return fJitTelemetry.val(CLRConfig::EXTERNAL_JitTelemetry) != 0; } //------------------------------------------------------------------------ diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp index 7541c36568..9fbf0a9550 100644 --- a/src/jit/lsra.cpp +++ b/src/jit/lsra.cpp @@ -952,7 +952,8 @@ LinearScan::LinearScan(Compiler * theCompiler) initRefTypeNames(); // Get the value of the environment variable that controls stress for register allocation - lsraStressMask = JitConfig.JitStressRegs(); + static ConfigDWORD fJitStressRegs; + lsraStressMask = fJitStressRegs.val(CLRConfig::INTERNAL_JitStressRegs); #if 0 #ifdef DEBUG if (lsraStressMask != 0) @@ -989,7 +990,8 @@ LinearScan::LinearScan(Compiler * theCompiler) #endif // DEBUG #endif - dumpTerse = (JitConfig.JitDumpTerseLsra() != 0); + static ConfigDWORD fJitDumpTerseLsra; + dumpTerse = (fJitDumpTerseLsra.val(CLRConfig::INTERNAL_JitDumpTerseLsra) != 0); #endif // DEBUG refPositionCount = 0; diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index 016f432978..4591a03d41 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -12854,7 +12854,8 @@ GenTreePtr Compiler::fgMorphTree(GenTreePtr tree, MorphAddrContext* mac #ifdef DEBUG if (verbose) { - if ((unsigned)JitConfig.JitBreakMorphTree() == tree->gtTreeID) + static ConfigDWORD fBreakOnMorphTree; + if (fBreakOnMorphTree.val(CLRConfig::INTERNAL_JitBreakMorphTree) == tree->gtTreeID) { noway_assert(!"JitBreakMorphTree hit"); } @@ -14239,7 +14240,8 @@ void Compiler::fgSetOptions() /* Should we force fully interruptible code ? */ #ifdef DEBUG - if (JitConfig.JitFullyInt() || + static ConfigDWORD fJitFullyInt; + if (fJitFullyInt.val(CLRConfig::INTERNAL_JitFullyInt) || compStressCompile(STRESS_GENERIC_VARN, 30)) { noway_assert(!codeGen->isGCTypeFixed()); diff --git a/src/jit/optcse.cpp b/src/jit/optcse.cpp index 61f99047af..e1d78690fe 100644 --- a/src/jit/optcse.cpp +++ b/src/jit/optcse.cpp @@ -1290,8 +1290,9 @@ public: } // Obtain the bias value and reinterpret as decimal. + static ConfigDWORD fJitStressBiasedCSE; unsigned bias = ReinterpretHexAsDecimal( - JitConfig.JitStressBiasedCSE()); + fJitStressBiasedCSE.val(CLRConfig::INTERNAL_JitStressBiasedCSE)); // Invalid value, check if JitStress is ON. if (bias > 100) @@ -2285,7 +2286,8 @@ bool Compiler::optConfigDisableCSE(bool lexicalCSE) // Next check if COMPLUS_JitNoCSE is set and applies to this method // - unsigned jitNoCSE = JitConfig.JitNoCSE(); + static ConfigDWORD fJitNoCSE; + unsigned jitNoCSE = fJitNoCSE.val(CLRConfig::INTERNAL_JitNoCSE); if (jitNoCSE > 0) { @@ -2325,7 +2327,8 @@ bool Compiler::optConfigDisableCSE2() { static unsigned totalCSEcount = 0; - unsigned jitNoCSE2 = JitConfig.JitNoCSE2(); + static ConfigDWORD fNoCSE2; + unsigned jitNoCSE2 = fNoCSE2.val(CLRConfig::INTERNAL_JitNoCSE2); totalCSEcount++; diff --git a/src/jit/optimizer.cpp b/src/jit/optimizer.cpp index 7cbc1c27de..3f6a8f656f 100644 --- a/src/jit/optimizer.cpp +++ b/src/jit/optimizer.cpp @@ -17,6 +17,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #pragma warning ( disable : 4701 ) #endif +static ConfigDWORD fCloneLoops; + /*****************************************************************************/ #if COUNT_RANGECHECKS @@ -2695,7 +2697,8 @@ void Compiler::optUnrollLoops() return; #ifdef DEBUG - if (JitConfig.JitNoUnroll()) + static ConfigDWORD fJitNoUnroll; + if (fJitNoUnroll.val(CLRConfig::INTERNAL_JitNoUnroll)) { return; } @@ -4086,7 +4089,8 @@ bool Compiler::optComputeDerefConditions(unsigned loopNum, LoopCloneContext* con // void Compiler::optDebugLogLoopCloning(BasicBlock* block, GenTreePtr insertBefore) { - if (JitConfig.JitDebugLogLoopCloning() == 0) + static ConfigDWORD fDebugLogLoopCloning; + if (fDebugLogLoopCloning.val(CLRConfig::INTERNAL_JitDebugLogLoopCloning) == 0) { return; } @@ -4161,7 +4165,7 @@ bool Compiler::optCanCloneLoops() // Enabled for retail builds now. unsigned cloneLoopsFlag = 1; #ifdef DEBUG - cloneLoopsFlag = JitConfig.JitCloneLoops(); + cloneLoopsFlag = fCloneLoops.val(CLRConfig::INTERNAL_JitCloneLoops); #endif return (cloneLoopsFlag != 0); } @@ -5434,7 +5438,8 @@ void Compiler::optHoistLoopCode() return; #ifdef DEBUG - unsigned jitNoHoist = JitConfig.JitNoHoist(); + static ConfigDWORD fJitNoHoist; + unsigned jitNoHoist = fJitNoHoist.val(CLRConfig::INTERNAL_JitNoHoist); if (jitNoHoist > 0) { return; diff --git a/src/jit/regalloc.cpp b/src/jit/regalloc.cpp index 63a3195e05..da48a87256 100644 --- a/src/jit/regalloc.cpp +++ b/src/jit/regalloc.cpp @@ -22,7 +22,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if FEATURE_FP_REGALLOC Compiler::enumConfigRegisterFP Compiler::raConfigRegisterFP() { - DWORD val = JitConfig.JitRegisterFP(); + static ConfigDWORD dwJitRegisterFP; + + DWORD val = dwJitRegisterFP.val(CLRConfig::EXTERNAL_JitRegisterFP); return (enumConfigRegisterFP) (val & 0x3); } @@ -61,7 +63,8 @@ DWORD Compiler::getCanDoubleAlign() if (compStressCompile(STRESS_DBL_ALN, 20)) return MUST_DOUBLE_ALIGN; - return JitConfig.JitDoubleAlign(); + static ConfigDWORD fJitDoubleAlign; + return fJitDoubleAlign.val_DontUse_(CLRConfig::INTERNAL_JitDoubleAlign, DEFAULT_DOUBLE_ALIGN); #else return DEFAULT_DOUBLE_ALIGN; #endif @@ -6257,7 +6260,8 @@ void Compiler::rpPredictRegUse() #endif #ifdef DEBUG - BOOL fJitNoRegLoc = JitConfig.JitNoRegLoc(); + static ConfigDWORD jitNoRegLoc; + BOOL fJitNoRegLoc = jitNoRegLoc.val(CLRConfig::INTERNAL_JitNoRegLoc); if (fJitNoRegLoc) regAvail = RBM_NONE; #endif @@ -6391,7 +6395,8 @@ void Compiler::rpPredictRegUse() } #ifdef DEBUG - if (JitConfig.JitAssertOnMaxRAPasses()) + static ConfigDWORD fJitMaxRegAllocPasses; + if (fJitMaxRegAllocPasses.val(CLRConfig::INTERNAL_JitAssertOnMaxRAPasses)) { noway_assert(rpPasses < rpPassesMax && "This may not a bug, but dev team should look and see what is happening"); diff --git a/src/jit/regset.cpp b/src/jit/regset.cpp index 4d3efa3468..704c3f8b88 100644 --- a/src/jit/regset.cpp +++ b/src/jit/regset.cpp @@ -178,7 +178,8 @@ RegSet::rsStressRegsType RegSet::rsStressRegs() #ifndef LEGACY_BACKEND return RS_STRESS_NONE; #else // LEGACY_BACKEND - rsStressRegsType val = (rsStressRegsType) JitConfig.JitStressRegs(); + static ConfigDWORD fJitStressRegs; + rsStressRegsType val = (rsStressRegsType) fJitStressRegs.val(CLRConfig::INTERNAL_JitStressRegs); if (val == RS_STRESS_NONE && m_rsCompiler->compStressCompile(Compiler::STRESS_REGS, 15)) val = RS_PICK_BAD_REG; return val; #endif // LEGACY_BACKEND diff --git a/src/jit/sharedfloat.cpp b/src/jit/sharedfloat.cpp index 2864c54681..db539d3dae 100644 --- a/src/jit/sharedfloat.cpp +++ b/src/jit/sharedfloat.cpp @@ -65,7 +65,8 @@ #ifdef DEBUG int CodeGenInterface::genStressFloat() { - return compiler->compStressCompile(Compiler::STRESS_FLATFP, 40)?1:JitConfig.JitStressFP(); + static ConfigDWORD fJitStressRegs; + return compiler->compStressCompile(Compiler::STRESS_FLATFP, 40)?1:fJitStressRegs.val(CLRConfig::INTERNAL_JitStressFP); } #endif diff --git a/src/jit/unwindarm.cpp b/src/jit/unwindarm.cpp index 0852924aad..4459a7253c 100644 --- a/src/jit/unwindarm.cpp +++ b/src/jit/unwindarm.cpp @@ -1595,7 +1595,8 @@ void UnwindInfo::Split() #ifdef DEBUG // Consider COMPLUS_JitSplitFunctionSize - unsigned splitFunctionSize = (unsigned) JitConfig.JitSplitFunctionSize(); + static ConfigDWORD fJitSplitFunctionSize; + unsigned splitFunctionSize = (unsigned) fJitSplitFunctionSize.val(CLRConfig::INTERNAL_JitSplitFunctionSize); if (splitFunctionSize != 0) if (splitFunctionSize < maxFragmentSize) diff --git a/src/jit/utils.cpp b/src/jit/utils.cpp index c38fc3ddc0..85ccdb75c3 100644 --- a/src/jit/utils.cpp +++ b/src/jit/utils.cpp @@ -721,18 +721,24 @@ bool ConfigMethodRange::contains(ICorJitInfo* info, CORINFO_METHOD_HANDLE method } /**************************************************************************/ -void ConfigMethodRange::initRanges(const wchar_t* rangeStr) +void ConfigMethodRange::init(const CLRConfig::ConfigStringInfo & info) { // make sure that the memory was zero initialized _ASSERTE(m_inited == 0 || m_inited == 1); - if (rangeStr == nullptr) - { - m_inited = true; + LPWSTR str = CLRConfig::GetConfigValue(info); + initRanges(str); + CLRConfig::FreeConfigString(str); + m_inited = true; +} + +/**************************************************************************/ +void ConfigMethodRange::initRanges(__in_z LPCWSTR rangeStr) +{ + if (rangeStr == 0) return; - } - LPCWSTR p = const_cast<LPCWSTR>(rangeStr); + LPCWSTR p = rangeStr; unsigned char lastRange = 0; while (*p) { while (*p == ' ') //skip blanks @@ -761,8 +767,6 @@ void ConfigMethodRange::initRanges(const wchar_t* rangeStr) m_ranges[lastRange++] = MAX_RANGE; assert(lastRange < 100); m_lastRange = lastRange; - - m_inited = true; } #endif // DEBUG @@ -1408,7 +1412,7 @@ void HelperCallProperties::init() // MyAssembly;mscorlib;System // MyAssembly;mscorlib System -AssemblyNamesList2::AssemblyNamesList2(const wchar_t* list, IAllocator* alloc) +AssemblyNamesList2::AssemblyNamesList2(__in LPWSTR list, IAllocator* alloc) : m_alloc(alloc) { assert(m_alloc != nullptr); @@ -1417,7 +1421,7 @@ AssemblyNamesList2::AssemblyNamesList2(const wchar_t* list, IAllocator* alloc) LPWSTR nameStart = nullptr; // start of the name currently being processed. nullptr if no current name AssemblyName** ppPrevLink = &m_pNames; - for (LPWSTR listWalk = const_cast<LPWSTR>(list); prevChar != '\0'; prevChar = *listWalk, listWalk++) + for (LPWSTR listWalk = list; prevChar != '\0'; prevChar = *listWalk, listWalk++) { WCHAR curChar = *listWalk; diff --git a/src/jit/utils.h b/src/jit/utils.h index 25ca684dc8..659c81623b 100644 --- a/src/jit/utils.h +++ b/src/jit/utils.h @@ -77,19 +77,20 @@ class ConfigMethodRange public: bool contains(class ICorJitInfo* info, CORINFO_METHOD_HANDLE method); - inline void ensureInit(const wchar_t* rangeStr) + inline void ensureInit(const CLRConfig::ConfigStringInfo & info) { // make sure that the memory was zero initialized _ASSERTE(m_inited == 0 || m_inited == 1); if (!m_inited) { - initRanges(rangeStr); + init(info); _ASSERTE(m_inited == 1); } } private: + void init(const CLRConfig::ConfigStringInfo & info); void initRanges(__in_z LPCWSTR rangeStr); private: @@ -425,7 +426,7 @@ class AssemblyNamesList2 public: // Take a Unicode string list of assembly names, parse it, and store it. - AssemblyNamesList2(const wchar_t* list, __in IAllocator* alloc); + AssemblyNamesList2(__in LPWSTR list, __in IAllocator* alloc); ~AssemblyNamesList2(); diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp index a1b3e9ef84..54ef578361 100644 --- a/src/jit/valuenum.cpp +++ b/src/jit/valuenum.cpp @@ -83,7 +83,8 @@ ValueNumStore::ValueNumStore(Compiler* comp, IAllocator* alloc) ChunkNum cn = m_chunks.Push(specialConstChunk); assert(cn == 0); - m_mapSelectBudget = JitConfig.JitVNMapSelBudget(); + static ConfigDWORD fMapSelBudget; + m_mapSelectBudget = fMapSelBudget.val(CLRConfig::INTERNAL_JitVNMapSelBudget); } // static. @@ -1242,7 +1243,8 @@ TailCall: // This printing is sometimes useful in debugging. // if ((m_numMapSels % 1000) == 0) printf("%d VNF_MapSelect applications.\n", m_numMapSels); #endif - unsigned selLim = JitConfig.JitVNMapSelLimit(); + static ConfigDWORD fMapSelLim; + unsigned selLim = fMapSelLim.val(CLRConfig::INTERNAL_JitVNMapSelLimit); assert(selLim == 0 || m_numMapSels < selLim); #endif ValueNum res; diff --git a/src/utilcode/jithost.cpp b/src/utilcode/jithost.cpp index 3174aa6188..412cc47786 100644 --- a/src/utilcode/jithost.cpp +++ b/src/utilcode/jithost.cpp @@ -41,7 +41,7 @@ int JitHost::getIntConfigValue(const wchar_t* name, int defaultValue) WRAPPER_NO_CONTRACT; // Translate JIT call into runtime configuration query - CLRConfig::ConfigDWORDInfo info{ name, defaultValue, CLRConfig::EEConfig_default }; + CLRConfig::ConfigDWORDInfo info{ name, defaultValue, CLRConfig::REGUTIL_default }; // Perform a CLRConfig look up on behalf of the JIT. return CLRConfig::GetConfigValue(info); @@ -52,7 +52,7 @@ const wchar_t* JitHost::getStringConfigValue(const wchar_t* name) WRAPPER_NO_CONTRACT; // Translate JIT call into runtime configuration query - CLRConfig::ConfigStringInfo info{ name, CLRConfig::EEConfig_default }; + CLRConfig::ConfigStringInfo info{ name, CLRConfig::REGUTIL_default }; // Perform a CLRConfig look up on behalf of the JIT. return CLRConfig::GetConfigValue(info); |