summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Andreenko <seandree@microsoft.com>2017-06-06 10:19:11 -0700
committerGitHub <noreply@github.com>2017-06-06 10:19:11 -0700
commitb23a11e834074e3e030b42fc8d93083e15b7545d (patch)
tree72a676ddde3c96b9df943a1e3b5df9723b6bcec3
parentb68851126b20e4ad40219760bfe80b73fb6db835 (diff)
downloadcoreclr-b23a11e834074e3e030b42fc8d93083e15b7545d.tar.gz
coreclr-b23a11e834074e3e030b42fc8d93083e15b7545d.tar.bz2
coreclr-b23a11e834074e3e030b42fc8d93083e15b7545d.zip
new JitEE interface method: expandRawHandleIntrinsic (#12071)
Create a new JitEE method expandRawHandleIntrinsic. Delete old isDelegateCreationAllowed and getAddrModuleDomainID. Support CORINFO_INTRINSIC_GetRawHandle. Change JITEEVersionIdentifier. fix MEASURE_CLRAPI_CALLS: add resolveVirtualMethod and expandRawHandleIntrinsic there.
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h9
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp23
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp21
-rw-r--r--src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp18
-rw-r--r--src/ToolBox/superpmi/superpmi/icorjitinfo.cpp24
-rw-r--r--src/inc/corinfo.h29
-rw-r--r--src/jit/ICorJitInfo_API_names.h4
-rw-r--r--src/jit/ICorJitInfo_API_wrapper.hpp40
-rw-r--r--src/jit/importer.cpp37
-rw-r--r--src/vm/jitinterface.cpp46
-rw-r--r--src/vm/jitinterface.h13
-rw-r--r--src/zap/zapinfo.cpp19
-rw-r--r--src/zap/zapinfo.h8
13 files changed, 134 insertions, 157 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
index 19feffab47..00b5c1b965 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
@@ -118,6 +118,10 @@ CORINFO_METHOD_HANDLE resolveVirtualMethod(CORINFO_METHOD_HANDLE virtualMethod,
CORINFO_CLASS_HANDLE implementingClass,
CORINFO_CONTEXT_HANDLE ownerType);
+void expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult);
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
// *pMustExpand tells whether or not JIT must expand the intrinsic.
@@ -150,9 +154,6 @@ BOOL isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type of the
BOOL* pfIsOpenDelegate /* is the delegate open */
);
-// Determines whether the delegate creation obeys security transparency rules
-BOOL isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd);
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN */
@@ -720,8 +721,6 @@ const void* getInlinedCallFrameVptr(void** ppIndirection = NULL);
LONG* getAddrOfCaptureThreadGlobal(void** ppIndirection = NULL);
-SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module);
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
void* getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection = NULL);
diff --git a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
index 4741cf1354..1ba0ed2a65 100644
--- a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
@@ -235,6 +235,14 @@ CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HAND
return result;
}
+void interceptor_ICJI::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ mc->cr->AddCall("expandRawHandleIntrinsic");
+ original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */
@@ -303,15 +311,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate(
return temp;
}
-// Determines whether the delegate creation obeys security transparency rules
-BOOL interceptor_ICJI::isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd)
-{
- mc->cr->AddCall("isDelegateCreationAllowed");
- BOOL temp = original_ICorJitInfo->isDelegateCreationAllowed(delegateHnd, calleeHnd);
- mc->recIsDelegateCreationAllowed(delegateHnd, calleeHnd, temp);
- return temp;
-}
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
@@ -1428,12 +1427,6 @@ LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection)
return temp;
}
-SIZE_T* interceptor_ICJI::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- mc->cr->AddCall("getAddrModuleDomainID");
- return original_ICorJitInfo->getAddrModuleDomainID(module);
-}
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
void* interceptor_ICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
diff --git a/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
index 1d45229655..6760800d59 100644
--- a/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
@@ -162,6 +162,14 @@ CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HAND
return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
}
+void interceptor_ICJI::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ mcs->AddCall("expandRawHandleIntrinsic");
+ original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */
@@ -217,13 +225,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate(
return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Determines whether the delegate creation obeys security transparency rules
-BOOL interceptor_ICJI::isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd)
-{
- mcs->AddCall("isDelegateCreationAllowed");
- return original_ICorJitInfo->isDelegateCreationAllowed(delegateHnd, calleeHnd);
-}
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
@@ -1126,12 +1127,6 @@ LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection)
return original_ICorJitInfo->getAddrOfCaptureThreadGlobal(ppIndirection);
}
-SIZE_T* interceptor_ICJI::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- mcs->AddCall("getAddrModuleDomainID");
- return original_ICorJitInfo->getAddrModuleDomainID(module);
-}
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
void* interceptor_ICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
diff --git a/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
index aca75361a0..b098eb6b46 100644
--- a/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
@@ -149,6 +149,13 @@ CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HAND
return original_ICorJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
}
+void interceptor_ICJI::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ return original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics interceptor_ICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */
@@ -198,12 +205,6 @@ BOOL interceptor_ICJI::isCompatibleDelegate(
return original_ICorJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Determines whether the delegate creation obeys security transparency rules
-BOOL interceptor_ICJI::isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd)
-{
- return original_ICorJitInfo->isDelegateCreationAllowed(delegateHnd, calleeHnd);
-}
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
CorInfoInstantiationVerification interceptor_ICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN
@@ -1014,11 +1015,6 @@ LONG* interceptor_ICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection)
return original_ICorJitInfo->getAddrOfCaptureThreadGlobal(ppIndirection);
}
-SIZE_T* interceptor_ICJI::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- return original_ICorJitInfo->getAddrModuleDomainID(module);
-}
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
void* interceptor_ICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
diff --git a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
index 59ad3c5e40..d88e35299a 100644
--- a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
+++ b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
@@ -184,6 +184,15 @@ CORINFO_METHOD_HANDLE MyICJI::resolveVirtualMethod(CORINFO_METHOD_HANDLE virtua
return result;
}
+void MyICJI::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ jitInstance->mc->cr->AddCall("expandRawHandleIntrinsic");
+ LogError("Hit unimplemented expandRawHandleIntrinsic");
+ DebugBreakorAV(129);
+}
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
CorInfoIntrinsics MyICJI::getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand /* OUT */
@@ -238,13 +247,6 @@ BOOL MyICJI::isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type
return jitInstance->mc->repIsCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-// Determines whether the delegate creation obeys security transparency rules
-BOOL MyICJI::isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd)
-{
- jitInstance->mc->cr->AddCall("isDelegateCreationAllowed");
- return jitInstance->mc->repIsDelegateCreationAllowed(delegateHnd, calleeHnd);
-}
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
CorInfoInstantiationVerification MyICJI::isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN */
@@ -1228,14 +1230,6 @@ LONG* MyICJI::getAddrOfCaptureThreadGlobal(void** ppIndirection)
return jitInstance->mc->repGetAddrOfCaptureThreadGlobal(ppIndirection);
}
-SIZE_T* MyICJI::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- jitInstance->mc->cr->AddCall("getAddrModuleDomainID");
- LogError("Hit unimplemented getAddrModuleDomainID");
- DebugBreakorAV(88);
- return 0;
-}
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
void* MyICJI::getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h
index 0620994f65..e27283c8b3 100644
--- a/src/inc/corinfo.h
+++ b/src/inc/corinfo.h
@@ -213,11 +213,11 @@ TODO: Talk about initializing strutures before use
#define SELECTANY extern __declspec(selectany)
#endif
-SELECTANY const GUID JITEEVersionIdentifier = { /* f00b3f49-ddd2-49be-ba43-6e49ffa66959 */
- 0xf00b3f49,
- 0xddd2,
- 0x49be,
- { 0xba, 0x43, 0x6e, 0x49, 0xff, 0xa6, 0x69, 0x59 }
+SELECTANY const GUID JITEEVersionIdentifier = { /* e5708e9e-dd18-4287-8745-5d10ff2697cf */
+ 0xe5708e9e,
+ 0xdd18,
+ 0x4287,
+ { 0x87, 0x45, 0x5d, 0x10, 0xff, 0x26, 0x97, 0xcf }
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -960,6 +960,7 @@ enum CorInfoIntrinsics
CORINFO_INTRINSIC_ByReference_Value,
CORINFO_INTRINSIC_Span_GetItem,
CORINFO_INTRINSIC_ReadOnlySpan_GetItem,
+ CORINFO_INTRINSIC_GetRawHandle,
CORINFO_INTRINSIC_Count,
CORINFO_INTRINSIC_Illegal = -1, // Not a true intrinsic,
@@ -2075,6 +2076,15 @@ public:
CORINFO_CONTEXT_HANDLE ownerType = NULL /* IN */
) = 0;
+ // Given resolved token that corresponds to an intrinsic classified as
+ // a CORINFO_INTRINSIC_GetRawHandle intrinsic, fetch the handle associated
+ // with the token. If this is not possible at compile-time (because the current method's
+ // code is shared and the token contains generic parameters) then indicate
+ // how the handle should be looked up at runtime.
+ virtual void expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult) = 0;
+
// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
// getIntrinsicID() returns the intrinsic ID.
// *pMustExpand tells whether or not JIT must expand the intrinsic.
@@ -2119,13 +2129,6 @@ public:
BOOL *pfIsOpenDelegate /* is the delegate open */
) = 0;
- // Determines whether the delegate creation obeys security transparency rules
- virtual BOOL isDelegateCreationAllowed (
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd
- ) = 0;
-
-
// Indicates if the method is an instance of the generic
// method that passes (or has passed) verification
virtual CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric (
@@ -2846,8 +2849,6 @@ public:
void **ppIndirection = NULL
) = 0;
- virtual SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module) = 0;
-
// return the native entry point to an EE helper (see CorInfoHelpFunc)
virtual void* getHelperFtn (
CorInfoHelpFunc ftnNum,
diff --git a/src/jit/ICorJitInfo_API_names.h b/src/jit/ICorJitInfo_API_names.h
index 601afbdfe1..1330f81097 100644
--- a/src/jit/ICorJitInfo_API_names.h
+++ b/src/jit/ICorJitInfo_API_names.h
@@ -20,7 +20,6 @@ DEF_CLR_API(getUnmanagedCallConv)
DEF_CLR_API(pInvokeMarshalingRequired)
DEF_CLR_API(satisfiesMethodConstraints)
DEF_CLR_API(isCompatibleDelegate)
-DEF_CLR_API(isDelegateCreationAllowed)
DEF_CLR_API(isInstantiationOfVerifiedGeneric)
DEF_CLR_API(initConstraintsForVerification)
DEF_CLR_API(canSkipMethodVerification)
@@ -113,7 +112,6 @@ DEF_CLR_API(getSystemVAmd64PassStructInRegisterDescriptor)
DEF_CLR_API(getThreadTLSIndex)
DEF_CLR_API(getInlinedCallFrameVptr)
DEF_CLR_API(getAddrOfCaptureThreadGlobal)
-DEF_CLR_API(getAddrModuleDomainID)
DEF_CLR_API(getHelperFtn)
DEF_CLR_API(getFunctionEntryPoint)
DEF_CLR_API(getFunctionFixedEntryPoint)
@@ -167,5 +165,7 @@ DEF_CLR_API(recordRelocation)
DEF_CLR_API(getRelocTypeHint)
DEF_CLR_API(getModuleNativeEntryPointRange)
DEF_CLR_API(getExpectedTargetArchitecture)
+DEF_CLR_API(resolveVirtualMethod)
+DEF_CLR_API(expandRawHandleIntrinsic)
#undef DEF_CLR_API
diff --git a/src/jit/ICorJitInfo_API_wrapper.hpp b/src/jit/ICorJitInfo_API_wrapper.hpp
index a3ad21165b..b9fd876995 100644
--- a/src/jit/ICorJitInfo_API_wrapper.hpp
+++ b/src/jit/ICorJitInfo_API_wrapper.hpp
@@ -189,17 +189,6 @@ BOOL WrapICorJitInfo::isCompatibleDelegate(
return temp;
}
-BOOL WrapICorJitInfo::isDelegateCreationAllowed(
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd)
-{
- API_ENTER(isDelegateCreationAllowed);
- BOOL temp = wrapHnd->isDelegateCreationAllowed(delegateHnd, calleeHnd);
- API_LEAVE(isDelegateCreationAllowed);
- return temp;
-}
-
-
CorInfoInstantiationVerification WrapICorJitInfo::isInstantiationOfVerifiedGeneric(
CORINFO_METHOD_HANDLE method /* IN */)
{
@@ -1097,14 +1086,6 @@ LONG * WrapICorJitInfo::getAddrOfCaptureThreadGlobal(
return temp;
}
-SIZE_T* WrapICorJitInfo::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- API_ENTER(getAddrModuleDomainID);
- SIZE_T* result = wrapHnd->getAddrModuleDomainID(module);
- API_LEAVE(getAddrModuleDomainID);
- return result;
-}
-
void* WrapICorJitInfo::getHelperFtn(
CorInfoHelpFunc ftnNum,
void **ppIndirection)
@@ -1615,6 +1596,27 @@ DWORD WrapICorJitInfo::getExpectedTargetArchitecture()
return result;
}
+CORINFO_METHOD_HANDLE WrapICorJitInfo::resolveVirtualMethod(
+ CORINFO_METHOD_HANDLE virtualMethod, /* IN */
+ CORINFO_CLASS_HANDLE implementingClass, /* IN */
+ CORINFO_CONTEXT_HANDLE ownerType = NULL /* IN */
+)
+{
+ API_ENTER(resolveVirtualMethod);
+ CORINFO_METHOD_HANDLE result = wrapHnd->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
+ API_LEAVE(resolveVirtualMethod);
+ return result;
+}
+
+void WrapICorJitInfo::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ API_ENTER(expandRawHandleIntrinsic);
+ wrapHnd->expandRawHandleIntrinsic(pResolvedToken, pResult);
+ API_LEAVE(expandRawHandleIntrinsic);
+}
+
/**********************************************************************************/
// clang-format on
/**********************************************************************************/
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp
index 5cc5e4efb9..4f5aec0ff4 100644
--- a/src/jit/importer.cpp
+++ b/src/jit/importer.cpp
@@ -3728,6 +3728,38 @@ GenTreePtr Compiler::impIntrinsic(GenTreePtr newobjThis,
break;
}
+ case CORINFO_INTRINSIC_GetRawHandle:
+ {
+ noway_assert(IsTargetAbi(CORINFO_CORERT_ABI)); // Only CoreRT supports it.
+ CORINFO_RESOLVED_TOKEN resolvedToken;
+ resolvedToken.tokenContext = MAKE_METHODCONTEXT(info.compMethodHnd);
+ resolvedToken.tokenScope = info.compScopeHnd;
+ resolvedToken.token = memberRef;
+ resolvedToken.tokenType = CORINFO_TOKENKIND_Method;
+
+ CORINFO_GENERICHANDLE_RESULT embedInfo;
+ info.compCompHnd->expandRawHandleIntrinsic(&resolvedToken, &embedInfo);
+
+ GenTreePtr rawHandle = impLookupToTree(&resolvedToken, &embedInfo.lookup, gtTokenToIconFlags(memberRef),
+ embedInfo.compileTimeHandle);
+ if (rawHandle == nullptr)
+ {
+ return nullptr;
+ }
+
+ noway_assert(genTypeSize(rawHandle->TypeGet()) == genTypeSize(TYP_I_IMPL));
+
+ unsigned rawHandleSlot = lvaGrabTemp(true DEBUGARG("rawHandle"));
+ impAssignTempGen(rawHandleSlot, rawHandle, clsHnd, (unsigned)CHECK_SPILL_NONE);
+
+ GenTreePtr lclVar = gtNewLclvNode(rawHandleSlot, TYP_I_IMPL);
+ GenTreePtr lclVarAddr = gtNewOperNode(GT_ADDR, TYP_I_IMPL, lclVar);
+ var_types resultType = JITtype2varType(sig->retType);
+ retNode = gtNewOperNode(GT_IND, resultType, lclVarAddr);
+
+ break;
+ }
+
default:
/* Unknown intrinsic */
break;
@@ -6689,6 +6721,11 @@ var_types Compiler::impImportCall(OPCODE opcode,
call = impIntrinsic(newobjThis, clsHnd, methHnd, sig, pResolvedToken->token, readonlyCall,
(canTailCall && (tailCall != 0)), &intrinsicID);
+ if (compIsForInlining() && compInlineResult->IsFailure())
+ {
+ return callRetTyp;
+ }
+
if (call != nullptr)
{
assert(!(mflags & CORINFO_FLG_VIRTUAL) || (mflags & CORINFO_FLG_FINAL) ||
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index c28d6e12bd..e5d6efe483 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -8743,6 +8743,14 @@ CORINFO_METHOD_HANDLE CEEInfo::resolveVirtualMethod(CORINFO_METHOD_HANDLE method
return result;
}
+void CEEInfo::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ LIMITED_METHOD_CONTRACT;
+ UNREACHABLE(); // only called with CoreRT.
+}
+
/*********************************************************************/
void CEEInfo::getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftnHnd,
CORINFO_CONST_LOOKUP * pResult,
@@ -9591,21 +9599,6 @@ BOOL CEEInfo::isCompatibleDelegate(
return result;
}
-// Determines whether the delegate creation obeys security transparency rules
-BOOL CEEInfo::isDelegateCreationAllowed (
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd)
-{
- CONTRACTL {
- SO_TOLERANT;
- THROWS;
- GC_TRIGGERS;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- return TRUE;
-}
-
/*********************************************************************/
// return the unmanaged target *if method has already been prelinked.*
void* CEEInfo::getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method,
@@ -9866,29 +9859,6 @@ const void * CEEInfo::getInlinedCallFrameVptr(void **ppIndirection)
return result;
}
-
-SIZE_T * CEEInfo::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- CONTRACTL {
- SO_TOLERANT;
- NOTHROW;
- GC_NOTRIGGER;
- MODE_PREEMPTIVE;
- } CONTRACTL_END;
-
- SIZE_T * result = NULL;
-
- JIT_TO_EE_TRANSITION_LEAF();
-
- Module* pModule = GetModule(module);
-
- result = pModule->GetAddrModuleID();
-
- EE_TO_JIT_TRANSITION_LEAF();
-
- return result;
-}
-
LONG * CEEInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection)
{
CONTRACTL {
diff --git a/src/vm/jitinterface.h b/src/vm/jitinterface.h
index d287248d24..182e797737 100644
--- a/src/vm/jitinterface.h
+++ b/src/vm/jitinterface.h
@@ -741,6 +741,10 @@ public:
CORINFO_CONTEXT_HANDLE ownerType
);
+ void expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult);
+
CorInfoIntrinsics getIntrinsicID(CORINFO_METHOD_HANDLE method,
bool * pMustExpand = NULL);
@@ -777,11 +781,6 @@ public:
CORINFO_CLASS_HANDLE delegateCls,
BOOL* pfIsOpenDelegate);
- // Determines whether the delegate creation obeys security transparency rules
- BOOL isDelegateCreationAllowed (
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd);
-
// ICorFieldInfo stuff
const char* getFieldName (CORINFO_FIELD_HANDLE field,
const char** scopeName);
@@ -898,10 +897,6 @@ public:
DWORD getThreadTLSIndex(void **ppIndirection);
const void * getInlinedCallFrameVptr(void **ppIndirection);
- // Returns the address of the domain neutral module id. This only makes sense for domain neutral (shared)
- // modules
- SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module);
-
LONG * getAddrOfCaptureThreadGlobal(void **ppIndirection);
void* getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */
void ** ppIndirection); /* OUT */
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index 60e03af5c2..554783f70d 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -1411,11 +1411,6 @@ const void * ZapInfo::getInlinedCallFrameVptr(void **ppIndirection)
return NULL;
}
-SIZE_T* ZapInfo::getAddrModuleDomainID(CORINFO_MODULE_HANDLE module)
-{
- return m_pEEJitInfo->getAddrModuleDomainID(module);
-}
-
LONG * ZapInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection)
{
_ASSERTE(ppIndirection != NULL);
@@ -3723,6 +3718,13 @@ CORINFO_METHOD_HANDLE ZapInfo::resolveVirtualMethod(
return m_pEEJitInfo->resolveVirtualMethod(virtualMethod, implementingClass, ownerType);
}
+void ZapInfo::expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult)
+{
+ m_pEEJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
+}
+
CorInfoIntrinsics ZapInfo::getIntrinsicID(CORINFO_METHOD_HANDLE method,
bool * pMustExpand)
{
@@ -3778,13 +3780,6 @@ BOOL ZapInfo::isCompatibleDelegate(
return m_pEEJitInfo->isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate);
}
-BOOL ZapInfo::isDelegateCreationAllowed (
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd)
-{
- return m_pEEJitInfo->isDelegateCreationAllowed(delegateHnd, calleeHnd);
-}
-
//
// ICorErrorInfo
//
diff --git a/src/zap/zapinfo.h b/src/zap/zapinfo.h
index 6e83657170..44ad5de52d 100644
--- a/src/zap/zapinfo.h
+++ b/src/zap/zapinfo.h
@@ -326,7 +326,6 @@ public:
DWORD getThreadTLSIndex(void **ppIndirection);
const void * getInlinedCallFrameVptr(void **ppIndirection);
LONG * getAddrOfCaptureThreadGlobal(void **ppIndirection);
- SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module);
// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).
// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used.
@@ -671,6 +670,10 @@ public:
CORINFO_CONTEXT_HANDLE ownerType
);
+ void expandRawHandleIntrinsic(
+ CORINFO_RESOLVED_TOKEN * pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT * pResult);
+
CorInfoIntrinsics getIntrinsicID(CORINFO_METHOD_HANDLE method,
bool * pMustExpand = NULL);
bool isInSIMDModule(CORINFO_CLASS_HANDLE classHnd);
@@ -688,9 +691,6 @@ public:
CORINFO_CLASS_HANDLE delegateCls,
BOOL* pfIsOpenDelegate);
- BOOL isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd);
-
void getGSCookie(GSCookie * pCookieVal,
GSCookie** ppCookieVal);
// ICorErrorInfo