diff options
Diffstat (limited to 'src/ToolBox/superpmi/superpmi-shared')
8 files changed, 52 insertions, 14 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/compileresult.h b/src/ToolBox/superpmi/superpmi-shared/compileresult.h index 8fc3f7a352..87853f4cd3 100644 --- a/src/ToolBox/superpmi/superpmi-shared/compileresult.h +++ b/src/ToolBox/superpmi/superpmi-shared/compileresult.h @@ -203,7 +203,7 @@ public: void recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd, CorInfoInline inlineResult, const char * reason); void dmpReportInliningDecision(DWORD key, const Agnostic_ReportInliningDecision& value); - CorInfoInline CompileResult::repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd); + CorInfoInline repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd); void recSetEHcount(unsigned cEH); void dmpSetEHcount(DWORD key, DWORD value); diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h index 671b45b392..e1190d7ab6 100644 --- a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h +++ b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h @@ -57,7 +57,11 @@ public: // When the EE loads the System.Numerics.Vectors assembly, it asks the JIT what length (in bytes) of // SIMD vector it supports as an intrinsic type. Zero means that the JIT does not support SIMD // intrinsics, so the EE should use the default size (i.e. the size of the IL implementation). +#if COR_JIT_EE_VERSION > 460 + unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */ +#else unsigned getMaxIntrinsicSIMDVectorLength(DWORD cpuCompileFlags); /* { return 0; } */ +#endif // IL obfuscators sometimes interpose on the EE-JIT interface. This function allows the VM to // tell the JIT to use a particular ICorJitCompiler to implement the methods of this interface, diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h index 6eb862c8b8..b847d9bc50 100644 --- a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h +++ b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h @@ -653,7 +653,7 @@ public: // in the code are. The native compiler will ensure that these places // have a corresponding break point in native code. // - // Note that unless CORJIT_FLG_DEBUG_CODE is specified, this function will + // Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will // be used only as a hint and the native compiler should not change its // code generation. void getBoundaries( @@ -683,7 +683,7 @@ public: // under debugging, the JIT needs to keep them live over their // entire scope so that they can be inspected. // - // Note that unless CORJIT_FLG_DEBUG_CODE is specified, this function will + // Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will // be used only as a hint and the native compiler should not change its // code generation. void getVars( diff --git a/src/ToolBox/superpmi/superpmi-shared/logging.cpp b/src/ToolBox/superpmi/superpmi-shared/logging.cpp index 5f7aa48a4f..69c321bb39 100644 --- a/src/ToolBox/superpmi/superpmi-shared/logging.cpp +++ b/src/ToolBox/superpmi/superpmi-shared/logging.cpp @@ -262,9 +262,9 @@ void Logger::LogVprintf(const char *function, const char *file, int line, const char *timeStr = ""; #endif // FEATURE_PAL - const char *logEntryFmtStr = "%s - %s [%s:%d] - %s - %s\r\n"; - size_t logEntryBuffSize = _snprintf(nullptr, 0, logEntryFmtStr, - timeStr, function, file, line, logLevelStr, fullMsg) + 1; + const char logEntryFmtStr[] = "%s - %s [%s:%d] - %s - %s\r\n"; + size_t logEntryBuffSize = sizeof(logEntryFmtStr) + strlen(timeStr) + strlen(function) + + strlen(file) + 10 + strlen(logLevelStr) + strlen(fullMsg); char *logEntry = new char[logEntryBuffSize]; sprintf_s(logEntry, logEntryBuffSize, logEntryFmtStr, diff --git a/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/ToolBox/superpmi/superpmi-shared/lwmlist.h index 774e732620..de0db3a9bb 100644 --- a/src/ToolBox/superpmi/superpmi-shared/lwmlist.h +++ b/src/ToolBox/superpmi/superpmi-shared/lwmlist.h @@ -85,6 +85,7 @@ LWM(GetFunctionFixedEntryPoint, DWORDLONG, Agnostic_CORINFO_CONST_LOOKUP) LWM(GetGSCookie, DWORD, DLDL) LWM(GetHelperFtn, DWORD, DLDL) LWM(GetHelperName, DWORD, DWORD) +LWM(GetHFAType, DWORDLONG, DWORD) LWM(GetInlinedCallFrameVptr, DWORD, DLDL) LWM(GetIntConfigValue, Agnostic_ConfigIntInfo, DWORD) LWM(GetIntrinsicID, DWORDLONG, DD) diff --git a/src/ToolBox/superpmi/superpmi-shared/mclist.cpp b/src/ToolBox/superpmi/superpmi-shared/mclist.cpp index 6a6f8701bf..511893fc96 100644 --- a/src/ToolBox/superpmi/superpmi-shared/mclist.cpp +++ b/src/ToolBox/superpmi/superpmi-shared/mclist.cpp @@ -237,7 +237,7 @@ void MCList::AddMethodToMCL(int methodIndex) DWORD charCount = 0; DWORD bytesWritten = 0; - charCount = sprintf(strMethodIndex, "%d\r\n", methodIndex); + charCount = sprintf_s(strMethodIndex, sizeof(strMethodIndex), "%d\r\n", methodIndex); if (!WriteFile(hMCLFile, strMethodIndex, charCount, &bytesWritten, nullptr) || bytesWritten != charCount) { diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index 2c46065b48..5768d38569 100644 --- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -744,7 +744,7 @@ void MethodContext::recCompileMethod(CORINFO_METHOD_INFO *info, unsigned flags) void MethodContext::dmpCompileMethod(DWORD key, const Agnostic_CompileMethod& value) { printf("CompiledMethod key %u, value ftn-%016llX scp-%016llX ilo-%u ils-%u ms-%u ehc-%u opt-%u rk-%u " - "args{cc-%u rc-%016llX rts-%016llX rt-%u(%s) flg-%08X nA-%u cc-%u ci-%u mc-%u mi-%u arg-%016llX cb-%u pSig-%u scp-%016llX tok-%08X} " + "args{cc-%u rc-%016llX rts-%016llX rt-%u(%s) flg-%08X nA-%u cc-%u ci-%u mc-%u mi-%u arg-%016llX cb-%u pSig-%u scp-%016llX tok-%08X} " "locals{cc-%u rc-%016llX rts-%016llX rt-%u(%s) flg-%08X nA-%u cc-%u ci-%u mc-%u mi-%u arg-%016llX cb-%u pSig-%u scp-%016llX tok-%08X} " "flg-%08X", key, @@ -1098,8 +1098,8 @@ void MethodContext::recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DW } void MethodContext::dmpGetJitFlags(DWORD key, DD value) { - CORJIT_FLAGS *flags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A); - printf("GetJitFlags key %u sizeInBytes-%u corJitFlags-%08X corJitFlags2-%08X", key, value.B, flags->corJitFlags, flags->corJitFlags2); + CORJIT_FLAGS *jitflags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A); + printf("GetJitFlags key %u sizeInBytes-%u jitFlags-%016llX", key, value.B, jitflags->GetFlagsRaw()); GetJitFlags->Unlock(); } DWORD MethodContext::repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes) @@ -2842,6 +2842,34 @@ CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig, CORINF return (CORINFO_CLASS_HANDLE)value.result; } +void MethodContext::recGetHFAType(CORINFO_CLASS_HANDLE clsHnd, CorInfoType result) +{ + if (GetHFAType == nullptr) + GetHFAType = new LightWeightMap<DWORDLONG, DWORD>(); + + GetHFAType->Add((DWORDLONG)clsHnd, (DWORD)result); + DEBUG_REC(dmpGetHFAType((DWORDLONG)clsHnd, (DWORD)result)); + return; +} + +void MethodContext::dmpGetHFAType(DWORDLONG key, DWORD value) +{ + printf("GetHFAType key %016llX, value %u ", key, value); + return; +} + +CorInfoType MethodContext::repGetHFAType(CORINFO_CLASS_HANDLE clsHnd) +{ + DWORD value; + + AssertCodeMsg(GetHFAType != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)clsHnd); + AssertCodeMsg(GetHFAType->GetIndex((DWORDLONG)clsHnd) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)clsHnd); + + value = GetHFAType->Get((DWORDLONG)clsHnd); + DEBUG_REP(dmpGetHFAType((DWORDLONG)clsHnd, value)); + return (CorInfoType)value; +} + void MethodContext::recGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO *info, bool result, DWORD exceptionCode) { if (GetMethodInfo == nullptr) diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index 5869c85b45..0d49666e5c 100644 --- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -513,9 +513,9 @@ public: void dmpGetMethodName(DLD key, DD value); const char *repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char **moduleName); - void MethodContext::recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result); - void MethodContext::dmpGetJitFlags(DWORD key, DD value); - DWORD MethodContext::repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes); + void recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result); + void dmpGetJitFlags(DWORD key, DD value); + DWORD repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes); void recGetJitTimeLogFilename(LPCWSTR tempFileName); void dmpGetJitTimeLogFilename(DWORD key, DWORD value); @@ -674,6 +674,10 @@ public: void dmpGetArgClass(const Agnostic_GetArgClass& key, const Agnostic_GetArgClass_Value& value); CORINFO_CLASS_HANDLE repGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, DWORD *exceptionCode); + void recGetHFAType(CORINFO_CLASS_HANDLE clsHnd, CorInfoType result); + void dmpGetHFAType(DWORDLONG key, DWORD value); + CorInfoType repGetHFAType(CORINFO_CLASS_HANDLE clsHnd); + void recGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO *info, bool result, DWORD exceptionCode); void dmpGetMethodInfo(DWORDLONG key, const Agnostic_GetMethodInfo& value); bool repGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO *info, DWORD *exceptionCode); @@ -1012,7 +1016,7 @@ private: // ********************* Please keep this up-to-date to ease adding more *************** -// Highest packet number: 158 +// Highest packet number: 159 // ************************************************************************************* enum mcPackets { @@ -1055,6 +1059,7 @@ enum mcPackets Packet_GetAddrOfCaptureThreadGlobal = 27, Retired1 = 28, Packet_GetArgClass = 139, //retired as 28 on 2013/07/03 + Packet_GetHFAType = 159, Packet_GetArgNext = 29, Retired2 = 30, Packet_GetArgType = 140, //retired as 30 on 2013/07/03 |