From 30b34e6d7b475c1de91623d3589723181a260523 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 1 Aug 2024 19:33:04 -0700 Subject: [PATCH] Convert exception throwing JIT helpers to managed code. (#105671) * Change JIT helper definition macro to encode BinderMethodID. Remove CorInfoHelpSig and replace with BinderMethodID in macros. Convert start up loading of managed JIT helpers to lazy model. * Remove the early start-up registration of managed JIT helpers. * Narrowly permit type loading in SPCL during eager fixup for R2R images. --- .../System.Private.CoreLib.csproj | 1 + .../src/System/ThrowHelper.cs | 38 ++ src/coreclr/debug/daccess/daccess.cpp | 4 +- .../debug/daccess/dacdbiimplstackwalk.cpp | 6 +- src/coreclr/inc/corinfo.h | 20 - src/coreclr/inc/jithelpers.h | 470 +++++++++--------- src/coreclr/jit/eeinterface.cpp | 4 +- .../superpmi/superpmi-shared/callutils.cpp | 4 +- src/coreclr/vm/appdomain.cpp | 1 - src/coreclr/vm/ceeload.cpp | 15 +- src/coreclr/vm/comutilnative.cpp | 28 ++ src/coreclr/vm/comutilnative.h | 10 + src/coreclr/vm/corelib.h | 14 + src/coreclr/vm/ecall.cpp | 92 ---- src/coreclr/vm/ecall.h | 2 - src/coreclr/vm/jithelpers.cpp | 308 +++--------- src/coreclr/vm/jitinterface.cpp | 45 +- src/coreclr/vm/jitinterface.h | 6 +- src/coreclr/vm/metasig.h | 1 + src/coreclr/vm/methodtable.cpp | 36 +- src/coreclr/vm/methodtable.h | 10 + src/coreclr/vm/qcallentrypoints.cpp | 2 + .../src/System/ThrowHelper.cs | 34 +- 23 files changed, 500 insertions(+), 651 deletions(-) create mode 100644 src/coreclr/System.Private.CoreLib/src/System/ThrowHelper.cs diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index 10c6bde0b25be..115e29762b420 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -231,6 +231,7 @@ + diff --git a/src/coreclr/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/coreclr/System.Private.CoreLib/src/System/ThrowHelper.cs new file mode 100644 index 0000000000000..254cc0df8a270 --- /dev/null +++ b/src/coreclr/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace System +{ + internal static unsafe partial class ThrowHelper + { + [DoesNotReturn] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowAmbiguousResolutionException")] + private static partial void ThrowAmbiguousResolutionException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); + + [DoesNotReturn] + internal static void ThrowAmbiguousResolutionException( + void* method, // MethodDesc* + void* interfaceType, // MethodTable* + void* targetType) // MethodTable* + { + ThrowAmbiguousResolutionException((MethodTable*)targetType, (MethodTable*)interfaceType, method); + } + + [DoesNotReturn] + [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowEntryPointNotFoundException")] + private static partial void ThrowEntryPointNotFoundException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); + + [DoesNotReturn] + internal static void ThrowEntryPointNotFoundException( + void* method, // MethodDesc* + void* interfaceType, // MethodTable* + void* targetType) // MethodTable* + { + ThrowEntryPointNotFoundException((MethodTable*)targetType, (MethodTable*)interfaceType, method); + } + } +} diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index 5e74d592ac83c..bd6a30f77b613 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -5656,8 +5656,8 @@ ClrDataAccess::GetJitHelperName( // Check if its a dynamically generated JIT helper const static CorInfoHelpFunc s_rgDynamicHCallIds[] = { -#define DYNAMICJITHELPER(code, fn, sig) code, -#define JITHELPER(code, fn,sig) +#define DYNAMICJITHELPER(code, fn, binderId) code, +#define JITHELPER(code, fn, binderId) #include }; diff --git a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp index 4ccaa7a5fa769..3f60dec6a9b1a 100644 --- a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp +++ b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp @@ -882,15 +882,15 @@ void DacDbiInterfaceImpl::InitFrameData(StackFrameIterator * pIter, pJITFuncData->nativeOffset = pCF->GetRelOffset(); // Here we detect (and set the appropriate flag) if the nativeOffset in the current frame points to the return address of IL_Throw() - // (or other exception related JIT helpers like IL_Throw, IL_Rethrow, JIT_RngChkFail, IL_VerificationError, JIT_Overflow etc). - // Since return addres point to the next(!) instruction after [call IL_Throw] this sometimes can lead to incorrect exception stacktraces + // (or other exception related JIT helpers like IL_Throw, IL_Rethrow etc). + // Since return address point to the next(!) instruction after [call IL_Throw] this sometimes can lead to incorrect exception stacktraces // where a next source line is spotted as an exception origin. This happens when the next instruction after [call IL_Throw] belongs to // a sequence point and a source line different from a sequence point and a source line of [call IL_Throw]. // Later on this flag is used in order to adjust nativeOffset and make ICorDebugILFrame::GetIP return IL offset within // the same sequence point as an actual IL throw instruction. // Here is how we detect it: - // We can assume that nativeOffset points to an the instruction after [call IL_Throw] when these conditioins are met: + // We can assume that nativeOffset points to an the instruction after [call IL_Throw] when these conditions are met: // 1. pCF->IsInterrupted() - Exception has been thrown by this managed frame (frame attr FRAME_ATTR_EXCEPTION) // 2. !pCF->HasFaulted() - It wasn't a "hardware" exception (Access violation, dev by 0, etc.) // 3. !pCF->IsIPadjusted() - It hasn't been previously adjusted to point to [call IL_Throw] diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index acc2707856e11..9ae9489e18e5b 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -604,26 +604,6 @@ enum CorInfoHelpFunc CORINFO_HELP_COUNT, }; -//This describes the signature for a helper method. -enum CorInfoHelpSig -{ - CORINFO_HELP_SIG_UNDEF, - CORINFO_HELP_SIG_NO_ALIGN_STUB, - CORINFO_HELP_SIG_NO_UNWIND_STUB, - CORINFO_HELP_SIG_REG_ONLY, - CORINFO_HELP_SIG_4_STACK, - CORINFO_HELP_SIG_8_STACK, - CORINFO_HELP_SIG_12_STACK, - CORINFO_HELP_SIG_16_STACK, - - CORINFO_HELP_SIG_EBPCALL, //special calling convention that uses EDX and - //EBP as arguments - - CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB, - - CORINFO_HELP_SIG_COUNT -}; - // The enumeration is returned in 'getSig','getType', getArgType methods enum CorInfoType { diff --git a/src/coreclr/inc/jithelpers.h b/src/coreclr/inc/jithelpers.h index b6167217a60b1..4401a38098921 100644 --- a/src/coreclr/inc/jithelpers.h +++ b/src/coreclr/inc/jithelpers.h @@ -20,321 +20,325 @@ #ifndef DYNAMICJITHELPER //I should never try to generate an alignment stub for a dynamic helper -#define DYNAMICJITHELPER(code,fn,sig) JITHELPER(code,fn,sig) +#define DYNAMICJITHELPER(code,fn,binderId) JITHELPER(code,fn,binderId) #endif - // pfnHelper is set to NULL if it is a stubbed helper. // It will be set in InitJITHelpers2 - JITHELPER(CORINFO_HELP_UNDEF, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_UNDEF, NULL, METHOD__NIL) // Arithmetic - JITHELPER(CORINFO_HELP_DIV, JIT_Div, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_MOD, JIT_Mod, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_UDIV, JIT_UDiv, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_UMOD, JIT_UMod, CORINFO_HELP_SIG_8_STACK) + JITHELPER(CORINFO_HELP_DIV, JIT_Div, METHOD__NIL) + JITHELPER(CORINFO_HELP_MOD, JIT_Mod, METHOD__NIL) + JITHELPER(CORINFO_HELP_UDIV, JIT_UDiv, METHOD__NIL) + JITHELPER(CORINFO_HELP_UMOD, JIT_UMod, METHOD__NIL) // CORINFO_HELP_DBL2INT, CORINFO_HELP_DBL2UINT, and CORINFO_HELP_DBL2LONG get // patched for CPUs that support SSE2 (P4 and above). #ifndef TARGET_64BIT - JITHELPER(CORINFO_HELP_LLSH, JIT_LLsh, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_LRSH, JIT_LRsh, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_LRSZ, JIT_LRsz, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_LLSH, JIT_LLsh, METHOD__NIL) + JITHELPER(CORINFO_HELP_LRSH, JIT_LRsh, METHOD__NIL) + JITHELPER(CORINFO_HELP_LRSZ, JIT_LRsz, METHOD__NIL) #else // !TARGET_64BIT - JITHELPER(CORINFO_HELP_LLSH, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_LRSH, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_LRSZ, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_LLSH, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_LRSH, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_LRSZ, NULL, METHOD__NIL) +#endif // TARGET_64BIT + JITHELPER(CORINFO_HELP_LMUL, JIT_LMul, METHOD__NIL) +#ifndef TARGET_64BIT + DYNAMICJITHELPER(CORINFO_HELP_LMUL_OVF, NULL, METHOD__MATH__MULTIPLY_CHECKED_INT64) + DYNAMICJITHELPER(CORINFO_HELP_ULMUL_OVF, NULL, METHOD__MATH__MULTIPLY_CHECKED_UINT64) +#else + DYNAMICJITHELPER(CORINFO_HELP_LMUL_OVF, NULL, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ULMUL_OVF, NULL, METHOD__NIL) #endif // TARGET_64BIT - JITHELPER(CORINFO_HELP_LMUL, JIT_LMul, CORINFO_HELP_SIG_16_STACK) - DYNAMICJITHELPER(CORINFO_HELP_LMUL_OVF, NULL, CORINFO_HELP_SIG_16_STACK) - DYNAMICJITHELPER(CORINFO_HELP_ULMUL_OVF, NULL, CORINFO_HELP_SIG_16_STACK) - JITHELPER(CORINFO_HELP_LDIV, JIT_LDiv, CORINFO_HELP_SIG_16_STACK) - JITHELPER(CORINFO_HELP_LMOD, JIT_LMod, CORINFO_HELP_SIG_16_STACK) - JITHELPER(CORINFO_HELP_ULDIV, JIT_ULDiv, CORINFO_HELP_SIG_16_STACK) - JITHELPER(CORINFO_HELP_ULMOD, JIT_ULMod, CORINFO_HELP_SIG_16_STACK) - JITHELPER(CORINFO_HELP_LNG2DBL, JIT_Lng2Dbl, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_ULNG2DBL, JIT_ULng2Dbl, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_DBL2INT, JIT_Dbl2Int, CORINFO_HELP_SIG_8_STACK) - DYNAMICJITHELPER(CORINFO_HELP_DBL2INT_OVF, NULL, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_DBL2LNG, JIT_Dbl2Lng, CORINFO_HELP_SIG_8_STACK) - DYNAMICJITHELPER(CORINFO_HELP_DBL2LNG_OVF, NULL, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_DBL2UINT, JIT_Dbl2UInt, CORINFO_HELP_SIG_8_STACK) - DYNAMICJITHELPER(CORINFO_HELP_DBL2UINT_OVF, NULL, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_DBL2ULNG, JIT_Dbl2ULng, CORINFO_HELP_SIG_8_STACK) - DYNAMICJITHELPER(CORINFO_HELP_DBL2ULNG_OVF, NULL, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_FLTREM, JIT_FltRem, CORINFO_HELP_SIG_8_STACK) - JITHELPER(CORINFO_HELP_DBLREM, JIT_DblRem, CORINFO_HELP_SIG_16_STACK) + JITHELPER(CORINFO_HELP_LDIV, JIT_LDiv, METHOD__NIL) + JITHELPER(CORINFO_HELP_LMOD, JIT_LMod, METHOD__NIL) + JITHELPER(CORINFO_HELP_ULDIV, JIT_ULDiv, METHOD__NIL) + JITHELPER(CORINFO_HELP_ULMOD, JIT_ULMod, METHOD__NIL) + JITHELPER(CORINFO_HELP_LNG2DBL, JIT_Lng2Dbl, METHOD__NIL) + JITHELPER(CORINFO_HELP_ULNG2DBL, JIT_ULng2Dbl, METHOD__NIL) + JITHELPER(CORINFO_HELP_DBL2INT, JIT_Dbl2Int, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_DBL2INT_OVF, NULL, METHOD__MATH__CONVERT_TO_INT32_CHECKED) + JITHELPER(CORINFO_HELP_DBL2LNG, JIT_Dbl2Lng, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_DBL2LNG_OVF, NULL, METHOD__MATH__CONVERT_TO_INT64_CHECKED) + JITHELPER(CORINFO_HELP_DBL2UINT, JIT_Dbl2UInt, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_DBL2UINT_OVF, NULL, METHOD__MATH__CONVERT_TO_UINT32_CHECKED) + JITHELPER(CORINFO_HELP_DBL2ULNG, JIT_Dbl2ULng, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_DBL2ULNG_OVF, NULL, METHOD__MATH__CONVERT_TO_UINT64_CHECKED) + JITHELPER(CORINFO_HELP_FLTREM, JIT_FltRem, METHOD__NIL) + JITHELPER(CORINFO_HELP_DBLREM, JIT_DblRem, METHOD__NIL) // Allocating a new object - JITHELPER(CORINFO_HELP_NEWFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEWFAST_MAYBEFROZEN, JIT_NewMaybeFrozen,CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEWSFAST_FINALIZE, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8, JIT_New, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_VC, NULL, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, NULL, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEW_MDARR, JIT_NewMDArr,CORINFO_HELP_SIG_4_STACK) - JITHELPER(CORINFO_HELP_NEW_MDARR_RARE, JIT_NewMDArr,CORINFO_HELP_SIG_4_STACK) - JITHELPER(CORINFO_HELP_NEWARR_1_DIRECT, JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NEWARR_1_MAYBEFROZEN, JIT_NewArr1MaybeFrozen,CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_OBJ, JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_VC, JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_ALIGN8, JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY) - - JITHELPER(CORINFO_HELP_STRCNS, JIT_StrCns, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_NEWFAST, JIT_New, METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWFAST_MAYBEFROZEN, JIT_NewMaybeFrozen,METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST, JIT_New, METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWSFAST_FINALIZE, NULL, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8, JIT_New, METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_VC, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_NEW_MDARR, JIT_NewMDArr,METHOD__NIL) + JITHELPER(CORINFO_HELP_NEW_MDARR_RARE, JIT_NewMDArr,METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWARR_1_DIRECT, JIT_NewArr1,METHOD__NIL) + JITHELPER(CORINFO_HELP_NEWARR_1_MAYBEFROZEN, JIT_NewArr1MaybeFrozen,METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_OBJ, JIT_NewArr1,METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_VC, JIT_NewArr1,METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_ALIGN8, JIT_NewArr1,METHOD__NIL) + + JITHELPER(CORINFO_HELP_STRCNS, JIT_StrCns, METHOD__NIL) // Object model - JITHELPER(CORINFO_HELP_INITCLASS, JIT_InitClass, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_INITINSTCLASS, JIT_InitInstantiatedClass, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_INITCLASS, JIT_InitClass, METHOD__NIL) + JITHELPER(CORINFO_HELP_INITINSTCLASS, JIT_InitInstantiatedClass, METHOD__NIL) // Casting helpers - DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFINTERFACE, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFARRAY, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFCLASS, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFANY, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_CHKCASTINTERFACE, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_CHKCASTARRAY, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_CHKCASTANY, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS_SPECIAL, NULL, CORINFO_HELP_SIG_REG_ONLY) - - JITHELPER(CORINFO_HELP_ISINSTANCEOF_EXCEPTION, JIT_IsInstanceOfException, CORINFO_HELP_SIG_REG_ONLY) - - DYNAMICJITHELPER(CORINFO_HELP_BOX, JIT_Box, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_BOX_NULLABLE, JIT_Box, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_UNBOX, NULL, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_UNBOX_TYPETEST, JIT_Unbox_TypeTest, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_UNBOX_NULLABLE, JIT_Unbox_Nullable, CORINFO_HELP_SIG_4_STACK) - - JITHELPER(CORINFO_HELP_GETREFANY, JIT_GetRefAny, CORINFO_HELP_SIG_8_STACK) - DYNAMICJITHELPER(CORINFO_HELP_ARRADDR_ST, NULL, CORINFO_HELP_SIG_4_STACK) - DYNAMICJITHELPER(CORINFO_HELP_LDELEMA_REF, NULL, CORINFO_HELP_SIG_4_STACK) + DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFINTERFACE, NULL, METHOD__CASTHELPERS__ISINSTANCEOFINTERFACE) + DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFARRAY, NULL, METHOD__CASTHELPERS__ISINSTANCEOFANY) // array cast uses the "ANY" helper + DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFCLASS, NULL, METHOD__CASTHELPERS__ISINSTANCEOFCLASS) + DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFANY, NULL, METHOD__CASTHELPERS__ISINSTANCEOFANY) + DYNAMICJITHELPER(CORINFO_HELP_CHKCASTINTERFACE, NULL, METHOD__CASTHELPERS__CHKCASTINTERFACE) + DYNAMICJITHELPER(CORINFO_HELP_CHKCASTARRAY, NULL, METHOD__CASTHELPERS__CHKCASTANY) // array cast uses the "ANY" helper + DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS, NULL, METHOD__CASTHELPERS__CHKCASTCLASS) + DYNAMICJITHELPER(CORINFO_HELP_CHKCASTANY, NULL, METHOD__CASTHELPERS__CHKCASTANY) + DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS_SPECIAL, NULL, METHOD__CASTHELPERS__CHKCASTCLASSSPECIAL) + + JITHELPER(CORINFO_HELP_ISINSTANCEOF_EXCEPTION, JIT_IsInstanceOfException, METHOD__NIL) + + DYNAMICJITHELPER(CORINFO_HELP_BOX, JIT_Box, METHOD__NIL) + JITHELPER(CORINFO_HELP_BOX_NULLABLE, JIT_Box, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_UNBOX, NULL, METHOD__CASTHELPERS__UNBOX) + JITHELPER(CORINFO_HELP_UNBOX_TYPETEST, JIT_Unbox_TypeTest, METHOD__NIL) + JITHELPER(CORINFO_HELP_UNBOX_NULLABLE, JIT_Unbox_Nullable, METHOD__NIL) + + JITHELPER(CORINFO_HELP_GETREFANY, JIT_GetRefAny, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ARRADDR_ST, NULL, METHOD__CASTHELPERS__STELEMREF) + DYNAMICJITHELPER(CORINFO_HELP_LDELEMA_REF, NULL, METHOD__CASTHELPERS__LDELEMAREF) // Exceptions - DYNAMICJITHELPER(CORINFO_HELP_THROW, IL_Throw, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_RETHROW, IL_Rethrow, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_USER_BREAKPOINT, JIT_UserBreakpoint, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_RNGCHKFAIL, JIT_RngChkFail, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_OVERFLOW, JIT_Overflow, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROWDIVZERO, JIT_ThrowDivZero, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROWNULLREF, JIT_ThrowNullRef, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_VERIFICATION, IL_VerificationError,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_FAIL_FAST, JIT_FailFast, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_METHOD_ACCESS_EXCEPTION,JIT_ThrowMethodAccessException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_FIELD_ACCESS_EXCEPTION,JIT_ThrowFieldAccessException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_CLASS_ACCESS_EXCEPTION,JIT_ThrowClassAccessException, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_THROW, IL_Throw, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_RETHROW, IL_Rethrow, METHOD__NIL) + JITHELPER(CORINFO_HELP_USER_BREAKPOINT, JIT_UserBreakpoint, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_RNGCHKFAIL, NULL, METHOD__THROWHELPER__THROWINDEXOUTOFRANGEEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_OVERFLOW, NULL, METHOD__THROWHELPER__THROWOVERFLOWEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROWDIVZERO, NULL, METHOD__THROWHELPER__THROWDIVIDEBYZEROEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROWNULLREF, NULL, METHOD__THROWHELPER__THROWNULLREFEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_VERIFICATION, NULL, METHOD__THROWHELPER__THROWVERIFICATIONEXCEPTION) + JITHELPER(CORINFO_HELP_FAIL_FAST, JIT_FailFast, METHOD__NIL) + JITHELPER(CORINFO_HELP_METHOD_ACCESS_EXCEPTION,JIT_ThrowMethodAccessException, METHOD__NIL) + JITHELPER(CORINFO_HELP_FIELD_ACCESS_EXCEPTION,JIT_ThrowFieldAccessException, METHOD__NIL) + JITHELPER(CORINFO_HELP_CLASS_ACCESS_EXCEPTION,JIT_ThrowClassAccessException, METHOD__NIL) #ifdef FEATURE_EH_FUNCLETS - JITHELPER(CORINFO_HELP_ENDCATCH, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_ENDCATCH, NULL, METHOD__NIL) #else - JITHELPER(CORINFO_HELP_ENDCATCH, JIT_EndCatch, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_ENDCATCH, JIT_EndCatch, METHOD__NIL) #endif - JITHELPER(CORINFO_HELP_MON_ENTER, JIT_MonEnterWorker, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_MON_EXIT, JIT_MonExitWorker, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_MON_ENTER_STATIC, JIT_MonEnterStatic,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_MON_EXIT_STATIC, JIT_MonExitStatic,CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_MON_ENTER, JIT_MonEnterWorker, METHOD__NIL) + JITHELPER(CORINFO_HELP_MON_EXIT, JIT_MonExitWorker, METHOD__NIL) + JITHELPER(CORINFO_HELP_MON_ENTER_STATIC, JIT_MonEnterStatic,METHOD__NIL) + JITHELPER(CORINFO_HELP_MON_EXIT_STATIC, JIT_MonExitStatic,METHOD__NIL) - JITHELPER(CORINFO_HELP_GETCLASSFROMMETHODPARAM, JIT_GetClassFromMethodParam, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETSYNCFROMCLASSHANDLE, JIT_GetSyncFromClassHandle, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_GETCLASSFROMMETHODPARAM, JIT_GetClassFromMethodParam, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETSYNCFROMCLASSHANDLE, JIT_GetSyncFromClassHandle, METHOD__NIL) // GC support - DYNAMICJITHELPER(CORINFO_HELP_STOP_FOR_GC, JIT_RareDisableHelper, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_POLL_GC, JIT_PollGC, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_STRESS_GC, JIT_StressGC, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_STOP_FOR_GC, JIT_RareDisableHelper, METHOD__NIL) + JITHELPER(CORINFO_HELP_POLL_GC, JIT_PollGC, METHOD__NIL) + JITHELPER(CORINFO_HELP_STRESS_GC, JIT_StressGC, METHOD__NIL) - JITHELPER(CORINFO_HELP_CHECK_OBJ, JIT_CheckObj, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_CHECK_OBJ, JIT_CheckObj, METHOD__NIL) // GC Write barrier support - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF, JIT_WriteBarrier, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF, JIT_CheckedWriteBarrier,CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP, JIT_WriteBarrierEnsureNonHeapTarget,CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF, JIT_WriteBarrier, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF, JIT_CheckedWriteBarrier,METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP, JIT_WriteBarrierEnsureNonHeapTarget,METHOD__NIL) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_BYREF, JIT_ByRefWriteBarrier,CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_BULK_WRITEBARRIER, NULL, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_BYREF, JIT_ByRefWriteBarrier,METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_BULK_WRITEBARRIER, NULL, METHOD__BUFFER__MEMCOPYGC) // Accessing fields - JITHELPER(CORINFO_HELP_GETFIELDADDR, JIT_GetFieldAddr,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR, JIT_GetStaticFieldAddr,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - - JITHELPER(CORINFO_HELP_GET_GCSTATIC_BASE, JIT_GetGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GET_NONGCSTATIC_BASE, JIT_GetNonGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETDYNAMIC_GCSTATIC_BASE, JIT_GetDynamicGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCSTATIC_BASE, JIT_GetDynamicNonGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETPINNED_GCSTATIC_BASE, JIT_GetDynamicGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETPINNED_NONGCSTATIC_BASE, JIT_GetDynamicNonGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GET_GCSTATIC_BASE_NOCTOR, JIT_GetGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GET_NONGCSTATIC_BASE_NOCTOR, JIT_GetNonGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETDYNAMIC_GCSTATIC_BASE_NOCTOR, JIT_GetDynamicGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETPINNED_GCSTATIC_BASE_NOCTOR, JIT_GetDynamicGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) - JITHELPER(CORINFO_HELP_GETPINNED_NONGCSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_GETFIELDADDR, JIT_GetFieldAddr,METHOD__NIL) + JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR, JIT_GetStaticFieldAddr,METHOD__NIL) + JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS, NULL, METHOD__NIL) + + JITHELPER(CORINFO_HELP_GET_GCSTATIC_BASE, JIT_GetGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_NONGCSTATIC_BASE, JIT_GetNonGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_GCSTATIC_BASE, JIT_GetDynamicGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCSTATIC_BASE, JIT_GetDynamicNonGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETPINNED_GCSTATIC_BASE, JIT_GetDynamicGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETPINNED_NONGCSTATIC_BASE, JIT_GetDynamicNonGCStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_GCSTATIC_BASE_NOCTOR, JIT_GetGCStaticBaseNoCtor, METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_NONGCSTATIC_BASE_NOCTOR, JIT_GetNonGCStaticBaseNoCtor, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_GCSTATIC_BASE_NOCTOR, JIT_GetDynamicGCStaticBaseNoCtor, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCStaticBaseNoCtor, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETPINNED_GCSTATIC_BASE_NOCTOR, JIT_GetDynamicGCStaticBaseNoCtor, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETPINNED_NONGCSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCStaticBaseNoCtor, METHOD__NIL) // Thread statics - JITHELPER(CORINFO_HELP_GET_GCTHREADSTATIC_BASE, JIT_GetGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GET_NONGCTHREADSTATIC_BASE, JIT_GetNonGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE, JIT_GetDynamicGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE, JIT_GetDynamicNonGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GET_GCTHREADSTATIC_BASE_NOCTOR, JIT_GetGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GET_NONGCTHREADSTATIC_BASE_NOCTOR, JIT_GetNonGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE_NOCTOR, JIT_GetDynamicGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED,JIT_GetGCThreadStaticBaseOptimized, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED,JIT_GetNonGCThreadStaticBaseOptimized, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED2,JIT_GetNonGCThreadStaticBaseOptimized2, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_GET_GCTHREADSTATIC_BASE, JIT_GetGCThreadStaticBase,METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_NONGCTHREADSTATIC_BASE, JIT_GetNonGCThreadStaticBase,METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE, JIT_GetDynamicGCThreadStaticBase,METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE, JIT_GetDynamicNonGCThreadStaticBase,METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_GCTHREADSTATIC_BASE_NOCTOR, JIT_GetGCThreadStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GET_NONGCTHREADSTATIC_BASE_NOCTOR, JIT_GetNonGCThreadStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE_NOCTOR, JIT_GetDynamicGCThreadStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR,JIT_GetDynamicNonGCThreadStaticBase, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_GCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED,JIT_GetGCThreadStaticBaseOptimized, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED,JIT_GetNonGCThreadStaticBaseOptimized, METHOD__NIL) + JITHELPER(CORINFO_HELP_GETDYNAMIC_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED2,JIT_GetNonGCThreadStaticBaseOptimized2, METHOD__NIL) // Debugger - JITHELPER(CORINFO_HELP_DBG_IS_JUST_MY_CODE, JIT_DbgIsJustMyCode,CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_DBG_IS_JUST_MY_CODE, JIT_DbgIsJustMyCode,METHOD__NIL) /* Profiling enter/leave probe addresses */ - DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_ENTER, JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK) - DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_LEAVE, JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK) - DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_TAILCALL, JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK) + DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_ENTER, JIT_ProfilerEnterLeaveTailcallStub, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_LEAVE, JIT_ProfilerEnterLeaveTailcallStub, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_TAILCALL, JIT_ProfilerEnterLeaveTailcallStub, METHOD__NIL) // Miscellaneous - JITHELPER(CORINFO_HELP_BBT_FCN_ENTER, JIT_LogMethodEnter,CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_BBT_FCN_ENTER, JIT_LogMethodEnter,METHOD__NIL) - JITHELPER(CORINFO_HELP_PINVOKE_CALLI, GenericPInvokeCalliHelper, CORINFO_HELP_SIG_NO_ALIGN_STUB) + JITHELPER(CORINFO_HELP_PINVOKE_CALLI, GenericPInvokeCalliHelper, METHOD__NIL) #if defined(TARGET_X86) && !defined(UNIX_X86_ABI) - JITHELPER(CORINFO_HELP_TAILCALL, JIT_TailCall, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_TAILCALL, JIT_TailCall, METHOD__NIL) #else - JITHELPER(CORINFO_HELP_TAILCALL, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) + JITHELPER(CORINFO_HELP_TAILCALL, NULL, METHOD__NIL) #endif - JITHELPER(CORINFO_HELP_GETCURRENTMANAGEDTHREADID, JIT_GetCurrentManagedThreadId, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_GETCURRENTMANAGEDTHREADID, JIT_GetCurrentManagedThreadId, METHOD__NIL) #ifdef TARGET_64BIT - JITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME, JIT_InitPInvokeFrame, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME, JIT_InitPInvokeFrame, METHOD__NIL) #else - DYNAMICJITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME, NULL, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME, NULL, METHOD__NIL) #endif - DYNAMICJITHELPER(CORINFO_HELP_MEMSET, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_MEMZERO, NULL, CORINFO_HELP_SIG_REG_ONLY) - DYNAMICJITHELPER(CORINFO_HELP_MEMCPY, NULL, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_NATIVE_MEMSET, Jit_NativeMemSet, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_MEMSET, NULL, METHOD__SPAN_HELPERS__MEMSET) + DYNAMICJITHELPER(CORINFO_HELP_MEMZERO, NULL, METHOD__SPAN_HELPERS__MEMZERO) + DYNAMICJITHELPER(CORINFO_HELP_MEMCPY, NULL, METHOD__SPAN_HELPERS__MEMCOPY) + JITHELPER(CORINFO_HELP_NATIVE_MEMSET, Jit_NativeMemSet, METHOD__NIL) // Generics - JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD, JIT_GenericHandleMethod, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG,JIT_GenericHandleMethodLogging, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS, JIT_GenericHandleClass, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG, JIT_GenericHandleClassLogging, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, JIT_GetRuntimeType, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD, JIT_GetRuntimeMethodStub,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD, JIT_GetRuntimeFieldStub, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE, JIT_GetRuntimeType, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, CORINFO_HELP_SIG_REG_ONLY) - - JITHELPER(CORINFO_HELP_VIRTUAL_FUNC_PTR, JIT_VirtualFunctionPointer, CORINFO_HELP_SIG_4_STACK) - - JITHELPER(CORINFO_HELP_READYTORUN_NEW, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_NEWARR_1, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_ISINSTANCEOF, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_CHKCAST, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_GCSTATIC_BASE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_NONGCSTATIC_BASE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_THREADSTATIC_BASE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_THREADSTATIC_BASE_NOCTOR, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_NONGCTHREADSTATIC_BASE, NULL,CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_HANDLE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_DELEGATE_CTOR, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) + JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD, JIT_GenericHandleMethod, METHOD__NIL) + JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG,JIT_GenericHandleMethodLogging, METHOD__NIL) + JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS, JIT_GenericHandleClass, METHOD__NIL) + JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG, JIT_GenericHandleClassLogging, METHOD__NIL) + JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, JIT_GetRuntimeType, METHOD__NIL) + JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, METHOD__NIL) + JITHELPER(CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD, JIT_GetRuntimeMethodStub,METHOD__NIL) + JITHELPER(CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD, JIT_GetRuntimeFieldStub, METHOD__NIL) + JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE, JIT_GetRuntimeType, METHOD__NIL) + JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, METHOD__NIL) + + JITHELPER(CORINFO_HELP_VIRTUAL_FUNC_PTR, JIT_VirtualFunctionPointer, METHOD__NIL) + + JITHELPER(CORINFO_HELP_READYTORUN_NEW, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_NEWARR_1, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_ISINSTANCEOF, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_CHKCAST, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_GCSTATIC_BASE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_NONGCSTATIC_BASE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_THREADSTATIC_BASE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_THREADSTATIC_BASE_NOCTOR, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_NONGCTHREADSTATIC_BASE, NULL,METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_HANDLE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_DELEGATE_CTOR, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE, NULL, METHOD__NIL) #ifdef FEATURE_EH_FUNCLETS - DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, ProcessCLRException, CORINFO_HELP_SIG_UNDEF) - DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, ProcessCLRException,CORINFO_HELP_SIG_UNDEF) + DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, ProcessCLRException, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, ProcessCLRException,METHOD__NIL) #else // FEATURE_EH_FUNCLETS - JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, NULL, CORINFO_HELP_SIG_UNDEF) + JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, NULL, METHOD__NIL) #endif // !FEATURE_EH_FUNCLETS #ifdef TARGET_X86 - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, JIT_WriteBarrierEAX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, JIT_WriteBarrierEBX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, JIT_WriteBarrierECX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, JIT_WriteBarrierESI, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, JIT_WriteBarrierEDI, CORINFO_HELP_SIG_NO_ALIGN_STUB) - DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, JIT_WriteBarrierEBP, CORINFO_HELP_SIG_NO_ALIGN_STUB) - - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, JIT_CheckedWriteBarrierEAX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, JIT_CheckedWriteBarrierEBX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, JIT_CheckedWriteBarrierECX, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, JIT_CheckedWriteBarrierESI, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, JIT_CheckedWriteBarrierEDI, CORINFO_HELP_SIG_NO_ALIGN_STUB) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, JIT_CheckedWriteBarrierEBP, CORINFO_HELP_SIG_NO_ALIGN_STUB) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, JIT_WriteBarrierEAX, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, JIT_WriteBarrierEBX, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, JIT_WriteBarrierECX, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, JIT_WriteBarrierESI, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, JIT_WriteBarrierEDI, METHOD__NIL) + DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, JIT_WriteBarrierEBP, METHOD__NIL) + + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, JIT_CheckedWriteBarrierEAX, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, JIT_CheckedWriteBarrierEBX, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, JIT_CheckedWriteBarrierECX, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, JIT_CheckedWriteBarrierESI, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, JIT_CheckedWriteBarrierEDI, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, JIT_CheckedWriteBarrierEBP, METHOD__NIL) #else - JITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, NULL, CORINFO_HELP_SIG_UNDEF) - - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, NULL, CORINFO_HELP_SIG_UNDEF) - JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, NULL, CORINFO_HELP_SIG_UNDEF) + JITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, NULL, METHOD__NIL) + + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, NULL, METHOD__NIL) #endif - JITHELPER(CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, JIT_LoopCloneChoiceAddr, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, JIT_DebugLogLoopCloning, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, JIT_LoopCloneChoiceAddr, METHOD__NIL) + JITHELPER(CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, JIT_DebugLogLoopCloning, METHOD__NIL) - JITHELPER(CORINFO_HELP_THROW_ARGUMENTEXCEPTION, JIT_ThrowArgumentException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, JIT_ThrowArgumentOutOfRangeException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_NOT_IMPLEMENTED, JIT_ThrowNotImplementedException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, JIT_ThrowPlatformNotSupportedException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, JIT_ThrowTypeNotSupportedException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, JIT_ThrowAmbiguousResolutionException, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_THROW_ENTRYPOINT_NOT_FOUND_EXCEPTION, JIT_ThrowEntryPointNotFoundException, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_THROW_ARGUMENTEXCEPTION, NULL, METHOD__THROWHELPER__THROWARGUMENTEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, NULL, METHOD__THROWHELPER__THROWARGUMENTOUTOFRANGEEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROW_NOT_IMPLEMENTED, NULL, METHOD__THROWHELPER__THROWNOTIMPLEMENTEDEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, NULL, METHOD__THROWHELPER__THROWPLATFORMNOTSUPPORTEDEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, NULL, METHOD__THROWHELPER__THROWTYPENOTSUPPORTED) + DYNAMICJITHELPER(CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, NULL, METHOD__THROWHELPER__THROWAMBIGUOUSRESOLUTIONEXCEPTION) + DYNAMICJITHELPER(CORINFO_HELP_THROW_ENTRYPOINT_NOT_FOUND_EXCEPTION, NULL, METHOD__THROWHELPER__THROWENTRYPOINTNOTFOUNDEXCEPTION) - JITHELPER(CORINFO_HELP_JIT_PINVOKE_BEGIN, JIT_PInvokeBegin, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_JIT_PINVOKE_END, JIT_PInvokeEnd, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_JIT_PINVOKE_BEGIN, JIT_PInvokeBegin, METHOD__NIL) + JITHELPER(CORINFO_HELP_JIT_PINVOKE_END, JIT_PInvokeEnd, METHOD__NIL) - JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER, JIT_ReversePInvokeEnter, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER_TRACK_TRANSITIONS, JIT_ReversePInvokeEnterTrackTransitions, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT, JIT_ReversePInvokeExit, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT_TRACK_TRANSITIONS, JIT_ReversePInvokeExitTrackTransitions, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER, JIT_ReversePInvokeEnter, METHOD__NIL) + JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER_TRACK_TRANSITIONS, JIT_ReversePInvokeEnterTrackTransitions, METHOD__NIL) + JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT, JIT_ReversePInvokeExit, METHOD__NIL) + JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT_TRACK_TRANSITIONS, JIT_ReversePInvokeExitTrackTransitions, METHOD__NIL) - JITHELPER(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) + JITHELPER(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, NULL, METHOD__NIL) #if !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64) - JITHELPER(CORINFO_HELP_STACK_PROBE, JIT_StackProbe, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_STACK_PROBE, JIT_StackProbe, METHOD__NIL) #else - JITHELPER(CORINFO_HELP_STACK_PROBE, NULL, CORINFO_HELP_SIG_UNDEF) + JITHELPER(CORINFO_HELP_STACK_PROBE, NULL, METHOD__NIL) #endif - JITHELPER(CORINFO_HELP_PATCHPOINT, JIT_Patchpoint, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_PARTIAL_COMPILATION_PATCHPOINT, JIT_PartialCompilationPatchpoint, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_PATCHPOINT, JIT_Patchpoint, METHOD__NIL) + JITHELPER(CORINFO_HELP_PARTIAL_COMPILATION_PATCHPOINT, JIT_PartialCompilationPatchpoint, METHOD__NIL) - JITHELPER(CORINFO_HELP_CLASSPROFILE32, JIT_ClassProfile32, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_CLASSPROFILE64, JIT_ClassProfile64, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_DELEGATEPROFILE32, JIT_DelegateProfile32, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_DELEGATEPROFILE64, JIT_DelegateProfile64, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_VTABLEPROFILE32, JIT_VTableProfile32, CORINFO_HELP_SIG_4_STACK) - JITHELPER(CORINFO_HELP_VTABLEPROFILE64, JIT_VTableProfile64, CORINFO_HELP_SIG_4_STACK) - JITHELPER(CORINFO_HELP_COUNTPROFILE32, JIT_CountProfile32, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_COUNTPROFILE64, JIT_CountProfile64, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_VALUEPROFILE32, JIT_ValueProfile32, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_VALUEPROFILE64, JIT_ValueProfile64, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_CLASSPROFILE32, JIT_ClassProfile32, METHOD__NIL) + JITHELPER(CORINFO_HELP_CLASSPROFILE64, JIT_ClassProfile64, METHOD__NIL) + JITHELPER(CORINFO_HELP_DELEGATEPROFILE32, JIT_DelegateProfile32, METHOD__NIL) + JITHELPER(CORINFO_HELP_DELEGATEPROFILE64, JIT_DelegateProfile64, METHOD__NIL) + JITHELPER(CORINFO_HELP_VTABLEPROFILE32, JIT_VTableProfile32, METHOD__NIL) + JITHELPER(CORINFO_HELP_VTABLEPROFILE64, JIT_VTableProfile64, METHOD__NIL) + JITHELPER(CORINFO_HELP_COUNTPROFILE32, JIT_CountProfile32, METHOD__NIL) + JITHELPER(CORINFO_HELP_COUNTPROFILE64, JIT_CountProfile64, METHOD__NIL) + JITHELPER(CORINFO_HELP_VALUEPROFILE32, JIT_ValueProfile32, METHOD__NIL) + JITHELPER(CORINFO_HELP_VALUEPROFILE64, JIT_ValueProfile64, METHOD__NIL) #if defined(TARGET_AMD64) || defined(TARGET_ARM64) - JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, JIT_ValidateIndirectCall, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, JIT_ValidateIndirectCall, METHOD__NIL) #ifdef TARGET_AMD64 - DYNAMICJITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, CORINFO_HELP_SIG_REG_ONLY) + DYNAMICJITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, METHOD__NIL) #else - JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, METHOD__NIL) #endif #else - JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, NULL, CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, NULL, CORINFO_HELP_SIG_REG_ONLY) + JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, NULL, METHOD__NIL) + JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, NULL, METHOD__NIL) #endif #undef JITHELPER diff --git a/src/coreclr/jit/eeinterface.cpp b/src/coreclr/jit/eeinterface.cpp index a6552c2194294..fb07912ebf7d9 100644 --- a/src/coreclr/jit/eeinterface.cpp +++ b/src/coreclr/jit/eeinterface.cpp @@ -210,8 +210,8 @@ void Compiler::eePrintTypeOrJitAlias(StringPrinter* printer, CORINFO_CLASS_HANDL } static const char* s_jitHelperNames[CORINFO_HELP_COUNT] = { -#define JITHELPER(code, pfnHelper, sig) #code, -#define DYNAMICJITHELPER(code, pfnHelper, sig) #code, +#define JITHELPER(code, pfnHelper, binderId) #code, +#define DYNAMICJITHELPER(code, pfnHelper, binderId) #code, #include "jithelpers.h" }; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/callutils.cpp b/src/coreclr/tools/superpmi/superpmi-shared/callutils.cpp index 79778bf508493..c35481cff0af6 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/callutils.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/callutils.cpp @@ -14,8 +14,8 @@ // String representations of the JIT helper functions const char* kHelperName[CORINFO_HELP_COUNT] = { -#define JITHELPER(code, pfnHelper, sig) #code, -#define DYNAMICJITHELPER(code, pfnHelper, sig) #code, +#define JITHELPER(code, pfnHelper, binderId) #code, +#define DYNAMICJITHELPER(code, pfnHelper, binderId) #code, #include "jithelpers.h" }; diff --git a/src/coreclr/vm/appdomain.cpp b/src/coreclr/vm/appdomain.cpp index f7d3e6bded841..5d0e7b220aaa8 100644 --- a/src/coreclr/vm/appdomain.cpp +++ b/src/coreclr/vm/appdomain.cpp @@ -1238,7 +1238,6 @@ void SystemDomain::LoadBaseSystemClasses() // further loading of nonprimitive types may need casting support. // initialize cast cache here. CastCache::Initialize(); - ECall::PopulateManagedHelpers(); // used by IsImplicitInterfaceOfSZArray CoreLibBinder::GetClass(CLASS__IENUMERABLEGENERIC); diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index 447e585c5f42d..799d60713296b 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -3469,21 +3469,26 @@ void Module::RunEagerFixups() #ifdef _DEBUG // Loading types during eager fixup is not a tested scenario. Make bugs out of any attempts to do so in a - // debug build. Use holder to recover properly in case of exception. + // debug build. Use holder to recover properly in case of exception. We make a narrow exception for + // System.Private.CoreLib so we can lazily load JIT helpers written in managed code. class ForbidTypeLoadHolder { + BOOL _isCoreLib; public: - ForbidTypeLoadHolder() + ForbidTypeLoadHolder(BOOL isCoreLib) + : _isCoreLib{ isCoreLib } { - BEGIN_FORBID_TYPELOAD(); + if (!_isCoreLib) + BEGIN_FORBID_TYPELOAD(); } ~ForbidTypeLoadHolder() { - END_FORBID_TYPELOAD(); + if (!_isCoreLib) + END_FORBID_TYPELOAD(); } } - forbidTypeLoad; + forbidTypeLoad{ GetPEAssembly()->GetHostAssembly()->GetAssemblyName()->IsCoreLib() }; #endif // TODO: Verify that eager fixup dependency graphs can contain no cycles diff --git a/src/coreclr/vm/comutilnative.cpp b/src/coreclr/vm/comutilnative.cpp index 4f4fda16e3f18..82a855f8864a8 100644 --- a/src/coreclr/vm/comutilnative.cpp +++ b/src/coreclr/vm/comutilnative.cpp @@ -456,6 +456,34 @@ extern "C" void QCALLTYPE ExceptionNative_GetMethodFromStackTrace(QCall::ObjectH END_QCALL; } +extern "C" void QCALLTYPE ExceptionNative_ThrowAmbiguousResolutionException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + + ThrowAmbiguousResolutionException(pTargetClass, pInterfaceMT, pInterfaceMD); + + END_QCALL; +} + +extern "C" void QCALLTYPE ExceptionNative_ThrowEntryPointNotFoundException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD) +{ + QCALL_CONTRACT; + + BEGIN_QCALL; + + ThrowEntryPointNotFoundException(pTargetClass, pInterfaceMT, pInterfaceMD); + + END_QCALL; +} + extern "C" void QCALLTYPE Buffer_Clear(void *dst, size_t length) { QCALL_CONTRACT; diff --git a/src/coreclr/vm/comutilnative.h b/src/coreclr/vm/comutilnative.h index bb05ea4cb553c..3f2b3f26a932a 100644 --- a/src/coreclr/vm/comutilnative.h +++ b/src/coreclr/vm/comutilnative.h @@ -64,6 +64,16 @@ extern "C" void QCALLTYPE ExceptionNative_GetMessageFromNativeResources(Exceptio extern "C" void QCALLTYPE ExceptionNative_GetMethodFromStackTrace(QCall::ObjectHandleOnStack array, QCall::ObjectHandleOnStack retMethodInfo); +extern "C" void QCALLTYPE ExceptionNative_ThrowAmbiguousResolutionException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD); + +extern "C" void QCALLTYPE ExceptionNative_ThrowEntryPointNotFoundException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD); + // // Buffer // diff --git a/src/coreclr/vm/corelib.h b/src/coreclr/vm/corelib.h index 9de09e9da2ef5..71896c927da20 100644 --- a/src/coreclr/vm/corelib.h +++ b/src/coreclr/vm/corelib.h @@ -642,6 +642,20 @@ DEFINE_METHOD(SPAN_HELPERS, MEMSET, Fill, SM_RefByte_Byt DEFINE_METHOD(SPAN_HELPERS, MEMZERO, ClearWithoutReferences, SM_RefByte_UIntPtr_RetVoid) DEFINE_METHOD(SPAN_HELPERS, MEMCOPY, Memmove, SM_RefByte_RefByte_UIntPtr_RetVoid) +DEFINE_CLASS(THROWHELPER, System, ThrowHelper) +DEFINE_METHOD(THROWHELPER, THROWARGUMENTEXCEPTION, ThrowArgumentException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWARGUMENTOUTOFRANGEEXCEPTION, ThrowArgumentOutOfRangeException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWINDEXOUTOFRANGEEXCEPTION, ThrowIndexOutOfRangeException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWNOTIMPLEMENTEDEXCEPTION, ThrowNotImplementedException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWPLATFORMNOTSUPPORTEDEXCEPTION, ThrowPlatformNotSupportedException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWTYPENOTSUPPORTED, ThrowTypeNotSupportedException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWOVERFLOWEXCEPTION, ThrowOverflowException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWDIVIDEBYZEROEXCEPTION, ThrowDivideByZeroException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWNULLREFEXCEPTION, ThrowNullReferenceException, SM_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWVERIFICATIONEXCEPTION, ThrowVerificationException, SM_Int_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWAMBIGUOUSRESOLUTIONEXCEPTION, ThrowAmbiguousResolutionException, SM_PtrVoid_PtrVoid_PtrVoid_RetVoid) +DEFINE_METHOD(THROWHELPER, THROWENTRYPOINTNOTFOUNDEXCEPTION, ThrowEntryPointNotFoundException, SM_PtrVoid_PtrVoid_PtrVoid_RetVoid) + DEFINE_CLASS(UNSAFE, CompilerServices, Unsafe) DEFINE_METHOD(UNSAFE, AS_POINTER, AsPointer, NoSig) DEFINE_METHOD(UNSAFE, BYREF_IS_NULL, IsNullRef, NoSig) diff --git a/src/coreclr/vm/ecall.cpp b/src/coreclr/vm/ecall.cpp index e5023b2f72d2b..99bbdeb397284 100644 --- a/src/coreclr/vm/ecall.cpp +++ b/src/coreclr/vm/ecall.cpp @@ -96,98 +96,6 @@ void ECall::PopulateManagedStringConstructors() INDEBUG(fInitialized = true); } -void ECall::PopulateManagedHelpers() -{ - - STANDARD_VM_CONTRACT; - - MethodDesc* pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFANY)); - PCODE pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFANY, pDest); - // array cast uses the "ANY" helper - SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFARRAY, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFINTERFACE)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFINTERFACE, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFCLASS)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFCLASS, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTANY)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_CHKCASTANY, pDest); - // array cast uses the "ANY" helper - SetJitHelperFunction(CORINFO_HELP_CHKCASTARRAY, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTINTERFACE)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_CHKCASTINTERFACE, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASS)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_CHKCASTCLASS, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASSSPECIAL)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_CHKCASTCLASS_SPECIAL, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__UNBOX)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_UNBOX, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__STELEMREF)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_ARRADDR_ST, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__LDELEMAREF)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_LDELEMA_REF, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__SPAN_HELPERS__MEMSET)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_MEMSET, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__SPAN_HELPERS__MEMZERO)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_MEMZERO, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__SPAN_HELPERS__MEMCOPY)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_MEMCPY, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__BUFFER__MEMCOPYGC)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_BULK_WRITEBARRIER, pDest); - -#ifndef TARGET_64BIT - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__MULTIPLY_CHECKED_INT64)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_LMUL_OVF, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__MULTIPLY_CHECKED_UINT64)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_ULMUL_OVF, pDest); -#endif - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__CONVERT_TO_INT32_CHECKED)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_DBL2INT_OVF, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__CONVERT_TO_UINT32_CHECKED)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_DBL2UINT_OVF, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__CONVERT_TO_INT64_CHECKED)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_DBL2LNG_OVF, pDest); - - pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__MATH__CONVERT_TO_UINT64_CHECKED)); - pDest = pMD->GetMultiCallableAddrOfCode(); - SetJitHelperFunction(CORINFO_HELP_DBL2ULNG_OVF, pDest); -} - static CrstStatic gFCallLock; // This variable is used to force the compiler not to tailcall a function. diff --git a/src/coreclr/vm/ecall.h b/src/coreclr/vm/ecall.h index 792eea633e8f7..f5c8df1b33f99 100644 --- a/src/coreclr/vm/ecall.h +++ b/src/coreclr/vm/ecall.h @@ -94,8 +94,6 @@ class ECall static void PopulateManagedStringConstructors(); - static void PopulateManagedHelpers(); - #ifdef DACCESS_COMPILE // Enumerates all gFCallMethods for minidumps. static void EnumFCallMethods(); diff --git a/src/coreclr/vm/jithelpers.cpp b/src/coreclr/vm/jithelpers.cpp index 689749c616660..b365309257dbc 100644 --- a/src/coreclr/vm/jithelpers.cpp +++ b/src/coreclr/vm/jithelpers.cpp @@ -3183,243 +3183,6 @@ HCIMPL0(void, IL_Rethrow) } HCIMPLEND -/*********************************************************************/ -HCIMPL0(void, JIT_RngChkFail) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kIndexOutOfRangeException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowArgumentException) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kArgumentException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowArgumentOutOfRangeException) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kArgumentOutOfRangeException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowNotImplementedException) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kNotImplementedException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowPlatformNotSupportedException) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kPlatformNotSupportedException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowTypeNotSupportedException) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kNotSupportedException, W("Arg_TypeNotSupported")); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL3(void, JIT_ThrowAmbiguousResolutionException, - MethodDesc *method, - MethodTable *interfaceType, - MethodTable *targetType) -{ - FCALL_CONTRACT; - - SString strMethodName; - SString strInterfaceName; - SString strTargetClassName; - - HELPER_METHOD_FRAME_BEGIN_0(); // Set up a frame - - TypeString::AppendMethod(strMethodName, method, method->GetMethodInstantiation()); - TypeString::AppendType(strInterfaceName, TypeHandle(interfaceType)); - TypeString::AppendType(strTargetClassName, targetType); - - HELPER_METHOD_FRAME_END(); // Set up a frame - - FCThrowExVoid( - kAmbiguousImplementationException, - IDS_CLASSLOAD_AMBIGUOUS_OVERRIDE, - strMethodName, - strInterfaceName, - strTargetClassName); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL3(void, JIT_ThrowEntryPointNotFoundException, - MethodDesc *method, - MethodTable *interfaceType, - MethodTable *targetType) -{ - FCALL_CONTRACT; - - HELPER_METHOD_FRAME_BEGIN_0(); // Set up a frame - - SString strMethodName; - SString strInterfaceName; - SString strTargetClassName; - SString assemblyName; - - targetType->GetAssembly()->GetDisplayName(assemblyName); - TypeString::AppendMethod(strMethodName, method, method->GetMethodInstantiation()); - TypeString::AppendType(strInterfaceName, TypeHandle(interfaceType)); - TypeString::AppendType(strTargetClassName, targetType); - - COMPlusThrow( - kEntryPointNotFoundException, - IDS_CLASSLOAD_METHOD_NOT_IMPLEMENTED, - strMethodName, - strInterfaceName, - strTargetClassName, - assemblyName); - - HELPER_METHOD_FRAME_END(); // Set up a frame -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_Overflow) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kOverflowException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowDivZero) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kDivideByZeroException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL0(void, JIT_ThrowNullRef) -{ - FCALL_CONTRACT; - - /* Make no assumptions about the current machine state */ - ResetCurrentContext(); - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kNullReferenceException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - -/*********************************************************************/ -HCIMPL1(void, IL_VerificationError, int ilOffset) -{ - FCALL_CONTRACT; - - FC_GC_POLL_NOT_NEEDED(); // throws always open up for GC - HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame - - COMPlusThrow(kVerificationException); - - HELPER_METHOD_FRAME_END(); -} -HCIMPLEND - /*********************************************************************/ static RuntimeExceptionKind MapCorInfoExceptionToRuntimeExceptionKind(unsigned exceptNum) { @@ -5238,16 +5001,24 @@ enum __CorInfoHelpFunc { // static helpers - constant array const VMHELPDEF hlpFuncTable[CORINFO_HELP_COUNT] = { -#define JITHELPER(code, pfnHelper, sig) HELPERDEF(code, pfnHelper,sig) -#define DYNAMICJITHELPER(code, pfnHelper,sig) HELPERDEF(code, 1 + DYNAMIC_##code, sig) +#define JITHELPER(code, pfnHelper, binderId) HELPERDEF(code, pfnHelper, binderId) +#define DYNAMICJITHELPER(code, pfnHelper, binderId) HELPERDEF(code, 1 + DYNAMIC_##code, binderId) #include "jithelpers.h" }; -// dynamic helpers - filled in at runtime +// dynamic helpers - filled in at runtime - See definition of DynamicCorInfoHelpFunc. VMHELPDEF hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_COUNT] = { -#define JITHELPER(code, pfnHelper, sig) -#define DYNAMICJITHELPER(code, pfnHelper, sig) HELPERDEF(DYNAMIC_ ## code, pfnHelper, sig) +#define JITHELPER(code, pfnHelper, binderId) +#define DYNAMICJITHELPER(code, pfnHelper, binderId) HELPERDEF(DYNAMIC_ ## code, pfnHelper, binderId) +#include "jithelpers.h" +}; + +// dynamic helpers to Binder ID mapping - See definition of DynamicCorInfoHelpFunc. +static const BinderMethodID hlpDynamicToBinderMap[DYNAMIC_CORINFO_HELP_COUNT] = +{ +#define JITHELPER(code, pfnHelper, binderId) +#define DYNAMICJITHELPER(code, pfnHelper, binderId) (BinderMethodID)binderId, #include "jithelpers.h" }; @@ -5256,8 +5027,8 @@ VMHELPDEF hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_COUNT] = VMHELPCOUNTDEF hlpFuncCountTable[CORINFO_HELP_COUNT+1] = { -#define JITHELPER(code, pfnHelper, sig) HELPERCOUNTDEF(pfnHelper) -#define DYNAMICJITHELPER(code, pfnHelper, sig) HELPERCOUNTDEF(1 + DYNAMIC_##code) +#define JITHELPER(code, pfnHelper, binderId) HELPERCOUNTDEF(pfnHelper) +#define DYNAMICJITHELPER(code, pfnHelper, binderId) HELPERCOUNTDEF(1 + DYNAMIC_##code) #include "jithelpers.h" }; #endif @@ -5265,19 +5036,60 @@ VMHELPCOUNTDEF hlpFuncCountTable[CORINFO_HELP_COUNT+1] = // Set the JIT helper function in the helper table // Handles the case where the function does not reside in mscorwks.dll -void _SetJitHelperFunction(DynamicCorInfoHelpFunc ftnNum, void * pFunc) +void _SetJitHelperFunction(DynamicCorInfoHelpFunc ftnNum, void * pFunc) { - CONTRACTL { + CONTRACTL + { NOTHROW; GC_NOTRIGGER; - } CONTRACTL_END; + } + CONTRACTL_END; _ASSERTE(ftnNum < DYNAMIC_CORINFO_HELP_COUNT); LOG((LF_JIT, LL_INFO1000000, "Setting JIT dynamic helper %3d (%s) to %p\n", ftnNum, hlpDynamicFuncTable[ftnNum].name, pFunc)); - hlpDynamicFuncTable[ftnNum].pfnHelper = (void *) pFunc; + hlpDynamicFuncTable[ftnNum].pfnHelper = (void*)pFunc; +} + +VMHELPDEF LoadDynamicJitHelper(DynamicCorInfoHelpFunc ftnNum, MethodDesc** methodDesc) +{ + STANDARD_VM_CONTRACT; + + _ASSERTE(ftnNum < DYNAMIC_CORINFO_HELP_COUNT); + + MethodDesc* pMD = NULL; + void* helper = VolatileLoad(&hlpDynamicFuncTable[ftnNum].pfnHelper); + if (helper == NULL) + { + BinderMethodID binderId = hlpDynamicToBinderMap[ftnNum]; + + LOG((LF_JIT, LL_INFO1000000, "Loading JIT dynamic helper %3d (%s) to binderID %u\n", + ftnNum, hlpDynamicFuncTable[ftnNum].name, binderId)); + + if (binderId == METHOD__NIL) + return {}; + + pMD = CoreLibBinder::GetMethod(binderId); + PCODE pFunc = pMD->GetMultiCallableAddrOfCode(); + InterlockedCompareExchangeT(&hlpDynamicFuncTable[ftnNum].pfnHelper, (void*)pFunc, nullptr); + } + + // If the caller wants the MethodDesc, we may need to try and load it. + if (methodDesc != NULL) + { + if (pMD == NULL) + { + BinderMethodID binderId = hlpDynamicToBinderMap[ftnNum]; + pMD = binderId != METHOD__NIL + ? CoreLibBinder::GetMethod(binderId) + : NULL; + } + *methodDesc = pMD; + } + + return hlpDynamicFuncTable[ftnNum]; } /*********************************************************************/ diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 8436a63c706e4..62d1e8da7b0ba 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -6157,7 +6157,7 @@ CORINFO_CLASS_HANDLE CEEInfo::getTypeForBoxOnStack(CORINFO_CLASS_HANDLE cls) JIT_TO_EE_TRANSITION(); TypeHandle VMClsHnd(cls); - if (Nullable::IsNullableType(VMClsHnd)) + if (Nullable::IsNullableType(VMClsHnd)) { VMClsHnd = VMClsHnd.AsMethodTable()->GetInstantiation()[0]; } @@ -7847,7 +7847,7 @@ CORINFO_CLASS_HANDLE CEEInfo::getTypeDefinition(CORINFO_CLASS_HANDLE type) result = CORINFO_CLASS_HANDLE(th.AsPtr()); - EE_TO_JIT_TRANSITION(); + EE_TO_JIT_TRANSITION(); _ASSERTE(result != NULL); @@ -10550,8 +10550,8 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ void ** ppIndirection) /* OUT */ { CONTRACTL { - NOTHROW; - GC_NOTRIGGER; + THROWS; + GC_TRIGGERS; MODE_PREEMPTIVE; } CONTRACTL_END; @@ -10560,7 +10560,7 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ if (ppIndirection != NULL) *ppIndirection = NULL; - JIT_TO_EE_TRANSITION_LEAF(); + JIT_TO_EE_TRANSITION(); _ASSERTE(ftnNum < CORINFO_HELP_COUNT); @@ -10591,6 +10591,7 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ dynamicFtnNum == DYNAMIC_CORINFO_HELP_DISPATCH_INDIRECT_CALL) { _ASSERTE(ppIndirection != NULL); + _ASSERTE(hlpDynamicFuncTable[dynamicFtnNum].pfnHelper != NULL); // Confirm the helper is non-null and doesn't require lazy loading. *ppIndirection = &hlpDynamicFuncTable[dynamicFtnNum].pfnHelper; result = NULL; goto exit; @@ -10629,8 +10630,9 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2UINT_OVF || dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2ULNG_OVF) { - Precode* pPrecode = Precode::GetPrecodeFromEntryPoint((PCODE)hlpDynamicFuncTable[dynamicFtnNum].pfnHelper); - _ASSERTE(pPrecode->GetType() == PRECODE_FIXUP); + MethodDesc* helperMD = NULL; + (void)LoadDynamicJitHelper((DynamicCorInfoHelpFunc)dynamicFtnNum, &helperMD); + _ASSERT(helperMD != NULL); // Check if the target MethodDesc is already jitted to its final Tier // so we no longer need to use indirections and can emit a direct call instead. @@ -10639,15 +10641,12 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ // // JitEnableOptionalRelocs being false means we should avoid non-deterministic // optimizations that can randomly change codegen. - if (!GetAppDomain()->GetTieredCompilationManager()->IsTieringDelayActive() && - g_pConfig->JitEnableOptionalRelocs()) + if (!GetAppDomain()->GetTieredCompilationManager()->IsTieringDelayActive() + && g_pConfig->JitEnableOptionalRelocs()) { - MethodDesc* helperMD = pPrecode->GetMethodDesc(); - _ASSERT(helperMD != nullptr); - CodeVersionManager* manager = helperMD->GetCodeVersionManager(); - NativeCodeVersion activeCodeVersion; + NativeCodeVersion activeCodeVersion; { // Get active code version under a lock CodeVersionManager::LockHolder codeVersioningLockHolder; @@ -10667,30 +10666,36 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */ } } + Precode* pPrecode = helperMD->GetPrecode(); + _ASSERTE(pPrecode->GetType() == PRECODE_FIXUP); *ppIndirection = ((FixupPrecode*)pPrecode)->GetTargetSlot(); result = NULL; goto exit; } - pfnHelper = hlpDynamicFuncTable[dynamicFtnNum].pfnHelper; + pfnHelper = LoadDynamicJitHelper((DynamicCorInfoHelpFunc)dynamicFtnNum).pfnHelper; #ifdef _PREFAST_ #pragma warning(pop) #endif /*_PREFAST_*/ } - _ASSERTE(pfnHelper); + _ASSERTE(pfnHelper != NULL); result = (LPVOID)GetEEFuncEntryPoint(pfnHelper); exit: ; - EE_TO_JIT_TRANSITION_LEAF(); + EE_TO_JIT_TRANSITION(); return result; } PCODE CEEJitInfo::getHelperFtnStatic(CorInfoHelpFunc ftnNum) { - LIMITED_METHOD_CONTRACT; + CONTRACTL { + THROWS; + GC_TRIGGERS; + MODE_PREEMPTIVE; + } CONTRACTL_END; void* pfnHelper = hlpFuncTable[ftnNum].pfnHelper; @@ -10700,7 +10705,7 @@ PCODE CEEJitInfo::getHelperFtnStatic(CorInfoHelpFunc ftnNum) // where pfnHelper==0 where pfnHelper-1 will underflow and we will avoid the indirection. if (((size_t)pfnHelper - 1) < DYNAMIC_CORINFO_HELP_COUNT) { - pfnHelper = hlpDynamicFuncTable[((size_t)pfnHelper - 1)].pfnHelper; + pfnHelper = LoadDynamicJitHelper((DynamicCorInfoHelpFunc)((size_t)pfnHelper - 1)).pfnHelper; } _ASSERTE(pfnHelper != NULL); @@ -13596,6 +13601,10 @@ BOOL LoadDynamicInfoEntry(Module *currentModule, if (bHookFunction) { + // Confirm the helpers are non-null and don't require lazy loading. + _ASSERTE(hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_ENTER].pfnHelper != NULL); + _ASSERTE(hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_LEAVE].pfnHelper != NULL); + _ASSERTE(hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_TAILCALL].pfnHelper != NULL); *(entry+kZapProfilingHandleImportValueIndexEnterAddr) = (SIZE_T)(void *)hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_ENTER].pfnHelper; *(entry+kZapProfilingHandleImportValueIndexLeaveAddr) = (SIZE_T)(void *)hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_LEAVE].pfnHelper; *(entry+kZapProfilingHandleImportValueIndexTailcallAddr) = (SIZE_T)(void *)hlpDynamicFuncTable[DYNAMIC_CORINFO_HELP_PROF_FCN_TAILCALL].pfnHelper; diff --git a/src/coreclr/vm/jitinterface.h b/src/coreclr/vm/jitinterface.h index 68617d39305bd..a473576d1aacd 100644 --- a/src/coreclr/vm/jitinterface.h +++ b/src/coreclr/vm/jitinterface.h @@ -1037,8 +1037,8 @@ inline void WriteJitHelperCountToSTRESSLOG() { } // enum for dynamically assigned helper calls enum DynamicCorInfoHelpFunc { -#define JITHELPER(code, pfnHelper, sig) -#define DYNAMICJITHELPER(code, pfnHelper, sig) DYNAMIC_##code, +#define JITHELPER(code, pfnHelper, binderId) +#define DYNAMICJITHELPER(code, pfnHelper, binderId) DYNAMIC_##code, #include "jithelpers.h" DYNAMIC_CORINFO_HELP_COUNT }; @@ -1052,6 +1052,8 @@ GARY_DECL(VMHELPDEF, hlpDynamicFuncTable, DYNAMIC_CORINFO_HELP_COUNT); #define SetJitHelperFunction(ftnNum, pFunc) _SetJitHelperFunction(DYNAMIC_##ftnNum, (void*)(pFunc)) void _SetJitHelperFunction(DynamicCorInfoHelpFunc ftnNum, void * pFunc); +VMHELPDEF LoadDynamicJitHelper(DynamicCorInfoHelpFunc ftnNum, MethodDesc** methodDesc = NULL); + void *GenFastGetSharedStaticBase(bool bCheckCCtor); #ifdef HAVE_GCCOVER diff --git a/src/coreclr/vm/metasig.h b/src/coreclr/vm/metasig.h index 5ec038df79a76..2a74fa3511258 100644 --- a/src/coreclr/vm/metasig.h +++ b/src/coreclr/vm/metasig.h @@ -588,6 +588,7 @@ DEFINE_METASIG_T(SM(RefCleanupWorkListElement_SafeHandle_RetIntPtr, r(C(CLEANUP_ DEFINE_METASIG_T(SM(RefCleanupWorkListElement_Obj_RetVoid, r(C(CLEANUP_WORK_LIST_ELEMENT)) j, v)) DEFINE_METASIG(SM(PtrVoid_RetPtrVoid, P(v), P(v))) +DEFINE_METASIG(SM(PtrVoid_PtrVoid_PtrVoid_RetVoid, P(v) P(v) P(v), v)) DEFINE_METASIG(IM(PtrVoid_RetVoid, P(v), v)) #if defined(TARGET_X86) && defined(TARGET_WINDOWS) DEFINE_METASIG_T(IM(PtrCopyConstructorCookie_RetVoid, P(g(COPY_CONSTRUCTOR_COOKIE)), v)) diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index fba8c85980fc8..5e0ba6c09bfd5 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -5188,12 +5188,12 @@ BOOL MethodTable::FindDispatchEntry(UINT32 typeID, #ifndef DACCESS_COMPILE -void ThrowExceptionForAbstractOverride( +void ThrowEntryPointNotFoundException( MethodTable *pTargetClass, MethodTable *pInterfaceMT, MethodDesc *pInterfaceMD) { - LIMITED_METHOD_CONTRACT; + STANDARD_VM_CONTRACT; SString assemblyName; @@ -5240,9 +5240,7 @@ MethodTable::FindDispatchImpl( { CONTRACT (BOOL) { INSTANCE_CHECK; - MODE_ANY; - THROWS; - GC_TRIGGERS; + STANDARD_VM_CHECK; PRECONDITION(CheckPointer(pImplSlot)); POSTCONDITION(!RETVAL || !pImplSlot->IsNull() || IsComObjectType()); } CONTRACT_END; @@ -5352,9 +5350,7 @@ MethodTable::FindDispatchImpl( if (pDefaultMethod->IsAbstract()) { if (throwOnConflict) - { - ThrowExceptionForAbstractOverride(this, pIfcMT, pIfcMD); - } + ThrowEntryPointNotFoundException(this, pIfcMT, pIfcMD); } else { @@ -5395,18 +5391,12 @@ MethodTable::FindDispatchImpl( #ifndef DACCESS_COMPILE -struct MatchCandidate -{ - MethodTable *pMT; - MethodDesc *pMD; -}; - -void ThrowExceptionForConflictingOverride( +void ThrowAmbiguousResolutionException( MethodTable *pTargetClass, MethodTable *pInterfaceMT, MethodDesc *pInterfaceMD) { - LIMITED_METHOD_CONTRACT; + STANDARD_VM_CONTRACT; SString assemblyName; @@ -5591,7 +5581,6 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( { CONTRACT(BOOL) { INSTANCE_CHECK; - MODE_ANY; THROWS; GC_TRIGGERS; PRECONDITION(CheckPointer(pInterfaceMD)); @@ -5601,6 +5590,11 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( } CONTRACT_END; #ifdef FEATURE_DEFAULT_INTERFACES + struct MatchCandidate + { + MethodTable *pMT; + MethodDesc *pMD; + }; bool allowVariance = (findDefaultImplementationFlags & FindDefaultInterfaceImplementationFlags::AllowVariance) != FindDefaultInterfaceImplementationFlags::None; CQuickArray candidates; unsigned candidatesCount = 0; @@ -5746,7 +5740,7 @@ BOOL MethodTable::FindDefaultInterfaceImplementation( bool throwOnConflict = (findDefaultImplementationFlags & FindDefaultInterfaceImplementationFlags::ThrowOnConflict) != FindDefaultInterfaceImplementationFlags::None; if (throwOnConflict) - ThrowExceptionForConflictingOverride(this, pInterfaceMT, pInterfaceMD); + ThrowAmbiguousResolutionException(this, pInterfaceMT, pInterfaceMD); *ppDefaultMethod = pBestCandidateMD; RETURN(FALSE); @@ -5777,6 +5771,7 @@ DispatchSlot MethodTable::FindDispatchSlot(UINT32 typeID, UINT32 slotNumber, BOO } CONTRACTL_END; + GCX_PREEMP(); DispatchSlot implSlot(0); FindDispatchImpl(typeID, slotNumber, &implSlot, throwOnConflict); return implSlot; @@ -7872,6 +7867,11 @@ MethodTable::ResolveVirtualStaticMethod( BOOL* uniqueResolution, ClassLoadLevel level) { + CONTRACTL{ + THROWS; + GC_TRIGGERS; + } CONTRACTL_END; + bool verifyImplemented = (resolveVirtualStaticMethodFlags & ResolveVirtualStaticMethodFlags::VerifyImplemented) != ResolveVirtualStaticMethodFlags::None; bool allowVariantMatches = (resolveVirtualStaticMethodFlags & ResolveVirtualStaticMethodFlags::AllowVariantMatches) != ResolveVirtualStaticMethodFlags::None; bool instantiateMethodParameters = (resolveVirtualStaticMethodFlags & ResolveVirtualStaticMethodFlags::InstantiateResultOverFinalMethodDesc) != ResolveVirtualStaticMethodFlags::None; diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index 0fedd53ef4c73..2f0593e2eac4b 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -4057,4 +4057,14 @@ MethodTable* CreateMinimalMethodTable(Module* pContainingModule, LoaderAllocator* pLoaderAllocator, AllocMemTracker* pamTracker); +void ThrowEntryPointNotFoundException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD); + +void ThrowAmbiguousResolutionException( + MethodTable* pTargetClass, + MethodTable* pInterfaceMT, + MethodDesc* pInterfaceMD); + #endif // !_METHODTABLE_H_ diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp index 11234b4ba2dce..bf2a8f6ce3a32 100644 --- a/src/coreclr/vm/qcallentrypoints.cpp +++ b/src/coreclr/vm/qcallentrypoints.cpp @@ -100,6 +100,8 @@ static const Entry s_QCall[] = DllImportEntry(Environment_GetProcessorCount) DllImportEntry(ExceptionNative_GetMessageFromNativeResources) DllImportEntry(ExceptionNative_GetMethodFromStackTrace) + DllImportEntry(ExceptionNative_ThrowAmbiguousResolutionException) + DllImportEntry(ExceptionNative_ThrowEntryPointNotFoundException) DllImportEntry(RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter) DllImportEntry(QCall_GetGCHandleForTypeHandle) DllImportEntry(QCall_FreeGCHandleForTypeHandle) diff --git a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs index ef7d3adbc0a1d..4dc475742c6db 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -51,7 +51,7 @@ namespace System { [StackTraceHidden] - internal static class ThrowHelper + internal static partial class ThrowHelper { [DoesNotReturn] internal static void ThrowArithmeticException(string message) @@ -71,6 +71,12 @@ internal static void ThrowArrayTypeMismatchException() throw new ArrayTypeMismatchException(); } + [DoesNotReturn] + internal static void ThrowArgumentException() + { + throw new ArgumentException(); + } + [DoesNotReturn] internal static void ThrowInvalidTypeWithPointersNotSupported(Type targetType) { @@ -89,6 +95,30 @@ internal static void ThrowArgumentOutOfRangeException() throw new ArgumentOutOfRangeException(); } + [DoesNotReturn] + internal static void ThrowNotImplementedException() + { + throw new NotImplementedException(); + } + + [DoesNotReturn] + internal static void ThrowPlatformNotSupportedException() + { + throw new PlatformNotSupportedException(); + } + + [DoesNotReturn] + internal static void ThrowTypeNotSupportedException() + { + throw new NotSupportedException(SR.Arg_TypeNotSupported); + } + + [DoesNotReturn] + internal static void ThrowVerificationException(int ilOffset) + { + throw new System.Security.VerificationException(); + } + [DoesNotReturn] internal static void ThrowArgumentException_DestinationTooShort() { @@ -768,8 +798,6 @@ internal static void IfNullAndNullsAreIllegalThenThrow(object? value, Excepti ThrowArgumentNullException(argName); } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void ThrowForUnsupportedSimdVectorBaseType() where TVector : ISimdVector