Skip to content

Commit 97f5045

Browse files
authored
Remove unused CrawlFrame::GetExactGenericInstantiations (#109351)
1 parent fd77ab7 commit 97f5045

File tree

3 files changed

+8
-50
lines changed

3 files changed

+8
-50
lines changed

src/coreclr/vm/jitinterface.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7593,12 +7593,6 @@ static void getMethodInfoHelper(
75937593
(ftn->RequiresInstMethodTableArg() ? CORINFO_GENERICS_CTXT_FROM_METHODTABLE : 0) |
75947594
(ftn->RequiresInstMethodDescArg() ? CORINFO_GENERICS_CTXT_FROM_METHODDESC : 0)));
75957595

7596-
// EEJitManager::ResolveEHClause and CrawlFrame::GetExactGenericInstantiations
7597-
// need to be able to get to CORINFO_GENERICS_CTXT_MASK if there are any
7598-
// catch clauses like "try {} catch(MyException<T> e) {}".
7599-
// Such constructs are rare, and having to extend the lifetime of variable
7600-
// for such cases is reasonable
7601-
76027596
if (methInfo->options & CORINFO_GENERICS_CTXT_MASK)
76037597
{
76047598
#if defined(PROFILING_SUPPORTED)

src/coreclr/vm/stackwalk.cpp

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -229,39 +229,6 @@ PTR_VOID CrawlFrame::GetParamTypeArg()
229229
}
230230
}
231231

232-
233-
234-
// [pClassInstantiation] : Always filled in, though may be set to NULL if no inst.
235-
// [pMethodInst] : Always filled in, though may be set to NULL if no inst.
236-
void CrawlFrame::GetExactGenericInstantiations(Instantiation *pClassInst,
237-
Instantiation *pMethodInst)
238-
{
239-
240-
CONTRACTL {
241-
NOTHROW;
242-
GC_NOTRIGGER;
243-
PRECONDITION(CheckPointer(pClassInst));
244-
PRECONDITION(CheckPointer(pMethodInst));
245-
} CONTRACTL_END;
246-
247-
TypeHandle specificClass;
248-
MethodDesc* specificMethod;
249-
250-
BOOL ret = Generics::GetExactInstantiationsOfMethodAndItsClassFromCallInformation(
251-
GetFunction(),
252-
GetExactGenericArgsToken(),
253-
&specificClass,
254-
&specificMethod);
255-
256-
if (!ret)
257-
{
258-
_ASSERTE(!"Cannot return exact class instantiation when we are requested to.");
259-
}
260-
261-
*pClassInst = specificMethod->GetExactClassInstantiation(specificClass);
262-
*pMethodInst = specificMethod->GetMethodInstantiation();
263-
}
264-
265232
PTR_VOID CrawlFrame::GetExactGenericArgsToken()
266233
{
267234

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

19691936
if (!fFrameWasUnwound && !ExecutionManager::IsManagedCode(GetIP(m_crawl.GetRegisterSet()->pCallerContext)))
19701937
{
1971-
// Initiate force reporting of references in the new managed exception handling code frames.
1938+
// Initiate force reporting of references in the new managed exception handling code frames.
19721939
// These frames are still alive when we are in a finally funclet.
19731940
m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame;
19741941
STRESS_LOG0(LF_GCROOTS, LL_INFO100, "STACKWALK: Setting m_forceReportingWhileSkipping = ForceGCReportingStage::LookForManagedFrame\n");
@@ -2160,7 +2127,7 @@ StackWalkAction StackFrameIterator::Filter(void)
21602127
// would report garbage values as live objects. So instead parent can use the IP of the resume
21612128
// address of catch funclet to report live GC references.
21622129
m_crawl.fShouldParentFrameUseUnwindTargetPCforGCReporting = true;
2163-
2130+
21642131
if (g_isNewExceptionHandlingEnabled)
21652132
{
21662133
m_crawl.ehClauseForCatch = pExInfo->m_ClauseForCatch;
@@ -2181,7 +2148,7 @@ StackWalkAction StackFrameIterator::Filter(void)
21812148
"(EH handler range [%x, %x) ), so we need to specially report roots to ensure variables alive"
21822149
" in its handler stay live.\n",
21832150
pTracker->GetCatchToCallPC(), m_crawl.ehClauseForCatch.HandlerStartPC,
2184-
m_crawl.ehClauseForCatch.HandlerEndPC);
2151+
m_crawl.ehClauseForCatch.HandlerEndPC);
21852152
}
21862153
}
21872154
else if (!m_crawl.IsFunclet())
@@ -2291,14 +2258,14 @@ StackWalkAction StackFrameIterator::Filter(void)
22912258
STRESS_LOG0(LF_GCROOTS, LL_INFO100, "STACKWALK: Setting m_forceReportingWhileSkipping = ForceGCReportingStage::LookForMarkerFrame\n");
22922259
}
22932260

2294-
#ifdef _DEBUG
2261+
#ifdef _DEBUG
22952262
if (m_forceReportingWhileSkipping != ForceGCReportingStage::Off)
22962263
{
22972264
STRESS_LOG3(LF_GCROOTS, LL_INFO100,
22982265
"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);
22992266
_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));
23002267
}
2301-
#endif
2268+
#endif
23022269
}
23032270
}
23042271
}

src/coreclr/vm/stackwalk.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ class CrawlFrame
130130
*/
131131
TADDR GetAmbientSPFromCrawlFrame();
132132

133-
void GetExactGenericInstantiations(Instantiation *pClassInst,
134-
Instantiation *pMethodInst);
135-
136133
/* Returns extra information required to reconstruct exact generic parameters,
137134
if any.
138135
Returns NULL if
@@ -666,7 +663,7 @@ class StackFrameIterator
666663
enum class ForceGCReportingStage : BYTE
667664
{
668665
Off = 0,
669-
// The stack walker has hit a funclet, we are looking for the first managed
666+
// The stack walker has hit a funclet, we are looking for the first managed
670667
// frame that would be one of the managed exception handling code frames
671668
LookForManagedFrame = 1,
672669
// The stack walker has already hit a managed exception handling code frame,

0 commit comments

Comments
 (0)