Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix jit inlining, fix R2R too
  • Loading branch information
davmason committed Oct 6, 2021
commit c46a4df1ad64f7df2da462ac5f3a99d6a1f64916
6 changes: 4 additions & 2 deletions src/coreclr/inc/profilepriv.inl
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,15 @@ inline BOOL IsProfilerTrackingCacheSearches(ProfilerInfo *pProfilerInfo)
inline HRESULT JITCachedFunctionSearchStartedHelper(BOOL *pAllTrue, VolatilePtr<EEToProfInterfaceImpl> profInterface, FunctionID functionId, BOOL *pbUseCachedFunction)
{
HRESULT hr = profInterface->JITCachedFunctionSearchStarted(functionId, pbUseCachedFunction);
*pAllTrue &= *pbUseCachedFunction;
*pAllTrue = *pAllTrue && *pbUseCachedFunction;
return hr;
}

inline void ProfControlBlock::JITCachedFunctionSearchStarted(FunctionID functionId, BOOL *pbUseCachedFunction)
{
LIMITED_METHOD_CONTRACT;

*pbUseCachedFunction = TRUE;
BOOL allTrue = TRUE;
DoProfilerCallback(ProfilerCallbackType::Active,
IsProfilerTrackingCacheSearches,
Expand Down Expand Up @@ -565,14 +566,15 @@ inline void ProfControlBlock::JITCachedFunctionSearchFinished(FunctionID functio
inline HRESULT JITInliningHelper(BOOL *pAllTrue, VolatilePtr<EEToProfInterfaceImpl> profInterface, FunctionID callerId, FunctionID calleeId, BOOL *pfShouldInline)
{
HRESULT hr = profInterface->JITInlining(callerId, calleeId, pfShouldInline);
*pAllTrue &= *pfShouldInline;
*pAllTrue = *pAllTrue && *pfShouldInline;
return hr;
}

inline HRESULT ProfControlBlock::JITInlining(FunctionID callerId, FunctionID calleeId, BOOL *pfShouldInline)
{
LIMITED_METHOD_CONTRACT;

*pfShouldInline = TRUE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will initialize *pfShouldInline deterministically for the first profiler only.

Should this line rather be in JITInliningHelper instead? I think you can even delete pfShouldInline argument for the JITInliningHelper and have BOOL fShouldInline local in JITInliningHelper instead.

BOOL allTrue = TRUE;
HRESULT hr = DoProfilerCallback(ProfilerCallbackType::Active,
IsProfilerTrackingJITInfo,
Expand Down