Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store last OSR transition context in static memory in DEBUG builds #101537

Merged
merged 7 commits into from
Apr 25, 2024
Merged
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
12 changes: 9 additions & 3 deletions src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5144,7 +5144,7 @@ void JIT_Patchpoint(int* counter, int ilOffset)
const int counterBump = g_pConfig->OSR_CounterBump();
*counter = counterBump;

#if _DEBUG
#ifdef _DEBUG
Copy link
Member

Choose a reason for hiding this comment

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

There are a couple more of these just below.

const int ppId = ppInfo->m_patchpointId;
#endif

Expand Down Expand Up @@ -5389,6 +5389,12 @@ void JIT_Patchpoint(int* counter, int ilOffset)
// Install new entry point as IP
SetIP(pFrameContext, osrMethodCode);

#ifdef _DEBUG
// Keep this context around to aid in debugging OSR transition problems
static CONTEXT s_lastOSRTransitionContext;
s_lastOSRTransitionContext = *pFrameContext;
#endif

// Restore last error (since call below does not return)
// END_PRESERVE_LAST_ERROR;
::SetLastError(dwLastError);
Expand Down Expand Up @@ -5425,7 +5431,7 @@ HCIMPL1(VOID, JIT_PartialCompilationPatchpoint, int ilOffset)
// Patchpoint identity is the helper return address
PCODE ip = (PCODE)_ReturnAddress();

#if _DEBUG
#ifdef _DEBUG
// Friendly ID number
int ppId = 0;
#endif
Expand All @@ -5439,7 +5445,7 @@ HCIMPL1(VOID, JIT_PartialCompilationPatchpoint, int ilOffset)
OnStackReplacementManager* manager = allocator->GetOnStackReplacementManager();
ppInfo = manager->GetPerPatchpointInfo(ip);

#if _DEBUG
#ifdef _DEBUG
ppId = ppInfo->m_patchpointId;
#endif

Expand Down