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
6 changes: 5 additions & 1 deletion src/coreclr/vm/codeversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,11 @@ HRESULT CodeVersionManager::PublishNativeCodeVersion(MethodDesc* pMethod, Native
pMethod,
nativeCodeVersion.GetVersionId()));

#ifdef FEATURE_TIERED_COMPILATION
#ifdef FEATURE_INTERPRETER
// When we hit the Precode that should fixup any issues with an unset interpreter code pointer. This is notably most important in ReJIT scenarios
pMethod->ClearInterpreterCodePointer();
#endif
#ifdef FEATURE_TIERED_COMPILATION
bool wasSet = CallCountingManager::SetCodeEntryPoint(nativeCodeVersion, pCode, false, nullptr);
_ASSERTE(wasSet);
#else
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,10 @@ void MethodDesc::ResetCodeEntryPoint()
WRAPPER_NO_CONTRACT;
_ASSERTE(IsVersionable());

#ifdef FEATURE_INTERPRETER
ClearInterpreterCodePointer();
#endif

if (MayHaveEntryPointSlotsToBackpatch())
{
BackpatchToResetEntryPointSlots();
Expand Down Expand Up @@ -3265,6 +3269,10 @@ void MethodDesc::ResetCodeEntryPointForEnC()
return;
}

#ifdef FEATURE_INTERPRETER
ClearInterpreterCodePointer();
#endif

LOG((LF_ENC, LL_INFO100000, "MD::RCEPFENC: this:%p - %s::%s\n", this, m_pszDebugClassName, m_pszDebugMethodName));
#ifndef FEATURE_PORTABLE_ENTRYPOINTS
LOG((LF_ENC, LL_INFO100000, "MD::RCEPFENC: HasPrecode():%s, HasNativeCodeSlot():%s\n",
Expand Down