From: Pat Gavlin Date: Thu, 12 May 2016 19:57:13 +0000 (-0700) Subject: Apply the JIT interface changes needed for Fadi's upcoming shared generics change. X-Git-Tag: submit/tizen/20210909.063632~11030^2~10534^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98c21a5258154ae947c948f8dadcf4f8021b5517;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Apply the JIT interface changes needed for Fadi's upcoming shared generics change. [tfs-changeset: 1604316] Commit migrated from https://github.com/dotnet/coreclr/commit/8a972e65990b962613b474c11639245d90be5079 --- diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index d3c18d9..bd4a086 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -231,11 +231,11 @@ TODO: Talk about initializing strutures before use #if COR_JIT_EE_VERSION > 460 // Update this one -SELECTANY const GUID JITEEVersionIdentifier = { /* 7fe8ebd7-2f61-41fc-8aac-2be394620be0 */ - 0x7fe8ebd7, - 0x2f61, - 0x41fc, - { 0x8a, 0xac, 0x2b, 0xe3, 0x94, 0x62, 0xb, 0xe0 } +SELECTANY const GUID JITEEVersionIdentifier = { /* 7a6aa61a-78b1-4dfb-9e06-655fb4774d7f */ + 0x7a6aa61a, + 0x78b1, + 0x4dfb, + { 0x9e, 0x6, 0x65, 0x5f, 0xb4, 0x77, 0x4d, 0x7f } }; #else @@ -641,6 +641,7 @@ enum CorInfoHelpFunc CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, #if COR_JIT_EE_VERSION > 460 + CORINFO_HELP_READYTORUN_GENERIC_HANDLE, CORINFO_HELP_READYTORUN_DELEGATE_CTOR, #else #define CORINFO_HELP_READYTORUN_DELEGATE_CTOR CORINFO_HELP_EE_PRESTUB @@ -1309,12 +1310,29 @@ enum CORINFO_RUNTIME_LOOKUP_KIND CORINFO_LOOKUP_CLASSPARAM, }; +#if COR_JIT_EE_VERSION > 460 + +struct CORINFO_LOOKUP_KIND +{ + bool needsRuntimeLookup; + CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind; + + // The 'runtimeLookupFlags' field is just for internal VM / ZAP communication, + // not to be used by the JIT. + WORD runtimeLookupFlags; +} ; + +#else + struct CORINFO_LOOKUP_KIND { bool needsRuntimeLookup; CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind; } ; +#endif + + // CORINFO_RUNTIME_LOOKUP indicates the details of the runtime lookup // operation to be performed. // @@ -2405,20 +2423,28 @@ public: CORINFO_CLASS_HANDLE cls ) = 0; - virtual void getReadyToRunHelper( +#if COR_JIT_EE_VERSION > 460 + virtual bool getReadyToRunHelper( CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_LOOKUP_KIND * pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP * pLookup ) = 0; -#if COR_JIT_EE_VERSION > 460 virtual void getReadyToRunDelegateCtorHelper( CORINFO_RESOLVED_TOKEN * pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_CONST_LOOKUP * pLookup ) = 0; +#else + virtual void getReadyToRunHelper( + CORINFO_RESOLVED_TOKEN * pResolvedToken, + CorInfoHelpFunc id, + CORINFO_CONST_LOOKUP * pLookup + ) = 0; #endif + virtual const char* getHelperName( CorInfoHelpFunc ) = 0; diff --git a/src/coreclr/src/inc/jithelpers.h b/src/coreclr/src/inc/jithelpers.h index 371143d..b8521bf 100644 --- a/src/coreclr/src/inc/jithelpers.h +++ b/src/coreclr/src/inc/jithelpers.h @@ -309,6 +309,7 @@ JITHELPER(CORINFO_HELP_READYTORUN_STATIC_BASE, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) JITHELPER(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB) #if COR_JIT_EE_VERSION > 460 + 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) #endif // COR_JIT_EE_VERSION diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 3ba0cd0..2aba8ce 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -1633,7 +1633,11 @@ GenTreePtr Compiler::impReadyToRunHelperToTree(CORINFO_RESOLVED_TOKEN * GenTreePtr arg) { CORINFO_CONST_LOOKUP lookup; +#if COR_JIT_EE_VERSION > 460 + info.compCompHnd->getReadyToRunHelper(pResolvedToken, nullptr, helper, &lookup); +#else info.compCompHnd->getReadyToRunHelper(pResolvedToken, helper, &lookup); +#endif GenTreeArgList* args = NULL; diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index 28f41c6..e94cb0d 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -6196,8 +6196,9 @@ CorInfoHelpFunc CEEInfo::getUnBoxHelper(CORINFO_CLASS_HANDLE clsHnd) } /***********************************************************************/ -void CEEInfo::getReadyToRunHelper( +bool CEEInfo::getReadyToRunHelper( CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_LOOKUP_KIND * pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP * pLookup ) @@ -10096,7 +10097,7 @@ bool CEEInfo::runWithErrorTrap(void (*function)(void*), void* param) // No dynamic contract here because SEH is used STATIC_CONTRACT_THROWS; STATIC_CONTRACT_GC_TRIGGERS; - STATIC_CONTRACT_SO_INTOLERANT; + STATIC_CONTRACT_SO_TOLERANT; STATIC_CONTRACT_MODE_PREEMPTIVE; // NOTE: the lack of JIT/EE transition markers in this method is intentional. Any diff --git a/src/coreclr/src/vm/jitinterface.h b/src/coreclr/src/vm/jitinterface.h index ace9608..0df18849 100644 --- a/src/coreclr/src/vm/jitinterface.h +++ b/src/coreclr/src/vm/jitinterface.h @@ -543,8 +543,9 @@ public: CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls); CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls); - void getReadyToRunHelper( + bool getReadyToRunHelper( CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_LOOKUP_KIND * pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP * pLookup ); diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index 8b6e216..79abbf7 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -1582,7 +1582,6 @@ ZapInfo::getLocationOfThisType(CORINFO_METHOD_HANDLE context) return m_pEEJitInfo->getLocationOfThisType(context); } - void ZapInfo::embedGenericHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, BOOL fEmbedParent, @@ -3394,8 +3393,9 @@ CorInfoHelpFunc ZapInfo::getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls) return m_pEEJitInfo->getNewArrHelper(arrayCls); } -void ZapInfo::getReadyToRunHelper( +bool ZapInfo::getReadyToRunHelper( CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_LOOKUP_KIND * pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP * pLookup ) @@ -3481,6 +3481,9 @@ void ZapInfo::getReadyToRunHelper( pLookup->accessType = IAT_PVALUE; pLookup->addr = pImport; + return true; +#else + return false; #endif } diff --git a/src/coreclr/src/zap/zapinfo.h b/src/coreclr/src/zap/zapinfo.h index b472d48..059917a 100644 --- a/src/coreclr/src/zap/zapinfo.h +++ b/src/coreclr/src/zap/zapinfo.h @@ -546,8 +546,9 @@ public: CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls); CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls); - void getReadyToRunHelper( + bool getReadyToRunHelper( CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_LOOKUP_KIND * pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP * pLookup );