Skip to content
Draft
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
3 changes: 3 additions & 0 deletions src/coreclr/vm/codeversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,9 @@ HRESULT CodeVersionManager::PublishNativeCodeVersion(MethodDesc* pMethod, Native
// 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_PORTABLE_ENTRYPOINTS
pMethod->ResetPortableEntryPoint();
#endif // FEATURE_PORTABLE_ENTRYPOINTS
#ifdef FEATURE_TIERED_COMPILATION
bool wasSet = CallCountingManager::SetCodeEntryPoint(nativeCodeVersion, pCode, false, nullptr);
_ASSERTE(wasSet);
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/finalizerthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ extern "C" void SystemJS_ExecuteFinalizationCallback()
INSTALL_UNHANDLED_MANAGED_EXCEPTION_TRAP;
{
GCX_COOP();
// TODO-WASM https://github.com/dotnet/runtime/issues/123712
// ManagedThreadBase::KickOff(FinalizerThread::FinalizerThreadWorkerIteration, NULL);
ManagedThreadBase::KickOff(FinalizerThread::FinalizerThreadWorkerIteration, NULL);
}
UNINSTALL_UNHANDLED_MANAGED_EXCEPTION_TRAP;
}
Expand Down
26 changes: 23 additions & 3 deletions src/coreclr/vm/method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2474,6 +2474,18 @@ BOOL MethodDesc::ShouldCallPrestub()
#endif // FEATURE_PORTABLE_ENTRYPOINTS
}

#ifdef FEATURE_PORTABLE_ENTRYPOINTS
void MethodDesc::ResetPortableEntryPoint()
{
PCODE tempEntry = GetTemporaryEntryPointIfExists();
if (tempEntry != (PCODE)NULL)
{
PortableEntryPoint* pep = PortableEntryPoint::ToPortableEntryPoint(tempEntry);
pep->Init(this); // Re-initializes: clears _pActualCode, _pInterpreterData, _flags
}
}
#endif // FEATURE_PORTABLE_ENTRYPOINTS

//*******************************************************************************
void MethodDesc::Reset()
{
Expand All @@ -2490,10 +2502,12 @@ void MethodDesc::Reset()
// Reset any flags relevant to the old code
ClearFlagsOnUpdate();

#ifndef FEATURE_PORTABLE_ENTRYPOINTS
#ifdef FEATURE_PORTABLE_ENTRYPOINTS
ResetPortableEntryPoint();
#else // !FEATURE_PORTABLE_ENTRYPOINTS
_ASSERTE(HasPrecode());
GetPrecode()->Reset();
#endif // !FEATURE_PORTABLE_ENTRYPOINTS
#endif // FEATURE_PORTABLE_ENTRYPOINTS

if (HasNativeCodeSlot())
{
Expand Down Expand Up @@ -3276,6 +3290,10 @@ void MethodDesc::ResetCodeEntryPoint()
ClearInterpreterCodePointer();
#endif

#ifdef FEATURE_PORTABLE_ENTRYPOINTS
ResetPortableEntryPoint();
#endif // FEATURE_PORTABLE_ENTRYPOINTS

if (MayHaveEntryPointSlotsToBackpatch())
{
BackpatchToResetEntryPointSlots();
Expand Down Expand Up @@ -3313,7 +3331,9 @@ void MethodDesc::ResetCodeEntryPointForEnC()
#endif

LOG((LF_ENC, LL_INFO100000, "MD::RCEPFENC: this:%p - %s::%s\n", this, m_pszDebugClassName, m_pszDebugMethodName));
#ifndef FEATURE_PORTABLE_ENTRYPOINTS
#ifdef FEATURE_PORTABLE_ENTRYPOINTS
ResetPortableEntryPoint();
#else // !FEATURE_PORTABLE_ENTRYPOINTS
LOG((LF_ENC, LL_INFO100000, "MD::RCEPFENC: HasPrecode():%s, HasNativeCodeSlot():%s\n",
(HasPrecode() ? "true" : "false"), (HasNativeCodeSlot() ? "true" : "false")));
if (HasPrecode())
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/vm/method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,8 @@ class MethodDesc
void EnsurePortableEntryPoint();

PCODE GetPortableEntryPoint();

void ResetPortableEntryPoint();
#endif // FEATURE_PORTABLE_ENTRYPOINTS

//*******************************************************************************
Expand Down
Loading