diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index b078d6c9329b1a..b0d0108a31dffe 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -3206,12 +3206,6 @@ class ICorDynamicInfo : public ICorStaticInfo void** ppIndirection = NULL ) = 0; - // returns true if a VM cookie can be generated for it (might be false due to cross-module - // inlining, in which case the inlining should be aborted) - virtual bool canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig - ) = 0; - // Generate a cookie based on the signature to pass to INTOP_CALLI in the interpreter. virtual void* GetCookieForInterpreterCalliSig( CORINFO_SIG_INFO* szMetaSig) = 0; @@ -3297,15 +3291,10 @@ class ICorDynamicInfo : public ICorStaticInfo // registers a vararg sig & returns a VM cookie for it (which can contain other stuff) virtual CORINFO_VARARGS_HANDLE getVarArgsHandle( CORINFO_SIG_INFO *pSig, + CORINFO_METHOD_HANDLE methHnd, void **ppIndirection = NULL ) = 0; - // returns true if a VM cookie can be generated for it (might be false due to cross-module - // inlining, in which case the inlining should be aborted) - virtual bool canGetVarArgsHandle( - CORINFO_SIG_INFO *pSig - ) = 0; - // Allocate a string literal on the heap and return a handle to it virtual InfoAccessType constructStringLiteral( CORINFO_MODULE_HANDLE module, diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 472ada1cdd64d6..6f4908d9c05235 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -590,9 +590,6 @@ void* GetCookieForPInvokeCalliSig( void* GetCookieForInterpreterCalliSig( CORINFO_SIG_INFO* szMetaSig) override; -bool canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) override; - CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle( CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) override; @@ -628,11 +625,9 @@ CORINFO_CLASS_HANDLE getStaticFieldCurrentClass( CORINFO_VARARGS_HANDLE getVarArgsHandle( CORINFO_SIG_INFO* pSig, + CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) override; -bool canGetVarArgsHandle( - CORINFO_SIG_INFO* pSig) override; - InfoAccessType constructStringLiteral( CORINFO_MODULE_HANDLE module, mdToken metaTok, diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index 079280146be060..203f13bb671239 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -37,11 +37,11 @@ #include -constexpr GUID JITEEVersionIdentifier = { /* fafeaf26-740f-4e0a-b3f4-852fb3d5ccae */ - 0xfafeaf26, - 0x740f, - 0x4e0a, - {0xb3, 0xf4, 0x85, 0x2f, 0xb3, 0xd5, 0xcc, 0xae} +constexpr GUID JITEEVersionIdentifier = { /* 7a8cbc56-9e19-4321-80b9-a0d2c578c945 */ + 0x7a8cbc56, + 0x9e19, + 0x4321, + {0x80, 0xb9, 0xa0, 0xd2, 0xc5, 0x78, 0xc9, 0x45} }; #endif // JIT_EE_VERSIONING_GUID_H diff --git a/src/coreclr/jit/ICorJitInfo_names_generated.h b/src/coreclr/jit/ICorJitInfo_names_generated.h index 349725350198a8..1e455eb98bc74e 100644 --- a/src/coreclr/jit/ICorJitInfo_names_generated.h +++ b/src/coreclr/jit/ICorJitInfo_names_generated.h @@ -146,7 +146,6 @@ DEF_CLR_API(getLocationOfThisType) DEF_CLR_API(getAddressOfPInvokeTarget) DEF_CLR_API(GetCookieForPInvokeCalliSig) DEF_CLR_API(GetCookieForInterpreterCalliSig) -DEF_CLR_API(canGetCookieForPInvokeCalliSig) DEF_CLR_API(getJustMyCodeHandle) DEF_CLR_API(GetProfilingHandle) DEF_CLR_API(getCallInfo) @@ -154,7 +153,6 @@ DEF_CLR_API(getStaticFieldContent) DEF_CLR_API(getObjectContent) DEF_CLR_API(getStaticFieldCurrentClass) DEF_CLR_API(getVarArgsHandle) -DEF_CLR_API(canGetVarArgsHandle) DEF_CLR_API(constructStringLiteral) DEF_CLR_API(emptyStringLiteral) DEF_CLR_API(getFieldThreadLocalStoreID) diff --git a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp index 7ee76ced3f8a32..71dc8eaf7119af 100644 --- a/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp +++ b/src/coreclr/jit/ICorJitInfo_wrapper_generated.hpp @@ -1396,15 +1396,6 @@ void* WrapICorJitInfo::GetCookieForInterpreterCalliSig( return temp; } -bool WrapICorJitInfo::canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) -{ - API_ENTER(canGetCookieForPInvokeCalliSig); - bool temp = wrapHnd->canGetCookieForPInvokeCalliSig(szMetaSig); - API_LEAVE(canGetCookieForPInvokeCalliSig); - return temp; -} - CORINFO_JUST_MY_CODE_HANDLE WrapICorJitInfo::getJustMyCodeHandle( CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) @@ -1474,23 +1465,15 @@ CORINFO_CLASS_HANDLE WrapICorJitInfo::getStaticFieldCurrentClass( CORINFO_VARARGS_HANDLE WrapICorJitInfo::getVarArgsHandle( CORINFO_SIG_INFO* pSig, + CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { API_ENTER(getVarArgsHandle); - CORINFO_VARARGS_HANDLE temp = wrapHnd->getVarArgsHandle(pSig, ppIndirection); + CORINFO_VARARGS_HANDLE temp = wrapHnd->getVarArgsHandle(pSig, methHnd, ppIndirection); API_LEAVE(getVarArgsHandle); return temp; } -bool WrapICorJitInfo::canGetVarArgsHandle( - CORINFO_SIG_INFO* pSig) -{ - API_ENTER(canGetVarArgsHandle); - bool temp = wrapHnd->canGetVarArgsHandle(pSig); - API_LEAVE(canGetVarArgsHandle); - return temp; -} - InfoAccessType WrapICorJitInfo::constructStringLiteral( CORINFO_MODULE_HANDLE module, mdToken metaTok, diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index bc7f0433287a10..e4694194fdaeff 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -652,24 +652,6 @@ var_types Compiler::impImportCall(OPCODE opcode, else if ((opcode == CEE_CALLI) && ((sig->callConv & CORINFO_CALLCONV_MASK) != CORINFO_CALLCONV_DEFAULT) && ((sig->callConv & CORINFO_CALLCONV_MASK) != CORINFO_CALLCONV_VARARG)) { - if (!info.compCompHnd->canGetCookieForPInvokeCalliSig(sig)) - { - // Normally this only happens with inlining. - // However, a generic method (or type) being NGENd into another module - // can run into this issue as well. There's not an easy fall-back for AOT - // so instead we fallback to JIT. - if (compIsForInlining()) - { - compInlineResult->NoteFatal(InlineObservation::CALLSITE_CANT_EMBED_PINVOKE_COOKIE); - } - else - { - IMPL_LIMITATION("Can't get PInvoke cookie (cross module generics)"); - } - - return TYP_UNDEF; - } - GenTree* cookie = eeGetPInvokeCookie(sig); // This cookie is required to be either a simple GT_CNS_INT or @@ -766,13 +748,7 @@ var_types Compiler::impImportCall(OPCODE opcode, if ((sig->callConv & CORINFO_CALLCONV_MASK) == CORINFO_CALLCONV_VARARG) { void *varCookie, *pVarCookie; - if (!info.compCompHnd->canGetVarArgsHandle(sig)) - { - compInlineResult->NoteFatal(InlineObservation::CALLSITE_CANT_EMBED_VARARGS_COOKIE); - return TYP_UNDEF; - } - - varCookie = info.compCompHnd->getVarArgsHandle(sig, &pVarCookie); + varCookie = info.compCompHnd->getVarArgsHandle(sig, methHnd, &pVarCookie); assert((!varCookie) != (!pVarCookie)); varArgsCookie = gtNewIconEmbHndNode(varCookie, pVarCookie, GTF_ICON_VARG_HDL, sig); } diff --git a/src/coreclr/jit/inline.def b/src/coreclr/jit/inline.def index 47a226e07d4116..bb6d2226cea21a 100644 --- a/src/coreclr/jit/inline.def +++ b/src/coreclr/jit/inline.def @@ -128,8 +128,6 @@ INLINE_OBSERVATION(ARG_HAS_NULL_THIS, bool, "this pointer argument is INLINE_OBSERVATION(ARG_NO_BASH_TO_INT, bool, "argument can't bash to int", FATAL, CALLSITE) INLINE_OBSERVATION(ARG_NO_BASH_TO_REF, bool, "argument can't bash to ref", FATAL, CALLSITE) INLINE_OBSERVATION(ARG_TYPES_INCOMPATIBLE, bool, "argument types incompatible", FATAL, CALLSITE) -INLINE_OBSERVATION(CANT_EMBED_PINVOKE_COOKIE, bool, "can't embed pinvoke cookie", FATAL, CALLSITE) -INLINE_OBSERVATION(CANT_EMBED_VARARGS_COOKIE, bool, "can't embed varargs cookie", FATAL, CALLSITE) INLINE_OBSERVATION(CANT_CLASS_INIT, bool, "can't class init", FATAL, CALLSITE) INLINE_OBSERVATION(COMPILATION_ERROR, bool, "compilation error", FATAL, CALLSITE) INLINE_OBSERVATION(COMPILATION_FAILURE, bool, "failed to compile", FATAL, CALLSITE) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 06b34f71550601..e6fd0d4f7f80e0 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -3638,7 +3638,13 @@ private void getLocationOfThisType(CORINFO_METHOD_STRUCT_* context, ref CORINFO_ { throw new NotImplementedException("GetCookieForInterpreterCalliSig"); } private void* GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection) - { throw new NotImplementedException("GetCookieForPInvokeCalliSig"); } + { +#if READYTORUN + throw new RequiresRuntimeJitException($"{MethodBeingCompiled} -> {nameof(GetCookieForPInvokeCalliSig)}"); +#else + throw new NotImplementedException(nameof(GetCookieForPInvokeCalliSig)); +#endif + } #pragma warning disable CA1822 // Mark members as static private CORINFO_JUST_MY_CODE_HANDLE_* getJustMyCodeHandle(CORINFO_METHOD_STRUCT_* method, ref CORINFO_JUST_MY_CODE_HANDLE_* ppIndirection) #pragma warning restore CA1822 // Mark members as static @@ -3668,10 +3674,8 @@ private CORINFO_CONST_LOOKUP CreateConstLookupToSymbol(ISymbolNode symbol) return null; } - private IntPtr getVarArgsHandle(CORINFO_SIG_INFO* pSig, ref void* ppIndirection) + private IntPtr getVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_STRUCT_* methHnd, ref void* ppIndirection) { throw new NotImplementedException("getVarArgsHandle"); } - private bool canGetVarArgsHandle(CORINFO_SIG_INFO* pSig) - { throw new NotImplementedException("canGetVarArgsHandle"); } private InfoAccessType emptyStringLiteral(ref void* ppValue) { diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs index dd427561f98e90..8d0c83046277dd 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.cs @@ -2105,21 +2105,6 @@ private static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppExce } } - [UnmanagedCallersOnly] - private static byte _canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig) - { - var _this = GetThis(thisHandle); - try - { - return _this.canGetCookieForPInvokeCalliSig(szMetaSig) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] private static CORINFO_JUST_MY_CODE_HANDLE_* _getJustMyCodeHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_JUST_MY_CODE_HANDLE_** ppIndirection) { @@ -2209,27 +2194,12 @@ private static byte _getObjectContent(IntPtr thisHandle, IntPtr* ppException, CO } [UnmanagedCallersOnly] - private static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, void** ppIndirection) - { - var _this = GetThis(thisHandle); - try - { - return _this.getVarArgsHandle(pSig, ref *ppIndirection); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - - [UnmanagedCallersOnly] - private static byte _canGetVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig) + private static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, CORINFO_METHOD_STRUCT_* methHnd, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.canGetVarArgsHandle(pSig) ? (byte)1 : (byte)0; + return _this.getVarArgsHandle(pSig, methHnd, ref *ppIndirection); } catch (Exception ex) { @@ -2636,7 +2606,7 @@ private static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_ private static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 178); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 176); callbacks[0] = (delegate* unmanaged)&_isIntrinsic; callbacks[1] = (delegate* unmanaged)&_notifyMethodInfoUsage; @@ -2780,42 +2750,40 @@ private static IntPtr GetUnmanagedCallbacks() callbacks[139] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; callbacks[140] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; callbacks[141] = (delegate* unmanaged)&_GetCookieForInterpreterCalliSig; - callbacks[142] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[143] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[144] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[145] = (delegate* unmanaged)&_getCallInfo; - callbacks[146] = (delegate* unmanaged)&_getStaticFieldContent; - callbacks[147] = (delegate* unmanaged)&_getObjectContent; - callbacks[148] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[149] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[150] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[151] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[152] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[153] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[154] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[155] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[156] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[157] = (delegate* unmanaged)&_getAsyncResumptionStub; - callbacks[158] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[159] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[160] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[161] = (delegate* unmanaged)&_allocMem; - callbacks[162] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[163] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[164] = (delegate* unmanaged)&_allocGCInfo; - callbacks[165] = (delegate* unmanaged)&_setEHcount; - callbacks[166] = (delegate* unmanaged)&_setEHinfo; - callbacks[167] = (delegate* unmanaged)&_logMsg; - callbacks[168] = (delegate* unmanaged)&_doAssert; - callbacks[169] = (delegate* unmanaged)&_reportFatalError; - callbacks[170] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[171] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[172] = (delegate* unmanaged)&_recordCallSite; - callbacks[173] = (delegate* unmanaged)&_recordRelocation; - callbacks[174] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[175] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[176] = (delegate* unmanaged)&_getJitFlags; - callbacks[177] = (delegate* unmanaged)&_getSpecialCopyHelper; + callbacks[142] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[143] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[144] = (delegate* unmanaged)&_getCallInfo; + callbacks[145] = (delegate* unmanaged)&_getStaticFieldContent; + callbacks[146] = (delegate* unmanaged)&_getObjectContent; + callbacks[147] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[148] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[149] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[150] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[151] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[152] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[153] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[154] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[155] = (delegate* unmanaged)&_getAsyncResumptionStub; + callbacks[156] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[157] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[158] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[159] = (delegate* unmanaged)&_allocMem; + callbacks[160] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[161] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[162] = (delegate* unmanaged)&_allocGCInfo; + callbacks[163] = (delegate* unmanaged)&_setEHcount; + callbacks[164] = (delegate* unmanaged)&_setEHinfo; + callbacks[165] = (delegate* unmanaged)&_logMsg; + callbacks[166] = (delegate* unmanaged)&_doAssert; + callbacks[167] = (delegate* unmanaged)&_reportFatalError; + callbacks[168] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[169] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[170] = (delegate* unmanaged)&_recordCallSite; + callbacks[171] = (delegate* unmanaged)&_recordRelocation; + callbacks[172] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[173] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[174] = (delegate* unmanaged)&_getJitFlags; + callbacks[175] = (delegate* unmanaged)&_getSpecialCopyHelper; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 18f4498a848797..4c4945475399c1 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -308,15 +308,13 @@ FUNCTIONS void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, REF_CORINFO_CONST_LOOKUP pLookup); void* GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection); void* GetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* szMetaSig); - bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig); CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE**ppIndirection); void GetProfilingHandle(bool* pbHookFunction, void **pProfilerHandle, bool* pbIndirectedHandles); void getCallInfo(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_RESOLVED_TOKEN_PTR pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO *pResult); bool getStaticFieldContent(CORINFO_FIELD_HANDLE field, uint8_t *buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); bool getObjectContent(CORINFO_OBJECT_HANDLE obj, uint8_t *buffer, int bufferSize, int valueOffset); CORINFO_CLASS_HANDLE getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, BoolStar pIsSpeculative); - CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO *pSig, void **ppIndirection); - bool canGetVarArgsHandle(CORINFO_SIG_INFO *pSig); + CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO *pSig, CORINFO_METHOD_HANDLE methHnd, void **ppIndirection); InfoAccessType constructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void **ppValue); InfoAccessType emptyStringLiteral(void **ppValue); uint32_t getFieldThreadLocalStoreID (CORINFO_FIELD_HANDLE field, void **ppIndirection); diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index afa3677e648c68..45bfd1a2edbfee 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -3098,13 +3098,6 @@ private bool convertPInvokeCalliToCall(ref CORINFO_RESOLVED_TOKEN pResolvedToken throw new NotImplementedException(); } - private bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) - { - // If we answer "true" here, RyuJIT is going to ask for the cookie and for the CORINFO_HELP_PINVOKE_CALLI - // helper. The helper doesn't exist in ReadyToRun, so let's just throw right here. - throw new RequiresRuntimeJitException($"{MethodBeingCompiled} -> {nameof(canGetCookieForPInvokeCalliSig)}"); - } - private int SizeOfPInvokeTransitionFrame => ReadyToRunRuntimeConstants.READYTORUN_PInvokeTransitionFrameSizeInPointerUnits * PointerSize; private int SizeOfReversePInvokeTransitionFrame { diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs index 6f6f781e048b01..d3882b864d4f3b 100644 --- a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs +++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs @@ -2026,9 +2026,6 @@ private int SizeOfPInvokeTransitionFrame } } - private bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) - { throw new NotImplementedException("canGetCookieForPInvokeCalliSig"); } - #pragma warning disable CA1822 // Mark members as static private void classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_STRUCT_* cls) #pragma warning restore CA1822 // Mark members as static diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h index 6376292d538738..4069f29308dadd 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface_generated.h @@ -153,15 +153,13 @@ struct JitInterfaceCallbacks void (* getAddressOfPInvokeTarget)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup); void* (* GetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* szMetaSig, void** ppIndirection); void* (* GetCookieForInterpreterCalliSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* szMetaSig); - bool (* canGetCookieForPInvokeCalliSig)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* szMetaSig); CORINFO_JUST_MY_CODE_HANDLE (* getJustMyCodeHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection); void (* GetProfilingHandle)(void * thisHandle, CorInfoExceptionClass** ppException, bool* pbHookFunction, void** pProfilerHandle, bool* pbIndirectedHandles); void (* getCallInfo)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult); bool (* getStaticFieldContent)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, uint8_t* buffer, int bufferSize, int valueOffset, bool ignoreMovableObjects); bool (* getObjectContent)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_OBJECT_HANDLE obj, uint8_t* buffer, int bufferSize, int valueOffset); CORINFO_CLASS_HANDLE (* getStaticFieldCurrentClass)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, bool* pIsSpeculative); - CORINFO_VARARGS_HANDLE (* getVarArgsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* pSig, void** ppIndirection); - bool (* canGetVarArgsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* pSig); + CORINFO_VARARGS_HANDLE (* getVarArgsHandle)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection); InfoAccessType (* constructStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE module, unsigned int metaTok, void** ppValue); InfoAccessType (* emptyStringLiteral)(void * thisHandle, CorInfoExceptionClass** ppException, void** ppValue); uint32_t (* getFieldThreadLocalStoreID)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_FIELD_HANDLE field, void** ppIndirection); @@ -1576,15 +1574,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->canGetCookieForPInvokeCalliSig(_thisHandle, &pException, szMetaSig); - if (pException != nullptr) throw pException; - return temp; -} - virtual CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle( CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) @@ -1654,19 +1643,11 @@ class JitInterfaceWrapper : public ICorJitInfo virtual CORINFO_VARARGS_HANDLE getVarArgsHandle( CORINFO_SIG_INFO* pSig, + CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { CorInfoExceptionClass* pException = nullptr; - CORINFO_VARARGS_HANDLE temp = _callbacks->getVarArgsHandle(_thisHandle, &pException, pSig, ppIndirection); - if (pException != nullptr) throw pException; - return temp; -} - - virtual bool canGetVarArgsHandle( - CORINFO_SIG_INFO* pSig) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->canGetVarArgsHandle(_thisHandle, &pException, pSig); + CORINFO_VARARGS_HANDLE temp = _callbacks->getVarArgsHandle(_thisHandle, &pException, pSig, methHnd, ppIndirection); if (pException != nullptr) throw pException; return temp; } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h index 3097e47190040e..01ec01427fa862 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h @@ -708,12 +708,7 @@ struct GetVarArgsHandleValue DWORD pSig_Index; DWORDLONG scope; DWORD token; -}; - -struct CanGetVarArgsHandleValue -{ - DWORDLONG scope; - DWORD token; + DWORDLONG methHnd; }; struct GetCookieForPInvokeCalliSigValue @@ -732,12 +727,6 @@ struct GetCookieForInterpreterCalliSigValue DWORD token; }; -struct CanGetCookieForPInvokeCalliSigValue -{ - DWORDLONG scope; - DWORD token; -}; - struct GetReadyToRunHelper_TOKENin { Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h index 595f376ff735fe..848bcf324e5f60 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h @@ -21,8 +21,6 @@ LWM(GetPgoInstrumentationResults, DWORDLONG, Agnostic_GetPgoInstrumentationResul LWM(AsCorInfoType, DWORDLONG, DWORD) LWM(CanAccessClass, Agnostic_CanAccessClassIn, Agnostic_CanAccessClassOut) LWM(CanCast, DLDL, DWORD) -LWM(CanGetCookieForPInvokeCalliSig, CanGetCookieForPInvokeCalliSigValue, DWORD) -LWM(CanGetVarArgsHandle, CanGetVarArgsHandleValue, DWORD) LWM(CanInline, DLDL, Agnostic_CanInline) LWM(CanTailCall, Agnostic_CanTailCall, DWORD) LWM(CheckMethodModifier, Agnostic_CheckMethodModifier, DWORD) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 66c7b548efd8d2..51a7281fe32df4 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -5510,7 +5510,7 @@ void MethodContext::repFindCallSiteSig(CORINFO_MODULE_HANDLE module, *sig = SpmiRecordsHelper::Restore_CORINFO_SIG_INFO(value, FindCallSiteSig, SigInstHandleMap, cr->getOrCreateMemoryTracker()); } -void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection, CORINFO_VARARGS_HANDLE result) +void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection, CORINFO_VARARGS_HANDLE result) { if (GetVarArgsHandle == nullptr) GetVarArgsHandle = new LightWeightMap(); @@ -5521,6 +5521,7 @@ void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirec key.pSig_Index = (DWORD)GetVarArgsHandle->AddBuffer((unsigned char*)pSig->pSig, pSig->cbSig); key.scope = CastHandle(pSig->scope); key.token = (DWORD)pSig->token; + key.methHnd = CastHandle(methHnd); DLDL value; if (ppIndirection != nullptr) @@ -5534,12 +5535,12 @@ void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirec } void MethodContext::dmpGetVarArgsHandle(const GetVarArgsHandleValue& key, DLDL value) { - printf("GetVarArgsHandle key sig-%s scope-%016" PRIX64 " token-%08X", + printf("GetVarArgsHandle key sig-%s scope-%016" PRIX64 " token-%08X methHnd-%016" PRIX64 "", SpmiDumpHelper::DumpPSig(key.pSig_Index, key.cbSig, GetVarArgsHandle).c_str(), - key.scope, key.token); + key.scope, key.token, key.methHnd); printf(", value ppIndirection-%016" PRIX64 " result-%016" PRIX64 "", value.A, value.B); } -CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection) +CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { GetVarArgsHandleValue key; ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding @@ -5547,6 +5548,7 @@ CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO* pSig key.pSig_Index = (DWORD)GetVarArgsHandle->Contains((unsigned char*)pSig->pSig, pSig->cbSig); key.scope = CastHandle(pSig->scope); key.token = (DWORD)pSig->token; + key.methHnd = CastHandle(methHnd); DLDL value = LookupByKeyOrMissNoMessage(GetVarArgsHandle, key); @@ -5557,37 +5559,6 @@ CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO* pSig return (CORINFO_VARARGS_HANDLE)value.B; } -void MethodContext::recCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig, bool result) -{ - if (CanGetVarArgsHandle == nullptr) - CanGetVarArgsHandle = new LightWeightMap(); - - CanGetVarArgsHandleValue key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.scope = CastHandle(pSig->scope); - key.token = (DWORD)pSig->token; - - DWORD value = result ? 1 : 0; - CanGetVarArgsHandle->Add(key, value); - DEBUG_REC(dmpCanGetVarArgsHandle(key, value)); -} -void MethodContext::dmpCanGetVarArgsHandle(const CanGetVarArgsHandleValue& key, DWORD value) -{ - printf("CanGetVarArgsHandle key scope-%016" PRIX64 " token-%08X, value result-%08X", key.scope, key.token, value); -} -bool MethodContext::repCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig) -{ - CanGetVarArgsHandleValue key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.scope = CastHandle(pSig->scope); - key.token = (DWORD)pSig->token; - - DWORD value = LookupByKeyOrMiss(CanGetVarArgsHandle, key, ": key %016" PRIX64 " %08X", key.scope, key.token); - - DEBUG_REP(dmpCanGetVarArgsHandle(key, value)); - return value != 0; -} - void MethodContext::recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection, DWORD result) { if (GetFieldThreadLocalStoreID == nullptr) @@ -6196,38 +6167,6 @@ LPVOID MethodContext::repGetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* szMet return (LPVOID)value.A; } -void MethodContext::recCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, bool result) -{ - if (CanGetCookieForPInvokeCalliSig == nullptr) - CanGetCookieForPInvokeCalliSig = new LightWeightMap(); - - CanGetCookieForPInvokeCalliSigValue key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.scope = CastHandle(szMetaSig->scope); - key.token = (DWORD)szMetaSig->token; - - DWORD value = result ? 1 : 0; - CanGetCookieForPInvokeCalliSig->Add(key, value); - DEBUG_REC(dmpCanGetCookieForPInvokeCalliSig(key, value)); -} -void MethodContext::dmpCanGetCookieForPInvokeCalliSig(const CanGetCookieForPInvokeCalliSigValue& key, DWORD value) -{ - printf("CanGetCookieForPInvokeCalliSig key scope-%016" PRIX64 " token-%08X, value result-%08X", key.scope, key.token, - value); -} -bool MethodContext::repCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) -{ - CanGetCookieForPInvokeCalliSigValue key; - ZeroMemory(&key, sizeof(key)); // Zero key including any struct padding - key.scope = CastHandle(szMetaSig->scope); - key.token = (DWORD)szMetaSig->token; - - DWORD value = LookupByKeyOrMissNoMessage(CanGetCookieForPInvokeCalliSig, key); - - DEBUG_REP(dmpCanGetCookieForPInvokeCalliSig(key, value)); - return value != 0; -} - void MethodContext::recErrorList(const char* error) { if (ErrorList == nullptr) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h index d7ce4ed4069f69..fb5e12701a4f45 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h @@ -713,13 +713,9 @@ class MethodContext CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO* sig); - void recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection, CORINFO_VARARGS_HANDLE result); + void recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection, CORINFO_VARARGS_HANDLE result); void dmpGetVarArgsHandle(const GetVarArgsHandleValue& key, DLDL value); - CORINFO_VARARGS_HANDLE repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection); - - void recCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig, bool result); - void dmpCanGetVarArgsHandle(const CanGetVarArgsHandleValue& key, DWORD value); - bool repCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig); + CORINFO_VARARGS_HANDLE repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection); void recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection, DWORD result); void dmpGetFieldThreadLocalStoreID(DWORDLONG key, DLD value); @@ -762,10 +758,6 @@ class MethodContext void recGetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* szMetaSig, LPVOID result); void dmpGetCookieForInterpreterCalliSig(const GetCookieForInterpreterCalliSigValue& key, DLDL value); - void recCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, bool result); - void dmpCanGetCookieForPInvokeCalliSig(const CanGetCookieForPInvokeCalliSigValue& key, DWORD value); - bool repCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig); - void recErrorList(const char* error); void dmpErrorList(DWORD key, DWORD value); diff --git a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp index bc2fc0131515f9..0a6118d73ab862 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -1608,17 +1608,6 @@ LPVOID interceptor_ICJI::GetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* szMet return temp; } - -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) -{ - mc->cr->AddCall("canGetCookieForPInvokeCalliSig"); - bool temp = original_ICorJitInfo->canGetCookieForPInvokeCalliSig(szMetaSig); - mc->recCanGetCookieForPInvokeCalliSig(szMetaSig, temp); - return temp; -} - // Gets a handle that is checked to see if the current method is // included in "JustMyCode" CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle(CORINFO_METHOD_HANDLE method, @@ -1709,21 +1698,11 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass(CORINFO_FIELD_ } // registers a vararg sig & returns a VM cookie for it (which can contain other stuff) -CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection) +CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { mc->cr->AddCall("getVarArgsHandle"); - CORINFO_VARARGS_HANDLE temp = original_ICorJitInfo->getVarArgsHandle(pSig, ppIndirection); - mc->recGetVarArgsHandle(pSig, ppIndirection, temp); - return temp; -} - -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool interceptor_ICJI::canGetVarArgsHandle(CORINFO_SIG_INFO* pSig) -{ - mc->cr->AddCall("canGetVarArgsHandle"); - bool temp = original_ICorJitInfo->canGetVarArgsHandle(pSig); - mc->recCanGetVarArgsHandle(pSig, temp); + CORINFO_VARARGS_HANDLE temp = original_ICorJitInfo->getVarArgsHandle(pSig, methHnd, ppIndirection); + mc->recGetVarArgsHandle(pSig, methHnd, ppIndirection, temp); return temp; } diff --git a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp index 615f8c9dca1265..ac148df7c4e295 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-counter/icorjitinfo_generated.cpp @@ -1149,13 +1149,6 @@ void* interceptor_ICJI::GetCookieForInterpreterCalliSig( return original_ICorJitInfo->GetCookieForInterpreterCalliSig(szMetaSig); } -bool interceptor_ICJI::canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) -{ - mcs->AddCall("canGetCookieForPInvokeCalliSig"); - return original_ICorJitInfo->canGetCookieForPInvokeCalliSig(szMetaSig); -} - CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle( CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) @@ -1215,17 +1208,11 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass( CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle( CORINFO_SIG_INFO* pSig, + CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { mcs->AddCall("getVarArgsHandle"); - return original_ICorJitInfo->getVarArgsHandle(pSig, ppIndirection); -} - -bool interceptor_ICJI::canGetVarArgsHandle( - CORINFO_SIG_INFO* pSig) -{ - mcs->AddCall("canGetVarArgsHandle"); - return original_ICorJitInfo->canGetVarArgsHandle(pSig); + return original_ICorJitInfo->getVarArgsHandle(pSig, methHnd, ppIndirection); } InfoAccessType interceptor_ICJI::constructStringLiteral( diff --git a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp index c4caa76a89518c..1f47ea740c0c48 100644 --- a/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shim-simple/icorjitinfo_generated.cpp @@ -1007,12 +1007,6 @@ void* interceptor_ICJI::GetCookieForInterpreterCalliSig( return original_ICorJitInfo->GetCookieForInterpreterCalliSig(szMetaSig); } -bool interceptor_ICJI::canGetCookieForPInvokeCalliSig( - CORINFO_SIG_INFO* szMetaSig) -{ - return original_ICorJitInfo->canGetCookieForPInvokeCalliSig(szMetaSig); -} - CORINFO_JUST_MY_CODE_HANDLE interceptor_ICJI::getJustMyCodeHandle( CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) @@ -1066,15 +1060,10 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getStaticFieldCurrentClass( CORINFO_VARARGS_HANDLE interceptor_ICJI::getVarArgsHandle( CORINFO_SIG_INFO* pSig, + CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { - return original_ICorJitInfo->getVarArgsHandle(pSig, ppIndirection); -} - -bool interceptor_ICJI::canGetVarArgsHandle( - CORINFO_SIG_INFO* pSig) -{ - return original_ICorJitInfo->canGetVarArgsHandle(pSig); + return original_ICorJitInfo->getVarArgsHandle(pSig, methHnd, ppIndirection); } InfoAccessType interceptor_ICJI::constructStringLiteral( diff --git a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp index c40cd89f854fe3..a1b207c3de797e 100644 --- a/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp @@ -1378,14 +1378,6 @@ LPVOID MyICJI::GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** p return jitInstance->mc->repGetCookieForPInvokeCalliSig(szMetaSig, ppIndirection); } -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool MyICJI::canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) -{ - jitInstance->mc->cr->AddCall("canGetCookieForPInvokeCalliSig"); - return jitInstance->mc->repCanGetCookieForPInvokeCalliSig(szMetaSig); -} - // Generate a cookie based on the signature to pass to INTOP_CALLI LPVOID MyICJI::GetCookieForInterpreterCalliSig(CORINFO_SIG_INFO* szMetaSig) { @@ -1456,18 +1448,10 @@ CORINFO_CLASS_HANDLE MyICJI::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE fie } // registers a vararg sig & returns a VM cookie for it (which can contain other stuff) -CORINFO_VARARGS_HANDLE MyICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection) +CORINFO_VARARGS_HANDLE MyICJI::getVarArgsHandle(CORINFO_SIG_INFO* pSig, CORINFO_METHOD_HANDLE methHnd, void** ppIndirection) { jitInstance->mc->cr->AddCall("getVarArgsHandle"); - return jitInstance->mc->repGetVarArgsHandle(pSig, ppIndirection); -} - -// returns true if a VM cookie can be generated for it (might be false due to cross-module -// inlining, in which case the inlining should be aborted) -bool MyICJI::canGetVarArgsHandle(CORINFO_SIG_INFO* pSig) -{ - jitInstance->mc->cr->AddCall("canGetVarArgsHandle"); - return jitInstance->mc->repCanGetVarArgsHandle(pSig); + return jitInstance->mc->repGetVarArgsHandle(pSig, methHnd, ppIndirection); } // Allocate a string literal on the heap and return a handle to it diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index c18572a20b87b7..03a3fa0662fc7c 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -6138,6 +6138,7 @@ CorInfoHelpFunc CEEInfo::getBoxHelper(CORINFO_CLASS_HANDLE clsHnd) // registers a vararg sig & returns a class-specific cookie for it. CORINFO_VARARGS_HANDLE CEEInfo::getVarArgsHandle(CORINFO_SIG_INFO *sig, + CORINFO_METHOD_HANDLE methHnd, void **ppIndirection) { CONTRACTL { @@ -6166,12 +6167,6 @@ CORINFO_VARARGS_HANDLE CEEInfo::getVarArgsHandle(CORINFO_SIG_INFO *sig, return result; } -bool CEEInfo::canGetVarArgsHandle(CORINFO_SIG_INFO *sig) -{ - LIMITED_METHOD_CONTRACT; - return true; -} - /***********************************************************************/ unsigned CEEInfo::getMethodHash (CORINFO_METHOD_HANDLE ftnHnd) { @@ -10025,16 +10020,9 @@ LPVOID CEEInfo::GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, { WRAPPER_NO_CONTRACT; - return getVarArgsHandle(szMetaSig, ppIndirection); + return getVarArgsHandle(szMetaSig, NULL, ppIndirection); } -bool CEEInfo::canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig) -{ - LIMITED_METHOD_CONTRACT; - return true; -} - - // Check any constraints on method type arguments bool CEEInfo::satisfiesMethodConstraints( CORINFO_CLASS_HANDLE parent,