diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-09-29 07:23:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-29 07:23:06 +0300 |
commit | a6a7dca8327ae11cea2bf4d57945eef3c8a8e1e9 (patch) | |
tree | 2884e97773ff51dce08df99cd6b984d93a0a38d2 | |
parent | 590df20f31d370a3e650e9baf395bdb61a19a7cd (diff) |
Update JIT/EE interface (#4631)
-rw-r--r-- | src/JitInterface/src/CorInfoBase.cs | 329 | ||||
-rw-r--r-- | src/JitInterface/src/CorInfoImpl.cs | 7 | ||||
-rw-r--r-- | src/JitInterface/src/ThunkGenerator/ThunkInput.txt | 1 | ||||
-rw-r--r-- | src/JitInterface/src/ThunkGenerator/corinfo.h | 16 | ||||
-rw-r--r-- | src/Native/jitinterface/jitinterface.h | 10 | ||||
-rw-r--r-- | src/Native/jitinterface/jitwrapper.cpp | 10 |
6 files changed, 208 insertions, 165 deletions
diff --git a/src/JitInterface/src/CorInfoBase.cs b/src/JitInterface/src/CorInfoBase.cs index dd63457c6..d44d0599c 100644 --- a/src/JitInterface/src/CorInfoBase.cs +++ b/src/JitInterface/src/CorInfoBase.cs @@ -38,6 +38,8 @@ namespace Internal.JitInterface [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] delegate CORINFO_METHOD_STRUCT_* __resolveVirtualMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* virtualMethod, CORINFO_CLASS_STRUCT_* implementingClass, CORINFO_CONTEXT_STRUCT* ownerType); [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] + delegate CORINFO_CLASS_STRUCT_* __getDefaultEqualityComparerClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType); + [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] delegate void __expandRawHandleIntrinsic(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult); [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] delegate CorInfoIntrinsics __getIntrinsicID(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, [MarshalAs(UnmanagedType.U1)] ref bool pMustExpand); @@ -520,6 +522,20 @@ namespace Internal.JitInterface } } + static CORINFO_CLASS_STRUCT_* _getDefaultEqualityComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType) + { + var _this = GetThis(thisHandle); + try + { + return _this.getDefaultEqualityComparerClass(elemType); + } + catch (Exception ex) + { + *ppException = _this.AllocException(ex); + return default(CORINFO_CLASS_STRUCT_*); + } + } + static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult) { var _this = GetThis(thisHandle); @@ -2625,8 +2641,8 @@ namespace Internal.JitInterface static IntPtr GetUnmanagedCallbacks(out Object keepAlive) { - IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 166); - Object[] delegates = new Object[166]; + IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 167); + Object[] delegates = new Object[167]; var d0 = new __getMethodAttribs(_getMethodAttribs); callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0); @@ -2667,465 +2683,468 @@ namespace Internal.JitInterface var d12 = new __resolveVirtualMethod(_resolveVirtualMethod); callbacks[12] = Marshal.GetFunctionPointerForDelegate(d12); delegates[12] = d12; - var d13 = new __expandRawHandleIntrinsic(_expandRawHandleIntrinsic); + var d13 = new __getDefaultEqualityComparerClass(_getDefaultEqualityComparerClass); callbacks[13] = Marshal.GetFunctionPointerForDelegate(d13); delegates[13] = d13; - var d14 = new __getIntrinsicID(_getIntrinsicID); + var d14 = new __expandRawHandleIntrinsic(_expandRawHandleIntrinsic); callbacks[14] = Marshal.GetFunctionPointerForDelegate(d14); delegates[14] = d14; - var d15 = new __isInSIMDModule(_isInSIMDModule); + var d15 = new __getIntrinsicID(_getIntrinsicID); callbacks[15] = Marshal.GetFunctionPointerForDelegate(d15); delegates[15] = d15; - var d16 = new __getUnmanagedCallConv(_getUnmanagedCallConv); + var d16 = new __isInSIMDModule(_isInSIMDModule); callbacks[16] = Marshal.GetFunctionPointerForDelegate(d16); delegates[16] = d16; - var d17 = new __pInvokeMarshalingRequired(_pInvokeMarshalingRequired); + var d17 = new __getUnmanagedCallConv(_getUnmanagedCallConv); callbacks[17] = Marshal.GetFunctionPointerForDelegate(d17); delegates[17] = d17; - var d18 = new __satisfiesMethodConstraints(_satisfiesMethodConstraints); + var d18 = new __pInvokeMarshalingRequired(_pInvokeMarshalingRequired); callbacks[18] = Marshal.GetFunctionPointerForDelegate(d18); delegates[18] = d18; - var d19 = new __isCompatibleDelegate(_isCompatibleDelegate); + var d19 = new __satisfiesMethodConstraints(_satisfiesMethodConstraints); callbacks[19] = Marshal.GetFunctionPointerForDelegate(d19); delegates[19] = d19; - var d20 = new __isInstantiationOfVerifiedGeneric(_isInstantiationOfVerifiedGeneric); + var d20 = new __isCompatibleDelegate(_isCompatibleDelegate); callbacks[20] = Marshal.GetFunctionPointerForDelegate(d20); delegates[20] = d20; - var d21 = new __initConstraintsForVerification(_initConstraintsForVerification); + var d21 = new __isInstantiationOfVerifiedGeneric(_isInstantiationOfVerifiedGeneric); callbacks[21] = Marshal.GetFunctionPointerForDelegate(d21); delegates[21] = d21; - var d22 = new __canSkipMethodVerification(_canSkipMethodVerification); + var d22 = new __initConstraintsForVerification(_initConstraintsForVerification); callbacks[22] = Marshal.GetFunctionPointerForDelegate(d22); delegates[22] = d22; - var d23 = new __methodMustBeLoadedBeforeCodeIsRun(_methodMustBeLoadedBeforeCodeIsRun); + var d23 = new __canSkipMethodVerification(_canSkipMethodVerification); callbacks[23] = Marshal.GetFunctionPointerForDelegate(d23); delegates[23] = d23; - var d24 = new __mapMethodDeclToMethodImpl(_mapMethodDeclToMethodImpl); + var d24 = new __methodMustBeLoadedBeforeCodeIsRun(_methodMustBeLoadedBeforeCodeIsRun); callbacks[24] = Marshal.GetFunctionPointerForDelegate(d24); delegates[24] = d24; - var d25 = new __getGSCookie(_getGSCookie); + var d25 = new __mapMethodDeclToMethodImpl(_mapMethodDeclToMethodImpl); callbacks[25] = Marshal.GetFunctionPointerForDelegate(d25); delegates[25] = d25; - var d26 = new __resolveToken(_resolveToken); + var d26 = new __getGSCookie(_getGSCookie); callbacks[26] = Marshal.GetFunctionPointerForDelegate(d26); delegates[26] = d26; - var d27 = new __tryResolveToken(_tryResolveToken); + var d27 = new __resolveToken(_resolveToken); callbacks[27] = Marshal.GetFunctionPointerForDelegate(d27); delegates[27] = d27; - var d28 = new __findSig(_findSig); + var d28 = new __tryResolveToken(_tryResolveToken); callbacks[28] = Marshal.GetFunctionPointerForDelegate(d28); delegates[28] = d28; - var d29 = new __findCallSiteSig(_findCallSiteSig); + var d29 = new __findSig(_findSig); callbacks[29] = Marshal.GetFunctionPointerForDelegate(d29); delegates[29] = d29; - var d30 = new __getTokenTypeAsHandle(_getTokenTypeAsHandle); + var d30 = new __findCallSiteSig(_findCallSiteSig); callbacks[30] = Marshal.GetFunctionPointerForDelegate(d30); delegates[30] = d30; - var d31 = new __canSkipVerification(_canSkipVerification); + var d31 = new __getTokenTypeAsHandle(_getTokenTypeAsHandle); callbacks[31] = Marshal.GetFunctionPointerForDelegate(d31); delegates[31] = d31; - var d32 = new __isValidToken(_isValidToken); + var d32 = new __canSkipVerification(_canSkipVerification); callbacks[32] = Marshal.GetFunctionPointerForDelegate(d32); delegates[32] = d32; - var d33 = new __isValidStringRef(_isValidStringRef); + var d33 = new __isValidToken(_isValidToken); callbacks[33] = Marshal.GetFunctionPointerForDelegate(d33); delegates[33] = d33; - var d34 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); + var d34 = new __isValidStringRef(_isValidStringRef); callbacks[34] = Marshal.GetFunctionPointerForDelegate(d34); delegates[34] = d34; - var d35 = new __asCorInfoType(_asCorInfoType); + var d35 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); callbacks[35] = Marshal.GetFunctionPointerForDelegate(d35); delegates[35] = d35; - var d36 = new __getClassName(_getClassName); + var d36 = new __asCorInfoType(_asCorInfoType); callbacks[36] = Marshal.GetFunctionPointerForDelegate(d36); delegates[36] = d36; - var d37 = new __appendClassName(_appendClassName); + var d37 = new __getClassName(_getClassName); callbacks[37] = Marshal.GetFunctionPointerForDelegate(d37); delegates[37] = d37; - var d38 = new __isValueClass(_isValueClass); + var d38 = new __appendClassName(_appendClassName); callbacks[38] = Marshal.GetFunctionPointerForDelegate(d38); delegates[38] = d38; - var d39 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); + var d39 = new __isValueClass(_isValueClass); callbacks[39] = Marshal.GetFunctionPointerForDelegate(d39); delegates[39] = d39; - var d40 = new __getClassAttribs(_getClassAttribs); + var d40 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); callbacks[40] = Marshal.GetFunctionPointerForDelegate(d40); delegates[40] = d40; - var d41 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); + var d41 = new __getClassAttribs(_getClassAttribs); callbacks[41] = Marshal.GetFunctionPointerForDelegate(d41); delegates[41] = d41; - var d42 = new __getClassModule(_getClassModule); + var d42 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); callbacks[42] = Marshal.GetFunctionPointerForDelegate(d42); delegates[42] = d42; - var d43 = new __getModuleAssembly(_getModuleAssembly); + var d43 = new __getClassModule(_getClassModule); callbacks[43] = Marshal.GetFunctionPointerForDelegate(d43); delegates[43] = d43; - var d44 = new __getAssemblyName(_getAssemblyName); + var d44 = new __getModuleAssembly(_getModuleAssembly); callbacks[44] = Marshal.GetFunctionPointerForDelegate(d44); delegates[44] = d44; - var d45 = new __LongLifetimeMalloc(_LongLifetimeMalloc); + var d45 = new __getAssemblyName(_getAssemblyName); callbacks[45] = Marshal.GetFunctionPointerForDelegate(d45); delegates[45] = d45; - var d46 = new __LongLifetimeFree(_LongLifetimeFree); + var d46 = new __LongLifetimeMalloc(_LongLifetimeMalloc); callbacks[46] = Marshal.GetFunctionPointerForDelegate(d46); delegates[46] = d46; - var d47 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); + var d47 = new __LongLifetimeFree(_LongLifetimeFree); callbacks[47] = Marshal.GetFunctionPointerForDelegate(d47); delegates[47] = d47; - var d48 = new __getClassSize(_getClassSize); + var d48 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); callbacks[48] = Marshal.GetFunctionPointerForDelegate(d48); delegates[48] = d48; - var d49 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); + var d49 = new __getClassSize(_getClassSize); callbacks[49] = Marshal.GetFunctionPointerForDelegate(d49); delegates[49] = d49; - var d50 = new __getClassGClayout(_getClassGClayout); + var d50 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); callbacks[50] = Marshal.GetFunctionPointerForDelegate(d50); delegates[50] = d50; - var d51 = new __getClassNumInstanceFields(_getClassNumInstanceFields); + var d51 = new __getClassGClayout(_getClassGClayout); callbacks[51] = Marshal.GetFunctionPointerForDelegate(d51); delegates[51] = d51; - var d52 = new __getFieldInClass(_getFieldInClass); + var d52 = new __getClassNumInstanceFields(_getClassNumInstanceFields); callbacks[52] = Marshal.GetFunctionPointerForDelegate(d52); delegates[52] = d52; - var d53 = new __checkMethodModifier(_checkMethodModifier); + var d53 = new __getFieldInClass(_getFieldInClass); callbacks[53] = Marshal.GetFunctionPointerForDelegate(d53); delegates[53] = d53; - var d54 = new __getNewHelper(_getNewHelper); + var d54 = new __checkMethodModifier(_checkMethodModifier); callbacks[54] = Marshal.GetFunctionPointerForDelegate(d54); delegates[54] = d54; - var d55 = new __getNewArrHelper(_getNewArrHelper); + var d55 = new __getNewHelper(_getNewHelper); callbacks[55] = Marshal.GetFunctionPointerForDelegate(d55); delegates[55] = d55; - var d56 = new __getCastingHelper(_getCastingHelper); + var d56 = new __getNewArrHelper(_getNewArrHelper); callbacks[56] = Marshal.GetFunctionPointerForDelegate(d56); delegates[56] = d56; - var d57 = new __getSharedCCtorHelper(_getSharedCCtorHelper); + var d57 = new __getCastingHelper(_getCastingHelper); callbacks[57] = Marshal.GetFunctionPointerForDelegate(d57); delegates[57] = d57; - var d58 = new __getSecurityPrologHelper(_getSecurityPrologHelper); + var d58 = new __getSharedCCtorHelper(_getSharedCCtorHelper); callbacks[58] = Marshal.GetFunctionPointerForDelegate(d58); delegates[58] = d58; - var d59 = new __getTypeForBox(_getTypeForBox); + var d59 = new __getSecurityPrologHelper(_getSecurityPrologHelper); callbacks[59] = Marshal.GetFunctionPointerForDelegate(d59); delegates[59] = d59; - var d60 = new __getBoxHelper(_getBoxHelper); + var d60 = new __getTypeForBox(_getTypeForBox); callbacks[60] = Marshal.GetFunctionPointerForDelegate(d60); delegates[60] = d60; - var d61 = new __getUnBoxHelper(_getUnBoxHelper); + var d61 = new __getBoxHelper(_getBoxHelper); callbacks[61] = Marshal.GetFunctionPointerForDelegate(d61); delegates[61] = d61; - var d62 = new __getReadyToRunHelper(_getReadyToRunHelper); + var d62 = new __getUnBoxHelper(_getUnBoxHelper); callbacks[62] = Marshal.GetFunctionPointerForDelegate(d62); delegates[62] = d62; - var d63 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); + var d63 = new __getReadyToRunHelper(_getReadyToRunHelper); callbacks[63] = Marshal.GetFunctionPointerForDelegate(d63); delegates[63] = d63; - var d64 = new __getHelperName(_getHelperName); + var d64 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); callbacks[64] = Marshal.GetFunctionPointerForDelegate(d64); delegates[64] = d64; - var d65 = new __initClass(_initClass); + var d65 = new __getHelperName(_getHelperName); callbacks[65] = Marshal.GetFunctionPointerForDelegate(d65); delegates[65] = d65; - var d66 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); + var d66 = new __initClass(_initClass); callbacks[66] = Marshal.GetFunctionPointerForDelegate(d66); delegates[66] = d66; - var d67 = new __getBuiltinClass(_getBuiltinClass); + var d67 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); callbacks[67] = Marshal.GetFunctionPointerForDelegate(d67); delegates[67] = d67; - var d68 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); + var d68 = new __getBuiltinClass(_getBuiltinClass); callbacks[68] = Marshal.GetFunctionPointerForDelegate(d68); delegates[68] = d68; - var d69 = new __canCast(_canCast); + var d69 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); callbacks[69] = Marshal.GetFunctionPointerForDelegate(d69); delegates[69] = d69; - var d70 = new __areTypesEquivalent(_areTypesEquivalent); + var d70 = new __canCast(_canCast); callbacks[70] = Marshal.GetFunctionPointerForDelegate(d70); delegates[70] = d70; - var d71 = new __mergeClasses(_mergeClasses); + var d71 = new __areTypesEquivalent(_areTypesEquivalent); callbacks[71] = Marshal.GetFunctionPointerForDelegate(d71); delegates[71] = d71; - var d72 = new __getParentType(_getParentType); + var d72 = new __mergeClasses(_mergeClasses); callbacks[72] = Marshal.GetFunctionPointerForDelegate(d72); delegates[72] = d72; - var d73 = new __getChildType(_getChildType); + var d73 = new __getParentType(_getParentType); callbacks[73] = Marshal.GetFunctionPointerForDelegate(d73); delegates[73] = d73; - var d74 = new __satisfiesClassConstraints(_satisfiesClassConstraints); + var d74 = new __getChildType(_getChildType); callbacks[74] = Marshal.GetFunctionPointerForDelegate(d74); delegates[74] = d74; - var d75 = new __isSDArray(_isSDArray); + var d75 = new __satisfiesClassConstraints(_satisfiesClassConstraints); callbacks[75] = Marshal.GetFunctionPointerForDelegate(d75); delegates[75] = d75; - var d76 = new __getArrayRank(_getArrayRank); + var d76 = new __isSDArray(_isSDArray); callbacks[76] = Marshal.GetFunctionPointerForDelegate(d76); delegates[76] = d76; - var d77 = new __getArrayInitializationData(_getArrayInitializationData); + var d77 = new __getArrayRank(_getArrayRank); callbacks[77] = Marshal.GetFunctionPointerForDelegate(d77); delegates[77] = d77; - var d78 = new __canAccessClass(_canAccessClass); + var d78 = new __getArrayInitializationData(_getArrayInitializationData); callbacks[78] = Marshal.GetFunctionPointerForDelegate(d78); delegates[78] = d78; - var d79 = new __getFieldName(_getFieldName); + var d79 = new __canAccessClass(_canAccessClass); callbacks[79] = Marshal.GetFunctionPointerForDelegate(d79); delegates[79] = d79; - var d80 = new __getFieldClass(_getFieldClass); + var d80 = new __getFieldName(_getFieldName); callbacks[80] = Marshal.GetFunctionPointerForDelegate(d80); delegates[80] = d80; - var d81 = new __getFieldType(_getFieldType); + var d81 = new __getFieldClass(_getFieldClass); callbacks[81] = Marshal.GetFunctionPointerForDelegate(d81); delegates[81] = d81; - var d82 = new __getFieldOffset(_getFieldOffset); + var d82 = new __getFieldType(_getFieldType); callbacks[82] = Marshal.GetFunctionPointerForDelegate(d82); delegates[82] = d82; - var d83 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); + var d83 = new __getFieldOffset(_getFieldOffset); callbacks[83] = Marshal.GetFunctionPointerForDelegate(d83); delegates[83] = d83; - var d84 = new __getFieldInfo(_getFieldInfo); + var d84 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); callbacks[84] = Marshal.GetFunctionPointerForDelegate(d84); delegates[84] = d84; - var d85 = new __isFieldStatic(_isFieldStatic); + var d85 = new __getFieldInfo(_getFieldInfo); callbacks[85] = Marshal.GetFunctionPointerForDelegate(d85); delegates[85] = d85; - var d86 = new __getBoundaries(_getBoundaries); + var d86 = new __isFieldStatic(_isFieldStatic); callbacks[86] = Marshal.GetFunctionPointerForDelegate(d86); delegates[86] = d86; - var d87 = new __setBoundaries(_setBoundaries); + var d87 = new __getBoundaries(_getBoundaries); callbacks[87] = Marshal.GetFunctionPointerForDelegate(d87); delegates[87] = d87; - var d88 = new __getVars(_getVars); + var d88 = new __setBoundaries(_setBoundaries); callbacks[88] = Marshal.GetFunctionPointerForDelegate(d88); delegates[88] = d88; - var d89 = new __setVars(_setVars); + var d89 = new __getVars(_getVars); callbacks[89] = Marshal.GetFunctionPointerForDelegate(d89); delegates[89] = d89; - var d90 = new __allocateArray(_allocateArray); + var d90 = new __setVars(_setVars); callbacks[90] = Marshal.GetFunctionPointerForDelegate(d90); delegates[90] = d90; - var d91 = new __freeArray(_freeArray); + var d91 = new __allocateArray(_allocateArray); callbacks[91] = Marshal.GetFunctionPointerForDelegate(d91); delegates[91] = d91; - var d92 = new __getArgNext(_getArgNext); + var d92 = new __freeArray(_freeArray); callbacks[92] = Marshal.GetFunctionPointerForDelegate(d92); delegates[92] = d92; - var d93 = new __getArgType(_getArgType); + var d93 = new __getArgNext(_getArgNext); callbacks[93] = Marshal.GetFunctionPointerForDelegate(d93); delegates[93] = d93; - var d94 = new __getArgClass(_getArgClass); + var d94 = new __getArgType(_getArgType); callbacks[94] = Marshal.GetFunctionPointerForDelegate(d94); delegates[94] = d94; - var d95 = new __getHFAType(_getHFAType); + var d95 = new __getArgClass(_getArgClass); callbacks[95] = Marshal.GetFunctionPointerForDelegate(d95); delegates[95] = d95; - var d96 = new __GetErrorHRESULT(_GetErrorHRESULT); + var d96 = new __getHFAType(_getHFAType); callbacks[96] = Marshal.GetFunctionPointerForDelegate(d96); delegates[96] = d96; - var d97 = new __GetErrorMessage(_GetErrorMessage); + var d97 = new __GetErrorHRESULT(_GetErrorHRESULT); callbacks[97] = Marshal.GetFunctionPointerForDelegate(d97); delegates[97] = d97; - var d98 = new __FilterException(_FilterException); + var d98 = new __GetErrorMessage(_GetErrorMessage); callbacks[98] = Marshal.GetFunctionPointerForDelegate(d98); delegates[98] = d98; - var d99 = new __HandleException(_HandleException); + var d99 = new __FilterException(_FilterException); callbacks[99] = Marshal.GetFunctionPointerForDelegate(d99); delegates[99] = d99; - var d100 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); + var d100 = new __HandleException(_HandleException); callbacks[100] = Marshal.GetFunctionPointerForDelegate(d100); delegates[100] = d100; - var d101 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); + var d101 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); callbacks[101] = Marshal.GetFunctionPointerForDelegate(d101); delegates[101] = d101; - var d102 = new __runWithErrorTrap(_runWithErrorTrap); + var d102 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); callbacks[102] = Marshal.GetFunctionPointerForDelegate(d102); delegates[102] = d102; - var d103 = new __getEEInfo(_getEEInfo); + var d103 = new __runWithErrorTrap(_runWithErrorTrap); callbacks[103] = Marshal.GetFunctionPointerForDelegate(d103); delegates[103] = d103; - var d104 = new __getJitTimeLogFilename(_getJitTimeLogFilename); + var d104 = new __getEEInfo(_getEEInfo); callbacks[104] = Marshal.GetFunctionPointerForDelegate(d104); delegates[104] = d104; - var d105 = new __getMethodDefFromMethod(_getMethodDefFromMethod); + var d105 = new __getJitTimeLogFilename(_getJitTimeLogFilename); callbacks[105] = Marshal.GetFunctionPointerForDelegate(d105); delegates[105] = d105; - var d106 = new __getMethodName(_getMethodName); + var d106 = new __getMethodDefFromMethod(_getMethodDefFromMethod); callbacks[106] = Marshal.GetFunctionPointerForDelegate(d106); delegates[106] = d106; - var d107 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); + var d107 = new __getMethodName(_getMethodName); callbacks[107] = Marshal.GetFunctionPointerForDelegate(d107); delegates[107] = d107; - var d108 = new __getMethodHash(_getMethodHash); + var d108 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); callbacks[108] = Marshal.GetFunctionPointerForDelegate(d108); delegates[108] = d108; - var d109 = new __findNameOfToken(_findNameOfToken); + var d109 = new __getMethodHash(_getMethodHash); callbacks[109] = Marshal.GetFunctionPointerForDelegate(d109); delegates[109] = d109; - var d110 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); + var d110 = new __findNameOfToken(_findNameOfToken); callbacks[110] = Marshal.GetFunctionPointerForDelegate(d110); delegates[110] = d110; - var d111 = new __getThreadTLSIndex(_getThreadTLSIndex); + var d111 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); callbacks[111] = Marshal.GetFunctionPointerForDelegate(d111); delegates[111] = d111; - var d112 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); + var d112 = new __getThreadTLSIndex(_getThreadTLSIndex); callbacks[112] = Marshal.GetFunctionPointerForDelegate(d112); delegates[112] = d112; - var d113 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); + var d113 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); callbacks[113] = Marshal.GetFunctionPointerForDelegate(d113); delegates[113] = d113; - var d114 = new __getHelperFtn(_getHelperFtn); + var d114 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); callbacks[114] = Marshal.GetFunctionPointerForDelegate(d114); delegates[114] = d114; - var d115 = new __getFunctionEntryPoint(_getFunctionEntryPoint); + var d115 = new __getHelperFtn(_getHelperFtn); callbacks[115] = Marshal.GetFunctionPointerForDelegate(d115); delegates[115] = d115; - var d116 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); + var d116 = new __getFunctionEntryPoint(_getFunctionEntryPoint); callbacks[116] = Marshal.GetFunctionPointerForDelegate(d116); delegates[116] = d116; - var d117 = new __getMethodSync(_getMethodSync); + var d117 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); callbacks[117] = Marshal.GetFunctionPointerForDelegate(d117); delegates[117] = d117; - var d118 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); + var d118 = new __getMethodSync(_getMethodSync); callbacks[118] = Marshal.GetFunctionPointerForDelegate(d118); delegates[118] = d118; - var d119 = new __embedModuleHandle(_embedModuleHandle); + var d119 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); callbacks[119] = Marshal.GetFunctionPointerForDelegate(d119); delegates[119] = d119; - var d120 = new __embedClassHandle(_embedClassHandle); + var d120 = new __embedModuleHandle(_embedModuleHandle); callbacks[120] = Marshal.GetFunctionPointerForDelegate(d120); delegates[120] = d120; - var d121 = new __embedMethodHandle(_embedMethodHandle); + var d121 = new __embedClassHandle(_embedClassHandle); callbacks[121] = Marshal.GetFunctionPointerForDelegate(d121); delegates[121] = d121; - var d122 = new __embedFieldHandle(_embedFieldHandle); + var d122 = new __embedMethodHandle(_embedMethodHandle); callbacks[122] = Marshal.GetFunctionPointerForDelegate(d122); delegates[122] = d122; - var d123 = new __embedGenericHandle(_embedGenericHandle); + var d123 = new __embedFieldHandle(_embedFieldHandle); callbacks[123] = Marshal.GetFunctionPointerForDelegate(d123); delegates[123] = d123; - var d124 = new __getLocationOfThisType(_getLocationOfThisType); + var d124 = new __embedGenericHandle(_embedGenericHandle); callbacks[124] = Marshal.GetFunctionPointerForDelegate(d124); delegates[124] = d124; - var d125 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); + var d125 = new __getLocationOfThisType(_getLocationOfThisType); callbacks[125] = Marshal.GetFunctionPointerForDelegate(d125); delegates[125] = d125; - var d126 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); + var d126 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); callbacks[126] = Marshal.GetFunctionPointerForDelegate(d126); delegates[126] = d126; - var d127 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); + var d127 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); callbacks[127] = Marshal.GetFunctionPointerForDelegate(d127); delegates[127] = d127; - var d128 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); + var d128 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); callbacks[128] = Marshal.GetFunctionPointerForDelegate(d128); delegates[128] = d128; - var d129 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); + var d129 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); callbacks[129] = Marshal.GetFunctionPointerForDelegate(d129); delegates[129] = d129; - var d130 = new __getJustMyCodeHandle(_getJustMyCodeHandle); + var d130 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); callbacks[130] = Marshal.GetFunctionPointerForDelegate(d130); delegates[130] = d130; - var d131 = new __GetProfilingHandle(_GetProfilingHandle); + var d131 = new __getJustMyCodeHandle(_getJustMyCodeHandle); callbacks[131] = Marshal.GetFunctionPointerForDelegate(d131); delegates[131] = d131; - var d132 = new __getCallInfo(_getCallInfo); + var d132 = new __GetProfilingHandle(_GetProfilingHandle); callbacks[132] = Marshal.GetFunctionPointerForDelegate(d132); delegates[132] = d132; - var d133 = new __canAccessFamily(_canAccessFamily); + var d133 = new __getCallInfo(_getCallInfo); callbacks[133] = Marshal.GetFunctionPointerForDelegate(d133); delegates[133] = d133; - var d134 = new __isRIDClassDomainID(_isRIDClassDomainID); + var d134 = new __canAccessFamily(_canAccessFamily); callbacks[134] = Marshal.GetFunctionPointerForDelegate(d134); delegates[134] = d134; - var d135 = new __getClassDomainID(_getClassDomainID); + var d135 = new __isRIDClassDomainID(_isRIDClassDomainID); callbacks[135] = Marshal.GetFunctionPointerForDelegate(d135); delegates[135] = d135; - var d136 = new __getFieldAddress(_getFieldAddress); + var d136 = new __getClassDomainID(_getClassDomainID); callbacks[136] = Marshal.GetFunctionPointerForDelegate(d136); delegates[136] = d136; - var d137 = new __getVarArgsHandle(_getVarArgsHandle); + var d137 = new __getFieldAddress(_getFieldAddress); callbacks[137] = Marshal.GetFunctionPointerForDelegate(d137); delegates[137] = d137; - var d138 = new __canGetVarArgsHandle(_canGetVarArgsHandle); + var d138 = new __getVarArgsHandle(_getVarArgsHandle); callbacks[138] = Marshal.GetFunctionPointerForDelegate(d138); delegates[138] = d138; - var d139 = new __constructStringLiteral(_constructStringLiteral); + var d139 = new __canGetVarArgsHandle(_canGetVarArgsHandle); callbacks[139] = Marshal.GetFunctionPointerForDelegate(d139); delegates[139] = d139; - var d140 = new __emptyStringLiteral(_emptyStringLiteral); + var d140 = new __constructStringLiteral(_constructStringLiteral); callbacks[140] = Marshal.GetFunctionPointerForDelegate(d140); delegates[140] = d140; - var d141 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); + var d141 = new __emptyStringLiteral(_emptyStringLiteral); callbacks[141] = Marshal.GetFunctionPointerForDelegate(d141); delegates[141] = d141; - var d142 = new __setOverride(_setOverride); + var d142 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); callbacks[142] = Marshal.GetFunctionPointerForDelegate(d142); delegates[142] = d142; - var d143 = new __addActiveDependency(_addActiveDependency); + var d143 = new __setOverride(_setOverride); callbacks[143] = Marshal.GetFunctionPointerForDelegate(d143); delegates[143] = d143; - var d144 = new __GetDelegateCtor(_GetDelegateCtor); + var d144 = new __addActiveDependency(_addActiveDependency); callbacks[144] = Marshal.GetFunctionPointerForDelegate(d144); delegates[144] = d144; - var d145 = new __MethodCompileComplete(_MethodCompileComplete); + var d145 = new __GetDelegateCtor(_GetDelegateCtor); callbacks[145] = Marshal.GetFunctionPointerForDelegate(d145); delegates[145] = d145; - var d146 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); + var d146 = new __MethodCompileComplete(_MethodCompileComplete); callbacks[146] = Marshal.GetFunctionPointerForDelegate(d146); delegates[146] = d146; - var d147 = new __getMemoryManager(_getMemoryManager); + var d147 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); callbacks[147] = Marshal.GetFunctionPointerForDelegate(d147); delegates[147] = d147; - var d148 = new __allocMem(_allocMem); + var d148 = new __getMemoryManager(_getMemoryManager); callbacks[148] = Marshal.GetFunctionPointerForDelegate(d148); delegates[148] = d148; - var d149 = new __reserveUnwindInfo(_reserveUnwindInfo); + var d149 = new __allocMem(_allocMem); callbacks[149] = Marshal.GetFunctionPointerForDelegate(d149); delegates[149] = d149; - var d150 = new __allocUnwindInfo(_allocUnwindInfo); + var d150 = new __reserveUnwindInfo(_reserveUnwindInfo); callbacks[150] = Marshal.GetFunctionPointerForDelegate(d150); delegates[150] = d150; - var d151 = new __allocGCInfo(_allocGCInfo); + var d151 = new __allocUnwindInfo(_allocUnwindInfo); callbacks[151] = Marshal.GetFunctionPointerForDelegate(d151); delegates[151] = d151; - var d152 = new __yieldExecution(_yieldExecution); + var d152 = new __allocGCInfo(_allocGCInfo); callbacks[152] = Marshal.GetFunctionPointerForDelegate(d152); delegates[152] = d152; - var d153 = new __setEHcount(_setEHcount); + var d153 = new __yieldExecution(_yieldExecution); callbacks[153] = Marshal.GetFunctionPointerForDelegate(d153); delegates[153] = d153; - var d154 = new __setEHinfo(_setEHinfo); + var d154 = new __setEHcount(_setEHcount); callbacks[154] = Marshal.GetFunctionPointerForDelegate(d154); delegates[154] = d154; - var d155 = new __logMsg(_logMsg); + var d155 = new __setEHinfo(_setEHinfo); callbacks[155] = Marshal.GetFunctionPointerForDelegate(d155); delegates[155] = d155; - var d156 = new __doAssert(_doAssert); + var d156 = new __logMsg(_logMsg); callbacks[156] = Marshal.GetFunctionPointerForDelegate(d156); delegates[156] = d156; - var d157 = new __reportFatalError(_reportFatalError); + var d157 = new __doAssert(_doAssert); callbacks[157] = Marshal.GetFunctionPointerForDelegate(d157); delegates[157] = d157; - var d158 = new __allocBBProfileBuffer(_allocBBProfileBuffer); + var d158 = new __reportFatalError(_reportFatalError); callbacks[158] = Marshal.GetFunctionPointerForDelegate(d158); delegates[158] = d158; - var d159 = new __getBBProfileData(_getBBProfileData); + var d159 = new __allocBBProfileBuffer(_allocBBProfileBuffer); callbacks[159] = Marshal.GetFunctionPointerForDelegate(d159); delegates[159] = d159; - var d160 = new __recordCallSite(_recordCallSite); + var d160 = new __getBBProfileData(_getBBProfileData); callbacks[160] = Marshal.GetFunctionPointerForDelegate(d160); delegates[160] = d160; - var d161 = new __recordRelocation(_recordRelocation); + var d161 = new __recordCallSite(_recordCallSite); callbacks[161] = Marshal.GetFunctionPointerForDelegate(d161); delegates[161] = d161; - var d162 = new __getRelocTypeHint(_getRelocTypeHint); + var d162 = new __recordRelocation(_recordRelocation); callbacks[162] = Marshal.GetFunctionPointerForDelegate(d162); delegates[162] = d162; - var d163 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); + var d163 = new __getRelocTypeHint(_getRelocTypeHint); callbacks[163] = Marshal.GetFunctionPointerForDelegate(d163); delegates[163] = d163; - var d164 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); + var d164 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); callbacks[164] = Marshal.GetFunctionPointerForDelegate(d164); delegates[164] = d164; - var d165 = new __getJitFlags(_getJitFlags); + var d165 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); callbacks[165] = Marshal.GetFunctionPointerForDelegate(d165); delegates[165] = d165; + var d166 = new __getJitFlags(_getJitFlags); + callbacks[166] = Marshal.GetFunctionPointerForDelegate(d166); + delegates[166] = d166; keepAlive = delegates; return (IntPtr)callbacks; diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs index bba34c544..021531fd6 100644 --- a/src/JitInterface/src/CorInfoImpl.cs +++ b/src/JitInterface/src/CorInfoImpl.cs @@ -946,6 +946,13 @@ namespace Internal.JitInterface } } + private CORINFO_CLASS_STRUCT_* getDefaultEqualityComparerClass(CORINFO_CLASS_STRUCT_* elemType) + { + // TODO: EqualityComparer optimizations + // https://github.com/dotnet/corert/issues/763 + return null; + } + private void expandRawHandleIntrinsic(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult) { // Resolved token as a potentially RuntimeDetermined object. diff --git a/src/JitInterface/src/ThunkGenerator/ThunkInput.txt b/src/JitInterface/src/ThunkGenerator/ThunkInput.txt index 3be2b9935..fc2304191 100644 --- a/src/JitInterface/src/ThunkGenerator/ThunkInput.txt +++ b/src/JitInterface/src/ThunkGenerator/ThunkInput.txt @@ -171,6 +171,7 @@ FUNCTIONS CORINFO_MODULE_HANDLE getMethodModule( CORINFO_METHOD_HANDLE method ); void getMethodVTableOffset( CORINFO_METHOD_HANDLE method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); CORINFO_METHOD_HANDLE resolveVirtualMethod( CORINFO_METHOD_HANDLE virtualMethod, CORINFO_CLASS_HANDLE implementingClass, CORINFO_CONTEXT_HANDLE ownerType); + CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE elemType); void expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_GENERICHANDLE_RESULT * pResult); CorInfoIntrinsics getIntrinsicID( CORINFO_METHOD_HANDLE method , bool * pMustExpand); bool isInSIMDModule( CORINFO_CLASS_HANDLE classHnd ); diff --git a/src/JitInterface/src/ThunkGenerator/corinfo.h b/src/JitInterface/src/ThunkGenerator/corinfo.h index 3171d6b00..aa024e054 100644 --- a/src/JitInterface/src/ThunkGenerator/corinfo.h +++ b/src/JitInterface/src/ThunkGenerator/corinfo.h @@ -213,11 +213,11 @@ TODO: Talk about initializing strutures before use #define SELECTANY extern __declspec(selectany) #endif -SELECTANY const GUID JITEEVersionIdentifier = { /* 7f70c266-eada-427b-be8a-be1260e34b1b */ - 0x7f70c266, - 0xeada, - 0x427b, - {0xbe, 0x8a, 0xbe, 0x12, 0x60, 0xe3, 0x4b, 0x1b} +SELECTANY const GUID JITEEVersionIdentifier = { /* 76a743cd-8a07-471e-9ac4-cd5806a8ffac */ + 0x76a743cd, + 0x8a07, + 0x471e, + {0x9a, 0xc4, 0xcd, 0x58, 0x06, 0xa8, 0xff, 0xac} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -2085,6 +2085,12 @@ public: CORINFO_CONTEXT_HANDLE ownerType = NULL /* IN */ ) = 0; + // Given T, return the type of the default EqualityComparer<T>. + // Returns null if the type can't be determined exactly. + virtual CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass( + CORINFO_CLASS_HANDLE elemType + ) = 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 diff --git a/src/Native/jitinterface/jitinterface.h b/src/Native/jitinterface/jitinterface.h index 366d87544..b2e498283 100644 --- a/src/Native/jitinterface/jitinterface.h +++ b/src/Native/jitinterface/jitinterface.h @@ -23,6 +23,7 @@ struct JitInterfaceCallbacks void* (__stdcall * getMethodModule)(void * thisHandle, CorInfoException** ppException, void* method); void (__stdcall * getMethodVTableOffset)(void * thisHandle, CorInfoException** ppException, void* method, unsigned* offsetOfIndirection, unsigned* offsetAfterIndirection, bool* isRelative); void* (__stdcall * resolveVirtualMethod)(void * thisHandle, CorInfoException** ppException, void* virtualMethod, void* implementingClass, void* ownerType); + void* (__stdcall * getDefaultEqualityComparerClass)(void * thisHandle, CorInfoException** ppException, void* elemType); void (__stdcall * expandRawHandleIntrinsic)(void * thisHandle, CorInfoException** ppException, void* pResolvedToken, void* pResult); int (__stdcall * getIntrinsicID)(void * thisHandle, CorInfoException** ppException, void* method, bool* pMustExpand); bool (__stdcall * isInSIMDModule)(void * thisHandle, CorInfoException** ppException, void* classHnd); @@ -301,6 +302,15 @@ public: return _ret; } + virtual void* getDefaultEqualityComparerClass(void* elemType) + { + CorInfoException* pException = nullptr; + void* _ret = _callbacks->getDefaultEqualityComparerClass(_thisHandle, &pException, elemType); + if (pException != nullptr) + throw pException; + return _ret; + } + virtual void expandRawHandleIntrinsic(void* pResolvedToken, void* pResult) { CorInfoException* pException = nullptr; diff --git a/src/Native/jitinterface/jitwrapper.cpp b/src/Native/jitinterface/jitwrapper.cpp index 925395497..ba5f23279 100644 --- a/src/Native/jitinterface/jitwrapper.cpp +++ b/src/Native/jitinterface/jitwrapper.cpp @@ -27,11 +27,11 @@ private: unsigned __int64 corJitFlags; }; -static const GUID JITEEVersionIdentifier = { /* 7f70c266-eada-427b-be8a-be1260e34b1b */ - 0x7f70c266, - 0xeada, - 0x427b, - { 0xbe, 0x8a, 0xbe, 0x12, 0x60, 0xe3, 0x4b, 0x1b } +static const GUID JITEEVersionIdentifier = { /* 76a743cd-8a07-471e-9ac4-cd5806a8ffac */ + 0x76a743cd, + 0x8a07, + 0x471e, + { 0x9a, 0xc4, 0xcd, 0x58, 0x06, 0xa8, 0xff, 0xac } }; class Jit |