Skip to content

Commit

Permalink
Remove FastNExportHandler.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Dec 21, 2020
1 parent 41d704e commit 423f70e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 49 deletions.
1 change: 0 additions & 1 deletion src/coreclr/vm/dllimportcallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ class UMEntryThunkCache
//-------------------------------------------------------------------------
Stub *GenerateUMThunkPrestub();

EXCEPTION_HANDLER_DECL(FastNExportExceptHandler);
EXCEPTION_HANDLER_DECL(UMThunkPrestubHandler);

#endif // TARGET_X86 && !FEATURE_STUBS_AS_IL
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/vm/i386/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ COMPlusFrameHandler proto c
COMPlusNestedExceptionHandler proto c
.safeseh COMPlusNestedExceptionHandler

FastNExportExceptHandler proto c
.safeseh FastNExportExceptHandler

UMThunkPrestubHandler proto c
.safeseh UMThunkPrestubHandler

Expand Down
32 changes: 1 addition & 31 deletions src/coreclr/vm/i386/excepx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ BOOL NExportSEH(EXCEPTION_REGISTRATION_RECORD* pEHR)
return FALSE;
}

BOOL FastNExportSEH(EXCEPTION_REGISTRATION_RECORD* pEHR)
{
LIMITED_METHOD_CONTRACT;

if ((LPVOID)pEHR->Handler == (LPVOID)FastNExportExceptHandler)
return TRUE;
return FALSE;
}

BOOL ReverseCOMSEH(EXCEPTION_REGISTRATION_RECORD* pEHR)
{
LIMITED_METHOD_CONTRACT;
Expand All @@ -155,10 +146,9 @@ BOOL IsUnmanagedToManagedSEHHandler(EXCEPTION_REGISTRATION_RECORD *pEstablisherF

//
// ComPlusFrameSEH() is for COMPlusFrameHandler & COMPlusNestedExceptionHandler.
// FastNExportSEH() is for FastNExportExceptHandler.
// NExportSEH() is for UMThunkPrestubHandler.
//
return (ComPlusFrameSEH(pEstablisherFrame) || FastNExportSEH(pEstablisherFrame) || NExportSEH(pEstablisherFrame) || ReverseCOMSEH(pEstablisherFrame));
return (ComPlusFrameSEH(pEstablisherFrame) || NExportSEH(pEstablisherFrame) || ReverseCOMSEH(pEstablisherFrame));
}

Frame *GetCurrFrame(EXCEPTION_REGISTRATION_RECORD *pEstablisherFrame)
Expand Down Expand Up @@ -3362,26 +3352,6 @@ EXCEPTION_REGISTRATION_RECORD *FindNestedEstablisherFrame(EXCEPTION_REGISTRATION
return pEstablisherFrame;
}

EXCEPTION_HANDLER_IMPL(FastNExportExceptHandler)
{
WRAPPER_NO_CONTRACT;

// Most of our logic is in commin with COMPlusFrameHandler.
EXCEPTION_DISPOSITION retval = EXCEPTION_HANDLER_FWD(COMPlusFrameHandler);

#ifdef _DEBUG
// If the exception is escaping the last CLR personality routine on the stack,
// then state a flag on the thread to indicate so.
if (retval == ExceptionContinueSearch)
{
SetReversePInvokeEscapingUnhandledExceptionStatus(IS_UNWINDING(pExceptionRecord->ExceptionFlags), pEstablisherFrame);
}
#endif // _DEBUG

return retval;
}


// Just like a regular NExport handler -- except it pops an extra frame on unwind. A handler
// like this is needed by the COMMethodStubProlog code. It first pushes a frame -- and then
// pushes a handler. When we unwind, we need to pop the extra frame to avoid corrupting the
Expand Down
14 changes: 0 additions & 14 deletions src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5347,10 +5347,6 @@ EXTERN_C void JIT_PInvokeEnd(InlinedCallFrame* pFrame);
// Forward declaration
EXTERN_C void STDCALL ReversePInvokeBadTransition();

#ifndef FEATURE_EH_FUNCLETS
EXCEPTION_HANDLER_DECL(FastNExportExceptHandler);
#endif

// This is a slower version of the reverse PInvoke enter function.
NOINLINE static void JIT_ReversePInvokeEnterRare(ReversePInvokeFrame* frame)
{
Expand Down Expand Up @@ -5435,12 +5431,6 @@ void F_CALL_CONV HCCALL3(JIT_ReversePInvokeEnter, ReversePInvokeFrame* frame, CO
{
JIT_ReversePInvokeEnterRare(frame);
}

#ifndef FEATURE_EH_FUNCLETS
frame->record.m_pEntryFrame = thread->GetFrame();
frame->record.m_ExReg.Handler = (PEXCEPTION_ROUTINE)FastNExportExceptHandler;
INSTALL_EXCEPTION_HANDLING_RECORD(&frame->record.m_ExReg);
#endif
}

void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExit, ReversePInvokeFrame* frame)
Expand All @@ -5453,10 +5443,6 @@ void F_CALL_CONV HCCALL1(JIT_ReversePInvokeExit, ReversePInvokeFrame* frame)
// to make this exit faster.
frame->currentThread->m_fPreemptiveGCDisabled.StoreWithoutBarrier(0);

#ifndef FEATURE_EH_FUNCLETS
UNINSTALL_EXCEPTION_HANDLING_RECORD(&frame->record.m_ExReg);
#endif

#ifdef PROFILING_SUPPORTED
if (CORProfilerTrackTransitions())
{
Expand Down

0 comments on commit 423f70e

Please sign in to comment.