diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h index ff28c9bfd5a85..482bc998e63ea 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h @@ -255,6 +255,11 @@ BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ unsigned metaTOK /* IN */ ); +LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ); + BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope); /**********************************************************************************/ diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h index 45449d1161d46..59ebf7f35e7ba 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h @@ -147,6 +147,7 @@ LWM(IsInstantiationOfVerifiedGeneric, DWORDLONG, DWORD) LWM(IsSDArray, DWORDLONG, DWORD) LWM(IsStructRequiringStackAllocRetBuf, DWORDLONG, DWORD) LWM(IsValidStringRef, DLD, DWORD) +LWM(GetStringLiteral, DLD, DD) LWM(IsValidToken, DLD, DWORD) LWM(IsValueClass, DWORDLONG, DWORD) LWM(IsWriteBarrierHelperRequired, DWORDLONG, DWORD) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index 12686514eb593..b52fbcf400d4e 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -4606,6 +4606,65 @@ BOOL MethodContext::repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned m return value; } + +void MethodContext::recGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int length, LPCWSTR result) +{ + if (GetStringLiteral == nullptr) + GetStringLiteral = new LightWeightMap(); + + DLD key; + ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero + // out padding too + + key.A = (DWORDLONG)module; + key.B = (DWORD)metaTOK; + + DWORD strBuf = (DWORD)-1; + if (result != nullptr) + strBuf = (DWORD)GetStringLiteral->AddBuffer((unsigned char*)result, (unsigned int)((wcslen(result) * 2) + 2)); + + DD value; + value.A = (DWORD)length; + value.B = (DWORD)strBuf; + + GetStringLiteral->Add(key, value); +} + +void MethodContext::dmpGetStringLiteral(DLD key, DD value) +{ + printf("GetStringLiteral key mod-%016llX tok-%08X, result-%s, len-%u", key.A, key.B, + GetStringLiteral->GetBuffer(value.B), value.A); +} + +LPCWSTR MethodContext::repGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length) +{ + if (GetStringLiteral == nullptr) + { + *length = -1; + return nullptr; + } + + DLD key; + ZeroMemory(&key, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero + // out padding too + + key.A = (DWORDLONG)module; + key.B = (DWORD)metaTOK; + + int itemIndex = GetStringLiteral->GetIndex(key); + if (itemIndex < 0) + { + *length = -1; + return nullptr; + } + else + { + DD result = GetStringLiteral->Get(key); + *length = (int)result.A; + return (LPCWSTR)GetStringLiteral->GetBuffer(itemIndex); + } +} + void MethodContext::recGetHelperName(CorInfoHelpFunc funcNum, const char* result) { if (GetHelperName == nullptr) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index fb596c263ef0f..3c1c4792d96a4 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -1086,6 +1086,10 @@ class MethodContext void dmpIsValidStringRef(DLD key, DWORD value); BOOL repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK); + void recGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int length, LPCWSTR result); + void dmpGetStringLiteral(DLD key, DD value); + LPCWSTR repGetStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length); + void recGetHelperName(CorInfoHelpFunc funcNum, const char* result); void dmpGetHelperName(DWORD key, DWORD value); const char* repGetHelperName(CorInfoHelpFunc funcNum); @@ -1352,7 +1356,7 @@ class MethodContext }; // ********************* Please keep this up-to-date to ease adding more *************** -// Highest packet number: 174 +// Highest packet number: 175 // ************************************************************************************* enum mcPackets { @@ -1493,6 +1497,7 @@ enum mcPackets Packet_IsSDArray = 101, Packet_IsStructRequiringStackAllocRetBuf = 102, Packet_IsValidStringRef = 103, + Packet_GetStringLiteral = 175, // Added 1/7/2020 Retired6 = 104, Packet_IsValidToken = 144, // Added 7/19/2013 - adjusted members to proper types Packet_IsValueClass = 105, diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 0384e2c3218d2..9f42b42925344 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -517,6 +517,17 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return temp; } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + mc->cr->AddCall("getStringLiteral"); + LPCWSTR temp = original_ICorJitInfo->getStringLiteral(module, metaTOK, length); + mc->recGetStringLiteral(module, metaTOK, *length, temp); + return temp; +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { mc->cr->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp index 810aed301dcce..aa7d8a383cc3a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp @@ -378,6 +378,15 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return original_ICorJitInfo->isValidStringRef(module, metaTOK); } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + mcs->AddCall("getStringLiteral"); + return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { mcs->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp index b562704433a69..4a9a71464c836 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp @@ -340,6 +340,14 @@ BOOL interceptor_ICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return original_ICorJitInfo->isValidStringRef(module, metaTOK); } +LPCWSTR interceptor_ICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + return original_ICorJitInfo->getStringLiteral(module, metaTOK, length); +} + BOOL interceptor_ICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { return original_ICorJitInfo->shouldEnforceCallvirtRestriction(scope); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp index 3441850ed2eae..e7d95e4cfd8b9 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -408,6 +408,15 @@ BOOL MyICJI::isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */ return jitInstance->mc->repIsValidStringRef(module, metaTOK); } +LPCWSTR MyICJI::getStringLiteral(CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) +{ + jitInstance->mc->cr->AddCall("getStringLiteral"); + return jitInstance->mc->repGetStringLiteral(module, metaTOK, length); +} + BOOL MyICJI::shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) { jitInstance->mc->cr->AddCall("shouldEnforceCallvirtRestriction"); diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index 97e09a0d39460..d7331491b5d13 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -217,11 +217,11 @@ TODO: Talk about initializing strutures before use #endif #endif -SELECTANY const GUID JITEEVersionIdentifier = { /* abcf830c-56d1-4b33-a8ec-5063bb5495f1 */ - 0xabcf830c, - 0x56d1, - 0x4b33, - {0xa8, 0xec, 0x50, 0x63, 0xbb, 0x54, 0x95, 0xf1} +SELECTANY const GUID JITEEVersionIdentifier = { /* 13028353-152c-4886-b05b-fa76ee8169cf */ + 0x13028353, + 0x152c, + 0x4886, + {0xb0, 0x5b, 0xfa, 0x76, 0xee, 0x81, 0x69, 0xcf} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -2307,6 +2307,14 @@ class ICorStaticInfo unsigned metaTOK /* IN */ ) = 0; + // Returns string length and content (can be null for dynamic context) + // for given metaTOK and module, length `-1` means input is incorrect + virtual LPCWSTR getStringLiteral ( + CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */ + ) = 0; + virtual BOOL shouldEnforceCallvirtRestriction( CORINFO_MODULE_HANDLE scope ) = 0; diff --git a/src/coreclr/src/jit/ICorJitInfo_API_names.h b/src/coreclr/src/jit/ICorJitInfo_API_names.h index 2e578342cc1e1..a17127ed6d29a 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_names.h +++ b/src/coreclr/src/jit/ICorJitInfo_API_names.h @@ -38,6 +38,7 @@ DEF_CLR_API(getTokenTypeAsHandle) DEF_CLR_API(canSkipVerification) DEF_CLR_API(isValidToken) DEF_CLR_API(isValidStringRef) +DEF_CLR_API(getStringLiteral) DEF_CLR_API(shouldEnforceCallvirtRestriction) DEF_CLR_API(asCorInfoType) DEF_CLR_API(getClassName) diff --git a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp index 83ca2a2c7488f..824f86b8dd995 100644 --- a/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp +++ b/src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp @@ -367,6 +367,17 @@ BOOL WrapICorJitInfo::isValidStringRef( return temp; } +LPCWSTR WrapICorJitInfo::getStringLiteral( + CORINFO_MODULE_HANDLE module, /* IN */ + unsigned metaTOK, /* IN */ + int* length /* OUT */) +{ + API_ENTER(getStringLiteral); + LPCWSTR temp = wrapHnd->getStringLiteral(module, metaTOK, length); + API_LEAVE(getStringLiteral); + return temp; +} + BOOL WrapICorJitInfo::shouldEnforceCallvirtRestriction( CORINFO_MODULE_HANDLE scope) { diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 4950dba13189b..292651c3a3027 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -3632,6 +3632,27 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, op1 = impPopStack().val; if (opts.OptimizationEnabled()) { + if (op1->OperIs(GT_CNS_STR)) + { + // Optimize `ldstr + String::get_Length()` to CNS_INT + // e.g. "Hello".Length => 5 + int length = -1; + LPCWSTR str = info.compCompHnd->getStringLiteral(op1->AsStrCon()->gtScpHnd, + op1->AsStrCon()->gtSconCPX, &length); + if (length >= 0) + { + retNode = gtNewIconNode(length); + if (str != nullptr) // can be NULL for dynamic context + { + JITDUMP("Optimizing '\"%ws\".Length' to just '%d'\n", str, length); + } + else + { + JITDUMP("Optimizing 'CNS_STR.Length' to just '%d'\n", length); + } + break; + } + } GenTreeArrLen* arrLen = gtNewArrLen(TYP_INT, op1, OFFSETOF__CORINFO_String__stringLen, compCurBB); op1 = arrLen; } diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs index 1aa42f323d6af..5e64833b92487 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs @@ -84,6 +84,8 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidStringRef(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] + delegate char* __getStringLiteral(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length); + [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __shouldEnforceCallvirtRestriction(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate CorInfoType __asCorInfoType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); @@ -94,7 +96,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate CORINFO_CLASS_STRUCT_* __getTypeInstantiationArgument(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int __appendClassName(IntPtr _this, IntPtr* ppException, short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly); + delegate int __appendClassName(IntPtr _this, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValueClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -228,7 +230,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate HRESULT __GetErrorHRESULT(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __GetErrorMessage(IntPtr _this, IntPtr* ppException, short* buffer, uint bufferLength); + delegate uint __GetErrorMessage(IntPtr _this, IntPtr* ppException, char* buffer, uint bufferLength); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate int __FilterException(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -242,7 +244,7 @@ unsafe partial class CorInfoImpl [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate void __getEEInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_EE_INFO pEEInfoOut); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.LPWStr)]delegate string __getJitTimeLogFilename(IntPtr _this, IntPtr* ppException); + delegate char* __getJitTimeLogFilename(IntPtr _this, IntPtr* ppException); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] delegate mdToken __getMethodDefFromMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod); [UnmanagedFunctionPointerAttribute(default(CallingConvention))] @@ -860,6 +862,20 @@ static CorInfoCanSkipVerificationResult _canSkipVerification(IntPtr thisHandle, } } + static char* _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length) + { + var _this = GetThis(thisHandle); + try + { + return _this.getStringLiteral(module, metaTOK, ref length); + } + catch (Exception ex) + { + *ppException = _this.AllocException(ex); + return default(char*); + } + } + [return: MarshalAs(UnmanagedType.Bool)]static bool _shouldEnforceCallvirtRestriction(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* scope) { var _this = GetThis(thisHandle); @@ -930,7 +946,7 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF } } - static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly) + static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly) { var _this = GetThis(thisHandle); try @@ -1859,7 +1875,7 @@ static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTI } } - static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, short* buffer, uint bufferLength) + static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffer, uint bufferLength) { var _this = GetThis(thisHandle); try @@ -1953,7 +1969,7 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN } } - [return: MarshalAs(UnmanagedType.LPWStr)]static string _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException) + static char* _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException) { var _this = GetThis(thisHandle); try @@ -1963,7 +1979,7 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(string); + return default(char*); } } @@ -2833,8 +2849,8 @@ static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, ref CORJIT_FLAG static IntPtr GetUnmanagedCallbacks(out Object keepAlive) { - IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 179); - Object[] delegates = new Object[179]; + IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 180); + Object[] delegates = new Object[180]; var d0 = new __getMethodAttribs(_getMethodAttribs); callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0); @@ -2944,435 +2960,438 @@ static IntPtr GetUnmanagedCallbacks(out Object keepAlive) var d35 = new __isValidStringRef(_isValidStringRef); callbacks[35] = Marshal.GetFunctionPointerForDelegate(d35); delegates[35] = d35; - var d36 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); + var d36 = new __getStringLiteral(_getStringLiteral); callbacks[36] = Marshal.GetFunctionPointerForDelegate(d36); delegates[36] = d36; - var d37 = new __asCorInfoType(_asCorInfoType); + var d37 = new __shouldEnforceCallvirtRestriction(_shouldEnforceCallvirtRestriction); callbacks[37] = Marshal.GetFunctionPointerForDelegate(d37); delegates[37] = d37; - var d38 = new __getClassName(_getClassName); + var d38 = new __asCorInfoType(_asCorInfoType); callbacks[38] = Marshal.GetFunctionPointerForDelegate(d38); delegates[38] = d38; - var d39 = new __getClassNameFromMetadata(_getClassNameFromMetadata); + var d39 = new __getClassName(_getClassName); callbacks[39] = Marshal.GetFunctionPointerForDelegate(d39); delegates[39] = d39; - var d40 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument); + var d40 = new __getClassNameFromMetadata(_getClassNameFromMetadata); callbacks[40] = Marshal.GetFunctionPointerForDelegate(d40); delegates[40] = d40; - var d41 = new __appendClassName(_appendClassName); + var d41 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument); callbacks[41] = Marshal.GetFunctionPointerForDelegate(d41); delegates[41] = d41; - var d42 = new __isValueClass(_isValueClass); + var d42 = new __appendClassName(_appendClassName); callbacks[42] = Marshal.GetFunctionPointerForDelegate(d42); delegates[42] = d42; - var d43 = new __canInlineTypeCheck(_canInlineTypeCheck); + var d43 = new __isValueClass(_isValueClass); callbacks[43] = Marshal.GetFunctionPointerForDelegate(d43); delegates[43] = d43; - var d44 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); + var d44 = new __canInlineTypeCheck(_canInlineTypeCheck); callbacks[44] = Marshal.GetFunctionPointerForDelegate(d44); delegates[44] = d44; - var d45 = new __getClassAttribs(_getClassAttribs); + var d45 = new __canInlineTypeCheckWithObjectVTable(_canInlineTypeCheckWithObjectVTable); callbacks[45] = Marshal.GetFunctionPointerForDelegate(d45); delegates[45] = d45; - var d46 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); + var d46 = new __getClassAttribs(_getClassAttribs); callbacks[46] = Marshal.GetFunctionPointerForDelegate(d46); delegates[46] = d46; - var d47 = new __getClassModule(_getClassModule); + var d47 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); callbacks[47] = Marshal.GetFunctionPointerForDelegate(d47); delegates[47] = d47; - var d48 = new __getModuleAssembly(_getModuleAssembly); + var d48 = new __getClassModule(_getClassModule); callbacks[48] = Marshal.GetFunctionPointerForDelegate(d48); delegates[48] = d48; - var d49 = new __getAssemblyName(_getAssemblyName); + var d49 = new __getModuleAssembly(_getModuleAssembly); callbacks[49] = Marshal.GetFunctionPointerForDelegate(d49); delegates[49] = d49; - var d50 = new __LongLifetimeMalloc(_LongLifetimeMalloc); + var d50 = new __getAssemblyName(_getAssemblyName); callbacks[50] = Marshal.GetFunctionPointerForDelegate(d50); delegates[50] = d50; - var d51 = new __LongLifetimeFree(_LongLifetimeFree); + var d51 = new __LongLifetimeMalloc(_LongLifetimeMalloc); callbacks[51] = Marshal.GetFunctionPointerForDelegate(d51); delegates[51] = d51; - var d52 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); + var d52 = new __LongLifetimeFree(_LongLifetimeFree); callbacks[52] = Marshal.GetFunctionPointerForDelegate(d52); delegates[52] = d52; - var d53 = new __getClassSize(_getClassSize); + var d53 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); callbacks[53] = Marshal.GetFunctionPointerForDelegate(d53); delegates[53] = d53; - var d54 = new __getHeapClassSize(_getHeapClassSize); + var d54 = new __getClassSize(_getClassSize); callbacks[54] = Marshal.GetFunctionPointerForDelegate(d54); delegates[54] = d54; - var d55 = new __canAllocateOnStack(_canAllocateOnStack); + var d55 = new __getHeapClassSize(_getHeapClassSize); callbacks[55] = Marshal.GetFunctionPointerForDelegate(d55); delegates[55] = d55; - var d56 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); + var d56 = new __canAllocateOnStack(_canAllocateOnStack); callbacks[56] = Marshal.GetFunctionPointerForDelegate(d56); delegates[56] = d56; - var d57 = new __getClassGClayout(_getClassGClayout); + var d57 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); callbacks[57] = Marshal.GetFunctionPointerForDelegate(d57); delegates[57] = d57; - var d58 = new __getClassNumInstanceFields(_getClassNumInstanceFields); + var d58 = new __getClassGClayout(_getClassGClayout); callbacks[58] = Marshal.GetFunctionPointerForDelegate(d58); delegates[58] = d58; - var d59 = new __getFieldInClass(_getFieldInClass); + var d59 = new __getClassNumInstanceFields(_getClassNumInstanceFields); callbacks[59] = Marshal.GetFunctionPointerForDelegate(d59); delegates[59] = d59; - var d60 = new __checkMethodModifier(_checkMethodModifier); + var d60 = new __getFieldInClass(_getFieldInClass); callbacks[60] = Marshal.GetFunctionPointerForDelegate(d60); delegates[60] = d60; - var d61 = new __getNewHelper(_getNewHelper); + var d61 = new __checkMethodModifier(_checkMethodModifier); callbacks[61] = Marshal.GetFunctionPointerForDelegate(d61); delegates[61] = d61; - var d62 = new __getNewArrHelper(_getNewArrHelper); + var d62 = new __getNewHelper(_getNewHelper); callbacks[62] = Marshal.GetFunctionPointerForDelegate(d62); delegates[62] = d62; - var d63 = new __getCastingHelper(_getCastingHelper); + var d63 = new __getNewArrHelper(_getNewArrHelper); callbacks[63] = Marshal.GetFunctionPointerForDelegate(d63); delegates[63] = d63; - var d64 = new __getSharedCCtorHelper(_getSharedCCtorHelper); + var d64 = new __getCastingHelper(_getCastingHelper); callbacks[64] = Marshal.GetFunctionPointerForDelegate(d64); delegates[64] = d64; - var d65 = new __getSecurityPrologHelper(_getSecurityPrologHelper); + var d65 = new __getSharedCCtorHelper(_getSharedCCtorHelper); callbacks[65] = Marshal.GetFunctionPointerForDelegate(d65); delegates[65] = d65; - var d66 = new __getTypeForBox(_getTypeForBox); + var d66 = new __getSecurityPrologHelper(_getSecurityPrologHelper); callbacks[66] = Marshal.GetFunctionPointerForDelegate(d66); delegates[66] = d66; - var d67 = new __getBoxHelper(_getBoxHelper); + var d67 = new __getTypeForBox(_getTypeForBox); callbacks[67] = Marshal.GetFunctionPointerForDelegate(d67); delegates[67] = d67; - var d68 = new __getUnBoxHelper(_getUnBoxHelper); + var d68 = new __getBoxHelper(_getBoxHelper); callbacks[68] = Marshal.GetFunctionPointerForDelegate(d68); delegates[68] = d68; - var d69 = new __getReadyToRunHelper(_getReadyToRunHelper); + var d69 = new __getUnBoxHelper(_getUnBoxHelper); callbacks[69] = Marshal.GetFunctionPointerForDelegate(d69); delegates[69] = d69; - var d70 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); + var d70 = new __getReadyToRunHelper(_getReadyToRunHelper); callbacks[70] = Marshal.GetFunctionPointerForDelegate(d70); delegates[70] = d70; - var d71 = new __getHelperName(_getHelperName); + var d71 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); callbacks[71] = Marshal.GetFunctionPointerForDelegate(d71); delegates[71] = d71; - var d72 = new __initClass(_initClass); + var d72 = new __getHelperName(_getHelperName); callbacks[72] = Marshal.GetFunctionPointerForDelegate(d72); delegates[72] = d72; - var d73 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); + var d73 = new __initClass(_initClass); callbacks[73] = Marshal.GetFunctionPointerForDelegate(d73); delegates[73] = d73; - var d74 = new __getBuiltinClass(_getBuiltinClass); + var d74 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); callbacks[74] = Marshal.GetFunctionPointerForDelegate(d74); delegates[74] = d74; - var d75 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); + var d75 = new __getBuiltinClass(_getBuiltinClass); callbacks[75] = Marshal.GetFunctionPointerForDelegate(d75); delegates[75] = d75; - var d76 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass); + var d76 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); callbacks[76] = Marshal.GetFunctionPointerForDelegate(d76); delegates[76] = d76; - var d77 = new __canCast(_canCast); + var d77 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass); callbacks[77] = Marshal.GetFunctionPointerForDelegate(d77); delegates[77] = d77; - var d78 = new __areTypesEquivalent(_areTypesEquivalent); + var d78 = new __canCast(_canCast); callbacks[78] = Marshal.GetFunctionPointerForDelegate(d78); delegates[78] = d78; - var d79 = new __compareTypesForCast(_compareTypesForCast); + var d79 = new __areTypesEquivalent(_areTypesEquivalent); callbacks[79] = Marshal.GetFunctionPointerForDelegate(d79); delegates[79] = d79; - var d80 = new __compareTypesForEquality(_compareTypesForEquality); + var d80 = new __compareTypesForCast(_compareTypesForCast); callbacks[80] = Marshal.GetFunctionPointerForDelegate(d80); delegates[80] = d80; - var d81 = new __mergeClasses(_mergeClasses); + var d81 = new __compareTypesForEquality(_compareTypesForEquality); callbacks[81] = Marshal.GetFunctionPointerForDelegate(d81); delegates[81] = d81; - var d82 = new __isMoreSpecificType(_isMoreSpecificType); + var d82 = new __mergeClasses(_mergeClasses); callbacks[82] = Marshal.GetFunctionPointerForDelegate(d82); delegates[82] = d82; - var d83 = new __getParentType(_getParentType); + var d83 = new __isMoreSpecificType(_isMoreSpecificType); callbacks[83] = Marshal.GetFunctionPointerForDelegate(d83); delegates[83] = d83; - var d84 = new __getChildType(_getChildType); + var d84 = new __getParentType(_getParentType); callbacks[84] = Marshal.GetFunctionPointerForDelegate(d84); delegates[84] = d84; - var d85 = new __satisfiesClassConstraints(_satisfiesClassConstraints); + var d85 = new __getChildType(_getChildType); callbacks[85] = Marshal.GetFunctionPointerForDelegate(d85); delegates[85] = d85; - var d86 = new __isSDArray(_isSDArray); + var d86 = new __satisfiesClassConstraints(_satisfiesClassConstraints); callbacks[86] = Marshal.GetFunctionPointerForDelegate(d86); delegates[86] = d86; - var d87 = new __getArrayRank(_getArrayRank); + var d87 = new __isSDArray(_isSDArray); callbacks[87] = Marshal.GetFunctionPointerForDelegate(d87); delegates[87] = d87; - var d88 = new __getArrayInitializationData(_getArrayInitializationData); + var d88 = new __getArrayRank(_getArrayRank); callbacks[88] = Marshal.GetFunctionPointerForDelegate(d88); delegates[88] = d88; - var d89 = new __canAccessClass(_canAccessClass); + var d89 = new __getArrayInitializationData(_getArrayInitializationData); callbacks[89] = Marshal.GetFunctionPointerForDelegate(d89); delegates[89] = d89; - var d90 = new __getFieldName(_getFieldName); + var d90 = new __canAccessClass(_canAccessClass); callbacks[90] = Marshal.GetFunctionPointerForDelegate(d90); delegates[90] = d90; - var d91 = new __getFieldClass(_getFieldClass); + var d91 = new __getFieldName(_getFieldName); callbacks[91] = Marshal.GetFunctionPointerForDelegate(d91); delegates[91] = d91; - var d92 = new __getFieldType(_getFieldType); + var d92 = new __getFieldClass(_getFieldClass); callbacks[92] = Marshal.GetFunctionPointerForDelegate(d92); delegates[92] = d92; - var d93 = new __getFieldOffset(_getFieldOffset); + var d93 = new __getFieldType(_getFieldType); callbacks[93] = Marshal.GetFunctionPointerForDelegate(d93); delegates[93] = d93; - var d94 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); + var d94 = new __getFieldOffset(_getFieldOffset); callbacks[94] = Marshal.GetFunctionPointerForDelegate(d94); delegates[94] = d94; - var d95 = new __getFieldInfo(_getFieldInfo); + var d95 = new __isWriteBarrierHelperRequired(_isWriteBarrierHelperRequired); callbacks[95] = Marshal.GetFunctionPointerForDelegate(d95); delegates[95] = d95; - var d96 = new __isFieldStatic(_isFieldStatic); + var d96 = new __getFieldInfo(_getFieldInfo); callbacks[96] = Marshal.GetFunctionPointerForDelegate(d96); delegates[96] = d96; - var d97 = new __getBoundaries(_getBoundaries); + var d97 = new __isFieldStatic(_isFieldStatic); callbacks[97] = Marshal.GetFunctionPointerForDelegate(d97); delegates[97] = d97; - var d98 = new __setBoundaries(_setBoundaries); + var d98 = new __getBoundaries(_getBoundaries); callbacks[98] = Marshal.GetFunctionPointerForDelegate(d98); delegates[98] = d98; - var d99 = new __getVars(_getVars); + var d99 = new __setBoundaries(_setBoundaries); callbacks[99] = Marshal.GetFunctionPointerForDelegate(d99); delegates[99] = d99; - var d100 = new __setVars(_setVars); + var d100 = new __getVars(_getVars); callbacks[100] = Marshal.GetFunctionPointerForDelegate(d100); delegates[100] = d100; - var d101 = new __allocateArray(_allocateArray); + var d101 = new __setVars(_setVars); callbacks[101] = Marshal.GetFunctionPointerForDelegate(d101); delegates[101] = d101; - var d102 = new __freeArray(_freeArray); + var d102 = new __allocateArray(_allocateArray); callbacks[102] = Marshal.GetFunctionPointerForDelegate(d102); delegates[102] = d102; - var d103 = new __getArgNext(_getArgNext); + var d103 = new __freeArray(_freeArray); callbacks[103] = Marshal.GetFunctionPointerForDelegate(d103); delegates[103] = d103; - var d104 = new __getArgType(_getArgType); + var d104 = new __getArgNext(_getArgNext); callbacks[104] = Marshal.GetFunctionPointerForDelegate(d104); delegates[104] = d104; - var d105 = new __getArgClass(_getArgClass); + var d105 = new __getArgType(_getArgType); callbacks[105] = Marshal.GetFunctionPointerForDelegate(d105); delegates[105] = d105; - var d106 = new __getHFAType(_getHFAType); + var d106 = new __getArgClass(_getArgClass); callbacks[106] = Marshal.GetFunctionPointerForDelegate(d106); delegates[106] = d106; - var d107 = new __GetErrorHRESULT(_GetErrorHRESULT); + var d107 = new __getHFAType(_getHFAType); callbacks[107] = Marshal.GetFunctionPointerForDelegate(d107); delegates[107] = d107; - var d108 = new __GetErrorMessage(_GetErrorMessage); + var d108 = new __GetErrorHRESULT(_GetErrorHRESULT); callbacks[108] = Marshal.GetFunctionPointerForDelegate(d108); delegates[108] = d108; - var d109 = new __FilterException(_FilterException); + var d109 = new __GetErrorMessage(_GetErrorMessage); callbacks[109] = Marshal.GetFunctionPointerForDelegate(d109); delegates[109] = d109; - var d110 = new __HandleException(_HandleException); + var d110 = new __FilterException(_FilterException); callbacks[110] = Marshal.GetFunctionPointerForDelegate(d110); delegates[110] = d110; - var d111 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); + var d111 = new __HandleException(_HandleException); callbacks[111] = Marshal.GetFunctionPointerForDelegate(d111); delegates[111] = d111; - var d112 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); + var d112 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); callbacks[112] = Marshal.GetFunctionPointerForDelegate(d112); delegates[112] = d112; - var d113 = new __runWithErrorTrap(_runWithErrorTrap); + var d113 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); callbacks[113] = Marshal.GetFunctionPointerForDelegate(d113); delegates[113] = d113; - var d114 = new __getEEInfo(_getEEInfo); + var d114 = new __runWithErrorTrap(_runWithErrorTrap); callbacks[114] = Marshal.GetFunctionPointerForDelegate(d114); delegates[114] = d114; - var d115 = new __getJitTimeLogFilename(_getJitTimeLogFilename); + var d115 = new __getEEInfo(_getEEInfo); callbacks[115] = Marshal.GetFunctionPointerForDelegate(d115); delegates[115] = d115; - var d116 = new __getMethodDefFromMethod(_getMethodDefFromMethod); + var d116 = new __getJitTimeLogFilename(_getJitTimeLogFilename); callbacks[116] = Marshal.GetFunctionPointerForDelegate(d116); delegates[116] = d116; - var d117 = new __getMethodName(_getMethodName); + var d117 = new __getMethodDefFromMethod(_getMethodDefFromMethod); callbacks[117] = Marshal.GetFunctionPointerForDelegate(d117); delegates[117] = d117; - var d118 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); + var d118 = new __getMethodName(_getMethodName); callbacks[118] = Marshal.GetFunctionPointerForDelegate(d118); delegates[118] = d118; - var d119 = new __getMethodHash(_getMethodHash); + var d119 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); callbacks[119] = Marshal.GetFunctionPointerForDelegate(d119); delegates[119] = d119; - var d120 = new __findNameOfToken(_findNameOfToken); + var d120 = new __getMethodHash(_getMethodHash); callbacks[120] = Marshal.GetFunctionPointerForDelegate(d120); delegates[120] = d120; - var d121 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); + var d121 = new __findNameOfToken(_findNameOfToken); callbacks[121] = Marshal.GetFunctionPointerForDelegate(d121); delegates[121] = d121; - var d122 = new __getThreadTLSIndex(_getThreadTLSIndex); + var d122 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); callbacks[122] = Marshal.GetFunctionPointerForDelegate(d122); delegates[122] = d122; - var d123 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); + var d123 = new __getThreadTLSIndex(_getThreadTLSIndex); callbacks[123] = Marshal.GetFunctionPointerForDelegate(d123); delegates[123] = d123; - var d124 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); + var d124 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); callbacks[124] = Marshal.GetFunctionPointerForDelegate(d124); delegates[124] = d124; - var d125 = new __getHelperFtn(_getHelperFtn); + var d125 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); callbacks[125] = Marshal.GetFunctionPointerForDelegate(d125); delegates[125] = d125; - var d126 = new __getFunctionEntryPoint(_getFunctionEntryPoint); + var d126 = new __getHelperFtn(_getHelperFtn); callbacks[126] = Marshal.GetFunctionPointerForDelegate(d126); delegates[126] = d126; - var d127 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); + var d127 = new __getFunctionEntryPoint(_getFunctionEntryPoint); callbacks[127] = Marshal.GetFunctionPointerForDelegate(d127); delegates[127] = d127; - var d128 = new __getMethodSync(_getMethodSync); + var d128 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); callbacks[128] = Marshal.GetFunctionPointerForDelegate(d128); delegates[128] = d128; - var d129 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); + var d129 = new __getMethodSync(_getMethodSync); callbacks[129] = Marshal.GetFunctionPointerForDelegate(d129); delegates[129] = d129; - var d130 = new __embedModuleHandle(_embedModuleHandle); + var d130 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); callbacks[130] = Marshal.GetFunctionPointerForDelegate(d130); delegates[130] = d130; - var d131 = new __embedClassHandle(_embedClassHandle); + var d131 = new __embedModuleHandle(_embedModuleHandle); callbacks[131] = Marshal.GetFunctionPointerForDelegate(d131); delegates[131] = d131; - var d132 = new __embedMethodHandle(_embedMethodHandle); + var d132 = new __embedClassHandle(_embedClassHandle); callbacks[132] = Marshal.GetFunctionPointerForDelegate(d132); delegates[132] = d132; - var d133 = new __embedFieldHandle(_embedFieldHandle); + var d133 = new __embedMethodHandle(_embedMethodHandle); callbacks[133] = Marshal.GetFunctionPointerForDelegate(d133); delegates[133] = d133; - var d134 = new __embedGenericHandle(_embedGenericHandle); + var d134 = new __embedFieldHandle(_embedFieldHandle); callbacks[134] = Marshal.GetFunctionPointerForDelegate(d134); delegates[134] = d134; - var d135 = new __getLocationOfThisType(_getLocationOfThisType); + var d135 = new __embedGenericHandle(_embedGenericHandle); callbacks[135] = Marshal.GetFunctionPointerForDelegate(d135); delegates[135] = d135; - var d136 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); + var d136 = new __getLocationOfThisType(_getLocationOfThisType); callbacks[136] = Marshal.GetFunctionPointerForDelegate(d136); delegates[136] = d136; - var d137 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); + var d137 = new __getPInvokeUnmanagedTarget(_getPInvokeUnmanagedTarget); callbacks[137] = Marshal.GetFunctionPointerForDelegate(d137); delegates[137] = d137; - var d138 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); + var d138 = new __getAddressOfPInvokeFixup(_getAddressOfPInvokeFixup); callbacks[138] = Marshal.GetFunctionPointerForDelegate(d138); delegates[138] = d138; - var d139 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); + var d139 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); callbacks[139] = Marshal.GetFunctionPointerForDelegate(d139); delegates[139] = d139; - var d140 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); + var d140 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); callbacks[140] = Marshal.GetFunctionPointerForDelegate(d140); delegates[140] = d140; - var d141 = new __getJustMyCodeHandle(_getJustMyCodeHandle); + var d141 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); callbacks[141] = Marshal.GetFunctionPointerForDelegate(d141); delegates[141] = d141; - var d142 = new __GetProfilingHandle(_GetProfilingHandle); + var d142 = new __getJustMyCodeHandle(_getJustMyCodeHandle); callbacks[142] = Marshal.GetFunctionPointerForDelegate(d142); delegates[142] = d142; - var d143 = new __getCallInfo(_getCallInfo); + var d143 = new __GetProfilingHandle(_GetProfilingHandle); callbacks[143] = Marshal.GetFunctionPointerForDelegate(d143); delegates[143] = d143; - var d144 = new __canAccessFamily(_canAccessFamily); + var d144 = new __getCallInfo(_getCallInfo); callbacks[144] = Marshal.GetFunctionPointerForDelegate(d144); delegates[144] = d144; - var d145 = new __isRIDClassDomainID(_isRIDClassDomainID); + var d145 = new __canAccessFamily(_canAccessFamily); callbacks[145] = Marshal.GetFunctionPointerForDelegate(d145); delegates[145] = d145; - var d146 = new __getClassDomainID(_getClassDomainID); + var d146 = new __isRIDClassDomainID(_isRIDClassDomainID); callbacks[146] = Marshal.GetFunctionPointerForDelegate(d146); delegates[146] = d146; - var d147 = new __getFieldAddress(_getFieldAddress); + var d147 = new __getClassDomainID(_getClassDomainID); callbacks[147] = Marshal.GetFunctionPointerForDelegate(d147); delegates[147] = d147; - var d148 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass); + var d148 = new __getFieldAddress(_getFieldAddress); callbacks[148] = Marshal.GetFunctionPointerForDelegate(d148); delegates[148] = d148; - var d149 = new __getVarArgsHandle(_getVarArgsHandle); + var d149 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass); callbacks[149] = Marshal.GetFunctionPointerForDelegate(d149); delegates[149] = d149; - var d150 = new __canGetVarArgsHandle(_canGetVarArgsHandle); + var d150 = new __getVarArgsHandle(_getVarArgsHandle); callbacks[150] = Marshal.GetFunctionPointerForDelegate(d150); delegates[150] = d150; - var d151 = new __constructStringLiteral(_constructStringLiteral); + var d151 = new __canGetVarArgsHandle(_canGetVarArgsHandle); callbacks[151] = Marshal.GetFunctionPointerForDelegate(d151); delegates[151] = d151; - var d152 = new __emptyStringLiteral(_emptyStringLiteral); + var d152 = new __constructStringLiteral(_constructStringLiteral); callbacks[152] = Marshal.GetFunctionPointerForDelegate(d152); delegates[152] = d152; - var d153 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); + var d153 = new __emptyStringLiteral(_emptyStringLiteral); callbacks[153] = Marshal.GetFunctionPointerForDelegate(d153); delegates[153] = d153; - var d154 = new __setOverride(_setOverride); + var d154 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); callbacks[154] = Marshal.GetFunctionPointerForDelegate(d154); delegates[154] = d154; - var d155 = new __addActiveDependency(_addActiveDependency); + var d155 = new __setOverride(_setOverride); callbacks[155] = Marshal.GetFunctionPointerForDelegate(d155); delegates[155] = d155; - var d156 = new __GetDelegateCtor(_GetDelegateCtor); + var d156 = new __addActiveDependency(_addActiveDependency); callbacks[156] = Marshal.GetFunctionPointerForDelegate(d156); delegates[156] = d156; - var d157 = new __MethodCompileComplete(_MethodCompileComplete); + var d157 = new __GetDelegateCtor(_GetDelegateCtor); callbacks[157] = Marshal.GetFunctionPointerForDelegate(d157); delegates[157] = d157; - var d158 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); + var d158 = new __MethodCompileComplete(_MethodCompileComplete); callbacks[158] = Marshal.GetFunctionPointerForDelegate(d158); delegates[158] = d158; - var d159 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall); + var d159 = new __getTailCallCopyArgsThunk(_getTailCallCopyArgsThunk); callbacks[159] = Marshal.GetFunctionPointerForDelegate(d159); delegates[159] = d159; - var d160 = new __getMemoryManager(_getMemoryManager); + var d160 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall); callbacks[160] = Marshal.GetFunctionPointerForDelegate(d160); delegates[160] = d160; - var d161 = new __allocMem(_allocMem); + var d161 = new __getMemoryManager(_getMemoryManager); callbacks[161] = Marshal.GetFunctionPointerForDelegate(d161); delegates[161] = d161; - var d162 = new __reserveUnwindInfo(_reserveUnwindInfo); + var d162 = new __allocMem(_allocMem); callbacks[162] = Marshal.GetFunctionPointerForDelegate(d162); delegates[162] = d162; - var d163 = new __allocUnwindInfo(_allocUnwindInfo); + var d163 = new __reserveUnwindInfo(_reserveUnwindInfo); callbacks[163] = Marshal.GetFunctionPointerForDelegate(d163); delegates[163] = d163; - var d164 = new __allocGCInfo(_allocGCInfo); + var d164 = new __allocUnwindInfo(_allocUnwindInfo); callbacks[164] = Marshal.GetFunctionPointerForDelegate(d164); delegates[164] = d164; - var d165 = new __yieldExecution(_yieldExecution); + var d165 = new __allocGCInfo(_allocGCInfo); callbacks[165] = Marshal.GetFunctionPointerForDelegate(d165); delegates[165] = d165; - var d166 = new __setEHcount(_setEHcount); + var d166 = new __yieldExecution(_yieldExecution); callbacks[166] = Marshal.GetFunctionPointerForDelegate(d166); delegates[166] = d166; - var d167 = new __setEHinfo(_setEHinfo); + var d167 = new __setEHcount(_setEHcount); callbacks[167] = Marshal.GetFunctionPointerForDelegate(d167); delegates[167] = d167; - var d168 = new __logMsg(_logMsg); + var d168 = new __setEHinfo(_setEHinfo); callbacks[168] = Marshal.GetFunctionPointerForDelegate(d168); delegates[168] = d168; - var d169 = new __doAssert(_doAssert); + var d169 = new __logMsg(_logMsg); callbacks[169] = Marshal.GetFunctionPointerForDelegate(d169); delegates[169] = d169; - var d170 = new __reportFatalError(_reportFatalError); + var d170 = new __doAssert(_doAssert); callbacks[170] = Marshal.GetFunctionPointerForDelegate(d170); delegates[170] = d170; - var d171 = new __allocMethodBlockCounts(_allocMethodBlockCounts); + var d171 = new __reportFatalError(_reportFatalError); callbacks[171] = Marshal.GetFunctionPointerForDelegate(d171); delegates[171] = d171; - var d172 = new __getMethodBlockCounts(_getMethodBlockCounts); + var d172 = new __allocMethodBlockCounts(_allocMethodBlockCounts); callbacks[172] = Marshal.GetFunctionPointerForDelegate(d172); delegates[172] = d172; - var d173 = new __recordCallSite(_recordCallSite); + var d173 = new __getMethodBlockCounts(_getMethodBlockCounts); callbacks[173] = Marshal.GetFunctionPointerForDelegate(d173); delegates[173] = d173; - var d174 = new __recordRelocation(_recordRelocation); + var d174 = new __recordCallSite(_recordCallSite); callbacks[174] = Marshal.GetFunctionPointerForDelegate(d174); delegates[174] = d174; - var d175 = new __getRelocTypeHint(_getRelocTypeHint); + var d175 = new __recordRelocation(_recordRelocation); callbacks[175] = Marshal.GetFunctionPointerForDelegate(d175); delegates[175] = d175; - var d176 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); + var d176 = new __getRelocTypeHint(_getRelocTypeHint); callbacks[176] = Marshal.GetFunctionPointerForDelegate(d176); delegates[176] = d176; - var d177 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); + var d177 = new __getModuleNativeEntryPointRange(_getModuleNativeEntryPointRange); callbacks[177] = Marshal.GetFunctionPointerForDelegate(d177); delegates[177] = d177; - var d178 = new __getJitFlags(_getJitFlags); + var d178 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); callbacks[178] = Marshal.GetFunctionPointerForDelegate(d178); delegates[178] = d178; + var d179 = new __getJitFlags(_getJitFlags); + callbacks[179] = Marshal.GetFunctionPointerForDelegate(d179); + delegates[179] = d179; keepAlive = delegates; return (IntPtr)callbacks; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs index c8ff1a8fdc03b..9d1ec443e3fc7 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs @@ -1152,6 +1152,14 @@ private bool isValidStringRef(CORINFO_MODULE_STRUCT_* module, uint metaTOK) private bool shouldEnforceCallvirtRestriction(CORINFO_MODULE_STRUCT_* scope) { throw new NotImplementedException("shouldEnforceCallvirtRestriction"); } + private char* getStringLiteral(CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length) + { + MethodIL methodIL = (MethodIL)HandleToObject((IntPtr)module); + string s = (string)methodIL.GetObject((int)metaTOK); + length = (int)s.Length; + return (char*)GetPin(s); + } + private CorInfoType asCorInfoType(CORINFO_CLASS_STRUCT_* cls) { var type = HandleToObject(cls); @@ -1188,7 +1196,7 @@ private CorInfoType asCorInfoType(CORINFO_CLASS_STRUCT_* cls) } - private int appendClassName(short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, bool fNamespace, bool fFullInst, bool fAssembly) + private int appendClassName(char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, bool fNamespace, bool fFullInst, bool fAssembly) { // We support enough of this to make SIMD work, but not much else. @@ -1200,13 +1208,13 @@ private int appendClassName(short** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUC int length = name.Length; if (pnBufLen > 0) { - short* buffer = *ppBuf; + char* buffer = *ppBuf; for (int i = 0; i < Math.Min(name.Length, pnBufLen); i++) - buffer[i] = (short)name[i]; + buffer[i] = name[i]; if (name.Length < pnBufLen) - buffer[name.Length] = 0; + buffer[name.Length] = (char)0; else - buffer[pnBufLen - 1] = 0; + buffer[pnBufLen - 1] = (char)0; pnBufLen -= length; *ppBuf = buffer + length; } @@ -2353,7 +2361,7 @@ private CorInfoType getHFAType(CORINFO_CLASS_STRUCT_* hClass) private HRESULT GetErrorHRESULT(_EXCEPTION_POINTERS* pExceptionPointers) { throw new NotImplementedException("GetErrorHRESULT"); } - private uint GetErrorMessage(short* buffer, uint bufferLength) + private uint GetErrorMessage(char* buffer, uint bufferLength) { throw new NotImplementedException("GetErrorMessage"); } private int FilterException(_EXCEPTION_POINTERS* pExceptionPointers) @@ -2416,7 +2424,7 @@ private void getEEInfo(ref CORINFO_EE_INFO pEEInfoOut) pEEInfoOut.osType = _compilation.NodeFactory.Target.IsWindows ? CORINFO_OS.CORINFO_WINNT : CORINFO_OS.CORINFO_UNIX; } - private string getJitTimeLogFilename() + private char* getJitTimeLogFilename() { return null; } diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index fffc0de16cd8e..a124f01f0e85b 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -72,11 +72,11 @@ ULONG32*,ref uint,unsigned int* LONG*,int*,long* char*,byte* const char**,byte** -WCHAR**,short**,wchar_t** +WCHAR**,char**,wchar_t** LPCSTR,byte*,const char* -LPWSTR,short*,wchar_t* -LPCWSTR,short*,const wchar_t* -wchar_t*,short* +LPWSTR,char*,wchar_t* +LPCWSTR,char*,const wchar_t* +wchar_t*,char* const wchar_t*,String DWORD**,ref uint*,unsigned int** @@ -158,7 +158,6 @@ struct _EXCEPTION_POINTERS*,_EXCEPTION_POINTERS*,void* RETURNTYPES BOOL,[return: MarshalAs(UnmanagedType.Bool)]bool,int bool,[return: MarshalAs(UnmanagedType.I1)]bool -LPCWSTR,[return: MarshalAs(UnmanagedType.LPWStr)]string,const wchar_t* ; NOTE in managed SIZE_T is an enum that is 64bits in size, and returning one of those causing mcg to do the wrong thing. size_t,byte*,size_t @@ -199,6 +198,7 @@ FUNCTIONS CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE module) BOOL isValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK) BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK) + LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, unsigned metaTOK, int* length) BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope) CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls) const char* getClassName(CORINFO_CLASS_HANDLE cls) diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat index 2fec511758182..46328b52d08ba 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.bat @@ -1,2 +1,2 @@ cd /d %~dp0 -dotnet run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\jitinterface\jitinterface.h \ No newline at end of file +dotnet run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\crossgen2\jitinterface\jitinterface.h \ No newline at end of file diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh index 3eb458d6200b3..59672c72d4156 100755 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/gen.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash cd "$(dirname ${BASH_SOURCE[0]})" -dotnet run -- ThunkInput.txt ../CorInfoBase.cs ../../../jitinterface/jitinterface.h +dotnet run -- ThunkInput.txt ../CorInfoBase.cs ../../../crossgen2/jitinterface/jitinterface.h diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h index 96ea0747092ee..64ce8fcf69a22 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitinterface.h @@ -46,6 +46,7 @@ struct JitInterfaceCallbacks int (* canSkipVerification)(void * thisHandle, CorInfoException** ppException, void* module); int (* isValidToken)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); int (* isValidStringRef)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK); + const wchar_t* (* getStringLiteral)(void * thisHandle, CorInfoException** ppException, void* module, unsigned metaTOK, int* length); int (* shouldEnforceCallvirtRestriction)(void * thisHandle, CorInfoException** ppException, void* scope); int (* asCorInfoType)(void * thisHandle, CorInfoException** ppException, void* cls); const char* (* getClassName)(void * thisHandle, CorInfoException** ppException, void* cls); @@ -513,6 +514,15 @@ class JitInterfaceWrapper return _ret; } + virtual const wchar_t* getStringLiteral(void* module, unsigned metaTOK, int* length) + { + CorInfoException* pException = nullptr; + const wchar_t* _ret = _callbacks->getStringLiteral(_thisHandle, &pException, module, metaTOK, length); + if (pException != nullptr) + throw pException; + return _ret; + } + virtual int shouldEnforceCallvirtRestriction(void* scope) { CorInfoException* pException = nullptr; diff --git a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp index 0da621980ae89..ce6aae9ba83d9 100644 --- a/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp +++ b/src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp @@ -27,11 +27,11 @@ class CORJIT_FLAGS uint64_t corJitFlags; }; -static const GUID JITEEVersionIdentifier = { /* abcf830c-56d1-4b33-a8ec-5063bb5495f1 */ - 0xabcf830c, - 0x56d1, - 0x4b33, - {0xa8, 0xec, 0x50, 0x63, 0xbb, 0x54, 0x95, 0xf1} +static const GUID JITEEVersionIdentifier = { /* 13028353-152c-4886-b05b-fa76ee8169cf */ + 0x13028353, + 0x152c, + 0x4886, + {0xb0, 0x5b, 0xfa, 0x76, 0xee, 0x81, 0x69, 0xcf} }; class Jit diff --git a/src/coreclr/src/vm/dynamicmethod.cpp b/src/coreclr/src/vm/dynamicmethod.cpp index b25dfb73e2774..bb595a5cf9076 100644 --- a/src/coreclr/src/vm/dynamicmethod.cpp +++ b/src/coreclr/src/vm/dynamicmethod.cpp @@ -1197,6 +1197,21 @@ LCGMethodResolver::IsValidStringRef(mdToken metaTok) return GetStringLiteral(metaTok) != NULL; } +int +LCGMethodResolver::GetStringLiteralLength(mdToken metaTok) +{ + STANDARD_VM_CONTRACT; + + GCX_COOP(); + + STRINGREF str = GetStringLiteral(metaTok); + if (str != NULL) + { + return str->GetStringLength(); + } + return -1; +} + //--------------------------------------------------------------------------------------- // STRINGREF diff --git a/src/coreclr/src/vm/dynamicmethod.h b/src/coreclr/src/vm/dynamicmethod.h index c119877d55a8b..9e4322de213cf 100644 --- a/src/coreclr/src/vm/dynamicmethod.h +++ b/src/coreclr/src/vm/dynamicmethod.h @@ -73,6 +73,7 @@ class DynamicResolver // jit interface api virtual OBJECTHANDLE ConstructStringLiteral(mdToken metaTok) = 0; virtual BOOL IsValidStringRef(mdToken metaTok) = 0; + virtual int GetStringLiteralLength(mdToken metaTok) = 0; virtual void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD) = 0; virtual SigPointer ResolveSignature(mdToken token) = 0; virtual SigPointer ResolveSignatureForVarArg(mdToken token) = 0; @@ -122,6 +123,7 @@ class LCGMethodResolver : public DynamicResolver OBJECTHANDLE ConstructStringLiteral(mdToken metaTok); BOOL IsValidStringRef(mdToken metaTok); + int GetStringLiteralLength(mdToken metaTok); void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD); SigPointer ResolveSignature(mdToken token); SigPointer ResolveSignatureForVarArg(mdToken token); diff --git a/src/coreclr/src/vm/ilstubresolver.cpp b/src/coreclr/src/vm/ilstubresolver.cpp index 665d39dd20de1..94be0cf9ca2be 100644 --- a/src/coreclr/src/vm/ilstubresolver.cpp +++ b/src/coreclr/src/vm/ilstubresolver.cpp @@ -140,6 +140,13 @@ BOOL ILStubResolver::IsValidStringRef(mdToken metaTok) return FALSE; } +int ILStubResolver::GetStringLiteralLength(mdToken metaTok) +{ + STANDARD_VM_CONTRACT; + _ASSERTE(FALSE); + return -1; +} + void ILStubResolver::ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD) { STANDARD_VM_CONTRACT; diff --git a/src/coreclr/src/vm/ilstubresolver.h b/src/coreclr/src/vm/ilstubresolver.h index c3be136aaa9dc..8b42a0cd3b313 100644 --- a/src/coreclr/src/vm/ilstubresolver.h +++ b/src/coreclr/src/vm/ilstubresolver.h @@ -33,6 +33,7 @@ class ILStubResolver : DynamicResolver OBJECTHANDLE ConstructStringLiteral(mdToken metaTok); BOOL IsValidStringRef(mdToken metaTok); + int GetStringLiteralLength(mdToken metaTok); void ResolveToken(mdToken token, TypeHandle * pTH, MethodDesc ** ppMD, FieldDesc ** ppFD); SigPointer ResolveSignature(mdToken token); SigPointer ResolveSignatureForVarArg(mdToken token); diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index 780972f50e4f5..373775d6b36c4 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -799,6 +799,48 @@ BOOL CEEInfo::isValidStringRef ( return result; } +LPCWSTR CEEInfo::getStringLiteral ( + CORINFO_MODULE_HANDLE moduleHnd, + mdToken metaTOK, + int* length) +{ + CONTRACTL{ + THROWS; + GC_TRIGGERS; + MODE_PREEMPTIVE; + } CONTRACTL_END; + + Module* module = GetModule(moduleHnd); + + LPCWSTR result = nullptr; + + JIT_TO_EE_TRANSITION(); + + if (IsDynamicScope(moduleHnd)) + { + *length = GetDynamicResolver(moduleHnd)->GetStringLiteralLength(metaTOK); + } + else + { + DWORD dwCharCount; + LPCWSTR pString; + if (!FAILED((module)->GetMDImport()->GetUserString(metaTOK, &dwCharCount, NULL, &pString))) + { + // For string.Empty pString will be null + *length = dwCharCount; + result = pString; + } + else + { + *length = -1; + } + } + + EE_TO_JIT_TRANSITION(); + + return result; +} + /* static */ size_t CEEInfo::findNameOfToken (Module* module, mdToken metaTOK, diff --git a/src/coreclr/src/vm/jitinterface.h b/src/coreclr/src/vm/jitinterface.h index 4a7002f6c0dfe..9c8ff71f91d56 100644 --- a/src/coreclr/src/vm/jitinterface.h +++ b/src/coreclr/src/vm/jitinterface.h @@ -662,6 +662,12 @@ class CEEInfo : public ICorJitInfo CORINFO_MODULE_HANDLE module, mdToken metaTOK); + // Get string length and content (can be null) for given metaTOK + LPCWSTR getStringLiteral ( + CORINFO_MODULE_HANDLE module, + mdToken metaTOK, + int* length); + static size_t findNameOfToken (Module* module, mdToken metaTOK, __out_ecount (FQNameCapacity) char * szFQName, size_t FQNameCapacity); diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index 69476d0798171..980c2ad4116df 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -3809,6 +3809,13 @@ BOOL ZapInfo::isValidStringRef ( return m_pEEJitInfo->isValidStringRef(tokenScope, token); } +LPCWSTR ZapInfo::getStringLiteral ( + CORINFO_MODULE_HANDLE tokenScope, + unsigned token, + int* length) +{ + return m_pEEJitInfo->getStringLiteral(tokenScope, token, length); +} // // ICorMethodInfo diff --git a/src/coreclr/src/zap/zapinfo.h b/src/coreclr/src/zap/zapinfo.h index 338ad74911db2..8253de792f5db 100644 --- a/src/coreclr/src/zap/zapinfo.h +++ b/src/coreclr/src/zap/zapinfo.h @@ -629,6 +629,9 @@ class ZapInfo unsigned metaTOK); BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK); + LPCWSTR getStringLiteral(CORINFO_MODULE_HANDLE module, + unsigned metaTOK, + int* length); // ICorMethodInfo