Skip to content

Commit 1587221

Browse files
authored
Delete more of ExceptionTracker code (#114146)
* Delete more of ExceptionTracker code * Remove m_OOMTracker
1 parent 970070e commit 1587221

File tree

6 files changed

+10
-741
lines changed

6 files changed

+10
-741
lines changed

src/coreclr/vm/excep.cpp

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -10571,87 +10571,26 @@ StackWalkAction TAResetStateCallback(CrawlFrame* pCf, void* data)
1057110571
// Note: This function should be invoked ONLY during unwind.
1057210572
#ifndef FEATURE_EH_FUNCLETS
1057310573
void ResetThreadAbortState(PTR_Thread pThread, void *pEstablisherFrame)
10574-
#else
10575-
void ResetThreadAbortState(PTR_Thread pThread, CrawlFrame *pCf, StackFrame sfCurrentStackFrame)
10576-
#endif
1057710574
{
1057810575
CONTRACTL
1057910576
{
1058010577
NOTHROW;
1058110578
GC_NOTRIGGER;
1058210579
MODE_ANY;
1058310580
PRECONDITION(pThread != NULL);
10584-
#ifndef FEATURE_EH_FUNCLETS
1058510581
PRECONDITION(pEstablisherFrame != NULL);
10586-
#else
10587-
PRECONDITION(pCf != NULL);
10588-
PRECONDITION(!sfCurrentStackFrame.IsNull());
10589-
#endif
1059010582
}
1059110583
CONTRACTL_END;
1059210584

1059310585
if (pThread->IsAbortRequested())
1059410586
{
10595-
#ifndef FEATURE_EH_FUNCLETS
1059610587
if (GetNextCOMPlusSEHRecord(static_cast<EXCEPTION_REGISTRATION_RECORD *>(pEstablisherFrame)) == EXCEPTION_CHAIN_END)
1059710588
{
1059810589
_ASSERTE(!"Topmost handler and abort requested.");
1059910590
}
10600-
#else // !FEATURE_EH_FUNCLETS
10601-
// Get the active exception tracker
10602-
PTR_ExceptionTracker pCurEHTracker = (PTR_ExceptionTracker)pThread->GetExceptionState()->GetCurrentExceptionTracker();
10603-
_ASSERTE(pCurEHTracker != NULL);
10604-
10605-
// We will check if thread abort state needs to be reset only for the case of exception caught in
10606-
// native code. This will happen when:
10607-
//
10608-
// 1) an unwind is triggered and
10609-
// 2) current frame is the topmost frame we saw in the first pass and
10610-
// 3) a thread abort is requested and
10611-
// 4) we dont have address of the exception handler to be invoked.
10612-
//
10613-
// (1), (2) and (4) above are checked for in ExceptionTracker::ProcessOSExceptionNotification from where we call this
10614-
// function.
10615-
10616-
// Current frame should be the topmost frame we saw in the first pass
10617-
_ASSERTE(pCurEHTracker->GetTopmostStackFrameFromFirstPass() == sfCurrentStackFrame);
10618-
10619-
// If the exception has been caught in native code, then alongwith not having address of the handler to be
10620-
// invoked, we also wont have the IL clause for the catch block and resume stack frame will be NULL as well.
10621-
_ASSERTE((pCurEHTracker->GetCatchToCallPC() == 0) &&
10622-
(pCurEHTracker->GetCatchHandlerExceptionClauseToken() == NULL) &&
10623-
(pCurEHTracker->GetResumeStackFrame().IsNull()));
10624-
10625-
// Walk the frame chain to see if there is any more managed code on the stack. If not, then this is the last managed frame
10626-
// on the stack and we can reset the thread abort state.
10627-
//
10628-
// Get the frame from which to start the stack walk from
10629-
Frame* pFrame = pCurEHTracker->GetLimitFrame();
10630-
10631-
// At this point, we are at the topmost frame we saw during the first pass
10632-
// before the unwind began. Walk the stack using the specified crawlframe and the topmost
10633-
// explicit frame to determine if we have more managed code up the stack. If none is found,
10634-
// we can reset the thread abort state.
10635-
10636-
// Setup the data structure to be passed to the callback
10637-
TAResetStateCallbackData dataCallback;
10638-
dataCallback.fDoWeHaveMoreManagedCodeOnStack = FALSE;
10639-
10640-
// At this point, the StackFrame in CrawlFrame should represent the current frame we have been called for.
10641-
// _ASSERTE(sfCurrentStackFrame == StackFrame::FromRegDisplay(pCf->GetRegisterSet()));
10642-
10643-
// Reference to the StackFrame beyond which we are looking for managed code.
10644-
dataCallback.sfSeedCrawlFrame = sfCurrentStackFrame;
10645-
10646-
pThread->StackWalkFramesEx(pCf->GetRegisterSet(), TAResetStateCallback, &dataCallback, QUICKUNWIND, pFrame);
10647-
10648-
if (!dataCallback.fDoWeHaveMoreManagedCodeOnStack)
10649-
{
10650-
_ASSERTE(!"There is no more managed code on the stack, and thread abort is requested.");
10651-
}
10652-
#endif // !FEATURE_EH_FUNCLETS
1065310591
}
1065410592
}
10593+
#endif // !FEATURE_EH_FUNCLETS
1065510594
#endif // !DACCESS_COMPILE
1065610595

1065710596

src/coreclr/vm/excep.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,6 @@ class ExceptionNotifications
833833

834834
#ifndef FEATURE_EH_FUNCLETS
835835
void ResetThreadAbortState(PTR_Thread pThread, void *pEstablisherFrame);
836-
#else
837-
void ResetThreadAbortState(PTR_Thread pThread, CrawlFrame *pCf, StackFrame sfCurrentStackFrame);
838836
#endif
839837

840838
X86_ONLY(EXCEPTION_REGISTRATION_RECORD* GetNextCOMPlusSEHRecord(EXCEPTION_REGISTRATION_RECORD* pRec);)

0 commit comments

Comments
 (0)