Skip to content

Commit 30260b4

Browse files
simonferquelGitHub Enterprise
authored andcommitted
Merge pull request #1 from unity/make-cor-prf-disable-optimizations-non-immutable
Make cor prf disable optimizations non immutable
2 parents e79ac34 + fca0bae commit 30260b4

21 files changed

+3038
-2648
lines changed

src/coreclr/debug/daccess/dacdbiimpl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,7 @@ void DacDbiInterfaceImpl::GetCompilerFlags (
705705

706706
// Get the underlying module - none of this is AppDomain specific
707707
Module * pModule = pDomainAssembly->GetModule();
708-
DWORD dwBits = pModule->GetDebuggerInfoBits();
709-
*pfAllowJITOpts = !CORDisableJITOptimizations(dwBits);
708+
*pfAllowJITOpts = !pModule->AreJITOptimizationsDisabled();
710709
*pfEnableEnC = pModule->IsEditAndContinueEnabled();
711710

712711

@@ -7424,7 +7423,7 @@ HRESULT DacDbiInterfaceImpl::AreOptimizationsDisabled(VMPTR_Module vmModule, mdM
74247423
#else
74257424
pOptimizationsDisabled->SetDacTargetPtr(0);
74267425
#endif
7427-
7426+
74287427
return S_OK;
74297428
}
74307429

src/coreclr/debug/ee/debugger.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,7 +3305,7 @@ void Debugger::getBoundaries(MethodDesc * md,
33053305
// lives in, then don't grab specific boundaries from the symbol
33063306
// store since any boundaries we give the JIT will be pretty much
33073307
// ignored anyway.
3308-
if (!CORDisableJITOptimizations(md->GetModule()->GetDebuggerInfoBits()))
3308+
if (!md->GetModule()->AreJITOptimizationsDisabled())
33093309
{
33103310
*implicitBoundaries = ICorDebugInfo::BoundaryTypes(ICorDebugInfo::STACK_EMPTY_BOUNDARIES |
33113311
ICorDebugInfo::CALL_SITE_BOUNDARIES);
@@ -3383,13 +3383,10 @@ void Debugger::getVars(MethodDesc * md, ULONG32 *cVars, ICorDebugInfo::ILVarInfo
33833383
// free to ignore *extendOthers
33843384
*extendOthers = true;
33853385

3386-
DWORD bits = md->GetModule()->GetDebuggerInfoBits();
3387-
33883386
if (CORDBUnrecoverableError(this))
33893387
goto Exit;
33903388

3391-
if (CORDisableJITOptimizations(bits))
3392-
// if (!CORDebuggerAllowJITOpts(bits))
3389+
if (md->GetModule()->AreJITOptimizationsDisabled())
33933390
{
33943391
//
33953392
// @TODO: Do we really need this code since *extendOthers==true?

src/coreclr/debug/ee/debugger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,6 @@ class DebuggerModule
511511

512512
AppDomain* m_pAppDomain;
513513

514-
bool m_fHasOptimizedCode;
515-
516514
void PickPrimaryModule();
517515

518516
// Can we change jit flags on the module?

src/coreclr/debug/ee/debugger.inl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ inline DebuggerModule::DebuggerModule(Module * pRuntimeModule,
6767
// Arguably, this could be in DebuggerModuleTable::AddModule
6868
PickPrimaryModule();
6969

70-
71-
// Do we have any optimized code?
72-
DWORD dwDebugBits = pRuntimeModule->GetDebuggerInfoBits();
73-
m_fHasOptimizedCode = CORDebuggerAllowJITOpts(dwDebugBits);
74-
7570
// Dynamic modules must receive ClassLoad callbacks in order to receive metadata updates as the module
7671
// evolves. So we force this on here and refuse to change it for all dynamic modules.
7772
if (pRuntimeModule->IsReflection())
@@ -91,8 +86,7 @@ inline bool DebuggerModule::HasAnyOptimizedCode()
9186
{
9287
LIMITED_METHOD_CONTRACT;
9388
Module * pModule = this->GetPrimaryModule()->GetRuntimeModule();
94-
DWORD dwDebugBits = pModule->GetDebuggerInfoBits();
95-
return CORDebuggerAllowJITOpts(dwDebugBits);
89+
return !pModule->AreJITOptimizationsDisabled();
9690
}
9791

9892
//-----------------------------------------------------------------------------

src/coreclr/inc/corprof.idl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@ typedef enum
592592
COR_PRF_MONITOR_CLASS_LOADS |
593593
COR_PRF_MONITOR_EXCEPTIONS |
594594
COR_PRF_MONITOR_JIT_COMPILATION |
595+
COR_PRF_DISABLE_INLINING |
596+
COR_PRF_DISABLE_OPTIMIZATIONS |
595597
COR_PRF_ENABLE_REJIT,
596598

597599
COR_PRF_ALLOWABLE_NOTIFICATION_PROFILER
@@ -625,8 +627,6 @@ typedef enum
625627
COR_PRF_MONITOR_REMOTING_ASYNC |
626628
COR_PRF_ENABLE_INPROC_DEBUGGING |
627629
COR_PRF_ENABLE_JIT_MAPS |
628-
COR_PRF_DISABLE_OPTIMIZATIONS |
629-
COR_PRF_DISABLE_INLINING |
630630
COR_PRF_ENABLE_OBJECT_ALLOCATED |
631631
COR_PRF_ENABLE_FUNCTION_ARGS |
632632
COR_PRF_ENABLE_FUNCTION_RETVAL |
@@ -4289,10 +4289,10 @@ interface ICorProfilerInfo14 : ICorProfilerInfo13
42894289
[out, size_is(cObjectRanges), length_is(*pcObjectRanges)] COR_PRF_NONGC_HEAP_RANGE ranges[]);
42904290

42914291

4292-
// EventPipeCreateProvider2 allows you to pass in a callback which will be called whenever a
4292+
// EventPipeCreateProvider2 allows you to pass in a callback which will be called whenever a
42934293
// session enables your provider. The behavior of the callback matches the ETW behavior which
4294-
// can be counter intuitive. You will get a callback any time a session changes with the updated
4295-
// global keywords enabled for your session. The is_enabled parameter will be true if any
4294+
// can be counter intuitive. You will get a callback any time a session changes with the updated
4295+
// global keywords enabled for your session. The is_enabled parameter will be true if any
42964296
// session has your provider enabled. The source_id parameter will be a valid id if the callback
42974297
// was triggered due to a session enabling and it will be NULL if it was triggered due to a session
42984298
// disabling.

0 commit comments

Comments
 (0)