Skip to content

Commit

Permalink
Remove unused CrawlFrame::GetExactGenericInstantiations (#109351)
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung authored Oct 29, 2024
1 parent fd77ab7 commit 97f5045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 50 deletions.
6 changes: 0 additions & 6 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7593,12 +7593,6 @@ static void getMethodInfoHelper(
(ftn->RequiresInstMethodTableArg() ? CORINFO_GENERICS_CTXT_FROM_METHODTABLE : 0) |
(ftn->RequiresInstMethodDescArg() ? CORINFO_GENERICS_CTXT_FROM_METHODDESC : 0)));

// EEJitManager::ResolveEHClause and CrawlFrame::GetExactGenericInstantiations
// need to be able to get to CORINFO_GENERICS_CTXT_MASK if there are any
// catch clauses like "try {} catch(MyException<T> e) {}".
// Such constructs are rare, and having to extend the lifetime of variable
// for such cases is reasonable

if (methInfo->options & CORINFO_GENERICS_CTXT_MASK)
{
#if defined(PROFILING_SUPPORTED)
Expand Down
47 changes: 7 additions & 40 deletions src/coreclr/vm/stackwalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,39 +229,6 @@ PTR_VOID CrawlFrame::GetParamTypeArg()
}
}



// [pClassInstantiation] : Always filled in, though may be set to NULL if no inst.
// [pMethodInst] : Always filled in, though may be set to NULL if no inst.
void CrawlFrame::GetExactGenericInstantiations(Instantiation *pClassInst,
Instantiation *pMethodInst)
{

CONTRACTL {
NOTHROW;
GC_NOTRIGGER;
PRECONDITION(CheckPointer(pClassInst));
PRECONDITION(CheckPointer(pMethodInst));
} CONTRACTL_END;

TypeHandle specificClass;
MethodDesc* specificMethod;

BOOL ret = Generics::GetExactInstantiationsOfMethodAndItsClassFromCallInformation(
GetFunction(),
GetExactGenericArgsToken(),
&specificClass,
&specificMethod);

if (!ret)
{
_ASSERTE(!"Cannot return exact class instantiation when we are requested to.");
}

*pClassInst = specificMethod->GetExactClassInstantiation(specificClass);
*pMethodInst = specificMethod->GetMethodInstantiation();
}

PTR_VOID CrawlFrame::GetExactGenericArgsToken()
{

Expand Down Expand Up @@ -1696,7 +1663,7 @@ StackWalkAction StackFrameIterator::Filter(void)
m_fFuncletNotSeen = true;
STRESS_LOG3(LF_GCROOTS, LL_INFO100,
"STACKWALK: Moved over first ExInfo @ %p in second pass, SP: %p, Enclosing clause: %p\n",
pExInfo, (void*)m_crawl.GetRegisterSet()->SP, (void*)m_sfFuncletParent.SP);
pExInfo, (void*)m_crawl.GetRegisterSet()->SP, (void*)m_sfFuncletParent.SP);
}
m_movedPastFirstExInfo = true;
}
Expand Down Expand Up @@ -1907,7 +1874,7 @@ StackWalkAction StackFrameIterator::Filter(void)
{
if (!ExecutionManager::IsManagedCode(GetIP(m_crawl.GetRegisterSet()->pCallerContext)))
{
// Initiate force reporting of references in the new managed exception handling code frames.
// Initiate force reporting of references in the new managed exception handling code frames.
// These frames are still alive when we are in a finally funclet.
m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame;
STRESS_LOG0(LF_GCROOTS, LL_INFO100, "STACKWALK: Setting m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame while processing filter funclet\n");
Expand Down Expand Up @@ -1968,7 +1935,7 @@ StackWalkAction StackFrameIterator::Filter(void)

if (!fFrameWasUnwound && !ExecutionManager::IsManagedCode(GetIP(m_crawl.GetRegisterSet()->pCallerContext)))
{
// Initiate force reporting of references in the new managed exception handling code frames.
// Initiate force reporting of references in the new managed exception handling code frames.
// These frames are still alive when we are in a finally funclet.
m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame;
STRESS_LOG0(LF_GCROOTS, LL_INFO100, "STACKWALK: Setting m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame\n");
Expand Down Expand Up @@ -2160,7 +2127,7 @@ StackWalkAction StackFrameIterator::Filter(void)
// would report garbage values as live objects. So instead parent can use the IP of the resume
// address of catch funclet to report live GC references.
m_crawl.fShouldParentFrameUseUnwindTargetPCforGCReporting = true;

if (g_isNewExceptionHandlingEnabled)
{
m_crawl.ehClauseForCatch = pExInfo->m_ClauseForCatch;
Expand All @@ -2181,7 +2148,7 @@ StackWalkAction StackFrameIterator::Filter(void)
"(EH handler range [%x, %x) ), so we need to specially report roots to ensure variables alive"
" in its handler stay live.\n",
pTracker->GetCatchToCallPC(), m_crawl.ehClauseForCatch.HandlerStartPC,
m_crawl.ehClauseForCatch.HandlerEndPC);
m_crawl.ehClauseForCatch.HandlerEndPC);
}
}
else if (!m_crawl.IsFunclet())
Expand Down Expand Up @@ -2291,14 +2258,14 @@ StackWalkAction StackFrameIterator::Filter(void)
STRESS_LOG0(LF_GCROOTS, LL_INFO100, "STACKWALK: Setting m_forceReportingWhileSkipping = ForceGCReportingStage::LookForMarkerFrame\n");
}

#ifdef _DEBUG
#ifdef _DEBUG
if (m_forceReportingWhileSkipping != ForceGCReportingStage::Off)
{
STRESS_LOG3(LF_GCROOTS, LL_INFO100,
"STACKWALK: Force callback for skipped function m_crawl.pFunc = %pM (%s.%s)\n", m_crawl.pFunc, m_crawl.pFunc->m_pszDebugClassName, m_crawl.pFunc->m_pszDebugMethodName);
_ASSERTE((m_crawl.pFunc->GetMethodTable() == g_pEHClass) || (strcmp(m_crawl.pFunc->m_pszDebugClassName, "ILStubClass") == 0) || (strcmp(m_crawl.pFunc->m_pszDebugMethodName, "CallFinallyFunclet") == 0) || (m_crawl.pFunc->GetMethodTable() == g_pExceptionServicesInternalCallsClass));
}
#endif
#endif
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/coreclr/vm/stackwalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ class CrawlFrame
*/
TADDR GetAmbientSPFromCrawlFrame();

void GetExactGenericInstantiations(Instantiation *pClassInst,
Instantiation *pMethodInst);

/* Returns extra information required to reconstruct exact generic parameters,
if any.
Returns NULL if
Expand Down Expand Up @@ -666,7 +663,7 @@ class StackFrameIterator
enum class ForceGCReportingStage : BYTE
{
Off = 0,
// The stack walker has hit a funclet, we are looking for the first managed
// The stack walker has hit a funclet, we are looking for the first managed
// frame that would be one of the managed exception handling code frames
LookForManagedFrame = 1,
// The stack walker has already hit a managed exception handling code frame,
Expand Down

0 comments on commit 97f5045

Please sign in to comment.