Skip to content

Commit

Permalink
Remove unused FailFast FCALL implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinWise committed Feb 26, 2024
1 parent fab69ef commit 881f72b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
28 changes: 5 additions & 23 deletions src/coreclr/classlibnative/bcltype/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ WCHAR *g_pFailFastBuffer = g_szFailFastBuffer;

// This is the common code for FailFast processing that is wrapped by the two
// FailFast FCalls below.
void SystemNative::GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExceptionForWatsonBucketing, UINT_PTR retAddress, UINT exitCode, STRINGREF refErrorSourceString)
void SystemNative::GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExceptionForWatsonBucketing, UINT_PTR retAddress, STRINGREF refErrorSourceString)
{
CONTRACTL
{
Expand Down Expand Up @@ -282,7 +282,7 @@ void SystemNative::GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExce
if (gc.refExceptionForWatsonBucketing != NULL)
pThread->SetLastThrownObject(gc.refExceptionForWatsonBucketing);

EEPolicy::HandleFatalError(exitCode, retAddress, pszMessage, NULL, errorSourceString, argExceptionString);
EEPolicy::HandleFatalError(COR_E_FAILFAST, retAddress, pszMessage, NULL, errorSourceString, argExceptionString);

GCPROTECT_END();
}
Expand All @@ -301,25 +301,7 @@ FCIMPL1(VOID, SystemNative::FailFast, StringObject* refMessageUNSAFE)
UINT_PTR retaddr = HELPER_METHOD_FRAME_GET_RETURN_ADDRESS();

// Call the actual worker to perform failfast
GenericFailFast(refMessage, NULL, retaddr, COR_E_FAILFAST, NULL);

HELPER_METHOD_FRAME_END();
}
FCIMPLEND

FCIMPL2(VOID, SystemNative::FailFastWithExitCode, StringObject* refMessageUNSAFE, UINT exitCode)
{
FCALL_CONTRACT;

STRINGREF refMessage = (STRINGREF)refMessageUNSAFE;

HELPER_METHOD_FRAME_BEGIN_1(refMessage);

// The HelperMethodFrame knows how to get the return address.
UINT_PTR retaddr = HELPER_METHOD_FRAME_GET_RETURN_ADDRESS();

// Call the actual worker to perform failfast
GenericFailFast(refMessage, NULL, retaddr, exitCode, NULL);
GenericFailFast(refMessage, NULL, retaddr, NULL);

HELPER_METHOD_FRAME_END();
}
Expand All @@ -338,7 +320,7 @@ FCIMPL2(VOID, SystemNative::FailFastWithException, StringObject* refMessageUNSAF
UINT_PTR retaddr = HELPER_METHOD_FRAME_GET_RETURN_ADDRESS();

// Call the actual worker to perform failfast
GenericFailFast(refMessage, refException, retaddr, COR_E_FAILFAST, NULL);
GenericFailFast(refMessage, refException, retaddr, NULL);

HELPER_METHOD_FRAME_END();
}
Expand All @@ -358,7 +340,7 @@ FCIMPL3(VOID, SystemNative::FailFastWithExceptionAndSource, StringObject* refMes
UINT_PTR retaddr = HELPER_METHOD_FRAME_GET_RETURN_ADDRESS();

// Call the actual worker to perform failfast
GenericFailFast(refMessage, refException, retaddr, COR_E_FAILFAST, errorSource);
GenericFailFast(refMessage, refException, retaddr, errorSource);

HELPER_METHOD_FRAME_END();
}
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/classlibnative/bcltype/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class SystemNative
static FCDECL0(INT32, GetExitCode);

static FCDECL1(VOID, FailFast, StringObject* refMessageUNSAFE);
static FCDECL2(VOID, FailFastWithExitCode, StringObject* refMessageUNSAFE, UINT exitCode);
static FCDECL2(VOID, FailFastWithException, StringObject* refMessageUNSAFE, ExceptionObject* refExceptionUNSAFE);
static FCDECL3(VOID, FailFastWithExceptionAndSource, StringObject* refMessageUNSAFE, ExceptionObject* refExceptionUNSAFE, StringObject* errorSourceUNSAFE);

Expand All @@ -55,7 +54,7 @@ class SystemNative

private:
// Common processing code for FailFast
static void GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExceptionForWatsonBucketing, UINT_PTR retAddress, UINT exitCode, STRINGREF errorSource);
static void GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExceptionForWatsonBucketing, UINT_PTR retAddress, STRINGREF errorSource);
};

extern "C" void QCALLTYPE Environment_Exit(INT32 exitcode);
Expand Down

0 comments on commit 881f72b

Please sign in to comment.