Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/vm/ClrEtwAll.man
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,8 @@
<map value="0x0" message="$(string.RuntimePublisher.TieredCompilationSettingsFlags.NoneMapMessage)"/>
<map value="0x1" message="$(string.RuntimePublisher.TieredCompilationSettingsFlags.QuickJitMapMessage)"/>
<map value="0x2" message="$(string.RuntimePublisher.TieredCompilationSettingsFlags.QuickJitForLoopsMapMessage)"/>
<map value="0x4" message="$(string.RuntimePublisher.TieredCompilationSettingsFlags.TieredPGOMapMessage)"/>
<map value="0x8" message="$(string.RuntimePublisher.TieredCompilationSettingsFlags.ReadyToRunMapMessage)"/>
</bitMap>
</maps>

Expand Down Expand Up @@ -4365,6 +4367,8 @@
<map value="0x0" message="$(string.RundownPublisher.TieredCompilationSettingsFlags.NoneMapMessage)"/>
<map value="0x1" message="$(string.RundownPublisher.TieredCompilationSettingsFlags.QuickJitMapMessage)"/>
<map value="0x2" message="$(string.RundownPublisher.TieredCompilationSettingsFlags.QuickJitForLoopsMapMessage)"/>
<map value="0x4" message="$(string.RundownPublisher.TieredCompilationSettingsFlags.TieredPGOMapMessage)"/>
<map value="0x8" message="$(string.RundownPublisher.TieredCompilationSettingsFlags.ReadyToRunMapMessage)"/>
</bitMap>
</maps>

Expand Down Expand Up @@ -8865,6 +8869,8 @@
<string id="RuntimePublisher.TieredCompilationSettingsFlags.NoneMapMessage" value="None" />
<string id="RuntimePublisher.TieredCompilationSettingsFlags.QuickJitMapMessage" value="QuickJit" />
<string id="RuntimePublisher.TieredCompilationSettingsFlags.QuickJitForLoopsMapMessage" value="QuickJitForLoops" />
<string id="RuntimePublisher.TieredCompilationSettingsFlags.TieredPGOMapMessage" value="TieredPGO" />
<string id="RuntimePublisher.TieredCompilationSettingsFlags.ReadyToRunMapMessage" value="ReadyToRun" />
<string id="RuntimePublisher.KnownPathSource.ApplicationAssembliesMessage" value="ApplicationAssemblies" />
<string id="RuntimePublisher.KnownPathSource.UnusedMessage" value="Unused" />
<string id="RuntimePublisher.KnownPathSource.AppPathsMessage" value="AppPaths" />
Expand Down Expand Up @@ -8934,6 +8940,8 @@
<string id="RundownPublisher.TieredCompilationSettingsFlags.NoneMapMessage" value="None" />
<string id="RundownPublisher.TieredCompilationSettingsFlags.QuickJitMapMessage" value="QuickJit" />
<string id="RundownPublisher.TieredCompilationSettingsFlags.QuickJitForLoopsMapMessage" value="QuickJitForLoops" />
<string id="RundownPublisher.TieredCompilationSettingsFlags.TieredPGOMapMessage" value="TieredPGO" />
<string id="RundownPublisher.TieredCompilationSettingsFlags.ReadyToRunMapMessage" value="ReadyToRun" />

<string id="PrivatePublisher.ModuleRangeSectionTypeMap.ModuleSection" value="ModuleSection"/>
<string id="PrivatePublisher.ModuleRangeSectionTypeMap.EETableSection" value="EETableSection"/>
Expand Down
17 changes: 12 additions & 5 deletions src/coreclr/vm/eeconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ HRESULT EEConfig::Init()
fTieredPGO = false;
#endif

#if defined(FEATURE_READYTORUN)
fReadyToRun = false;
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
dwOSR_HitLimit = 10;
dwOSR_CounterBump = 5000;
Expand Down Expand Up @@ -476,8 +480,11 @@ HRESULT EEConfig::sync()
}

pReadyToRunExcludeList = NULL;

#if defined(FEATURE_READYTORUN)
if (ReadyToRunInfo::IsReadyToRunEnabled())
fReadyToRun = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ReadyToRun);

if (fReadyToRun)
{
NewArrayHolder<WCHAR> wszReadyToRunExcludeList;
IfFailRet(CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ReadyToRunExcludeList, &wszReadyToRunExcludeList));
Expand Down Expand Up @@ -692,6 +699,10 @@ HRESULT EEConfig::sync()

dwSleepOnExit = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_SleepOnExit);

#if defined(FEATURE_PGO)
fTieredPGO = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredPGO"), CLRConfig::EXTERNAL_TieredPGO);
#endif

#if defined(FEATURE_TIERED_COMPILATION)
fTieredCompilation = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredCompilation"), CLRConfig::EXTERNAL_TieredCompilation);
if (fTieredCompilation)
Expand Down Expand Up @@ -773,10 +784,6 @@ HRESULT EEConfig::sync()
}
#endif

#if defined(FEATURE_PGO)
fTieredPGO = Configuration::GetKnobBooleanValue(W("System.Runtime.TieredPGO"), CLRConfig::EXTERNAL_TieredPGO);
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
dwOSR_HitLimit = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_HitLimit);
dwOSR_CounterBump = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_OSR_CounterBump);
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/vm/eeconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class EEConfig
bool TieredPGO(void) const { LIMITED_METHOD_CONTRACT; return fTieredPGO; }
#endif

#if defined(FEATURE_READYTORUN)
bool ReadyToRun(void) const { LIMITED_METHOD_CONTRACT; return fReadyToRun; }
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
// OSR Config
DWORD OSR_CounterBump() const { LIMITED_METHOD_CONTRACT; return dwOSR_CounterBump; }
Expand Down Expand Up @@ -656,6 +660,10 @@ class EEConfig
bool fTieredPGO;
#endif

#if defined(FEATURE_READYTORUN)
bool fReadyToRun;
#endif

#if defined(FEATURE_ON_STACK_REPLACEMENT)
DWORD dwOSR_HitLimit;
DWORD dwOSR_CounterBump;
Expand Down
14 changes: 14 additions & 0 deletions src/coreclr/vm/eventtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7636,6 +7636,8 @@ void ETW::CompilationLog::TieredCompilation::GetSettings(UINT32 *flagsRef)
None = 0x0,
QuickJit = 0x1,
QuickJitForLoops = 0x2,
TieredPGO = 0x4,
ReadyToRun = 0x8,
};

UINT32 flags = (UINT32)Flags::None;
Expand All @@ -7647,6 +7649,18 @@ void ETW::CompilationLog::TieredCompilation::GetSettings(UINT32 *flagsRef)
flags |= (UINT32)Flags::QuickJitForLoops;
}
}
#ifdef FEATURE_PGO
if (g_pConfig->TieredPGO())
{
flags |= (UINT32)Flags::TieredPGO;
}
#endif
#ifdef FEATURE_READYTORUN
if (g_pConfig->ReadyToRun())
{
flags |= (UINT32)Flags::ReadyToRun;
}
#endif
*flagsRef = flags;
}

Expand Down
12 changes: 2 additions & 10 deletions src/coreclr/vm/readytoruninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,6 @@ void ReadyToRunInfo::SetMethodDescForEntryPointInNativeImage(PCODE entryPoint, M
}
}

BOOL ReadyToRunInfo::IsReadyToRunEnabled()
{
WRAPPER_NO_CONTRACT;

static ConfigDWORD configReadyToRun;
return configReadyToRun.val(CLRConfig::EXTERNAL_ReadyToRun);
}

// A log file to record success/failure of R2R loads. s_r2rLogFile can have the following values:
// -1: Logging not yet initialized.
// NULL: Logging disabled.
Expand All @@ -414,7 +406,7 @@ static void LogR2r(const char *msg, PEAssembly *pPEAssembly)
else
r2rLogFile = NULL;

if (r2rLogFile != NULL && !ReadyToRunInfo::IsReadyToRunEnabled())
if (r2rLogFile != NULL && !g_pConfig->ReadyToRun())
{
fputs("Ready to Run not enabled.\n", r2rLogFile);
fclose(r2rLogFile);
Expand Down Expand Up @@ -518,7 +510,7 @@ PTR_ReadyToRunInfo ReadyToRunInfo::Initialize(Module * pModule, AllocMemTracker

PEAssembly * pFile = pModule->GetPEAssembly();

if (!IsReadyToRunEnabled())
if (!g_pConfig->ReadyToRun())
{
// Log message is ignored in this case.
DoLog(NULL);
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/readytoruninfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ class ReadyToRunInfo
public:
ReadyToRunInfo(Module * pModule, LoaderAllocator* pLoaderAllocator, PEImageLayout * pLayout, READYTORUN_HEADER * pHeader, NativeImage * pNativeImage, AllocMemTracker *pamTracker);

static BOOL IsReadyToRunEnabled();

static PTR_ReadyToRunInfo ComputeAlternateGenericLocationForR2RCode(MethodDesc *pMethod);
static PTR_ReadyToRunInfo GetUnrelatedR2RModules();
PTR_ReadyToRunInfo GetNextUnrelatedR2RModule() { LIMITED_METHOD_CONTRACT; return m_pNextR2RForUnrelatedCode; }
Expand Down