From 65053424c296f1fecb4c293276771accfe838e62 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 24 Feb 2017 22:47:31 +0100 Subject: [PATCH] Remove NakedThrowHelper and ifdef-out its callers (#9771) This change removes NakedThrowHelper function for Unix since it was not used. It also ifdefs out its upstream callers. --- src/vm/amd64/unixstubs.cpp | 5 ----- src/vm/arm/ehhelpers.S | 21 --------------------- src/vm/arm64/asmhelpers.S | 21 --------------------- src/vm/excep.cpp | 24 +++++++++++++++--------- 4 files changed, 15 insertions(+), 56 deletions(-) diff --git a/src/vm/amd64/unixstubs.cpp b/src/vm/amd64/unixstubs.cpp index e7f4957..eba5cc2 100644 --- a/src/vm/amd64/unixstubs.cpp +++ b/src/vm/amd64/unixstubs.cpp @@ -11,11 +11,6 @@ extern "C" PORTABILITY_ASSERT("Implement for PAL"); } - void NakedThrowHelper() - { - PORTABILITY_ASSERT("Implement for PAL"); - } - void PInvokeStubForHost() { PORTABILITY_ASSERT("Implement for PAL"); diff --git a/src/vm/arm/ehhelpers.S b/src/vm/arm/ehhelpers.S index 1c8b5c0..27f246c 100644 --- a/src/vm/arm/ehhelpers.S +++ b/src/vm/arm/ehhelpers.S @@ -75,27 +75,6 @@ OFFSET_OF_FRAME=(4 + SIZEOF__GSCookie) .endm // ------------------------------------------------------------------ -// -// Helpers for async (NullRef, AccessViolation) exceptions -// - - NESTED_ENTRY NakedThrowHelper2,_TEXT,UnhandledExceptionHandlerUnix - push {r0, lr} - - // On entry: - // - // R0 = Address of FaultingExceptionFrame - bl C_FUNC(LinkFrameAndThrow) - - // Target should not return. - EMIT_BREAKPOINT - - NESTED_END NakedThrowHelper2, _TEXT - - - GenerateRedirectedStubWithFrame NakedThrowHelper, NakedThrowHelper2 - -// ------------------------------------------------------------------ // This helper enables us to call into a funclet after applying the non-volatiles NESTED_ENTRY CallEHFunclet, _TEXT, NoHandler diff --git a/src/vm/arm64/asmhelpers.S b/src/vm/arm64/asmhelpers.S index 64ec153..b318ad9 100644 --- a/src/vm/arm64/asmhelpers.S +++ b/src/vm/arm64/asmhelpers.S @@ -1012,27 +1012,6 @@ NESTED_END CallEHFilterFunclet, _TEXT // ------------------------------------------------------------------ -// -// Helpers for async (NullRef, AccessViolation) exceptions -// - -NESTED_ENTRY NakedThrowHelper2, _TEXT ,UnhandledExceptionHandlerUnix - PROLOG_SAVE_REG_PAIR_INDEXED fp,lr, -16 - - // On entry: - // - // X0 = Address of FaultingExceptionFrame - bl C_FUNC(LinkFrameAndThrow) - - // Target should not return. - EMIT_BREAKPOINT - -NESTED_END NakedThrowHelper2, _TEXT - - -GenerateRedirectedStubWithFrame NakedThrowHelper, NakedThrowHelper2 - -// ------------------------------------------------------------------ // ResolveWorkerChainLookupAsmStub // // This method will perform a quick chained lookup of the entry if the diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp index 6c42739..630d3f5 100644 --- a/src/vm/excep.cpp +++ b/src/vm/excep.cpp @@ -6969,6 +6969,8 @@ bool IsGcMarker(DWORD exceptionCode, CONTEXT *pContext) return false; } +#ifndef FEATURE_PAL + // Return true if the access violation is well formed (has two info parameters // at the end) static inline BOOL @@ -7040,6 +7042,8 @@ IsDebuggerFault(EXCEPTION_RECORD *pExceptionRecord, return false; } +#endif // FEATURE_PAL + #ifdef WIN64EXCEPTIONS #ifndef _TARGET_X86_ @@ -7188,6 +7192,8 @@ AdjustContextForWriteBarrier( #endif // ELSE } +#if defined(USE_FEF) && !defined(FEATURE_PAL) + struct SavedExceptionInfo { EXCEPTION_RECORD m_ExceptionRecord; @@ -7242,9 +7248,6 @@ struct SavedExceptionInfo } }; - -#if defined(USE_FEF) - SavedExceptionInfo g_SavedExceptionInfo; // Globals are guaranteed zero-init; void InitSavedExceptionInfo() @@ -7322,13 +7325,13 @@ void HandleManagedFault(EXCEPTION_RECORD* pExceptionRecord, SetIP(pContext, GetEEFuncEntryPoint(NakedThrowHelper)); } -#else // USE_FEF +#else // USE_FEF && !FEATURE_PAL void InitSavedExceptionInfo() { } -#endif // USE_FEF +#endif // USE_FEF && !FEATURE_PAL // // Init a new frame @@ -7442,6 +7445,8 @@ bool ShouldHandleManagedFault( return true; } +#ifndef FEATURE_PAL + LONG WINAPI CLRVectoredExceptionHandlerPhase2(PEXCEPTION_POINTERS pExceptionInfo); enum VEH_ACTION @@ -7877,7 +7882,6 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti // Remember the EIP for stress debugging purposes. g_LastAccessViolationEIP = (void*) ::GetIP(pContext); -#ifndef FEATURE_PAL // Note: we have a holder, called AVInRuntimeImplOkayHolder, that tells us that its okay to have an // AV in the Runtime's implementation in certain places. So, if its okay to have an AV at this // time, then skip the check for whether or not the AV is in our impl. @@ -7941,7 +7945,6 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti EEPOLICY_HANDLE_FATAL_ERROR_USING_EXCEPTION_INFO(COR_E_EXECUTIONENGINE, pExceptionInfo); } } -#endif // !FEATURE_PAL } } else if (exceptionCode == BOOTUP_EXCEPTION_COMPLUS) @@ -7953,6 +7956,8 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti return VEH_NO_ACTION; } +#endif // !FEATURE_PAL + BOOL IsIPInEE(void *ip) { WRAPPER_NO_CONTRACT; @@ -8161,6 +8166,8 @@ public: #endif // defined(_TARGET_X86_) +#ifndef FEATURE_PAL + LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) { // @@ -8308,7 +8315,6 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) } #ifdef _DEBUG -#ifndef FEATURE_PAL #ifndef WIN64EXCEPTIONS { CantAllocHolder caHolder; @@ -8373,7 +8379,6 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) } } } -#endif // !FEATURE_PAL #endif // _DEBUG #ifndef WIN64EXCEPTIONS @@ -8390,6 +8395,7 @@ LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo) return result; } +#endif // !FEATURE_PAL // Contains the handle to the registered VEH static PVOID g_hVectoredExceptionHandler = NULL; -- 2.7.4