summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/superpmi-shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolBox/superpmi/superpmi-shared')
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/asmdumper.cpp66
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/asmdumper.h2
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/callutils.cpp136
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/callutils.h28
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/compileresult.cpp821
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/compileresult.h232
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h20
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/errorhandling.cpp76
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/errorhandling.h42
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h88
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjithostimpl.h49
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h2136
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/lightweightmap.h439
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/logging.cpp139
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/logging.h80
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/mclist.cpp105
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/mclist.h12
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp4696
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.h1079
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.cpp13
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.h24
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp111
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h60
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/registertablexarch.h174
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/runtimedetails.h14
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/simpletimer.cpp11
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/simpletimer.h4
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp12
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/spmiutil.h2
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/standardpch.h9
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/tocfile.cpp13
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/tocfile.h16
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/typeutils.cpp110
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/typeutils.h4
34 files changed, 5490 insertions, 5333 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/asmdumper.cpp b/src/ToolBox/superpmi/superpmi-shared/asmdumper.cpp
index 240e228c1e..8fc944ac90 100644
--- a/src/ToolBox/superpmi/superpmi-shared/asmdumper.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/asmdumper.cpp
@@ -6,38 +6,38 @@
#include "standardpch.h"
#include "asmdumper.h"
-void ASMDumper::DumpToFile(HANDLE hFile, MethodContext *mc, CompileResult *cr)
+void ASMDumper::DumpToFile(HANDLE hFile, MethodContext* mc, CompileResult* cr)
{
CORINFO_METHOD_INFO info;
- unsigned flags = 0;
+ unsigned flags = 0;
mc->repCompileMethod(&info, &flags);
- #define bufflen 4096
+#define bufflen 4096
DWORD bytesWritten;
- char buff[bufflen];
+ char buff[bufflen];
int buff_offset = 0;
ZeroMemory(buff, bufflen * sizeof(char));
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, ";;Generated from SuperPMI on original input '%s'",
- cr->repProcessName());
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, "\r\n Method Name \"%s\"",
- mc->repGetMethodName(info.ftn,nullptr));
+ buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset,
+ ";;Generated from SuperPMI on original input '%s'", cr->repProcessName());
+ buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset, "\r\n Method Name \"%s\"",
+ mc->repGetMethodName(info.ftn, nullptr));
WriteFile(hFile, buff, buff_offset * sizeof(char), &bytesWritten, nullptr);
- ULONG hotCodeSize;
- ULONG coldCodeSize;
- ULONG roDataSize;
- ULONG xcptnsCount;
+ ULONG hotCodeSize;
+ ULONG coldCodeSize;
+ ULONG roDataSize;
+ ULONG xcptnsCount;
CorJitAllocMemFlag flag;
- unsigned char *hotCodeBlock;
- unsigned char *coldCodeBlock;
- unsigned char *roDataBlock;
- void *orig_hotCodeBlock;
- void *orig_coldCodeBlock;
- void *orig_roDataBlock;
-
- cr->repAllocMem(&hotCodeSize, &coldCodeSize, &roDataSize, &xcptnsCount, &flag,
- &hotCodeBlock, &coldCodeBlock, &roDataBlock, &orig_hotCodeBlock, &orig_coldCodeBlock, &orig_roDataBlock);
+ unsigned char* hotCodeBlock;
+ unsigned char* coldCodeBlock;
+ unsigned char* roDataBlock;
+ void* orig_hotCodeBlock;
+ void* orig_coldCodeBlock;
+ void* orig_roDataBlock;
+
+ cr->repAllocMem(&hotCodeSize, &coldCodeSize, &roDataSize, &xcptnsCount, &flag, &hotCodeBlock, &coldCodeBlock,
+ &roDataBlock, &orig_hotCodeBlock, &orig_coldCodeBlock, &orig_roDataBlock);
cr->applyRelocs(hotCodeBlock, hotCodeSize, orig_hotCodeBlock);
cr->applyRelocs(coldCodeBlock, coldCodeSize, orig_coldCodeBlock);
cr->applyRelocs(roDataBlock, roDataSize, orig_roDataBlock);
@@ -45,9 +45,9 @@ void ASMDumper::DumpToFile(HANDLE hFile, MethodContext *mc, CompileResult *cr)
#ifdef USE_MSVCDIS
#ifdef _TARGET_AMD64_
- DIS *disasm = DIS::PdisNew(DIS::distX8664);
+ DIS* disasm = DIS::PdisNew(DIS::distX8664);
#elif _TARGET_X86_
- DIS *disasm = DIS::PdisNew(DIS::distX86);
+ DIS* disasm = DIS::PdisNew(DIS::distX86);
#endif
size_t offset = 0;
while (offset < hotCodeSize)
@@ -56,22 +56,24 @@ void ASMDumper::DumpToFile(HANDLE hFile, MethodContext *mc, CompileResult *cr)
ZeroMemory(buff, bufflen * sizeof(char));
DIS::INSTRUCTION instr;
- DIS::OPERAND ops[3];
+ DIS::OPERAND ops[3];
- size_t instrSize = disasm->CbDisassemble(0, (void *)(hotCodeBlock + offset), 15);
- if(instrSize==0)
+ size_t instrSize = disasm->CbDisassemble(0, (void*)(hotCodeBlock + offset), 15);
+ if (instrSize == 0)
{
LogWarning("Zero sized instruction");
break;
}
disasm->FDecode(&instr, ops, 3);
- wchar_t instrMnemonic[64]; // I never know how much to allocate...
+ wchar_t instrMnemonic[64]; // I never know how much to allocate...
disasm->CchFormatInstr(instrMnemonic, 64);
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, "\r\n%p %S", (void*)((size_t)orig_hotCodeBlock+offset), instrMnemonic);
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, " ; ");
- for(unsigned int i=0;i<instrSize;i++)
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, "%02x ", *((BYTE*)(hotCodeBlock + offset + i) ));
+ buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset, "\r\n%p %S",
+ (void*)((size_t)orig_hotCodeBlock + offset), instrMnemonic);
+ buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset, " ; ");
+ for (unsigned int i = 0; i < instrSize; i++)
+ buff_offset +=
+ sprintf_s(&buff[buff_offset], bufflen - buff_offset, "%02x ", *((BYTE*)(hotCodeBlock + offset + i)));
WriteFile(hFile, buff, buff_offset * sizeof(char), &bytesWritten, nullptr);
offset += instrSize;
}
@@ -82,7 +84,7 @@ void ASMDumper::DumpToFile(HANDLE hFile, MethodContext *mc, CompileResult *cr)
buff_offset = 0;
ZeroMemory(buff, bufflen * sizeof(char));
- buff_offset+=sprintf_s(&buff[buff_offset], bufflen-buff_offset, ";; No disassembler available");
+ buff_offset += sprintf_s(&buff[buff_offset], bufflen - buff_offset, ";; No disassembler available");
WriteFile(hFile, buff, buff_offset * sizeof(char), &bytesWritten, nullptr);
#endif // !USE_MSVCDIS
diff --git a/src/ToolBox/superpmi/superpmi-shared/asmdumper.h b/src/ToolBox/superpmi/superpmi-shared/asmdumper.h
index d848d60e20..683deed820 100644
--- a/src/ToolBox/superpmi/superpmi-shared/asmdumper.h
+++ b/src/ToolBox/superpmi/superpmi-shared/asmdumper.h
@@ -12,7 +12,7 @@
class ASMDumper
{
public:
- static void DumpToFile(HANDLE hFile, MethodContext *mc, CompileResult *cr);
+ static void DumpToFile(HANDLE hFile, MethodContext* mc, CompileResult* cr);
};
#endif \ No newline at end of file
diff --git a/src/ToolBox/superpmi/superpmi-shared/callutils.cpp b/src/ToolBox/superpmi/superpmi-shared/callutils.cpp
index 027929bec0..42b9df5335 100644
--- a/src/ToolBox/superpmi/superpmi-shared/callutils.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/callutils.cpp
@@ -14,10 +14,9 @@
#include "logging.h"
// String representations of the JIT helper functions
-const char *kHelperName[CORINFO_HELP_COUNT] =
-{
+const char* kHelperName[CORINFO_HELP_COUNT] = {
#define JITHELPER(code, pfnHelper, sig) #code,
-#define DYNAMICJITHELPER(code, pfnHelper,sig) #code,
+#define DYNAMICJITHELPER(code, pfnHelper, sig) #code,
#include "jithelpers.h"
};
@@ -53,26 +52,24 @@ const char *kHelperName[CORINFO_HELP_COUNT] =
// if it is able to understand that call (i.e. if it does not return CallType_Unknown). You, the caller,
// are responsible for freeing the memory (with delete[]).
//
-CallType CallUtils::GetRecordedCallSiteInfo(MethodContext *mc,
- CompileResult *cr,
- unsigned int callInstrOffset,
- /*out*/ CORINFO_SIG_INFO *outSigInfo,
- /*out*/ char **outCallTargetSymbol)
+CallType CallUtils::GetRecordedCallSiteInfo(MethodContext* mc,
+ CompileResult* cr,
+ unsigned int callInstrOffset,
+ /*out*/ CORINFO_SIG_INFO* outSigInfo,
+ /*out*/ char** outCallTargetSymbol)
{
AssertCodeMsg(mc != nullptr, EXCEPTIONCODE_CALLUTILS,
- "Null method context passed into GetCallTargetInfo for call at offset %x.",
- callInstrOffset);
+ "Null method context passed into GetCallTargetInfo for call at offset %x.", callInstrOffset);
AssertCodeMsg(cr != nullptr, EXCEPTIONCODE_CALLUTILS,
- "Null compile result passed into GetCallTargetInfo for call at offset %x.",
- callInstrOffset);
+ "Null compile result passed into GetCallTargetInfo for call at offset %x.", callInstrOffset);
CallType targetType = CallType_Unknown;
CORINFO_SIG_INFO callSig;
- bool recordedCallSig = cr->fndRecordCallSiteSigInfo(callInstrOffset, &callSig);
+ bool recordedCallSig = cr->fndRecordCallSiteSigInfo(callInstrOffset, &callSig);
- CORINFO_METHOD_HANDLE methodHandle = nullptr;
- bool recordedMethodHandle = cr->fndRecordCallSiteMethodHandle(callInstrOffset, &methodHandle);
+ CORINFO_METHOD_HANDLE methodHandle = nullptr;
+ bool recordedMethodHandle = cr->fndRecordCallSiteMethodHandle(callInstrOffset, &methodHandle);
if (recordedCallSig)
{
@@ -80,7 +77,7 @@ CallType CallUtils::GetRecordedCallSiteInfo(MethodContext *mc,
*outSigInfo = callSig;
if (outCallTargetSymbol != nullptr)
- *outCallTargetSymbol = (char *)GetMethodFullName(mc, methodHandle, callSig);
+ *outCallTargetSymbol = (char*)GetMethodFullName(mc, methodHandle, callSig);
targetType = CallType_UserFunction;
}
@@ -88,10 +85,9 @@ CallType CallUtils::GetRecordedCallSiteInfo(MethodContext *mc,
{
CorInfoHelpFunc helperNum = CallUtils::GetHelperNum(methodHandle);
AssertCodeMsg(helperNum != CORINFO_HELP_UNDEF, EXCEPTIONCODE_CALLUTILS,
- "Unknown call at offset %x with method handle %016llX.",
- callInstrOffset, methodHandle);
+ "Unknown call at offset %x with method handle %016llX.", callInstrOffset, methodHandle);
- size_t length = strlen(kHelperName[helperNum]) + 1;
+ size_t length = strlen(kHelperName[helperNum]) + 1;
*outCallTargetSymbol = new char[length];
strcpy_s(*outCallTargetSymbol, length, kHelperName[helperNum]);
@@ -134,38 +130,39 @@ CallType CallUtils::GetRecordedCallSiteInfo(MethodContext *mc,
// are responsible for freeing the memory (with delete[]).
//
-CallType CallUtils::GetDirectCallSiteInfo(MethodContext *mc,
- void *callTarget,
- /*out*/ CORINFO_SIG_INFO *outSigInfo,
- /*out*/ char **outCallTargetSymbol)
+CallType CallUtils::GetDirectCallSiteInfo(MethodContext* mc,
+ void* callTarget,
+ /*out*/ CORINFO_SIG_INFO* outSigInfo,
+ /*out*/ char** outCallTargetSymbol)
{
AssertCodeMsg(mc != nullptr, EXCEPTIONCODE_CALLUTILS,
- "Null method context passed into GetCallTargetInfo for call to target %016llX.", callTarget);
+ "Null method context passed into GetCallTargetInfo for call to target %016llX.", callTarget);
- CallType targetType = CallType_Unknown;
- MethodContext::DLD functionEntryPoint;
+ CallType targetType = CallType_Unknown;
+ MethodContext::DLD functionEntryPoint;
CORINFO_METHOD_HANDLE methodHandle;
// Try to first obtain a method handle associated with this call target
functionEntryPoint.A = (DWORDLONG)callTarget;
- functionEntryPoint.B = 0; // TODO-Cleanup: we should be more conscious of this...
+ functionEntryPoint.B = 0; // TODO-Cleanup: we should be more conscious of this...
if (mc->fndGetFunctionEntryPoint(functionEntryPoint, &methodHandle))
{
// Now try to obtain the call info associated with this method handle
- struct Param {
- MethodContext* mc;
- CORINFO_SIG_INFO* outSigInfo;
- char** outCallTargetSymbol;
- CallType* pTargetType;
- CORINFO_METHOD_HANDLE* pMethodHandle;
+ struct Param
+ {
+ MethodContext* mc;
+ CORINFO_SIG_INFO* outSigInfo;
+ char** outCallTargetSymbol;
+ CallType* pTargetType;
+ CORINFO_METHOD_HANDLE* pMethodHandle;
} param;
- param.mc = mc;
- param.outSigInfo = outSigInfo;
+ param.mc = mc;
+ param.outSigInfo = outSigInfo;
param.outCallTargetSymbol = outCallTargetSymbol;
- param.pTargetType = &targetType;
- param.pMethodHandle = &methodHandle;
+ param.pTargetType = &targetType;
+ param.pMethodHandle = &methodHandle;
PAL_TRY(Param*, pParam, &param)
{
@@ -177,14 +174,15 @@ CallType CallUtils::GetDirectCallSiteInfo(MethodContext *mc,
*pParam->outSigInfo = callInfo.sig;
if (pParam->outCallTargetSymbol != nullptr)
- *pParam->outCallTargetSymbol = (char *)GetMethodFullName(pParam->mc, *pParam->pMethodHandle, callInfo.sig);
+ *pParam->outCallTargetSymbol =
+ (char*)GetMethodFullName(pParam->mc, *pParam->pMethodHandle, callInfo.sig);
*pParam->pTargetType = CallType_UserFunction;
}
PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CatchMC)
{
- LogWarning("Didn't find call info for method handle %016llX (call target: %016llX)",
- methodHandle, callTarget);
+ LogWarning("Didn't find call info for method handle %016llX (call target: %016llX)", methodHandle,
+ callTarget);
}
PAL_ENDTRY
}
@@ -197,7 +195,7 @@ CallType CallUtils::GetDirectCallSiteInfo(MethodContext *mc,
{
if (outCallTargetSymbol != nullptr)
{
- size_t length = strlen(kHelperName[helperNum]) + 1;
+ size_t length = strlen(kHelperName[helperNum]) + 1;
*outCallTargetSymbol = new char[length];
strcpy_s(*outCallTargetSymbol, length, kHelperName[helperNum]);
}
@@ -206,8 +204,7 @@ CallType CallUtils::GetDirectCallSiteInfo(MethodContext *mc,
}
else
{
- LogWarning("Call to target %016llX has no method handle and is not a helper call.",
- callTarget);
+ LogWarning("Call to target %016llX has no method handle and is not a helper call.", callTarget);
}
}
@@ -220,10 +217,9 @@ CallType CallUtils::GetDirectCallSiteInfo(MethodContext *mc,
//-------------------------------------------------------------------------------------------------
// Stolen from Compiler::impMethodInfo_hasRetBuffArg (in the importer)
-bool CallUtils::HasRetBuffArg(MethodContext *mc, CORINFO_SIG_INFO args)
+bool CallUtils::HasRetBuffArg(MethodContext* mc, CORINFO_SIG_INFO args)
{
- if (args.retType != CORINFO_TYPE_VALUECLASS &&
- args.retType != CORINFO_TYPE_REFANY)
+ if (args.retType != CORINFO_TYPE_VALUECLASS && args.retType != CORINFO_TYPE_REFANY)
{
return false;
}
@@ -233,16 +229,14 @@ bool CallUtils::HasRetBuffArg(MethodContext *mc, CORINFO_SIG_INFO args)
// i) TYP_STRUCT argument that can fit into a single register and
// ii) Power of two sized TYP_STRUCT on AMD64.
unsigned size = mc->repGetClassSize(args.retTypeClass);
- return (size > sizeof(void*)) || ((size & (size-1)) != 0);
+ return (size > sizeof(void*)) || ((size & (size - 1)) != 0);
#else
return true;
#endif
}
// Originally from src/jit/ee_il_dll.cpp
-const char *CallUtils::GetMethodName(MethodContext *mc,
- CORINFO_METHOD_HANDLE method,
- const char **classNamePtr)
+const char* CallUtils::GetMethodName(MethodContext* mc, CORINFO_METHOD_HANDLE method, const char** classNamePtr)
{
if (GetHelperNum(method))
{
@@ -257,16 +251,14 @@ const char *CallUtils::GetMethodName(MethodContext *mc,
{
if (classNamePtr != nullptr)
*classNamePtr = "NATIVE";
- method = GetMethodHandleForNative(method);
+ method = GetMethodHandleForNative(method);
}
- return(mc->repGetMethodName(method, classNamePtr));
+ return (mc->repGetMethodName(method, classNamePtr));
}
// Originally from src/jit/eeinterface.cpp
-const char *CallUtils::GetMethodFullName(MethodContext *mc,
- CORINFO_METHOD_HANDLE hnd,
- CORINFO_SIG_INFO sig)
+const char* CallUtils::GetMethodFullName(MethodContext* mc, CORINFO_METHOD_HANDLE hnd, CORINFO_SIG_INFO sig)
{
const char* returnType = NULL;
@@ -277,7 +269,7 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
return methodName;
}
- size_t length = 0;
+ size_t length = 0;
unsigned i;
/* Generating the full signature is a two-pass process. First we have to walk
@@ -290,7 +282,7 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
/* initialize length with length of className and '.' */
if (className != nullptr)
- length = strlen(className)+1;
+ length = strlen(className) + 1;
else
{
// Tweaked to avoid using CRT assertions
@@ -307,8 +299,8 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
{
// Tweaked to use EE types instead of JIT-specific types
CORINFO_CLASS_HANDLE typeHandle;
- DWORD exception;
- CorInfoType type = strip(mc->repGetArgType(&sig, argList, &typeHandle, &exception));
+ DWORD exception;
+ CorInfoType type = strip(mc->repGetArgType(&sig, argList, &typeHandle, &exception));
length += strlen(TypeUtils::GetCorInfoTypeName(type));
argList = mc->repGetArgNext(argList);
@@ -326,7 +318,8 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
length += strlen(returnType) + 1; // don't forget the delimiter ':'
}
- // Does it have a 'this' pointer? Don't count explicit this, which has the this pointer type as the first element of the arg type list
+ // Does it have a 'this' pointer? Don't count explicit this, which has the this pointer type as the first element of
+ // the arg type list
if (sig.hasThis() && !sig.hasExplicitThis())
{
// Tweaked to avoid using CRT assertions
@@ -338,7 +331,7 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
length += 2;
- char *retName = new char[length]; // Tweaked to use "new" instead of compGetMem
+ char* retName = new char[length]; // Tweaked to use "new" instead of compGetMem
/* Now generate the full signature string in the allocated buffer */
@@ -363,8 +356,8 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
{
// Tweaked to use EE types instead of JIT-specific types
CORINFO_CLASS_HANDLE typeHandle;
- DWORD exception;
- CorInfoType type = strip(mc->repGetArgType(&sig, argList, &typeHandle, &exception));
+ DWORD exception;
+ CorInfoType type = strip(mc->repGetArgType(&sig, argList, &typeHandle, &exception));
strcat_s(retName, length, TypeUtils::GetCorInfoTypeName(type));
argList = mc->repGetArgNext(argList);
@@ -380,25 +373,26 @@ const char *CallUtils::GetMethodFullName(MethodContext *mc,
strcat_s(retName, length, returnType);
}
- // Does it have a 'this' pointer? Don't count explicit this, which has the this pointer type as the first element of the arg type list
+ // Does it have a 'this' pointer? Don't count explicit this, which has the this pointer type as the first element of
+ // the arg type list
if (sig.hasThis() && !sig.hasExplicitThis())
{
strcat_s(retName, length, ":this");
}
// Tweaked to avoid using CRT assertions
- Assert(strlen(retName) == (length-1));
+ Assert(strlen(retName) == (length - 1));
- return(retName);
+ return (retName);
}
// Originally from jit/compiler.hpp
inline CorInfoHelpFunc CallUtils::GetHelperNum(CORINFO_METHOD_HANDLE method)
{
// Helpers are marked by the fact that they are odd numbers
- if (!(((size_t) method) & 1))
- return(CORINFO_HELP_UNDEF);
- return((CorInfoHelpFunc) (((size_t) method) >> 2));
+ if (!(((size_t)method) & 1))
+ return (CORINFO_HELP_UNDEF);
+ return ((CorInfoHelpFunc)(((size_t)method) >> 2));
}
// Originally from jit/compiler.hpp
@@ -411,6 +405,6 @@ inline bool CallUtils::IsNativeMethod(CORINFO_METHOD_HANDLE method)
inline CORINFO_METHOD_HANDLE CallUtils::GetMethodHandleForNative(CORINFO_METHOD_HANDLE method)
{
// Tweaked to avoid using CRT assertions
- Assert((((size_t) method) & 0x3) == 0x2);
- return (CORINFO_METHOD_HANDLE)(((size_t)method)& ~0x3);
+ Assert((((size_t)method) & 0x3) == 0x2);
+ return (CORINFO_METHOD_HANDLE)(((size_t)method) & ~0x3);
}
diff --git a/src/ToolBox/superpmi/superpmi-shared/callutils.h b/src/ToolBox/superpmi/superpmi-shared/callutils.h
index f428d77795..f0978d0def 100644
--- a/src/ToolBox/superpmi/superpmi-shared/callutils.h
+++ b/src/ToolBox/superpmi/superpmi-shared/callutils.h
@@ -20,25 +20,21 @@ enum CallType
class CallUtils
{
public:
- static CallType GetRecordedCallSiteInfo(MethodContext *mc,
- CompileResult *cr,
- unsigned int callInstrOffset,
- /*out*/ CORINFO_SIG_INFO *outSigInfo,
- /*out*/ char **outCallTargetSymbol);
- static CallType GetDirectCallSiteInfo(MethodContext *mc,
- void *callTarget,
- /*out*/ CORINFO_SIG_INFO *outSigInfo,
- /*out*/ char **outCallTargetSymbol);
- static bool HasRetBuffArg(MethodContext *mc, CORINFO_SIG_INFO args);
+ static CallType GetRecordedCallSiteInfo(MethodContext* mc,
+ CompileResult* cr,
+ unsigned int callInstrOffset,
+ /*out*/ CORINFO_SIG_INFO* outSigInfo,
+ /*out*/ char** outCallTargetSymbol);
+ static CallType GetDirectCallSiteInfo(MethodContext* mc,
+ void* callTarget,
+ /*out*/ CORINFO_SIG_INFO* outSigInfo,
+ /*out*/ char** outCallTargetSymbol);
+ static bool HasRetBuffArg(MethodContext* mc, CORINFO_SIG_INFO args);
static CorInfoHelpFunc GetHelperNum(CORINFO_METHOD_HANDLE method);
static bool IsNativeMethod(CORINFO_METHOD_HANDLE method);
static CORINFO_METHOD_HANDLE GetMethodHandleForNative(CORINFO_METHOD_HANDLE method);
- static const char *GetMethodName(MethodContext *mc,
- CORINFO_METHOD_HANDLE method,
- const char **classNamePtr);
- static const char *GetMethodFullName(MethodContext *mc,
- CORINFO_METHOD_HANDLE hnd,
- CORINFO_SIG_INFO sig);
+ static const char* GetMethodName(MethodContext* mc, CORINFO_METHOD_HANDLE method, const char** classNamePtr);
+ static const char* GetMethodFullName(MethodContext* mc, CORINFO_METHOD_HANDLE hnd, CORINFO_SIG_INFO sig);
};
#endif \ No newline at end of file
diff --git a/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp b/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp
index b15c51f28a..918d87ae5c 100644
--- a/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp
@@ -13,36 +13,39 @@
CompileResult::CompileResult()
{
- #define LWM(map,key,value) map = nullptr;
- #include "crlwmlist.h"
+#define LWM(map, key, value) map = nullptr;
+#include "crlwmlist.h"
- //Not persisted to disk. though should it be?
+ // Not persisted to disk. though should it be?
CallTargetTypes = new LightWeightMap<DWORDLONG, DWORD>();
- allocMemDets.hotCodeSize = 0;
- allocMemDets.coldCodeSize = 0;
- allocMemDets.roDataSize = 0;
- allocMemDets.xcptnsCount = 0;
- allocMemDets.flag = (CorJitAllocMemFlag)0;
- allocMemDets.hotCodeBlock = 0;
+ allocMemDets.hotCodeSize = 0;
+ allocMemDets.coldCodeSize = 0;
+ allocMemDets.roDataSize = 0;
+ allocMemDets.xcptnsCount = 0;
+ allocMemDets.flag = (CorJitAllocMemFlag)0;
+ allocMemDets.hotCodeBlock = 0;
allocMemDets.coldCodeBlock = 0;
- allocMemDets.roDataBlock = 0;
+ allocMemDets.roDataBlock = 0;
allocGCInfoDets.retval = 0;
- allocGCInfoDets.size = 0;
+ allocGCInfoDets.size = 0;
codeHeap = nullptr;
}
CompileResult::~CompileResult()
{
- #define LWM(map,key,value) if (map != nullptr) delete map;
- #include "crlwmlist.h"
+#define LWM(map, key, value) \
+ if (map != nullptr) \
+ delete map;
+#include "crlwmlist.h"
- if (CallTargetTypes != nullptr) delete CallTargetTypes;
+ if (CallTargetTypes != nullptr)
+ delete CallTargetTypes;
#ifndef FEATURE_PAL // PAL doesn't have HeapDestroy()
- if(codeHeap != nullptr)
+ if (codeHeap != nullptr)
::HeapDestroy(codeHeap);
#endif // !FEATURE_PAL
}
@@ -53,17 +56,19 @@ bool CompileResult::IsEmpty()
{
bool isEmpty = true;
- #define LWM(map,key,value) if (map != nullptr) isEmpty = false;
- #include "crlwmlist.h"
+#define LWM(map, key, value) \
+ if (map != nullptr) \
+ isEmpty = false;
+#include "crlwmlist.h"
return isEmpty;
}
HANDLE CompileResult::getCodeHeap()
{
- if(codeHeap == nullptr)
- codeHeap = ::HeapCreate(0,0,0);
- if(codeHeap == nullptr)
+ if (codeHeap == nullptr)
+ codeHeap = ::HeapCreate(0, 0, 0);
+ if (codeHeap == nullptr)
{
LogError("CompileResult::codeHeap() failed to acquire a heap.");
__debugbreak();
@@ -71,41 +76,41 @@ HANDLE CompileResult::getCodeHeap()
return codeHeap;
}
-void CompileResult::recAssert(const char *assertText)
+void CompileResult::recAssert(const char* assertText)
{
- if(AssertLog == nullptr)
+ if (AssertLog == nullptr)
AssertLog = new DenseLightWeightMap<DWORD>();
- AssertLog->Append(AssertLog->AddBuffer((const unsigned char*)assertText, (DWORD)strlen(assertText)+1));
+ AssertLog->Append(AssertLog->AddBuffer((const unsigned char*)assertText, (DWORD)strlen(assertText) + 1));
}
void CompileResult::dmpAssertLog(DWORD key, DWORD value)
{
- const char *assert = (const char *)AssertLog->GetBuffer(value);
+ const char* assert = (const char*)AssertLog->GetBuffer(value);
printf("AssertLog key %u, value '%s'", key, assert);
AssertLog->Unlock();
}
-const char *CompileResult::repAssert()
+const char* CompileResult::repAssert()
{
- if((AssertLog==nullptr)||(AssertLog->GetCount()==0))
+ if ((AssertLog == nullptr) || (AssertLog->GetCount() == 0))
return nullptr;
- return (const char *)AssertLog->GetBuffer(AssertLog->Get((DWORD)0));
+ return (const char*)AssertLog->GetBuffer(AssertLog->Get((DWORD)0));
}
-void CompileResult::AddCall(const char *name)
+void CompileResult::AddCall(const char* name)
{
- if(CallLog == nullptr)
+ if (CallLog == nullptr)
CallLog = new DenseLightWeightMap<DWORD>();
- //if(name[0] != '+')
- //CallLog->Append(CallLog->AddBuffer((const unsigned char *)name, (DWORD)strlen(name)+1));
+ // if(name[0] != '+')
+ //CallLog->Append(CallLog->AddBuffer((const unsigned char *)name, (DWORD)strlen(name)+1));
}
unsigned int CompileResult::CallLog_GetCount()
{
return CallLog->GetCount();
}
-bool CompileResult::CallLog_Contains(const char *str)
+bool CompileResult::CallLog_Contains(const char* str)
{
- return (CallLog->Contains((unsigned char *)str, (unsigned int)strlen(str))>0);
+ return (CallLog->Contains((unsigned char*)str, (unsigned int)strlen(str)) > 0);
}
void CompileResult::dmpCallLog(DWORD key, DWORD value)
{
@@ -118,132 +123,132 @@ void CompileResult::dumpToConsole()
{
printf("***************************************** CompileResult\n");
- #define LWM(map,key,value) dumpLWM(this,map)
- #define DENSELWM(map,value) dumpLWMDense(this,map)
- #include "crlwmlist.h"
+#define LWM(map, key, value) dumpLWM(this, map)
+#define DENSELWM(map, value) dumpLWMDense(this, map)
+#include "crlwmlist.h"
printf("-----------------------------------------\n");
}
-//Note - EE allocates these blocks (and the exception blocks) in a single linear region.
-//Note - EE assures that RoBlock is 8 byte aligned
-void CompileResult::recAllocMem(ULONG hotCodeSize, ULONG coldCodeSize, ULONG roDataSize, ULONG xcptnsCount, CorJitAllocMemFlag flag,
- void **hotCodeBlock, void **coldCodeBlock, void **roDataBlock)
-{
- //Grab the values, so we can scrape the real answers in the capture method
- allocMemDets.hotCodeSize = hotCodeSize;
- allocMemDets.coldCodeSize = coldCodeSize;
- allocMemDets.roDataSize = roDataSize;
- allocMemDets.xcptnsCount = xcptnsCount;
- allocMemDets.flag = flag;
- allocMemDets.hotCodeBlock = *hotCodeBlock;
+// Note - EE allocates these blocks (and the exception blocks) in a single linear region.
+ //Note - EE assures that RoBlock is 8 byte aligned
+void CompileResult::recAllocMem(ULONG hotCodeSize,
+ ULONG coldCodeSize,
+ ULONG roDataSize,
+ ULONG xcptnsCount,
+ CorJitAllocMemFlag flag,
+ void** hotCodeBlock,
+ void** coldCodeBlock,
+ void** roDataBlock)
+{
+ // Grab the values, so we can scrape the real answers in the capture method
+ allocMemDets.hotCodeSize = hotCodeSize;
+ allocMemDets.coldCodeSize = coldCodeSize;
+ allocMemDets.roDataSize = roDataSize;
+ allocMemDets.xcptnsCount = xcptnsCount;
+ allocMemDets.flag = flag;
+ allocMemDets.hotCodeBlock = *hotCodeBlock;
allocMemDets.coldCodeBlock = *coldCodeBlock;
- allocMemDets.roDataBlock = *roDataBlock;
+ allocMemDets.roDataBlock = *roDataBlock;
}
void CompileResult::recAllocMemCapture()
{
- if(AllocMem == nullptr)
+ if (AllocMem == nullptr)
AllocMem = new LightWeightMap<DWORD, Agnostic_AllocMemDetails>();
Agnostic_AllocMemDetails value;
- value.hotCodeSize = (DWORD)allocMemDets.hotCodeSize;
+ value.hotCodeSize = (DWORD)allocMemDets.hotCodeSize;
value.coldCodeSize = (DWORD)allocMemDets.coldCodeSize;
- value.roDataSize = (DWORD)allocMemDets.roDataSize;
- value.xcptnsCount = (DWORD)allocMemDets.xcptnsCount;
- value.flag = (DWORD)allocMemDets.flag;
- value.hotCodeBlock_offset = (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.hotCodeBlock, allocMemDets.hotCodeSize);
- value.coldCodeBlock_offset = (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.coldCodeBlock, allocMemDets.coldCodeSize);
- value.roDataBlock_offset = (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.roDataBlock, allocMemDets.roDataSize);
- value.hotCodeBlock = (DWORDLONG)allocMemDets.hotCodeBlock;
+ value.roDataSize = (DWORD)allocMemDets.roDataSize;
+ value.xcptnsCount = (DWORD)allocMemDets.xcptnsCount;
+ value.flag = (DWORD)allocMemDets.flag;
+ value.hotCodeBlock_offset =
+ (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.hotCodeBlock, allocMemDets.hotCodeSize);
+ value.coldCodeBlock_offset =
+ (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.coldCodeBlock, allocMemDets.coldCodeSize);
+ value.roDataBlock_offset =
+ (DWORD)AllocMem->AddBuffer((const unsigned char*)allocMemDets.roDataBlock, allocMemDets.roDataSize);
+ value.hotCodeBlock = (DWORDLONG)allocMemDets.hotCodeBlock;
value.coldCodeBlock = (DWORDLONG)allocMemDets.coldCodeBlock;
- value.roDataBlock = (DWORDLONG)allocMemDets.roDataBlock;
+ value.roDataBlock = (DWORDLONG)allocMemDets.roDataBlock;
AllocMem->Add(0, value);
}
void CompileResult::dmpAllocMem(DWORD key, const Agnostic_AllocMemDetails& value)
{
- printf("AllocMem key 0, value hotCodeSize-%u coldCodeSize-%u roDataSize-%u xcptnsCount-%u flag-%08X hotCodeBlock_offset-%u coldCodeBlock_offset-%u roDataBlock_offset-%u hotCodeBlock-%016llX coldCodeBlock-%016llX roDataBlock-%016llX",
- value.hotCodeSize,
- value.coldCodeSize,
- value.roDataSize,
- value.xcptnsCount,
- value.flag,
- value.hotCodeBlock_offset,
- value.coldCodeBlock_offset,
- value.roDataBlock_offset,
- value.hotCodeBlock,
- value.coldCodeBlock,
- value.roDataBlock);
+ printf("AllocMem key 0, value hotCodeSize-%u coldCodeSize-%u roDataSize-%u xcptnsCount-%u flag-%08X "
+ "hotCodeBlock_offset-%u coldCodeBlock_offset-%u roDataBlock_offset-%u hotCodeBlock-%016llX "
+ "coldCodeBlock-%016llX roDataBlock-%016llX",
+ value.hotCodeSize, value.coldCodeSize, value.roDataSize, value.xcptnsCount, value.flag,
+ value.hotCodeBlock_offset, value.coldCodeBlock_offset, value.roDataBlock_offset, value.hotCodeBlock,
+ value.coldCodeBlock, value.roDataBlock);
}
// We can't allocate memory in the same place is was during recording, so we pass back code/data block pointers
// that point into the AllocMem LightWeightMap, but also return what the original addresses were during recording.
-void CompileResult::repAllocMem(
- ULONG *hotCodeSize,
- ULONG *coldCodeSize,
- ULONG *roDataSize,
- ULONG *xcptnsCount,
- CorJitAllocMemFlag *flag,
- unsigned char **hotCodeBlock,
- unsigned char **coldCodeBlock,
- unsigned char **roDataBlock,
- void **orig_hotCodeBlock,
- void **orig_coldCodeBlock,
- void **orig_roDataBlock)
+void CompileResult::repAllocMem(ULONG* hotCodeSize,
+ ULONG* coldCodeSize,
+ ULONG* roDataSize,
+ ULONG* xcptnsCount,
+ CorJitAllocMemFlag* flag,
+ unsigned char** hotCodeBlock,
+ unsigned char** coldCodeBlock,
+ unsigned char** roDataBlock,
+ void** orig_hotCodeBlock,
+ void** orig_coldCodeBlock,
+ void** orig_roDataBlock)
{
Agnostic_AllocMemDetails value;
value = AllocMem->Get(0);
- *hotCodeSize = (ULONG)value.hotCodeSize;
+ *hotCodeSize = (ULONG)value.hotCodeSize;
*coldCodeSize = (ULONG)value.coldCodeSize;
- *roDataSize = (ULONG)value.roDataSize;
- *xcptnsCount = (ULONG)value.xcptnsCount;
- *flag = (CorJitAllocMemFlag)value.flag;
+ *roDataSize = (ULONG)value.roDataSize;
+ *xcptnsCount = (ULONG)value.xcptnsCount;
+ *flag = (CorJitAllocMemFlag)value.flag;
- if(*hotCodeSize>0)
+ if (*hotCodeSize > 0)
*hotCodeBlock = AllocMem->GetBuffer(value.hotCodeBlock_offset);
else
*hotCodeBlock = nullptr;
- if(*coldCodeSize>0)
+ if (*coldCodeSize > 0)
*coldCodeBlock = AllocMem->GetBuffer(value.coldCodeBlock_offset);
else
*coldCodeBlock = nullptr;
- if(*roDataSize>0)
+ if (*roDataSize > 0)
*roDataBlock = AllocMem->GetBuffer(value.roDataBlock_offset);
else
*roDataBlock = nullptr;
- *orig_hotCodeBlock = (void *)value.hotCodeBlock;
- *orig_coldCodeBlock = (void *)value.coldCodeBlock;
- *orig_roDataBlock = (void *)value.roDataBlock;
+ *orig_hotCodeBlock = (void*)value.hotCodeBlock;
+ *orig_coldCodeBlock = (void*)value.coldCodeBlock;
+ *orig_roDataBlock = (void*)value.roDataBlock;
}
-//Note - Ownership of pMap is transfered with this call. In replay icorjitinfo we should free it.
-void CompileResult::recSetBoundaries(CORINFO_METHOD_HANDLE ftn, ULONG32 cMap, ICorDebugInfo::OffsetMapping *pMap)
+// Note - Ownership of pMap is transfered with this call. In replay icorjitinfo we should free it.
+void CompileResult::recSetBoundaries(CORINFO_METHOD_HANDLE ftn, ULONG32 cMap, ICorDebugInfo::OffsetMapping* pMap)
{
- if(SetBoundaries == nullptr)
+ if (SetBoundaries == nullptr)
SetBoundaries = new LightWeightMap<DWORD, Agnostic_SetBoundaries>();
Agnostic_SetBoundaries value;
- value.ftn = (DWORDLONG)ftn;
+ value.ftn = (DWORDLONG)ftn;
value.cMap = (DWORD)cMap;
- value.pMap_offset = (DWORD)SetBoundaries->AddBuffer((const unsigned char*)pMap, sizeof(ICorDebugInfo::OffsetMapping)*cMap);
+ value.pMap_offset =
+ (DWORD)SetBoundaries->AddBuffer((const unsigned char*)pMap, sizeof(ICorDebugInfo::OffsetMapping) * cMap);
SetBoundaries->Add(0, value);
}
void CompileResult::dmpSetBoundaries(DWORD key, const Agnostic_SetBoundaries& value)
{
- ICorDebugInfo::OffsetMapping *om = (ICorDebugInfo::OffsetMapping *)SetBoundaries->GetBuffer(value.pMap_offset);
- printf("SetBoundaries key 0, value ftn-%016llX cMap-%u %u{",
- value.ftn,
- value.cMap,
- value.pMap_offset);
- for(unsigned int i=0;i<value.cMap;i++)
+ ICorDebugInfo::OffsetMapping* om = (ICorDebugInfo::OffsetMapping*)SetBoundaries->GetBuffer(value.pMap_offset);
+ printf("SetBoundaries key 0, value ftn-%016llX cMap-%u %u{", value.ftn, value.cMap, value.pMap_offset);
+ for (unsigned int i = 0; i < value.cMap; i++)
{
if (i != 0)
printf(", ");
@@ -252,11 +257,11 @@ void CompileResult::dmpSetBoundaries(DWORD key, const Agnostic_SetBoundaries& va
printf("}");
SetBoundaries->Unlock();
}
-bool CompileResult::repSetBoundaries(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cMap, ICorDebugInfo::OffsetMapping **pMap)
+bool CompileResult::repSetBoundaries(CORINFO_METHOD_HANDLE* ftn, ULONG32* cMap, ICorDebugInfo::OffsetMapping** pMap)
{
- if((SetBoundaries == nullptr)||(SetBoundaries->GetCount()==0))
+ if ((SetBoundaries == nullptr) || (SetBoundaries->GetCount() == 0))
{
- *ftn = (CORINFO_METHOD_HANDLE)-1;
+ *ftn = (CORINFO_METHOD_HANDLE)-1;
*cMap = -1;
*pMap = nullptr;
return false;
@@ -265,34 +270,32 @@ bool CompileResult::repSetBoundaries(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cMap,
value = SetBoundaries->Get(0);
- *ftn = (CORINFO_METHOD_HANDLE)value.ftn;
+ *ftn = (CORINFO_METHOD_HANDLE)value.ftn;
*cMap = (ULONG32)value.cMap;
- *pMap = (ICorDebugInfo::OffsetMapping *)SetBoundaries->GetBuffer(value.pMap_offset);
+ *pMap = (ICorDebugInfo::OffsetMapping*)SetBoundaries->GetBuffer(value.pMap_offset);
return true;
}
-//Note - Ownership of vars is transfered with this call. In replay icorjitinfo we should free it.
-void CompileResult::recSetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo *vars)
+// Note - Ownership of vars is transfered with this call. In replay icorjitinfo we should free it.
+void CompileResult::recSetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo* vars)
{
- if(SetVars == nullptr)
+ if (SetVars == nullptr)
SetVars = new LightWeightMap<DWORD, Agnostic_SetVars>();
Agnostic_SetVars value;
- value.ftn = (DWORDLONG)ftn;
- value.cVars = (DWORD)cVars;
- value.vars_offset = (DWORD)SetVars->AddBuffer((const unsigned char*)vars, sizeof(ICorDebugInfo::NativeVarInfo)*cVars); //not deep enough.. vlt memory is pointer sized.
+ value.ftn = (DWORDLONG)ftn;
+ value.cVars = (DWORD)cVars;
+ value.vars_offset = (DWORD)SetVars->AddBuffer((const unsigned char*)vars,
+ sizeof(ICorDebugInfo::NativeVarInfo) *
+ cVars); // not deep enough.. vlt memory is pointer sized.
SetVars->Add(0, value);
}
void CompileResult::dmpSetVars(DWORD key, const Agnostic_SetVars& value)
{
- ICorDebugInfo::NativeVarInfo *om = (ICorDebugInfo::NativeVarInfo *)SetVars->GetBuffer(value.vars_offset);
- printf("SetVars key %u, value ftn-%016llX cVars-%u %u{",
- key,
- value.ftn,
- value.cVars,
- value.vars_offset);
+ ICorDebugInfo::NativeVarInfo* om = (ICorDebugInfo::NativeVarInfo*)SetVars->GetBuffer(value.vars_offset);
+ printf("SetVars key %u, value ftn-%016llX cVars-%u %u{", key, value.ftn, value.cVars, value.vars_offset);
for (unsigned int i = 0; i < value.cVars; i++)
{
if (i != 0)
@@ -302,13 +305,13 @@ void CompileResult::dmpSetVars(DWORD key, const Agnostic_SetVars& value)
printf("}");
SetVars->Unlock();
}
-bool CompileResult::repSetVars(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cVars, ICorDebugInfo::NativeVarInfo **vars)
+bool CompileResult::repSetVars(CORINFO_METHOD_HANDLE* ftn, ULONG32* cVars, ICorDebugInfo::NativeVarInfo** vars)
{
- if((SetVars == nullptr)||(SetVars->GetCount()==0))
+ if ((SetVars == nullptr) || (SetVars->GetCount() == 0))
{
- *ftn = (CORINFO_METHOD_HANDLE)-1;
+ *ftn = (CORINFO_METHOD_HANDLE)-1;
*cVars = -1;
- *vars = nullptr;
+ *vars = nullptr;
return false;
}
@@ -316,96 +319,97 @@ bool CompileResult::repSetVars(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cVars, ICorD
value = SetVars->Get(0);
- *ftn = (CORINFO_METHOD_HANDLE)value.ftn;
+ *ftn = (CORINFO_METHOD_HANDLE)value.ftn;
*cVars = (ULONG32)value.cVars;
- *vars = (ICorDebugInfo::NativeVarInfo*)SetVars->GetBuffer(value.vars_offset);
+ *vars = (ICorDebugInfo::NativeVarInfo*)SetVars->GetBuffer(value.vars_offset);
return true;
}
void CompileResult::recAllocGCInfo(size_t size, void* retval)
{
- allocGCInfoDets.size = size;
+ allocGCInfoDets.size = size;
allocGCInfoDets.retval = retval;
}
void CompileResult::recAllocGCInfoCapture()
{
- if(AllocGCInfo == nullptr)
+ if (AllocGCInfo == nullptr)
AllocGCInfo = new LightWeightMap<DWORD, Agnostic_AllocGCInfo>();
Agnostic_AllocGCInfo value;
value.size = allocGCInfoDets.size;
- value.retval_offset = (DWORD)AllocGCInfo->AddBuffer((const unsigned char *)allocGCInfoDets.retval, (DWORD)allocGCInfoDets.size);
+ value.retval_offset =
+ (DWORD)AllocGCInfo->AddBuffer((const unsigned char*)allocGCInfoDets.retval, (DWORD)allocGCInfoDets.size);
AllocGCInfo->Add(0, value);
}
void CompileResult::dmpAllocGCInfo(DWORD key, const Agnostic_AllocGCInfo& value)
{
- const unsigned char *buff = AllocGCInfo->GetBuffer(value.retval_offset);
+ const unsigned char* buff = AllocGCInfo->GetBuffer(value.retval_offset);
printf("AllocGCInfo key 0, ");
printf("sz-%llu %p{ ", value.size, buff);
- for(unsigned int i=0; i<value.size; i++)
- printf("%02X ", *(buff+i));
+ for (unsigned int i = 0; i < value.size; i++)
+ printf("%02X ", *(buff + i));
printf("}");
AllocGCInfo->Unlock();
}
-void CompileResult::repAllocGCInfo(size_t *size, void **retval)
+void CompileResult::repAllocGCInfo(size_t* size, void** retval)
{
Agnostic_AllocGCInfo value;
value = AllocGCInfo->Get(0);
*size = (size_t)value.size;
- if(*size>0)
- *retval = (void *)AllocGCInfo->GetBuffer(value.retval_offset);
+ if (*size > 0)
+ *retval = (void*)AllocGCInfo->GetBuffer(value.retval_offset);
}
-void CompileResult::recCompileMethod(BYTE **nativeEntry, ULONG *nativeSizeOfCode, CorJitResult result)
+void CompileResult::recCompileMethod(BYTE** nativeEntry, ULONG* nativeSizeOfCode, CorJitResult result)
{
- if(CompileMethod == nullptr)
+ if (CompileMethod == nullptr)
CompileMethod = new LightWeightMap<DWORD, Agnostic_CompileMethodResults>();
Agnostic_CompileMethodResults value;
- value.nativeEntry = (DWORDLONG)*nativeEntry;
+ value.nativeEntry = (DWORDLONG)*nativeEntry;
value.nativeSizeOfCode = (DWORD)*nativeSizeOfCode;
- value.CorJitResult = (DWORD)result;
+ value.CorJitResult = (DWORD)result;
CompileMethod->Add(0, value);
}
void CompileResult::dmpCompileMethod(DWORD key, const Agnostic_CompileMethodResults& value)
{
- printf("CompileMethod key %u, value nativeEntry-%016llX nativeSizeOfCode-%u CorJitResult-%u",
- key, value.nativeEntry, value.nativeSizeOfCode, value.CorJitResult);
+ printf("CompileMethod key %u, value nativeEntry-%016llX nativeSizeOfCode-%u CorJitResult-%u", key,
+ value.nativeEntry, value.nativeSizeOfCode, value.CorJitResult);
}
-void CompileResult::repCompileMethod(BYTE **nativeEntry, ULONG *nativeSizeOfCode, CorJitResult *result)
+void CompileResult::repCompileMethod(BYTE** nativeEntry, ULONG* nativeSizeOfCode, CorJitResult* result)
{
Agnostic_CompileMethodResults value;
- value = CompileMethod->Get(0);
- *nativeEntry = (BYTE *)value.nativeEntry;
+ value = CompileMethod->Get(0);
+ *nativeEntry = (BYTE*)value.nativeEntry;
*nativeSizeOfCode = (ULONG)value.nativeSizeOfCode;
- *result = (CorJitResult)value.CorJitResult;
+ *result = (CorJitResult)value.CorJitResult;
}
void CompileResult::recMessageLog(const char* fmt, ...)
{
// TODO-Cleanup: ???
return;
- if(MessageLog == nullptr)
+ if (MessageLog == nullptr)
MessageLog = new DenseLightWeightMap<DWORD>();
va_list args;
// retrieve the variable arguments
- va_start( args, fmt );
+ va_start(args, fmt);
- size_t len = _vscprintf(fmt, args) + 1; //space for the terminator
+ size_t len = _vscprintf(fmt, args) + 1; // space for the terminator
- unsigned char *messageLogBuffer = new unsigned char[len];
+ unsigned char* messageLogBuffer = new unsigned char[len];
vsprintf_s((char*)messageLogBuffer, len, fmt, args);
- messageLogBuffer[len-1] = 0;
+ messageLogBuffer[len - 1] = 0;
MessageLog->Append(MessageLog->AddBuffer(messageLogBuffer, (DWORD)len));
- delete []messageLogBuffer;
+ delete[] messageLogBuffer;
}
void CompileResult::dmpMessageLog(DWORD key, DWORD value)
{
@@ -414,56 +418,55 @@ void CompileResult::dmpMessageLog(DWORD key, DWORD value)
void CompileResult::recClassMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls)
{
- if(ClassMustBeLoadedBeforeCodeIsRun == nullptr)
+ if (ClassMustBeLoadedBeforeCodeIsRun == nullptr)
ClassMustBeLoadedBeforeCodeIsRun = new DenseLightWeightMap<DWORDLONG>();
ClassMustBeLoadedBeforeCodeIsRun->Append((DWORDLONG)cls);
}
void CompileResult::dmpClassMustBeLoadedBeforeCodeIsRun(DWORD key, DWORDLONG value)
{
- printf("ClassMustBeLoadedBeforeCodeIsRun key %u, value cls-%016llX",
- key, value);
+ printf("ClassMustBeLoadedBeforeCodeIsRun key %u, value cls-%016llX", key, value);
}
-void CompileResult::recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd,
- CorInfoInline inlineResult, const char * reason)
+void CompileResult::recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd,
+ CORINFO_METHOD_HANDLE inlineeHnd,
+ CorInfoInline inlineResult,
+ const char* reason)
{
- if(ReportInliningDecision == nullptr)
+ if (ReportInliningDecision == nullptr)
ReportInliningDecision = new DenseLightWeightMap<Agnostic_ReportInliningDecision>();
Agnostic_ReportInliningDecision value;
- value.inlinerHnd = (DWORDLONG)inlinerHnd;
- value.inlineeHnd = (DWORDLONG)inlineeHnd;
+ value.inlinerHnd = (DWORDLONG)inlinerHnd;
+ value.inlineeHnd = (DWORDLONG)inlineeHnd;
value.inlineResult = (DWORD)inlineResult;
- if(reason!=nullptr)
- value.reason_offset = (DWORD)ReportInliningDecision->AddBuffer((unsigned char*)reason, (DWORD)strlen(reason)+1);
+ if (reason != nullptr)
+ value.reason_offset =
+ (DWORD)ReportInliningDecision->AddBuffer((unsigned char*)reason, (DWORD)strlen(reason) + 1);
else
- value.reason_offset = -1;
+ value.reason_offset = -1;
ReportInliningDecision->Append(value);
}
void CompileResult::dmpReportInliningDecision(DWORD key, const Agnostic_ReportInliningDecision& value)
{
- const char *reason = (const char*)ReportInliningDecision->GetBuffer(value.reason_offset);
- printf("ReportInliningDecision key %u, value inliner-%016llX inlinee-%016llX res-%u reason-'%s'",
- key,
- value.inlinerHnd,
- value.inlineeHnd,
- value.inlineResult,
- reason);
+ const char* reason = (const char*)ReportInliningDecision->GetBuffer(value.reason_offset);
+ printf("ReportInliningDecision key %u, value inliner-%016llX inlinee-%016llX res-%u reason-'%s'", key,
+ value.inlinerHnd, value.inlineeHnd, value.inlineResult, reason);
ReportInliningDecision->Unlock();
}
-CorInfoInline CompileResult::repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd)
+CorInfoInline CompileResult::repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd,
+ CORINFO_METHOD_HANDLE inlineeHnd)
{
CorInfoInline result = INLINE_FAIL;
- if(ReportInliningDecision!=nullptr)
+ if (ReportInliningDecision != nullptr)
{
- Agnostic_ReportInliningDecision *items = ReportInliningDecision->GetRawItems();
- unsigned int cnt = ReportInliningDecision->GetCount();
- for(unsigned int i=0;i<cnt;i++)
+ Agnostic_ReportInliningDecision* items = ReportInliningDecision->GetRawItems();
+ unsigned int cnt = ReportInliningDecision->GetCount();
+ for (unsigned int i = 0; i < cnt; i++)
{
- if((items[i].inlinerHnd == (DWORDLONG)inlinerHnd)&&(items[i].inlineeHnd == (DWORDLONG)inlineeHnd)&&
+ if ((items[i].inlinerHnd == (DWORDLONG)inlinerHnd) && (items[i].inlineeHnd == (DWORDLONG)inlineeHnd) &&
(items[i].inlineResult == INLINE_PASS))
result = INLINE_PASS;
}
@@ -473,7 +476,7 @@ CorInfoInline CompileResult::repReportInliningDecision(CORINFO_METHOD_HANDLE inl
void CompileResult::recSetEHcount(unsigned cEH)
{
- if(SetEHcount == nullptr)
+ if (SetEHcount == nullptr)
SetEHcount = new LightWeightMap<DWORD, DWORD>();
SetEHcount->Add((DWORD)0, (DWORD)cEH);
@@ -484,42 +487,37 @@ void CompileResult::dmpSetEHcount(DWORD key, DWORD value)
}
ULONG CompileResult::repSetEHcount()
{
- if(SetEHcount==nullptr)
+ if (SetEHcount == nullptr)
SetEHcount = new LightWeightMap<DWORD, DWORD>();
ULONG ehCount;
- int index = SetEHcount->GetIndex(0);
- if(index < 0)
+ int index = SetEHcount->GetIndex(0);
+ if (index < 0)
ehCount = 0;
else
ehCount = (ULONG)SetEHcount->Get(index);
return ehCount;
}
-void CompileResult::recSetEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE *clause)
+void CompileResult::recSetEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE* clause)
{
- if(SetEHinfo == nullptr)
+ if (SetEHinfo == nullptr)
SetEHinfo = new LightWeightMap<DWORD, Agnostic_CORINFO_EH_CLAUSE2>();
Agnostic_CORINFO_EH_CLAUSE2 value;
- value.Flags = (DWORD)clause->Flags;
- value.TryOffset = (DWORD)clause->TryOffset;
- value.TryLength = (DWORD)clause->TryLength;
+ value.Flags = (DWORD)clause->Flags;
+ value.TryOffset = (DWORD)clause->TryOffset;
+ value.TryLength = (DWORD)clause->TryLength;
value.HandlerOffset = (DWORD)clause->HandlerOffset;
value.HandlerLength = (DWORD)clause->HandlerLength;
- value.ClassToken = (DWORD)clause->ClassToken;
+ value.ClassToken = (DWORD)clause->ClassToken;
SetEHinfo->Add((DWORD)EHnumber, value);
}
void CompileResult::dmpSetEHinfo(DWORD key, const Agnostic_CORINFO_EH_CLAUSE2& value)
{
- printf("SetEHinfo key %u, value flg-%u to-%u tl-%u ho-%u hl-%u",
- key,
- value.Flags,
- value.TryOffset,
- value.TryLength,
- value.HandlerOffset,
- value.HandlerLength);
+ printf("SetEHinfo key %u, value flg-%u to-%u tl-%u ho-%u hl-%u", key, value.Flags, value.TryOffset, value.TryLength,
+ value.HandlerOffset, value.HandlerLength);
if ((CORINFO_EH_CLAUSE_FLAGS)value.Flags == CORINFO_EH_CLAUSE_FILTER)
{
printf(" fo-%u", value.ClassToken); // FilterOffset
@@ -530,22 +528,28 @@ void CompileResult::dmpSetEHinfo(DWORD key, const Agnostic_CORINFO_EH_CLAUSE2& v
}
// else, no need to print for finally/fault handlers
}
-void CompileResult::repSetEHinfo(unsigned EHnumber, ULONG *flags, ULONG *tryOffset, ULONG *tryLength, ULONG *handlerOffset, ULONG *handlerLength, ULONG *classToken)
+void CompileResult::repSetEHinfo(unsigned EHnumber,
+ ULONG* flags,
+ ULONG* tryOffset,
+ ULONG* tryLength,
+ ULONG* handlerOffset,
+ ULONG* handlerLength,
+ ULONG* classToken)
{
Agnostic_CORINFO_EH_CLAUSE2 value;
value = SetEHinfo->Get(EHnumber);
- *flags=(ULONG)value.Flags;
- *tryOffset=(ULONG)value.TryOffset;
- *tryLength=(ULONG)value.TryLength;
- *handlerOffset=(ULONG)value.HandlerOffset;
- *handlerLength=(ULONG)value.HandlerLength;
- *classToken=(ULONG)value.ClassToken;
+ *flags = (ULONG)value.Flags;
+ *tryOffset = (ULONG)value.TryOffset;
+ *tryLength = (ULONG)value.TryLength;
+ *handlerOffset = (ULONG)value.HandlerOffset;
+ *handlerLength = (ULONG)value.HandlerLength;
+ *classToken = (ULONG)value.ClassToken;
}
void CompileResult::recSetMethodAttribs(CORINFO_METHOD_HANDLE ftn, CorInfoMethodRuntimeFlags attribs)
{
- if(SetMethodAttribs == nullptr)
+ if (SetMethodAttribs == nullptr)
SetMethodAttribs = new LightWeightMap<DWORDLONG, DWORD>();
SetMethodAttribs->Add((DWORDLONG)ftn, (DWORD)attribs);
@@ -554,9 +558,9 @@ void CompileResult::dmpSetMethodAttribs(DWORDLONG key, DWORD value)
{
printf("SetMethodAttribs key ftn-%016llX, value attr-%08X", key, value);
}
-CorInfoMethodRuntimeFlags CompileResult::repSetMethodAttribs (CORINFO_METHOD_HANDLE ftn)
+CorInfoMethodRuntimeFlags CompileResult::repSetMethodAttribs(CORINFO_METHOD_HANDLE ftn)
{
- if((SetMethodAttribs==nullptr)||(SetMethodAttribs->GetIndex((DWORDLONG)ftn)==-1))
+ if ((SetMethodAttribs == nullptr) || (SetMethodAttribs->GetIndex((DWORDLONG)ftn) == -1))
return (CorInfoMethodRuntimeFlags)0;
CorInfoMethodRuntimeFlags result = (CorInfoMethodRuntimeFlags)SetMethodAttribs->Get((DWORDLONG)ftn);
return result;
@@ -564,7 +568,7 @@ CorInfoMethodRuntimeFlags CompileResult::repSetMethodAttribs (CORINFO_METHOD_HAN
void CompileResult::recMethodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method)
{
- if(MethodMustBeLoadedBeforeCodeIsRun == nullptr)
+ if (MethodMustBeLoadedBeforeCodeIsRun == nullptr)
MethodMustBeLoadedBeforeCodeIsRun = new DenseLightWeightMap<DWORDLONG>();
MethodMustBeLoadedBeforeCodeIsRun->Append((DWORDLONG)method);
@@ -574,20 +578,24 @@ void CompileResult::dmpMethodMustBeLoadedBeforeCodeIsRun(DWORD key, DWORDLONG va
printf("MethodMustBeLoadedBeforeCodeIsRun key %u, value ftn-%016llX", key, value);
}
-void CompileResult::recReportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, bool fIsTailPrefix,
- CorInfoTailCall tailCallResult, const char * reason)
+void CompileResult::recReportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ bool fIsTailPrefix,
+ CorInfoTailCall tailCallResult,
+ const char* reason)
{
- if(ReportTailCallDecision == nullptr)
+ if (ReportTailCallDecision == nullptr)
ReportTailCallDecision = new DenseLightWeightMap<Agnostic_ReportTailCallDecision>();
Agnostic_ReportTailCallDecision value;
- value.callerHnd = (DWORDLONG)callerHnd;
- value.calleeHnd = (DWORDLONG)calleeHnd;
- value.fIsTailPrefix = (DWORD)fIsTailPrefix;
+ value.callerHnd = (DWORDLONG)callerHnd;
+ value.calleeHnd = (DWORDLONG)calleeHnd;
+ value.fIsTailPrefix = (DWORD)fIsTailPrefix;
value.tailCallResult = (DWORD)tailCallResult;
- if(reason!=nullptr) //protect strlen
- value.reason_index = (DWORD)ReportTailCallDecision->AddBuffer((unsigned char*)reason, (DWORD)strlen(reason)+1);
+ if (reason != nullptr) // protect strlen
+ value.reason_index =
+ (DWORD)ReportTailCallDecision->AddBuffer((unsigned char*)reason, (DWORD)strlen(reason) + 1);
else
value.reason_index = (DWORD)-1;
@@ -595,15 +603,15 @@ void CompileResult::recReportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, C
}
void CompileResult::dmpReportTailCallDecision(DWORD key, const Agnostic_ReportTailCallDecision& value)
{
- const char *reason = (const char*)ReportTailCallDecision->GetBuffer(value.reason_index);
- printf("ReportTailCallDecision key-%u, value cr-%016llX ce-%016llX tail-%u call-%u -%s",
- key, value.callerHnd, value.calleeHnd, value.tailCallResult, value.tailCallResult, reason);
+ const char* reason = (const char*)ReportTailCallDecision->GetBuffer(value.reason_index);
+ printf("ReportTailCallDecision key-%u, value cr-%016llX ce-%016llX tail-%u call-%u -%s", key, value.callerHnd,
+ value.calleeHnd, value.tailCallResult, value.tailCallResult, reason);
ReportTailCallDecision->Unlock();
}
void CompileResult::recReportFatalError(CorJitResult result)
{
- if(ReportFatalError == nullptr)
+ if (ReportFatalError == nullptr)
ReportFatalError = new DenseLightWeightMap<DWORD>();
ReportFatalError->Append((DWORD)result);
@@ -613,7 +621,7 @@ void CompileResult::dmpReportFatalError(DWORD key, DWORD value)
printf("ReportFatalError key Count-%u, value result-%08X", key, value);
}
-void CompileResult::recRecordRelocation(void *location, void *target, WORD fRelocType, WORD slotNum, INT32 addlDelta)
+void CompileResult::recRecordRelocation(void* location, void* target, WORD fRelocType, WORD slotNum, INT32 addlDelta)
{
repRecordRelocation(location, target, fRelocType, slotNum, addlDelta);
}
@@ -622,43 +630,47 @@ const char* relocationTypeToString(WORD fRelocType)
{
switch (fRelocType)
{
- // From winnt.h
- case IMAGE_REL_BASED_ABSOLUTE : return "absolute";
- case IMAGE_REL_BASED_HIGH : return "high";
- case IMAGE_REL_BASED_LOW : return "low";
- case IMAGE_REL_BASED_HIGHLOW : return "highlow";
- case IMAGE_REL_BASED_HIGHADJ : return "highadj";
- case IMAGE_REL_BASED_DIR64 : return "dir64";
-
- // From corinfo.h
- case IMAGE_REL_BASED_REL32 : return "rel32";
- case IMAGE_REL_BASED_THUMB_BRANCH24 : return "thumb_branch24";
- default : return "UNKNOWN";
+ // From winnt.h
+ case IMAGE_REL_BASED_ABSOLUTE:
+ return "absolute";
+ case IMAGE_REL_BASED_HIGH:
+ return "high";
+ case IMAGE_REL_BASED_LOW:
+ return "low";
+ case IMAGE_REL_BASED_HIGHLOW:
+ return "highlow";
+ case IMAGE_REL_BASED_HIGHADJ:
+ return "highadj";
+ case IMAGE_REL_BASED_DIR64:
+ return "dir64";
+
+ // From corinfo.h
+ case IMAGE_REL_BASED_REL32:
+ return "rel32";
+ case IMAGE_REL_BASED_THUMB_BRANCH24:
+ return "thumb_branch24";
+ default:
+ return "UNKNOWN";
}
}
void CompileResult::dmpRecordRelocation(DWORD key, const Agnostic_RecordRelocation& value)
{
- printf("RecordRelocation key %u, value loc-%016llX tgt-%016llX fRelocType-%u(%s) slotNum-%u addlDelta-%d",
- key,
- value.location,
- value.target,
- value.fRelocType,
- relocationTypeToString((WORD)value.fRelocType),
- value.slotNum,
- (INT32)value.addlDelta);
+ printf("RecordRelocation key %u, value loc-%016llX tgt-%016llX fRelocType-%u(%s) slotNum-%u addlDelta-%d", key,
+ value.location, value.target, value.fRelocType, relocationTypeToString((WORD)value.fRelocType),
+ value.slotNum, (INT32)value.addlDelta);
}
-void CompileResult::repRecordRelocation(void *location, void *target, WORD fRelocType, WORD slotNum, INT32 addlDelta)
+void CompileResult::repRecordRelocation(void* location, void* target, WORD fRelocType, WORD slotNum, INT32 addlDelta)
{
- if(RecordRelocation == nullptr)
+ if (RecordRelocation == nullptr)
RecordRelocation = new DenseLightWeightMap<Agnostic_RecordRelocation>();
Agnostic_RecordRelocation value;
- value.location = (DWORDLONG)location;
- value.target = (DWORDLONG)target;
+ value.location = (DWORDLONG)location;
+ value.target = (DWORDLONG)target;
value.fRelocType = (DWORD)fRelocType;
- value.slotNum = (DWORD)slotNum;
- value.addlDelta = (DWORD)addlDelta;
+ value.slotNum = (DWORD)slotNum;
+ value.addlDelta = (DWORD)addlDelta;
RecordRelocation->Append(value);
}
@@ -681,25 +693,22 @@ void CompileResult::repRecordRelocation(void *location, void *target, WORD fRelo
// current section (using originalAddr), assuming we needed a jump stub. We'll let multiple calls to potentially
// different functions use the same address because even if they used different ones, and diffs were generated,
// no textual diffs would appear because most of the textual call names are "hackishMethodName".
-void CompileResult::applyRelocs(unsigned char *block1, ULONG blocksize1, void *originalAddr)
+void CompileResult::applyRelocs(unsigned char* block1, ULONG blocksize1, void* originalAddr)
{
- if(RecordRelocation == nullptr)
+ if (RecordRelocation == nullptr)
return;
- if(blocksize1 == 0)
+ if (blocksize1 == 0)
return;
size_t section_begin = (size_t)block1;
size_t section_end = (size_t)block1 + (size_t)blocksize1; // address is exclusive
- LogDebug("applyRelocs block [%p,%p) block size %u, orig addr %p",
- block1,
- block1 + blocksize1,
- blocksize1,
- originalAddr);
+ LogDebug("applyRelocs block [%p,%p) block size %u, orig addr %p", block1, block1 + blocksize1, blocksize1,
+ originalAddr);
- for(unsigned int i=0;i<RecordRelocation->GetCount();i++)
+ for (unsigned int i = 0; i < RecordRelocation->GetCount(); i++)
{
- Agnostic_RecordRelocation tmp = RecordRelocation->GetRawItems()[i];
+ Agnostic_RecordRelocation tmp = RecordRelocation->GetRawItems()[i];
if (Logger::IsLogLevelEnabled(LOGLEVEL_DEBUG))
{
@@ -710,15 +719,16 @@ void CompileResult::applyRelocs(unsigned char *block1, ULONG blocksize1, void *o
switch (tmp.fRelocType)
{
- #if defined(_TARGET_X86_)
- case IMAGE_REL_BASED_HIGHLOW:
+#if defined(_TARGET_X86_)
+ case IMAGE_REL_BASED_HIGHLOW:
{
DWORDLONG fixupLocation = tmp.location;
size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr;
- if ( (section_begin <= address) && (address < section_end) ) //A reloc for our section?
+ if ((section_begin <= address) && (address < section_end)) // A reloc for our section?
{
- LogDebug(" fixupLoc-%016llX (@%p) : %08X => %08X", fixupLocation, address, *(DWORD*)address, (DWORD)tmp.target);
+ LogDebug(" fixupLoc-%016llX (@%p) : %08X => %08X", fixupLocation, address, *(DWORD*)address,
+ (DWORD)tmp.target);
*(DWORD*)address = (DWORD)tmp.target;
}
if (tmp.addlDelta != 0)
@@ -727,131 +737,131 @@ void CompileResult::applyRelocs(unsigned char *block1, ULONG blocksize1, void *o
__debugbreak();
}
break;
- #endif // _TARGET_X86_
+#endif // _TARGET_X86_
- #if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) || defined(_TARGET_ARM_)
- case IMAGE_REL_BASED_REL32:
+#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) || defined(_TARGET_ARM_)
+ case IMAGE_REL_BASED_REL32:
{
- DWORDLONG target = tmp.target + tmp.addlDelta;
+ DWORDLONG target = tmp.target + tmp.addlDelta;
DWORDLONG fixupLocation = tmp.location + tmp.slotNum;
- DWORDLONG baseAddr = fixupLocation + sizeof(INT32);
- INT64 delta = (INT64)((BYTE *)target - baseAddr);
+ DWORDLONG baseAddr = fixupLocation + sizeof(INT32);
+ INT64 delta = (INT64)((BYTE*)target - baseAddr);
- #if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
if (delta != (INT64)(int)delta)
{
// This isn't going to fit in a signed 32-bit address. Use something that will fit,
// since we assume that original compilation fit fine. This is only an issue for
// 32-bit offsets on 64-bit targets.
- target = (DWORDLONG)originalAddr + (DWORDLONG)blocksize1;
- INT64 newdelta = (INT64)((BYTE *)target - baseAddr);
+ target = (DWORDLONG)originalAddr + (DWORDLONG)blocksize1;
+ INT64 newdelta = (INT64)((BYTE*)target - baseAddr);
- LogDebug(" REL32 overflow. Mapping target to %016llX. Mapping delta: %016llX => %016llX", target, delta, newdelta);
+ LogDebug(" REL32 overflow. Mapping target to %016llX. Mapping delta: %016llX => %016llX", target,
+ delta, newdelta);
delta = newdelta;
}
- #endif // defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+#endif // defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
if (delta != (INT64)(int)delta)
{
- #if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
LogError("REL32 relocation overflows field! delta=0x%016llX", delta);
- #else
+#else
LogError("REL32 relocation overflows field! delta=0x%08X", delta);
- #endif
+#endif
}
// Write 32-bits into location
size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr;
- if ( (section_begin <= address) && (address < section_end) ) //A reloc for our section?
+ if ((section_begin <= address) && (address < section_end)) // A reloc for our section?
{
- LogDebug(" fixupLoc-%016llX (@%p) : %08X => %08X", fixupLocation, address, *(DWORD*)address, delta);
+ LogDebug(" fixupLoc-%016llX (@%p) : %08X => %08X", fixupLocation, address, *(DWORD*)address,
+ delta);
*(DWORD*)address = (DWORD)delta;
}
}
break;
- #endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) || defined(_TARGET_ARM_)
+#endif // defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_) || defined(_TARGET_ARM_)
- #if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
- case IMAGE_REL_BASED_DIR64:
+#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+ case IMAGE_REL_BASED_DIR64:
{
DWORDLONG fixupLocation = tmp.location + tmp.slotNum;
// Write 64-bits into location
size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr;
- if ( (section_begin <= address) && (address < section_end) ) //A reloc for our section?
+ if ((section_begin <= address) && (address < section_end)) // A reloc for our section?
{
- LogDebug(" fixupLoc-%016llX (@%p) %016llX => %016llX", fixupLocation, address, *(DWORDLONG*)address, tmp.target);
+ LogDebug(" fixupLoc-%016llX (@%p) %016llX => %016llX", fixupLocation, address,
+ *(DWORDLONG*)address, tmp.target);
*(DWORDLONG*)address = tmp.target;
}
}
break;
- #endif // defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
-
- #ifdef _TARGET_ARM64_
- case IMAGE_REL_ARM64_BRANCH26: // 26 bit offset << 2 & sign ext, for B and BL
- case IMAGE_REL_ARM64_PAGEBASE_REL21:
- case IMAGE_REL_ARM64_PAGEOFFSET_12A:
- LogError("Unimplemented reloc type %u", tmp.fRelocType);
- break;
- #endif // _TARGET_ARM64_
-
- default:
- LogError("Unknown reloc type %u", tmp.fRelocType);
- break;
+#endif // defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
+
+#ifdef _TARGET_ARM64_
+ case IMAGE_REL_ARM64_BRANCH26: // 26 bit offset << 2 & sign ext, for B and BL
+ case IMAGE_REL_ARM64_PAGEBASE_REL21:
+ case IMAGE_REL_ARM64_PAGEOFFSET_12A:
+ LogError("Unimplemented reloc type %u", tmp.fRelocType);
+ break;
+#endif // _TARGET_ARM64_
+
+ default:
+ LogError("Unknown reloc type %u", tmp.fRelocType);
+ break;
}
}
}
void CompileResult::recProcessName(const char* name)
{
- if(ProcessName == nullptr)
+ if (ProcessName == nullptr)
ProcessName = new DenseLightWeightMap<DWORD>();
DWORD index = (DWORD)-1;
- if(name != nullptr)
- index = (DWORD)ProcessName->AddBuffer((unsigned char*)name, (DWORD)strlen(name)+1);
+ if (name != nullptr)
+ index = (DWORD)ProcessName->AddBuffer((unsigned char*)name, (DWORD)strlen(name) + 1);
ProcessName->Append(index);
}
void CompileResult::dmpProcessName(DWORD key, DWORD value)
{
- const char *procName = (const char *)ProcessName->GetBuffer(value);
+ const char* procName = (const char*)ProcessName->GetBuffer(value);
printf("ProcessName key %u, value '%s'", key, procName);
ProcessName->Unlock();
}
-const char *CompileResult::repProcessName()
+const char* CompileResult::repProcessName()
{
- if(ProcessName == nullptr)
+ if (ProcessName == nullptr)
return "hackishProcessName";
- if(ProcessName->GetCount()>0)
+ if (ProcessName->GetCount() > 0)
{
return (const char*)ProcessName->GetBuffer(ProcessName->Get((DWORD)0));
}
return nullptr;
}
-void CompileResult::recAddressMap(void *originalAddress, void *replayAddress, unsigned int size)
+void CompileResult::recAddressMap(void* originalAddress, void* replayAddress, unsigned int size)
{
- if(AddressMap == nullptr)
+ if (AddressMap == nullptr)
AddressMap = new LightWeightMap<DWORDLONG, Agnostic_AddressMap>();
Agnostic_AddressMap value;
value.Address = (DWORDLONG)originalAddress;
- value.size = (DWORD)size;
+ value.size = (DWORD)size;
AddressMap->Add((DWORDLONG)replayAddress, value);
}
void CompileResult::dmpAddressMap(DWORDLONG key, const Agnostic_AddressMap& value)
{
- printf("AddressMap key %016llX, value addr-%016llX, size-%u",
- key,
- value.Address,
- value.size);
+ printf("AddressMap key %016llX, value addr-%016llX, size-%u", key, value.Address, value.size);
}
-void* CompileResult::repAddressMap(void *replayAddress)
+void* CompileResult::repAddressMap(void* replayAddress)
{
if (AddressMap == nullptr)
return nullptr;
@@ -859,28 +869,28 @@ void* CompileResult::repAddressMap(void *replayAddress)
value = AddressMap->Get((DWORDLONG)replayAddress);
return (void*)value.Address;
}
-void *CompileResult::searchAddressMap(void *newAddress)
+void* CompileResult::searchAddressMap(void* newAddress)
{
- if(AddressMap==nullptr)
+ if (AddressMap == nullptr)
return (void*)-1;
- for(unsigned int i=0;i<AddressMap->GetCount();i++)
+ for (unsigned int i = 0; i < AddressMap->GetCount(); i++)
{
- DWORDLONG replayAddress = AddressMap->GetRawKeys()[i];
- Agnostic_AddressMap value = AddressMap->Get(replayAddress);
- if((replayAddress<=(DWORDLONG)newAddress)&&((DWORDLONG)newAddress<(replayAddress+value.size)))
- return (void *)(value.Address+((DWORDLONG)newAddress-replayAddress));
+ DWORDLONG replayAddress = AddressMap->GetRawKeys()[i];
+ Agnostic_AddressMap value = AddressMap->Get(replayAddress);
+ if ((replayAddress <= (DWORDLONG)newAddress) && ((DWORDLONG)newAddress < (replayAddress + value.size)))
+ return (void*)(value.Address + ((DWORDLONG)newAddress - replayAddress));
}
return (void*)-1;
}
void CompileResult::recReserveUnwindInfo(BOOL isFunclet, BOOL isColdCode, ULONG unwindSize)
{
- if(ReserveUnwindInfo == nullptr)
+ if (ReserveUnwindInfo == nullptr)
ReserveUnwindInfo = new DenseLightWeightMap<Agnostic_ReserveUnwindInfo>();
Agnostic_ReserveUnwindInfo value;
- value.isFunclet = (DWORD)isFunclet;
+ value.isFunclet = (DWORD)isFunclet;
value.isColdCode = (DWORD)isColdCode;
value.unwindSize = (DWORD)unwindSize;
@@ -888,102 +898,90 @@ void CompileResult::recReserveUnwindInfo(BOOL isFunclet, BOOL isColdCode, ULONG
}
void CompileResult::dmpReserveUnwindInfo(DWORD key, const Agnostic_ReserveUnwindInfo& value)
{
- printf("ReserveUnwindInfo key %u, value isFun-%u isCold-%u usz-%u",
- key, value.isFunclet, value.isColdCode, value.unwindSize);
+ printf("ReserveUnwindInfo key %u, value isFun-%u isCold-%u usz-%u", key, value.isFunclet, value.isColdCode,
+ value.unwindSize);
}
-void CompileResult::recAllocUnwindInfo(BYTE *pHotCode, BYTE *pColdCode, ULONG startOffset, ULONG endOffset, ULONG unwindSize, BYTE *pUnwindBlock,
- CorJitFuncKind funcKind)
+void CompileResult::recAllocUnwindInfo(BYTE* pHotCode,
+ BYTE* pColdCode,
+ ULONG startOffset,
+ ULONG endOffset,
+ ULONG unwindSize,
+ BYTE* pUnwindBlock,
+ CorJitFuncKind funcKind)
{
- if(AllocUnwindInfo == nullptr)
+ if (AllocUnwindInfo == nullptr)
AllocUnwindInfo = new DenseLightWeightMap<Agnostic_AllocUnwindInfo>();
Agnostic_AllocUnwindInfo value;
- value.pHotCode = (DWORDLONG)pHotCode;
- value.pColdCode = (DWORDLONG)pColdCode;
- value.startOffset = (DWORD)startOffset;
- value.endOffset = (DWORD)endOffset;
- value.unwindSize = (DWORD)unwindSize;
+ value.pHotCode = (DWORDLONG)pHotCode;
+ value.pColdCode = (DWORDLONG)pColdCode;
+ value.startOffset = (DWORD)startOffset;
+ value.endOffset = (DWORD)endOffset;
+ value.unwindSize = (DWORD)unwindSize;
value.pUnwindBlock_index = AllocUnwindInfo->AddBuffer((unsigned char*)pUnwindBlock, unwindSize);
- value.funcKind = funcKind;
+ value.funcKind = funcKind;
AllocUnwindInfo->Append(value);
}
void CompileResult::dmpAllocUnwindInfo(DWORD key, const Agnostic_AllocUnwindInfo& value)
{
- printf("AllocUnwindInfo key %u, value pHot-%016llX pCold-%016llX startOff-%u endOff-%u unwindSz-%u blki-%u funcKind-%u",
- key,
- value.pHotCode,
- value.pColdCode,
- value.startOffset,
- value.endOffset,
- value.unwindSize,
- value.pUnwindBlock_index,
- value.funcKind);
+ printf("AllocUnwindInfo key %u, value pHot-%016llX pCold-%016llX startOff-%u endOff-%u unwindSz-%u blki-%u "
+ "funcKind-%u",
+ key, value.pHotCode, value.pColdCode, value.startOffset, value.endOffset, value.unwindSize,
+ value.pUnwindBlock_index, value.funcKind);
}
-void CompileResult::recAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer **profileBuffer, HRESULT result)
+void CompileResult::recAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer** profileBuffer, HRESULT result)
{
- if(AllocBBProfileBuffer == nullptr)
- AllocBBProfileBuffer=new LightWeightMap<DWORD, Agnostic_AllocBBProfileBuffer>();
+ if (AllocBBProfileBuffer == nullptr)
+ AllocBBProfileBuffer = new LightWeightMap<DWORD, Agnostic_AllocBBProfileBuffer>();
Agnostic_AllocBBProfileBuffer value;
- value.count = (DWORD)count;
+ value.count = (DWORD)count;
value.result = (DWORD)result;
- value.profileBuffer_index = AllocBBProfileBuffer->AddBuffer((unsigned char*)*profileBuffer, count * sizeof(ICorJitInfo::ProfileBuffer));
+ value.profileBuffer_index =
+ AllocBBProfileBuffer->AddBuffer((unsigned char*)*profileBuffer, count * sizeof(ICorJitInfo::ProfileBuffer));
AllocBBProfileBuffer->Add((DWORD)0, value);
}
void CompileResult::dmpAllocBBProfileBuffer(DWORD key, const Agnostic_AllocBBProfileBuffer& value)
{
- printf("AllocBBProfileBuffer key %u, value cnt-%u ind-%u res-%08X",
- key,
- value.count,
- value.profileBuffer_index,
- value.result);
+ printf("AllocBBProfileBuffer key %u, value cnt-%u ind-%u res-%08X", key, value.count, value.profileBuffer_index,
+ value.result);
}
-HRESULT CompileResult::repAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer **profileBuffer)
+HRESULT CompileResult::repAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer** profileBuffer)
{
Agnostic_AllocBBProfileBuffer value;
value = AllocBBProfileBuffer->Get((DWORD)0);
- if(count != value.count)
+ if (count != value.count)
__debugbreak();
HRESULT result = (HRESULT)value.result;
- *profileBuffer = (ICorJitInfo::ProfileBuffer *)AllocBBProfileBuffer->GetBuffer(value.profileBuffer_index);
- recAddressMap((void*)0x4242, (void*)*profileBuffer, count *(sizeof(ICorJitInfo::ProfileBuffer)));
+ *profileBuffer = (ICorJitInfo::ProfileBuffer*)AllocBBProfileBuffer->GetBuffer(value.profileBuffer_index);
+ recAddressMap((void*)0x4242, (void*)*profileBuffer, count * (sizeof(ICorJitInfo::ProfileBuffer)));
return result;
}
-void CompileResult::recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callSig, CORINFO_METHOD_HANDLE methodHandle)
+void CompileResult::recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle)
{
repRecordCallSite(instrOffset, callSig, methodHandle);
}
void CompileResult::dmpRecordCallSite(DWORD key, const Agnostic_RecordCallSite& value)
{
- printf("RecordCallSite key %u, callSig{cc-%u rtc-%016llX rts-%016llX rt-%u flg-%u na-%u cc-%u ci-%u mc-%u mi-%u sig-%u pSig-%u scp-%016llX tok-%08X} ftn-%016llX",
- key,
- value.callSig.callConv,
- value.callSig.retTypeClass,
- value.callSig.retTypeSigClass,
- value.callSig.retType,
- value.callSig.flags,
- value.callSig.numArgs,
- value.callSig.sigInst_classInstCount,
- value.callSig.sigInst_classInst_Index,
- value.callSig.sigInst_methInstCount,
- value.callSig.sigInst_methInst_Index,
- value.callSig.cbSig,
- value.callSig.pSig,
- value.callSig.scope,
- value.callSig.token,
- value.methodHandle);
-}
-
-void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callSig, CORINFO_METHOD_HANDLE methodHandle)
+ printf("RecordCallSite key %u, callSig{cc-%u rtc-%016llX rts-%016llX rt-%u flg-%u na-%u cc-%u ci-%u mc-%u mi-%u "
+ "sig-%u pSig-%u scp-%016llX tok-%08X} ftn-%016llX",
+ key, value.callSig.callConv, value.callSig.retTypeClass, value.callSig.retTypeSigClass,
+ value.callSig.retType, value.callSig.flags, value.callSig.numArgs, value.callSig.sigInst_classInstCount,
+ value.callSig.sigInst_classInst_Index, value.callSig.sigInst_methInstCount,
+ value.callSig.sigInst_methInst_Index, value.callSig.cbSig, value.callSig.pSig, value.callSig.scope,
+ value.callSig.token, value.methodHandle);
+}
+
+void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle)
{
if (RecordCallSite == nullptr)
RecordCallSite = new LightWeightMap<DWORD, Agnostic_RecordCallSite>();
@@ -993,39 +991,43 @@ void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callS
if (callSig != nullptr)
{
- value.callSig.callConv = (DWORD)callSig->callConv;
- value.callSig.retTypeClass = (DWORDLONG)callSig->retTypeClass;
- value.callSig.retTypeSigClass = (DWORDLONG)callSig->retTypeSigClass;
- value.callSig.retType = (DWORD)callSig->retType;
- value.callSig.flags = (DWORD)callSig->flags;
- value.callSig.numArgs = (DWORD)callSig->numArgs;
+ value.callSig.callConv = (DWORD)callSig->callConv;
+ value.callSig.retTypeClass = (DWORDLONG)callSig->retTypeClass;
+ value.callSig.retTypeSigClass = (DWORDLONG)callSig->retTypeSigClass;
+ value.callSig.retType = (DWORD)callSig->retType;
+ value.callSig.flags = (DWORD)callSig->flags;
+ value.callSig.numArgs = (DWORD)callSig->numArgs;
value.callSig.sigInst_classInstCount = (DWORD)callSig->sigInst.classInstCount;
- value.callSig.sigInst_classInst_Index = RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.classInst, callSig->sigInst.classInstCount*8); // porting issue
+ value.callSig.sigInst_classInst_Index =
+ RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.classInst,
+ callSig->sigInst.classInstCount * 8); // porting issue
value.callSig.sigInst_methInstCount = (DWORD)callSig->sigInst.methInstCount;
- value.callSig.sigInst_methInst_Index = RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.methInst, callSig->sigInst.methInstCount*8); // porting issue
- value.callSig.args = (DWORDLONG)callSig->args;
+ value.callSig.sigInst_methInst_Index =
+ RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.methInst,
+ callSig->sigInst.methInstCount * 8); // porting issue
+ value.callSig.args = (DWORDLONG)callSig->args;
value.callSig.cbSig = (DWORD)callSig->cbSig;
- value.callSig.pSig = (DWORD)RecordCallSite->AddBuffer((unsigned char *)callSig->pSig, callSig->cbSig);
+ value.callSig.pSig = (DWORD)RecordCallSite->AddBuffer((unsigned char*)callSig->pSig, callSig->cbSig);
value.callSig.scope = (DWORDLONG)callSig->scope;
value.callSig.token = (DWORD)callSig->token;
}
else
{
- value.callSig.callConv = (DWORD)-1;
- value.callSig.retTypeClass = (DWORDLONG)-1;
- value.callSig.retTypeSigClass = (DWORDLONG)-1;
- value.callSig.retType = (DWORD)-1;
- value.callSig.flags = (DWORD)-1;
- value.callSig.numArgs = (DWORD)-1;
- value.callSig.sigInst_classInstCount = (DWORD)-1;
+ value.callSig.callConv = (DWORD)-1;
+ value.callSig.retTypeClass = (DWORDLONG)-1;
+ value.callSig.retTypeSigClass = (DWORDLONG)-1;
+ value.callSig.retType = (DWORD)-1;
+ value.callSig.flags = (DWORD)-1;
+ value.callSig.numArgs = (DWORD)-1;
+ value.callSig.sigInst_classInstCount = (DWORD)-1;
value.callSig.sigInst_classInst_Index = (DWORD)-1;
- value.callSig.sigInst_methInstCount = (DWORD)-1;
- value.callSig.sigInst_methInst_Index = (DWORD)-1;
- value.callSig.args = (DWORDLONG)-1;
- value.callSig.cbSig = (DWORD)-1;
- value.callSig.pSig = (DWORD)-1;
- value.callSig.scope = (DWORDLONG)-1;
- value.callSig.token = (DWORD)-1;
+ value.callSig.sigInst_methInstCount = (DWORD)-1;
+ value.callSig.sigInst_methInst_Index = (DWORD)-1;
+ value.callSig.args = (DWORDLONG)-1;
+ value.callSig.cbSig = (DWORD)-1;
+ value.callSig.pSig = (DWORD)-1;
+ value.callSig.scope = (DWORDLONG)-1;
+ value.callSig.token = (DWORD)-1;
}
value.methodHandle = (DWORDLONG)methodHandle;
@@ -1033,7 +1035,7 @@ void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callS
RecordCallSite->Add(instrOffset, value);
}
-bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO *pCallSig)
+bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO* pCallSig)
{
if (RecordCallSite == nullptr)
return false;
@@ -1046,26 +1048,27 @@ bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO
if (value.callSig.callConv == -1)
return false;
- pCallSig->callConv = (CorInfoCallConv)value.callSig.callConv;
- pCallSig->retTypeClass = (CORINFO_CLASS_HANDLE)value.callSig.retTypeClass;
- pCallSig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.callSig.retTypeSigClass;
- pCallSig->retType = (CorInfoType)value.callSig.retType;
- pCallSig->flags = (unsigned)value.callSig.flags;
- pCallSig->numArgs = (unsigned)value.callSig.numArgs;
+ pCallSig->callConv = (CorInfoCallConv)value.callSig.callConv;
+ pCallSig->retTypeClass = (CORINFO_CLASS_HANDLE)value.callSig.retTypeClass;
+ pCallSig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.callSig.retTypeSigClass;
+ pCallSig->retType = (CorInfoType)value.callSig.retType;
+ pCallSig->flags = (unsigned)value.callSig.flags;
+ pCallSig->numArgs = (unsigned)value.callSig.numArgs;
pCallSig->sigInst.classInstCount = (unsigned)value.callSig.sigInst_classInstCount;
- pCallSig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)RecordCallSite->GetBuffer(value.callSig.sigInst_classInst_Index);
+ pCallSig->sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)RecordCallSite->GetBuffer(value.callSig.sigInst_classInst_Index);
pCallSig->sigInst.methInstCount = (unsigned)value.callSig.sigInst_methInstCount;
pCallSig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)RecordCallSite->GetBuffer(value.callSig.sigInst_methInst_Index);
- pCallSig->args = (CORINFO_ARG_LIST_HANDLE)value.callSig.args;
- pCallSig->cbSig = (unsigned int)value.callSig.cbSig;
- pCallSig->pSig = (PCCOR_SIGNATURE)RecordCallSite->GetBuffer(value.callSig.pSig);
- pCallSig->scope = (CORINFO_MODULE_HANDLE)value.callSig.scope;
- pCallSig->token = (mdToken)value.callSig.token;
+ pCallSig->args = (CORINFO_ARG_LIST_HANDLE)value.callSig.args;
+ pCallSig->cbSig = (unsigned int)value.callSig.cbSig;
+ pCallSig->pSig = (PCCOR_SIGNATURE)RecordCallSite->GetBuffer(value.callSig.pSig);
+ pCallSig->scope = (CORINFO_MODULE_HANDLE)value.callSig.scope;
+ pCallSig->token = (mdToken)value.callSig.token;
return true;
}
-bool CompileResult::fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE *pMethodHandle)
+bool CompileResult::fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE* pMethodHandle)
{
if (RecordCallSite == nullptr)
return false;
@@ -1074,7 +1077,7 @@ bool CompileResult::fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_MET
return false;
Agnostic_RecordCallSite value = RecordCallSite->Get(instrOffset);
- *pMethodHandle = (CORINFO_METHOD_HANDLE)value.methodHandle;
+ *pMethodHandle = (CORINFO_METHOD_HANDLE)value.methodHandle;
return true;
}
diff --git a/src/ToolBox/superpmi/superpmi-shared/compileresult.h b/src/ToolBox/superpmi/superpmi-shared/compileresult.h
index 87853f4cd3..ebb1e7f512 100644
--- a/src/ToolBox/superpmi/superpmi-shared/compileresult.h
+++ b/src/ToolBox/superpmi/superpmi-shared/compileresult.h
@@ -19,46 +19,46 @@ public:
{
DWORDLONG location;
DWORDLONG target;
- DWORD fRelocType;
- DWORD slotNum;
- DWORD addlDelta;
+ DWORD fRelocType;
+ DWORD slotNum;
+ DWORD addlDelta;
};
struct Capture_AllocMemDetails
{
- ULONG hotCodeSize;
- ULONG coldCodeSize;
- ULONG roDataSize;
- ULONG xcptnsCount;
+ ULONG hotCodeSize;
+ ULONG coldCodeSize;
+ ULONG roDataSize;
+ ULONG xcptnsCount;
CorJitAllocMemFlag flag;
- void *hotCodeBlock;
- void *coldCodeBlock;
- void *roDataBlock;
+ void* hotCodeBlock;
+ void* coldCodeBlock;
+ void* roDataBlock;
};
struct allocGCInfoDetails
{
size_t size;
- void* retval;
+ void* retval;
};
struct Agnostic_AddressMap
{
DWORDLONG Address;
- DWORD size;
+ DWORD size;
};
struct Agnostic_AllocGCInfo
{
DWORDLONG size;
- DWORD retval_offset;
+ DWORD retval_offset;
};
struct Agnostic_AllocMemDetails
{
- DWORD hotCodeSize;
- DWORD coldCodeSize;
- DWORD roDataSize;
- DWORD xcptnsCount;
- DWORD flag;
- DWORD hotCodeBlock_offset;
- DWORD coldCodeBlock_offset;
- DWORD roDataBlock_offset;
+ DWORD hotCodeSize;
+ DWORD coldCodeSize;
+ DWORD roDataSize;
+ DWORD xcptnsCount;
+ DWORD flag;
+ DWORD hotCodeBlock_offset;
+ DWORD coldCodeBlock_offset;
+ DWORD roDataBlock_offset;
DWORDLONG hotCodeBlock;
DWORDLONG coldCodeBlock;
DWORDLONG roDataBlock;
@@ -67,32 +67,32 @@ public:
{
DWORDLONG pHotCode;
DWORDLONG pColdCode;
- DWORD startOffset;
- DWORD endOffset;
- DWORD unwindSize;
- DWORD pUnwindBlock_index;
- DWORD funcKind;
+ DWORD startOffset;
+ DWORD endOffset;
+ DWORD unwindSize;
+ DWORD pUnwindBlock_index;
+ DWORD funcKind;
};
struct Agnostic_CompileMethodResults
{
DWORDLONG nativeEntry;
- DWORD nativeSizeOfCode;
- DWORD CorJitResult;
+ DWORD nativeSizeOfCode;
+ DWORD CorJitResult;
};
struct Agnostic_ReportInliningDecision
{
DWORDLONG inlinerHnd;
DWORDLONG inlineeHnd;
- DWORD inlineResult;
- DWORD reason_offset;
+ DWORD inlineResult;
+ DWORD reason_offset;
};
struct Agnostic_ReportTailCallDecision
{
DWORDLONG callerHnd;
DWORDLONG calleeHnd;
- DWORD fIsTailPrefix;
- DWORD tailCallResult;
- DWORD reason_index;
+ DWORD fIsTailPrefix;
+ DWORD tailCallResult;
+ DWORD reason_index;
};
struct Agnostic_ReserveUnwindInfo
{
@@ -103,14 +103,14 @@ public:
struct Agnostic_SetBoundaries
{
DWORDLONG ftn;
- DWORD cMap;
- DWORD pMap_offset;
+ DWORD cMap;
+ DWORD pMap_offset;
};
struct Agnostic_SetVars
{
DWORDLONG ftn;
- DWORD cVars;
- DWORD vars_offset;
+ DWORD cVars;
+ DWORD vars_offset;
};
struct Agnostic_CORINFO_EH_CLAUSE2
{
@@ -119,7 +119,7 @@ public:
DWORD TryLength;
DWORD HandlerOffset;
DWORD HandlerLength;
- DWORD ClassToken; //one view of symetric union
+ DWORD ClassToken; // one view of symetric union
};
struct Agnostic_AllocBBProfileBuffer
{
@@ -129,26 +129,26 @@ public:
};
struct Agnostic_CORINFO_SIG_INFO2
{
- DWORD callConv;
+ DWORD callConv;
DWORDLONG retTypeClass;
DWORDLONG retTypeSigClass;
- DWORD retType;
- DWORD flags;
- DWORD numArgs;
- DWORD sigInst_classInstCount;
- DWORD sigInst_classInst_Index;
- DWORD sigInst_methInstCount;
- DWORD sigInst_methInst_Index;
+ DWORD retType;
+ DWORD flags;
+ DWORD numArgs;
+ DWORD sigInst_classInstCount;
+ DWORD sigInst_classInst_Index;
+ DWORD sigInst_methInstCount;
+ DWORD sigInst_methInst_Index;
DWORDLONG args;
- DWORD pSig;
- DWORD cbSig;
+ DWORD pSig;
+ DWORD cbSig;
DWORDLONG scope;
- DWORD token;
+ DWORD token;
};
struct Agnostic_RecordCallSite
{
Agnostic_CORINFO_SIG_INFO2 callSig;
- DWORDLONG methodHandle;
+ DWORDLONG methodHandle;
};
#pragma pack(pop)
@@ -157,43 +157,57 @@ public:
bool IsEmpty();
- void AddCall(const char *name);
+ void AddCall(const char* name);
unsigned int CallLog_GetCount();
- bool CallLog_Contains(const char *str);
+ bool CallLog_Contains(const char* str);
void dmpCallLog(DWORD key, DWORD value);
void dumpToConsole();
HANDLE getCodeHeap();
- void recAssert(const char *buff);
+ void recAssert(const char* buff);
void dmpAssertLog(DWORD key, DWORD value);
- const char *repAssert();
-
- void recAllocMem(ULONG hotCodeSize, ULONG coldCodeSize, ULONG roDataSize, ULONG xcptnsCount, CorJitAllocMemFlag flag,
- void **hotCodeBlock, void **coldCodeBlock, void **roDataBlock);
+ const char* repAssert();
+
+ void recAllocMem(ULONG hotCodeSize,
+ ULONG coldCodeSize,
+ ULONG roDataSize,
+ ULONG xcptnsCount,
+ CorJitAllocMemFlag flag,
+ void** hotCodeBlock,
+ void** coldCodeBlock,
+ void** roDataBlock);
void recAllocMemCapture();
void dmpAllocMem(DWORD key, const Agnostic_AllocMemDetails& value);
- void repAllocMem(ULONG *hotCodeSize, ULONG *coldCodeSize, ULONG *roDataSize, ULONG *xcptnsCount, CorJitAllocMemFlag *flag,
- unsigned char **hotCodeBlock, unsigned char **coldCodeBlock, unsigned char **roDataBlock,
- void **orig_hotCodeBlock, void **orig_coldCodeBlock, void **orig_roDataBlock);
-
- void recSetBoundaries(CORINFO_METHOD_HANDLE ftn, ULONG32 cMap, ICorDebugInfo::OffsetMapping *pMap);
+ void repAllocMem(ULONG* hotCodeSize,
+ ULONG* coldCodeSize,
+ ULONG* roDataSize,
+ ULONG* xcptnsCount,
+ CorJitAllocMemFlag* flag,
+ unsigned char** hotCodeBlock,
+ unsigned char** coldCodeBlock,
+ unsigned char** roDataBlock,
+ void** orig_hotCodeBlock,
+ void** orig_coldCodeBlock,
+ void** orig_roDataBlock);
+
+ void recSetBoundaries(CORINFO_METHOD_HANDLE ftn, ULONG32 cMap, ICorDebugInfo::OffsetMapping* pMap);
void dmpSetBoundaries(DWORD key, const Agnostic_SetBoundaries& value);
- bool repSetBoundaries(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cMap, ICorDebugInfo::OffsetMapping **pMap);
+ bool repSetBoundaries(CORINFO_METHOD_HANDLE* ftn, ULONG32* cMap, ICorDebugInfo::OffsetMapping** pMap);
- void recSetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo *vars);
+ void recSetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo* vars);
void dmpSetVars(DWORD key, const Agnostic_SetVars& value);
- bool repSetVars(CORINFO_METHOD_HANDLE *ftn, ULONG32 *cVars, ICorDebugInfo::NativeVarInfo **vars);
+ bool repSetVars(CORINFO_METHOD_HANDLE* ftn, ULONG32* cVars, ICorDebugInfo::NativeVarInfo** vars);
- void recAllocGCInfo(size_t size, void *retval);
+ void recAllocGCInfo(size_t size, void* retval);
void recAllocGCInfoCapture();
void dmpAllocGCInfo(DWORD key, const Agnostic_AllocGCInfo& value);
- void repAllocGCInfo(size_t *size, void **retval);
+ void repAllocGCInfo(size_t* size, void** retval);
- void recCompileMethod(BYTE **nativeEntry, ULONG *nativeSizeOfCode, CorJitResult result);
+ void recCompileMethod(BYTE** nativeEntry, ULONG* nativeSizeOfCode, CorJitResult result);
void dmpCompileMethod(DWORD key, const Agnostic_CompileMethodResults& value);
- void repCompileMethod(BYTE **nativeEntry, ULONG *nativeSizeOfCode, CorJitResult *result);
+ void repCompileMethod(BYTE** nativeEntry, ULONG* nativeSizeOfCode, CorJitResult* result);
void recMessageLog(const char* fmt, ...);
void dmpMessageLog(DWORD key, DWORD value);
@@ -201,7 +215,10 @@ public:
void recClassMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls);
void dmpClassMustBeLoadedBeforeCodeIsRun(DWORD key, DWORDLONG value);
- void recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd, CorInfoInline inlineResult, const char * reason);
+ void recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd,
+ CORINFO_METHOD_HANDLE inlineeHnd,
+ CorInfoInline inlineResult,
+ const char* reason);
void dmpReportInliningDecision(DWORD key, const Agnostic_ReportInliningDecision& value);
CorInfoInline repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd);
@@ -209,68 +226,83 @@ public:
void dmpSetEHcount(DWORD key, DWORD value);
ULONG repSetEHcount();
- void recSetEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE *clause);
+ void recSetEHinfo(unsigned EHnumber, const CORINFO_EH_CLAUSE* clause);
void dmpSetEHinfo(DWORD key, const Agnostic_CORINFO_EH_CLAUSE2& value);
- void repSetEHinfo(unsigned EHnumber, ULONG *flags, ULONG *tryOffset, ULONG *tryLength, ULONG *handlerOffset, ULONG *handlerLength, ULONG *classToken);
-
- void recSetMethodAttribs (CORINFO_METHOD_HANDLE ftn, CorInfoMethodRuntimeFlags attribs);
+ void repSetEHinfo(unsigned EHnumber,
+ ULONG* flags,
+ ULONG* tryOffset,
+ ULONG* tryLength,
+ ULONG* handlerOffset,
+ ULONG* handlerLength,
+ ULONG* classToken);
+
+ void recSetMethodAttribs(CORINFO_METHOD_HANDLE ftn, CorInfoMethodRuntimeFlags attribs);
void dmpSetMethodAttribs(DWORDLONG key, DWORD value);
- CorInfoMethodRuntimeFlags repSetMethodAttribs (CORINFO_METHOD_HANDLE ftn);
+ CorInfoMethodRuntimeFlags repSetMethodAttribs(CORINFO_METHOD_HANDLE ftn);
void recMethodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method);
void dmpMethodMustBeLoadedBeforeCodeIsRun(DWORD key, DWORDLONG value);
- void recReportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, bool fIsTailPrefix,
- CorInfoTailCall tailCallResult, const char * reason);
+ void recReportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ bool fIsTailPrefix,
+ CorInfoTailCall tailCallResult,
+ const char* reason);
void dmpReportTailCallDecision(DWORD key, const Agnostic_ReportTailCallDecision& value);
void recReportFatalError(CorJitResult result);
void dmpReportFatalError(DWORD key, DWORD value);
- void recRecordRelocation(void *location, void *target, WORD fRelocType, WORD slotNum, INT32 addlDelta);
+ void recRecordRelocation(void* location, void* target, WORD fRelocType, WORD slotNum, INT32 addlDelta);
void dmpRecordRelocation(DWORD key, const Agnostic_RecordRelocation& value);
- void repRecordRelocation(void *location, void *target, WORD fRelocType, WORD slotNum, INT32 addlDelta);
- void applyRelocs(unsigned char *block1, ULONG blocksize1, void *originalAddr);
+ void repRecordRelocation(void* location, void* target, WORD fRelocType, WORD slotNum, INT32 addlDelta);
+ void applyRelocs(unsigned char* block1, ULONG blocksize1, void* originalAddr);
void recProcessName(const char* name);
void dmpProcessName(DWORD key, DWORD value);
- const char *repProcessName();
+ const char* repProcessName();
- void recAddressMap(void *original_address, void *replay_address, unsigned int size);
+ void recAddressMap(void* original_address, void* replay_address, unsigned int size);
void dmpAddressMap(DWORDLONG key, const Agnostic_AddressMap& value);
- void* repAddressMap(void *replay_address);
- void *searchAddressMap(void *replay_address);
+ void* repAddressMap(void* replay_address);
+ void* searchAddressMap(void* replay_address);
void recReserveUnwindInfo(BOOL isFunclet, BOOL isColdCode, ULONG unwindSize);
void dmpReserveUnwindInfo(DWORD key, const Agnostic_ReserveUnwindInfo& value);
- void recAllocUnwindInfo(BYTE *pHotCode, BYTE *pColdCode, ULONG startOffset, ULONG endOffset, ULONG unwindSize, BYTE *pUnwindBlock,
- CorJitFuncKind funcKind);
+ void recAllocUnwindInfo(BYTE* pHotCode,
+ BYTE* pColdCode,
+ ULONG startOffset,
+ ULONG endOffset,
+ ULONG unwindSize,
+ BYTE* pUnwindBlock,
+ CorJitFuncKind funcKind);
void dmpAllocUnwindInfo(DWORD key, const Agnostic_AllocUnwindInfo& value);
- void recAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer **profileBuffer, HRESULT result);
+ void recAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer** profileBuffer, HRESULT result);
void dmpAllocBBProfileBuffer(DWORD key, const Agnostic_AllocBBProfileBuffer& value);
- HRESULT repAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer **profileBuffer);
+ HRESULT repAllocBBProfileBuffer(ULONG count, ICorJitInfo::ProfileBuffer** profileBuffer);
- void recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callSig, CORINFO_METHOD_HANDLE methodHandle);
+ void recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle);
void dmpRecordCallSite(DWORD key, const Agnostic_RecordCallSite& value);
- void repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO *callSig, CORINFO_METHOD_HANDLE methodHandle);
- bool fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO *pCallSig);
- bool fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE *pMethodHandle);
+ void repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle);
+ bool fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO* pCallSig);
+ bool fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE* pMethodHandle);
- DOUBLE secondsToCompile;
+ DOUBLE secondsToCompile;
ULONGLONG clockCyclesToCompile;
- #define LWM(map,key,value) LightWeightMap<key, value>* map;
- #define DENSELWM(map,value) DenseLightWeightMap<value>* map;
- #include "crlwmlist.h"
+#define LWM(map, key, value) LightWeightMap<key, value>* map;
+#define DENSELWM(map, value) DenseLightWeightMap<value>* map;
+#include "crlwmlist.h"
-//not persisted to disk.
+ // not persisted to disk.
public:
- LightWeightMap<DWORDLONG, DWORD> *CallTargetTypes;
+ LightWeightMap<DWORDLONG, DWORD>* CallTargetTypes;
+
private:
- HANDLE codeHeap;
+ HANDLE codeHeap;
Capture_AllocMemDetails allocMemDets;
- allocGCInfoDetails allocGCInfoDets;
+ allocGCInfoDetails allocGCInfoDets;
};
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h b/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h
new file mode 100644
index 0000000000..ca542fb234
--- /dev/null
+++ b/src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h
@@ -0,0 +1,20 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+#ifndef _CoreClrCommonCallbacks
+#define _CoreClrCommonCallbacks
+
+#include "runtimedetails.h"
+
+IExecutionEngine* IEE_t();
+HRESULT GetCORSystemDirectory(LPWSTR pbuffer, DWORD cchBuffer, DWORD* pdwlength);
+LPVOID EEHeapAllocInProcessHeap(DWORD dwFlags, SIZE_T dwBytes);
+BOOL EEHeapFreeInProcessHeap(DWORD dwFlags, LPVOID lpMem);
+void* GetCLRFunction(LPCSTR functionName);
+
+typedef LPVOID (*pfnEEHeapAllocInProcessHeap)(DWORD dwFlags, SIZE_T dwBytes);
+typedef BOOL (*pfnEEHeapFreeInProcessHeap)(DWORD dwFlags, LPVOID lpMem);
+
+#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/errorhandling.cpp b/src/ToolBox/superpmi/superpmi-shared/errorhandling.cpp
index ad871db4ce..7131471c11 100644
--- a/src/ToolBox/superpmi/superpmi-shared/errorhandling.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/errorhandling.cpp
@@ -14,32 +14,31 @@ void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode)
}
// Allocating memory here seems moderately dangerous: we'll probably leak like a sieve...
-void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, va_list args, const char *message)
+void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, va_list args, const char* message)
{
- char *buffer = new char[8192];
- ULONG_PTR *ptr = new ULONG_PTR();
- *ptr = (ULONG_PTR)buffer;
+ char* buffer = new char[8192];
+ ULONG_PTR* ptr = new ULONG_PTR();
+ *ptr = (ULONG_PTR)buffer;
_vsnprintf_s(buffer, 8192, 8191, message, args);
RaiseException(exceptionCode, 0, 1, ptr);
}
-void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, const char *msg, ...)
+void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, const char* msg, ...)
{
va_list ap;
va_start(ap, msg);
ThrowException(exceptionCode, ap, msg);
}
-SpmiException::SpmiException(PEXCEPTION_POINTERS exp)
- : exCode(exp->ExceptionRecord->ExceptionCode)
+SpmiException::SpmiException(PEXCEPTION_POINTERS exp) : exCode(exp->ExceptionRecord->ExceptionCode)
{
- exMessage = (exp->ExceptionRecord->NumberParameters != 1) ? nullptr : (char *) exp->ExceptionRecord->ExceptionInformation[0];
+ exMessage =
+ (exp->ExceptionRecord->NumberParameters != 1) ? nullptr : (char*)exp->ExceptionRecord->ExceptionInformation[0];
}
SpmiException::SpmiException(DWORD exceptionCode, char* exceptionMessage)
- : exCode(exceptionCode)
- , exMessage(exceptionMessage)
+ : exCode(exceptionCode), exMessage(exceptionMessage)
{
}
@@ -51,7 +50,7 @@ SpmiException::~SpmiException()
}
#endif
-char *SpmiException::GetExceptionMessage()
+char* SpmiException::GetExceptionMessage()
{
return exMessage;
}
@@ -76,27 +75,30 @@ DWORD SpmiException::GetCode()
{
return exCode;
}
-
+
// This filter function executes the handler only for EXCEPTIONCODE_MC, otherwise it continues the handler search.
LONG FilterSuperPMIExceptions_CatchMC(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam)
{
- return (pExceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTIONCODE_MC) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
+ return (pExceptionPointers->ExceptionRecord->ExceptionCode == EXCEPTIONCODE_MC) ? EXCEPTION_EXECUTE_HANDLER
+ : EXCEPTION_CONTINUE_SEARCH;
}
// This filter function captures the exception pointers and continues searching.
LONG FilterSuperPMIExceptions_CaptureExceptionAndContinue(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam)
{
- FilterSuperPMIExceptionsParam_CaptureException* pSPMIEParam = (FilterSuperPMIExceptionsParam_CaptureException *)lpvParam;
- pSPMIEParam->exceptionPointers = *pExceptionPointers; // Capture the exception pointers for use later
- pSPMIEParam->exceptionCode = pSPMIEParam->exceptionPointers.ExceptionRecord->ExceptionCode;
+ FilterSuperPMIExceptionsParam_CaptureException* pSPMIEParam =
+ (FilterSuperPMIExceptionsParam_CaptureException*)lpvParam;
+ pSPMIEParam->exceptionPointers = *pExceptionPointers; // Capture the exception pointers for use later
+ pSPMIEParam->exceptionCode = pSPMIEParam->exceptionPointers.ExceptionRecord->ExceptionCode;
return EXCEPTION_CONTINUE_SEARCH;
}
LONG FilterSuperPMIExceptions_CaptureExceptionAndStop(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam)
{
- FilterSuperPMIExceptionsParam_CaptureException* pSPMIEParam = (FilterSuperPMIExceptionsParam_CaptureException *)lpvParam;
- pSPMIEParam->exceptionPointers = *pExceptionPointers; // Capture the exception pointers for use later
- pSPMIEParam->exceptionCode = pSPMIEParam->exceptionPointers.ExceptionRecord->ExceptionCode;
+ FilterSuperPMIExceptionsParam_CaptureException* pSPMIEParam =
+ (FilterSuperPMIExceptionsParam_CaptureException*)lpvParam;
+ pSPMIEParam->exceptionPointers = *pExceptionPointers; // Capture the exception pointers for use later
+ pSPMIEParam->exceptionCode = pSPMIEParam->exceptionPointers.ExceptionRecord->ExceptionCode;
return EXCEPTION_EXECUTE_HANDLER;
}
@@ -104,23 +106,24 @@ bool IsSuperPMIException(unsigned code)
{
switch (code)
{
- case EXCEPTIONCODE_MC:
- case EXCEPTIONCODE_LWM:
- case EXCEPTIONCODE_CALLUTILS:
- case EXCEPTIONCODE_TYPEUTILS:
- case EXCEPTIONCODE_ASSERT:
- return true;
- default:
- if ((EXCEPTIONCODE_DebugBreakorAV <= code) && (code < EXCEPTIONCODE_DebugBreakorAV_MAX))
- {
+ case EXCEPTIONCODE_MC:
+ case EXCEPTIONCODE_LWM:
+ case EXCEPTIONCODE_CALLUTILS:
+ case EXCEPTIONCODE_TYPEUTILS:
+ case EXCEPTIONCODE_ASSERT:
return true;
- }
- return false;
+ default:
+ if ((EXCEPTIONCODE_DebugBreakorAV <= code) && (code < EXCEPTIONCODE_DebugBreakorAV_MAX))
+ {
+ return true;
+ }
+ return false;
}
}
-
-// This filter function executes the handler only for non-SuperPMI generated exceptions, otherwise it continues the handler search.
-// This allows for SuperPMI-thrown exceptions to pass through the JIT and be caught by the outer SuperPMI handler.
+
+// This filter function executes the handler only for non-SuperPMI generated exceptions, otherwise it continues the
+// handler search. This allows for SuperPMI-thrown exceptions to pass through the JIT and be caught by the outer
+// SuperPMI handler.
LONG FilterSuperPMIExceptions_CatchNonSuperPMIException(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam)
{
return !IsSuperPMIException(pExceptionPointers->ExceptionRecord->ExceptionCode);
@@ -130,12 +133,13 @@ bool RunWithErrorTrap(void (*function)(void*), void* param)
{
bool success = true;
- struct TrapParam {
+ struct TrapParam
+ {
void (*function)(void*);
- void *param;
+ void* param;
} trapParam;
trapParam.function = function;
- trapParam.param = param;
+ trapParam.param = param;
PAL_TRY(TrapParam*, pTrapParam, &trapParam)
{
diff --git a/src/ToolBox/superpmi/superpmi-shared/errorhandling.h b/src/ToolBox/superpmi/superpmi-shared/errorhandling.h
index 412bf97ba6..8c0cadd8b8 100644
--- a/src/ToolBox/superpmi/superpmi-shared/errorhandling.h
+++ b/src/ToolBox/superpmi/superpmi-shared/errorhandling.h
@@ -14,32 +14,36 @@
// EXCEPTIONCODE_DebugBreakorAV is just the base exception number; calls to DebugBreakorAV()
// pass a unique number to add to this. EXCEPTIONCODE_DebugBreakorAV_MAX is the maximum number
// of this exception range.
-#define EXCEPTIONCODE_DebugBreakorAV 0xe0421000
+#define EXCEPTIONCODE_DebugBreakorAV 0xe0421000
#define EXCEPTIONCODE_DebugBreakorAV_MAX 0xe0422000
-#define EXCEPTIONCODE_MC 0xe0422000
-#define EXCEPTIONCODE_LWM 0xe0423000
-#define EXCEPTIONCODE_CALLUTILS 0xe0426000
-#define EXCEPTIONCODE_TYPEUTILS 0xe0427000
-#define EXCEPTIONCODE_ASSERT 0xe0440000
+#define EXCEPTIONCODE_MC 0xe0422000
+#define EXCEPTIONCODE_LWM 0xe0423000
+#define EXCEPTIONCODE_CALLUTILS 0xe0426000
+#define EXCEPTIONCODE_TYPEUTILS 0xe0427000
+#define EXCEPTIONCODE_ASSERT 0xe0440000
// RaiseException wrappers
void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode);
-void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, const char *message, ...);
+void MSC_ONLY(__declspec(noreturn)) ThrowException(DWORD exceptionCode, const char* message, ...);
// Assert stuff
-#define AssertCodeMsg(expr, exCode, msg, ...) \
- do { \
- if (!(expr)) LogException(exCode, "SuperPMI assertion '%s' failed (" #msg ")", #expr, ##__VA_ARGS__); \
+#define AssertCodeMsg(expr, exCode, msg, ...) \
+ do \
+ { \
+ if (!(expr)) \
+ LogException(exCode, "SuperPMI assertion '%s' failed (" #msg ")", #expr, ##__VA_ARGS__); \
} while (0)
-#define AssertCode(expr, exCode) \
- do { \
- if (!(expr)) LogException(exCode, "SuperPMI assertion '%s' failed", #expr); \
+#define AssertCode(expr, exCode) \
+ do \
+ { \
+ if (!(expr)) \
+ LogException(exCode, "SuperPMI assertion '%s' failed", #expr); \
} while (0)
#define AssertMsg(expr, msg, ...) AssertCodeMsg(expr, EXCEPTIONCODE_ASSERT, msg, ##__VA_ARGS__)
-#define Assert(expr) AssertCode(expr, EXCEPTIONCODE_ASSERT)
+#define Assert(expr) AssertCode(expr, EXCEPTIONCODE_ASSERT)
class SpmiException
{
@@ -54,7 +58,7 @@ public:
~SpmiException();
#endif
- char *GetExceptionMessage();
+ char* GetExceptionMessage();
DWORD GetCode();
void ShowAndDeleteMessage();
@@ -72,15 +76,15 @@ struct FilterSuperPMIExceptionsParam_CaptureException
EXCEPTION_POINTERS exceptionPointers;
DWORD exceptionCode;
- FilterSuperPMIExceptionsParam_CaptureException()
- : exceptionCode(0)
+ FilterSuperPMIExceptionsParam_CaptureException() : exceptionCode(0)
{
exceptionPointers.ExceptionRecord = nullptr;
- exceptionPointers.ContextRecord = nullptr;
+ exceptionPointers.ContextRecord = nullptr;
}
};
-extern LONG FilterSuperPMIExceptions_CaptureExceptionAndContinue(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam);
+extern LONG FilterSuperPMIExceptions_CaptureExceptionAndContinue(PEXCEPTION_POINTERS pExceptionPointers,
+ LPVOID lpvParam);
extern LONG FilterSuperPMIExceptions_CaptureExceptionAndStop(PEXCEPTION_POINTERS pExceptionPointers, LPVOID lpvParam);
extern bool RunWithErrorTrap(void (*function)(void*), void* param);
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
index 0e36562076..28d67c20d1 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitcompilerimpl.h
@@ -16,55 +16,53 @@
// against the interface declaration.
public:
- // compileMethod is the main routine to ask the JIT Compiler to create native code for a method. The
- // method to be compiled is passed in the 'info' parameter, and the code:ICorJitInfo is used to allow the
- // JIT to resolve tokens, and make any other callbacks needed to create the code. nativeEntry, and
- // nativeSizeOfCode are just for convenience because the JIT asks the EE for the memory to emit code into
- // (see code:ICorJitInfo.allocMem), so really the EE already knows where the method starts and how big
- // it is (in fact, it could be in more than one chunk).
- //
- // * In the 32 bit jit this is implemented by code:CILJit.compileMethod
- // * For the 64 bit jit this is implemented by code:PreJit.compileMethod
- //
- // Note: Obfuscators that are hacking the JIT depend on this method having __stdcall calling convention
- CorJitResult __stdcall compileMethod (
- ICorJitInfo *comp, /* IN */
- struct CORINFO_METHOD_INFO *info, /* IN */
- unsigned /* code:CorJitFlag */ flags, /* IN */
- BYTE **nativeEntry, /* OUT */
- ULONG *nativeSizeOfCode /* OUT */
- );
+// compileMethod is the main routine to ask the JIT Compiler to create native code for a method. The
+// method to be compiled is passed in the 'info' parameter, and the code:ICorJitInfo is used to allow the
+// JIT to resolve tokens, and make any other callbacks needed to create the code. nativeEntry, and
+// nativeSizeOfCode are just for convenience because the JIT asks the EE for the memory to emit code into
+// (see code:ICorJitInfo.allocMem), so really the EE already knows where the method starts and how big
+// it is (in fact, it could be in more than one chunk).
+//
+// * In the 32 bit jit this is implemented by code:CILJit.compileMethod
+// * For the 64 bit jit this is implemented by code:PreJit.compileMethod
+//
+// Note: Obfuscators that are hacking the JIT depend on this method having __stdcall calling convention
+CorJitResult __stdcall compileMethod(ICorJitInfo* comp, /* IN */
+ struct CORINFO_METHOD_INFO* info, /* IN */
+ unsigned /* code:CorJitFlag */ flags, /* IN */
+ BYTE** nativeEntry, /* OUT */
+ ULONG* nativeSizeOfCode /* OUT */
+ );
- // Some JIT compilers (most notably Phoenix), cache information about EE structures from one invocation
- // of the compiler to the next. This can be a problem when appdomains are unloaded, as some of this
- // cached information becomes stale. The code:ICorJitCompiler.isCacheCleanupRequired is called by the EE
- // early first to see if jit needs these notifications, and if so, the EE will call ClearCache is called
- // whenever the compiler should abandon its cache (eg on appdomain unload)
- void clearCache();
- BOOL isCacheCleanupRequired();
+// Some JIT compilers (most notably Phoenix), cache information about EE structures from one invocation
+// of the compiler to the next. This can be a problem when appdomains are unloaded, as some of this
+// cached information becomes stale. The code:ICorJitCompiler.isCacheCleanupRequired is called by the EE
+// early first to see if jit needs these notifications, and if so, the EE will call ClearCache is called
+// whenever the compiler should abandon its cache (eg on appdomain unload)
+void clearCache();
+BOOL isCacheCleanupRequired();
- // Do any appropriate work at process shutdown. Default impl is to do nothing.
- void ProcessShutdownWork(ICorStaticInfo* info); /* {}; */
+// Do any appropriate work at process shutdown. Default impl is to do nothing.
+void ProcessShutdownWork(ICorStaticInfo* info); /* {}; */
- // The EE asks the JIT for a "version identifier". This represents the version of the JIT/EE interface.
- // If the JIT doesn't implement the same JIT/EE interface expected by the EE (because the JIT doesn't
- // return the version identifier that the EE expects), then the EE fails to load the JIT.
- //
- void getVersionIdentifier(
- GUID* versionIdentifier /* OUT */
- );
+// The EE asks the JIT for a "version identifier". This represents the version of the JIT/EE interface.
+// If the JIT doesn't implement the same JIT/EE interface expected by the EE (because the JIT doesn't
+// return the version identifier that the EE expects), then the EE fails to load the JIT.
+//
+void getVersionIdentifier(GUID* versionIdentifier /* OUT */
+ );
- // 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).
- unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */
+// 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).
+unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags); /* { return 0; } */
- // 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,
- // and not to implement those methods itself. The JIT must not return this method when getJit()
- // is called. Instead, it must pass along all calls to this interface from within its own
- // ICorJitCompiler implementation. If 'realJitCompiler' is nullptr, then the JIT should resume
- // executing all the functions itself.
- void setRealJit(ICorJitCompiler* realJitCompiler); /* { } */
+// 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,
+// and not to implement those methods itself. The JIT must not return this method when getJit()
+// is called. Instead, it must pass along all calls to this interface from within its own
+// ICorJitCompiler implementation. If 'realJitCompiler' is nullptr, then the JIT should resume
+// executing all the functions itself.
+void setRealJit(ICorJitCompiler* realJitCompiler); /* { } */
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjithostimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjithostimpl.h
index 8bd09e5331..aac68421e7 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjithostimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjithostimpl.h
@@ -23,33 +23,26 @@
// against the interface declaration.
public:
- // Allocate memory of the given size in bytes. All bytes of the returned block
- // must be initialized to zero. If `usePageAllocator` is true, the implementation
- // should use an allocator that deals in OS pages if one exists.
- void* allocateMemory(size_t size, bool usePageAllocator = false);
-
- // Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`. The
- // value of the `usePageAllocator` parameter must match the value that was
- // provided to the call to used to allocate the memory.
- void freeMemory(void* block, bool usePageAllocator = false);
-
- // Return an integer config value for the given key, if any exists.
- int getIntConfigValue(
- const wchar_t* name,
- int defaultValue
- );
-
- // Return a string config value for the given key, if any exists.
- const wchar_t* getStringConfigValue(
- const wchar_t* name
- );
-
- // Free a string ConfigValue returned by the runtime.
- // JITs using the getStringConfigValue query are required
- // to return the string values to the runtime for deletion.
- // This avoids leaking the memory in the JIT.
- void freeStringConfigValue(
- const wchar_t* value
- );
+// Allocate memory of the given size in bytes. All bytes of the returned block
+// must be initialized to zero. If `usePageAllocator` is true, the implementation
+// should use an allocator that deals in OS pages if one exists.
+void* allocateMemory(size_t size, bool usePageAllocator = false);
+
+// Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`. The
+// value of the `usePageAllocator` parameter must match the value that was
+// provided to the call to used to allocate the memory.
+void freeMemory(void* block, bool usePageAllocator = false);
+
+// Return an integer config value for the given key, if any exists.
+int getIntConfigValue(const wchar_t* name, int defaultValue);
+
+// Return a string config value for the given key, if any exists.
+const wchar_t* getStringConfigValue(const wchar_t* name);
+
+// Free a string ConfigValue returned by the runtime.
+// JITs using the getStringConfigValue query are required
+// to return the string values to the runtime for deletion.
+// This avoids leaking the memory in the JIT.
+void freeStringConfigValue(const wchar_t* value);
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
index 0c5b269899..19feffab47 100644
--- a/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
+++ b/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
@@ -16,791 +16,627 @@
// against the interface declaration.
public:
- /**********************************************************************************/
- //
- // ICorMethodInfo
- //
- /**********************************************************************************/
-
- // return flags (defined above, CORINFO_FLG_PUBLIC ...)
- DWORD getMethodAttribs (
- CORINFO_METHOD_HANDLE ftn /* IN */
- );
-
- // sets private JIT flags, which can be, retrieved using getAttrib.
- void setMethodAttribs (
- CORINFO_METHOD_HANDLE ftn, /* IN */
- CorInfoMethodRuntimeFlags attribs /* IN */
- );
-
- // Given a method descriptor ftnHnd, extract signature information into sigInfo
- //
- // 'memberParent' is typically only set when verifying. It should be the
- // result of calling getMemberParent.
- void getMethodSig (
- CORINFO_METHOD_HANDLE ftn, /* IN */
- CORINFO_SIG_INFO *sig, /* OUT */
- CORINFO_CLASS_HANDLE memberParent = NULL /* IN */
- );
+/**********************************************************************************/
+//
+// ICorMethodInfo
+//
+/**********************************************************************************/
- /*********************************************************************
- * Note the following methods can only be used on functions known
- * to be IL. This includes the method being compiled and any method
- * that 'getMethodInfo' returns true for
- *********************************************************************/
-
- // return information about a method private to the implementation
- // returns false if method is not IL, or is otherwise unavailable.
- // This method is used to fetch data needed to inline functions
- bool getMethodInfo (
- CORINFO_METHOD_HANDLE ftn, /* IN */
- CORINFO_METHOD_INFO* info /* OUT */
- );
-
- // Decides if you have any limitations for inlining. If everything's OK, it will return
- // INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this
- // function must respect. If caller passes pRestrictions = NULL, if there are any restrictions
- // INLINE_FAIL will be returned
- //
- // The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)
- //
- // The inlined method need not be verified
-
- CorInfoInline canInline (
- CORINFO_METHOD_HANDLE callerHnd, /* IN */
- CORINFO_METHOD_HANDLE calleeHnd, /* IN */
- DWORD* pRestrictions /* OUT */
- );
-
- // Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all
- // inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the
- // JIT.
- void reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd,
- CORINFO_METHOD_HANDLE inlineeHnd,
- CorInfoInline inlineResult,
- const char * reason);
-
-
- // Returns false if the call is across security boundaries thus we cannot tailcall
- //
- // The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)
- bool canTailCall (
- CORINFO_METHOD_HANDLE callerHnd, /* IN */
- CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */
- CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */
- bool fIsTailPrefix /* IN */
- );
-
- // Reports whether or not a method can be tail called, and why.
- // canTailCall is responsible for reporting all results when it returns
- // false. All other results are reported by the JIT.
- void reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd,
- CORINFO_METHOD_HANDLE calleeHnd,
- bool fIsTailPrefix,
- CorInfoTailCall tailCallResult,
- const char * reason);
-
- // get individual exception handler
- void getEHinfo(
- CORINFO_METHOD_HANDLE ftn, /* IN */
- unsigned EHnumber, /* IN */
- CORINFO_EH_CLAUSE* clause /* OUT */
- );
-
- // return class it belongs to
- CORINFO_CLASS_HANDLE getMethodClass (
- CORINFO_METHOD_HANDLE method
- );
-
- // return module it belongs to
- CORINFO_MODULE_HANDLE getMethodModule (
- CORINFO_METHOD_HANDLE method
- );
-
- // This function returns the offset of the specified method in the
- // vtable of it's owning class or interface.
- void getMethodVTableOffset (
- CORINFO_METHOD_HANDLE method, /* IN */
- unsigned* offsetOfIndirection, /* OUT */
- unsigned* offsetAfterIndirection /* OUT */
- );
-
- // Find the virtual method in implementingClass that overrides virtualMethod.
- // Return null if devirtualization is not possible.
- CORINFO_METHOD_HANDLE resolveVirtualMethod(
- CORINFO_METHOD_HANDLE virtualMethod,
- CORINFO_CLASS_HANDLE implementingClass,
- CORINFO_CONTEXT_HANDLE ownerType
- );
-
- // If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
- // getIntrinsicID() returns the intrinsic ID.
- // *pMustExpand tells whether or not JIT must expand the intrinsic.
- CorInfoIntrinsics getIntrinsicID(
- CORINFO_METHOD_HANDLE method,
- bool* pMustExpand = NULL /* OUT */
- );
-
- // Is the given module the System.Numerics.Vectors module?
- // This defaults to false.
- bool isInSIMDModule(
- CORINFO_CLASS_HANDLE classHnd
- ); /* { return false; } */
-
- // return the unmanaged calling convention for a PInvoke
- CorInfoUnmanagedCallConv getUnmanagedCallConv(
- CORINFO_METHOD_HANDLE method
- );
-
- // return if any marshaling is required for PInvoke methods. Note that
- // method == 0 => calli. The call site sig is only needed for the varargs or calli case
- BOOL pInvokeMarshalingRequired(
- CORINFO_METHOD_HANDLE method,
- CORINFO_SIG_INFO* callSiteSig
- );
-
- // Check constraints on method type arguments (only).
- // The parent class should be checked separately using satisfiesClassConstraints(parent).
- BOOL satisfiesMethodConstraints(
- CORINFO_CLASS_HANDLE parent, // the exact parent of the method
- CORINFO_METHOD_HANDLE method
- );
-
- // Given a delegate target class, a target method parent class, a target method,
- // a delegate class, check if the method signature is compatible with the Invoke method of the delegate
- // (under the typical instantiation of any free type variables in the memberref signatures).
- BOOL isCompatibleDelegate(
- CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */
- CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */
- CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */
- CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */
- BOOL *pfIsOpenDelegate /* is the delegate open */
- );
-
- // Determines whether the delegate creation obeys security transparency rules
- BOOL isDelegateCreationAllowed (
- CORINFO_CLASS_HANDLE delegateHnd,
- CORINFO_METHOD_HANDLE calleeHnd
- );
-
-
- // Indicates if the method is an instance of the generic
- // method that passes (or has passed) verification
- CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric (
- CORINFO_METHOD_HANDLE method /* IN */
- );
-
- // Loads the constraints on a typical method definition, detecting cycles;
- // for use in verification.
- void initConstraintsForVerification(
- CORINFO_METHOD_HANDLE method, /* IN */
- BOOL *pfHasCircularClassConstraints, /* OUT */
- BOOL *pfHasCircularMethodConstraint /* OUT */
- );
-
- // Returns enum whether the method does not require verification
- // Also see ICorModuleInfo::canSkipVerification
- CorInfoCanSkipVerificationResult canSkipMethodVerification (
- CORINFO_METHOD_HANDLE ftnHandle
- );
-
- // load and restore the method
- void methodMustBeLoadedBeforeCodeIsRun(
- CORINFO_METHOD_HANDLE method
- );
-
- CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(
- CORINFO_METHOD_HANDLE method
- );
-
- // Returns the global cookie for the /GS unsafe buffer checks
- // The cookie might be a constant value (JIT), or a handle to memory location (Ngen)
- void getGSCookie(
- GSCookie * pCookieVal, // OUT
- GSCookie ** ppCookieVal // OUT
- );
-
- /**********************************************************************************/
- //
- // ICorModuleInfo
- //
- /**********************************************************************************/
-
- // Resolve metadata token into runtime method handles. This function may not
- // return normally (e.g. it may throw) if it encounters invalid metadata or other
- // failures during token resolution.
- void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
-
- // Attempt to resolve a metadata token into a runtime method handle. Returns true
- // if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata
- // during token reoslution). This method should be used instead of `resolveToken` in
- // situations that need to be resilient to invalid metadata.
- bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken);
-
- // Signature information about the call sig
- void findSig (
- CORINFO_MODULE_HANDLE module, /* IN */
- unsigned sigTOK, /* IN */
- CORINFO_CONTEXT_HANDLE context, /* IN */
- CORINFO_SIG_INFO *sig /* OUT */
- );
-
- // for Varargs, the signature at the call site may differ from
- // the signature at the definition. Thus we need a way of
- // fetching the call site information
- void findCallSiteSig (
- CORINFO_MODULE_HANDLE module, /* IN */
- unsigned methTOK, /* IN */
- CORINFO_CONTEXT_HANDLE context, /* IN */
- CORINFO_SIG_INFO *sig /* OUT */
- );
-
- CORINFO_CLASS_HANDLE getTokenTypeAsHandle (
- CORINFO_RESOLVED_TOKEN * pResolvedToken /* IN */);
-
- // Returns true if the module does not require verification
- //
- // If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
- // module does not currently require verification in the current AppDomain.
- // This decision could change in the future, and so should not be cached.
- // If it is cached, it should only be used as a hint.
- // This is only used by ngen for calculating certain hints.
- //
-
- // Returns enum whether the module does not require verification
- // Also see ICorMethodInfo::canSkipMethodVerification();
- CorInfoCanSkipVerificationResult canSkipVerification (
- CORINFO_MODULE_HANDLE module /* IN */
- );
-
- // Checks if the given metadata token is valid
- BOOL isValidToken (
- CORINFO_MODULE_HANDLE module, /* IN */
- unsigned metaTOK /* IN */
- );
-
- // Checks if the given metadata token is valid StringRef
- BOOL isValidStringRef (
- CORINFO_MODULE_HANDLE module, /* IN */
- unsigned metaTOK /* IN */
- );
-
- BOOL shouldEnforceCallvirtRestriction(
- CORINFO_MODULE_HANDLE scope
- );
-
- /**********************************************************************************/
- //
- // ICorClassInfo
- //
- /**********************************************************************************/
-
- // If the value class 'cls' is isomorphic to a primitive type it will
- // return that type, otherwise it will return CORINFO_TYPE_VALUECLASS
- CorInfoType asCorInfoType (
- CORINFO_CLASS_HANDLE cls
- );
-
- // for completeness
- const char* getClassName (
- CORINFO_CLASS_HANDLE cls
- );
-
-
- // Append a (possibly truncated) representation of the type cls to the preallocated buffer ppBuf of length pnBufLen
- // If fNamespace=TRUE, include the namespace/enclosing classes
- // If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
- // If fAssembly=TRUE, suffix with a comma and the full assembly qualification
- // return size of representation
- int appendClassName(
- __deref_inout_ecount(*pnBufLen) WCHAR** ppBuf,
- int* pnBufLen,
- CORINFO_CLASS_HANDLE cls,
- BOOL fNamespace,
- BOOL fFullInst,
- BOOL fAssembly
- );
-
- // Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) & CORINFO_FLG_VALUECLASS, except faster.
- BOOL isValueClass(CORINFO_CLASS_HANDLE cls);
-
- // If this method returns true, JIT will do optimization to inline the check for
- // GetTypeFromHandle(handle) == obj.GetType()
- BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls);
-
- // return flags (defined above, CORINFO_FLG_PUBLIC ...)
- DWORD getClassAttribs (
- CORINFO_CLASS_HANDLE cls
- );
-
- // Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
- // of this type must be stack-allocated. This will generally be true only if the struct
- // contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
- // an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
- // returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
- // buffers do not require GC write barriers.
- BOOL isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls);
-
- CORINFO_MODULE_HANDLE getClassModule (
- CORINFO_CLASS_HANDLE cls
- );
-
- // Returns the assembly that contains the module "mod".
- CORINFO_ASSEMBLY_HANDLE getModuleAssembly (
- CORINFO_MODULE_HANDLE mod
- );
-
- // Returns the name of the assembly "assem".
- const char* getAssemblyName (
- CORINFO_ASSEMBLY_HANDLE assem
- );
-
- // Allocate and delete process-lifetime objects. Should only be
- // referred to from static fields, lest a leak occur.
- // Note that "LongLifetimeFree" does not execute destructors, if "obj"
- // is an array of a struct type with a destructor.
- void* LongLifetimeMalloc(size_t sz);
- void LongLifetimeFree(void* obj);
-
- size_t getClassModuleIdForStatics (
- CORINFO_CLASS_HANDLE cls,
- CORINFO_MODULE_HANDLE *pModule,
- void **ppIndirection
- );
-
- // return the number of bytes needed by an instance of the class
- unsigned getClassSize (
- CORINFO_CLASS_HANDLE cls
- );
-
- unsigned getClassAlignmentRequirement (
- CORINFO_CLASS_HANDLE cls,
- BOOL fDoubleAlignHint = FALSE
- );
-
- // This is only called for Value classes. It returns a boolean array
- // in representing of 'cls' from a GC perspective. The class is
- // assumed to be an array of machine words
- // (of length // getClassSize(cls) / sizeof(void*)),
- // 'gcPtrs' is a pointer to an array of BYTEs of this length.
- // getClassGClayout fills in this array so that gcPtrs[i] is set
- // to one of the CorInfoGCType values which is the GC type of
- // the i-th machine word of an object of type 'cls'
- // returns the number of GC pointers in the array
- unsigned getClassGClayout (
- CORINFO_CLASS_HANDLE cls, /* IN */
- BYTE *gcPtrs /* OUT */
- );
-
- // returns the number of instance fields in a class
- unsigned getClassNumInstanceFields (
- CORINFO_CLASS_HANDLE cls /* IN */
- );
-
- CORINFO_FIELD_HANDLE getFieldInClass(
- CORINFO_CLASS_HANDLE clsHnd,
- INT num
- );
-
- BOOL checkMethodModifier(
- CORINFO_METHOD_HANDLE hMethod,
- LPCSTR modifier,
- BOOL fOptional
- );
-
- // returns the "NEW" helper optimized for "newCls."
- CorInfoHelpFunc getNewHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle
- );
-
- // returns the newArr (1-Dim array) helper optimized for "arrayCls."
- CorInfoHelpFunc getNewArrHelper(
- CORINFO_CLASS_HANDLE arrayCls
- );
-
- // returns the optimized "IsInstanceOf" or "ChkCast" helper
- CorInfoHelpFunc getCastingHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- bool fThrowing
- );
-
- // returns helper to trigger static constructor
- CorInfoHelpFunc getSharedCCtorHelper(
- CORINFO_CLASS_HANDLE clsHnd
- );
-
- CorInfoHelpFunc getSecurityPrologHelper(
- CORINFO_METHOD_HANDLE ftn
- );
-
- // This is not pretty. Boxing nullable<T> actually returns
- // a boxed<T> not a boxed Nullable<T>. This call allows the verifier
- // to call back to the EE on the 'box' instruction and get the transformed
- // type to use for verification.
- CORINFO_CLASS_HANDLE getTypeForBox(
- CORINFO_CLASS_HANDLE cls
- );
-
- // returns the correct box helper for a particular class. Note
- // that if this returns CORINFO_HELP_BOX, the JIT can assume
- // 'standard' boxing (allocate object and copy), and optimize
- CorInfoHelpFunc getBoxHelper(
- CORINFO_CLASS_HANDLE cls
- );
-
- // returns the unbox helper. If 'helperCopies' points to a true
- // value it means the JIT is requesting a helper that unboxes the
- // value into a particular location and thus has the signature
- // void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
- // Otherwise (it is null or points at a FALSE value) it is requesting
- // a helper that returns a pointer to the unboxed data
- // void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
- // The EE has the option of NOT returning the copy style helper
- // (But must be able to always honor the non-copy style helper)
- // The EE set 'helperCopies' on return to indicate what kind of
- // helper has been created.
-
- CorInfoHelpFunc getUnBoxHelper(
- CORINFO_CLASS_HANDLE cls
- );
-
- bool getReadyToRunHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_LOOKUP_KIND * pGenericLookupKind,
- CorInfoHelpFunc id,
- CORINFO_CONST_LOOKUP * pLookup
- );
-
- void getReadyToRunDelegateCtorHelper(
- CORINFO_RESOLVED_TOKEN * pTargetMethod,
- CORINFO_CLASS_HANDLE delegateType,
- CORINFO_LOOKUP * pLookup
- );
-
- const char* getHelperName(
- CorInfoHelpFunc
- );
-
- // This function tries to initialize the class (run the class constructor).
- // this function returns whether the JIT must insert helper calls before
- // accessing static field or method.
- //
- // See code:ICorClassInfo#ClassConstruction.
- CorInfoInitClassResult initClass(
- CORINFO_FIELD_HANDLE field, // Non-NULL - inquire about cctor trigger before static field access
- // NULL - inquire about cctor trigger in method prolog
- CORINFO_METHOD_HANDLE method, // Method referencing the field or prolog
- CORINFO_CONTEXT_HANDLE context, // Exact context of method
- BOOL speculative = FALSE // TRUE means don't actually run it
- );
-
- // This used to be called "loadClass". This records the fact
- // that the class must be loaded (including restored if necessary) before we execute the
- // code that we are currently generating. When jitting code
- // the function loads the class immediately. When zapping code
- // the zapper will if necessary use the call to record the fact that we have
- // to do a fixup/restore before running the method currently being generated.
- //
- // This is typically used to ensure value types are loaded before zapped
- // code that manipulates them is executed, so that the GC can access information
- // about those value types.
- void classMustBeLoadedBeforeCodeIsRun(
- CORINFO_CLASS_HANDLE cls
- );
-
- // returns the class handle for the special builtin classes
- CORINFO_CLASS_HANDLE getBuiltinClass (
- CorInfoClassId classId
- );
-
- // "System.Int32" ==> CORINFO_TYPE_INT..
- CorInfoType getTypeForPrimitiveValueClass(
- CORINFO_CLASS_HANDLE cls
- );
-
- // TRUE if child is a subtype of parent
- // if parent is an interface, then does child implement / extend parent
- BOOL canCast(
- CORINFO_CLASS_HANDLE child, // subtype (extends parent)
- CORINFO_CLASS_HANDLE parent // base type
- );
-
- // TRUE if cls1 and cls2 are considered equivalent types.
- BOOL areTypesEquivalent(
- CORINFO_CLASS_HANDLE cls1,
- CORINFO_CLASS_HANDLE cls2
- );
-
- // returns is the intersection of cls1 and cls2.
- CORINFO_CLASS_HANDLE mergeClasses(
- CORINFO_CLASS_HANDLE cls1,
- CORINFO_CLASS_HANDLE cls2
- );
-
- // Given a class handle, returns the Parent type.
- // For COMObjectType, it returns Class Handle of System.Object.
- // Returns 0 if System.Object is passed in.
- CORINFO_CLASS_HANDLE getParentType (
- CORINFO_CLASS_HANDLE cls
- );
-
- // Returns the CorInfoType of the "child type". If the child type is
- // not a primitive type, *clsRet will be set.
- // Given an Array of Type Foo, returns Foo.
- // Given BYREF Foo, returns Foo
- CorInfoType getChildType (
- CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_CLASS_HANDLE *clsRet
- );
-
- // Check constraints on type arguments of this class and parent classes
- BOOL satisfiesClassConstraints(
- CORINFO_CLASS_HANDLE cls
- );
-
- // Check if this is a single dimensional array type
- BOOL isSDArray(
- CORINFO_CLASS_HANDLE cls
- );
-
- // Get the numbmer of dimensions in an array
- unsigned getArrayRank(
- CORINFO_CLASS_HANDLE cls
- );
-
- // Get static field data for an array
- void * getArrayInitializationData(
- CORINFO_FIELD_HANDLE field,
- DWORD size
- );
-
- // Check Visibility rules.
- CorInfoIsAccessAllowedResult canAccessClass(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_HELPER_DESC *pAccessHelper /* If canAccessMethod returns something other
- than ALLOWED, then this is filled in. */
- );
+// return flags (defined above, CORINFO_FLG_PUBLIC ...)
+DWORD getMethodAttribs(CORINFO_METHOD_HANDLE ftn /* IN */
+ );
- /**********************************************************************************/
- //
- // ICorFieldInfo
- //
- /**********************************************************************************/
-
- // this function is for debugging only. It returns the field name
- // and if 'moduleName' is non-null, it sets it to something that will
- // says which method (a class name, or a module name)
- const char* getFieldName (
- CORINFO_FIELD_HANDLE ftn, /* IN */
- const char **moduleName /* OUT */
- );
+// sets private JIT flags, which can be, retrieved using getAttrib.
+void setMethodAttribs(CORINFO_METHOD_HANDLE ftn, /* IN */
+ CorInfoMethodRuntimeFlags attribs /* IN */
+ );
- // return class it belongs to
- CORINFO_CLASS_HANDLE getFieldClass (
- CORINFO_FIELD_HANDLE field
- );
+// Given a method descriptor ftnHnd, extract signature information into sigInfo
+//
+// 'memberParent' is typically only set when verifying. It should be the
+// result of calling getMemberParent.
+void getMethodSig(CORINFO_METHOD_HANDLE ftn, /* IN */
+ CORINFO_SIG_INFO* sig, /* OUT */
+ CORINFO_CLASS_HANDLE memberParent = NULL /* IN */
+ );
+
+/*********************************************************************
+ * Note the following methods can only be used on functions known
+ * to be IL. This includes the method being compiled and any method
+ * that 'getMethodInfo' returns true for
+ *********************************************************************/
+
+// return information about a method private to the implementation
+// returns false if method is not IL, or is otherwise unavailable.
+// This method is used to fetch data needed to inline functions
+bool getMethodInfo(CORINFO_METHOD_HANDLE ftn, /* IN */
+ CORINFO_METHOD_INFO* info /* OUT */
+ );
+
+// Decides if you have any limitations for inlining. If everything's OK, it will return
+// INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this
+// function must respect. If caller passes pRestrictions = NULL, if there are any restrictions
+// INLINE_FAIL will be returned
+//
+// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)
+//
+// The inlined method need not be verified
- // Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set
- // the field's value class (if 'structType' == 0, then don't bother
- // the structure info).
- //
- // 'memberParent' is typically only set when verifying. It should be the
- // result of calling getMemberParent.
- CorInfoType getFieldType(
- CORINFO_FIELD_HANDLE field,
- CORINFO_CLASS_HANDLE *structType,
- CORINFO_CLASS_HANDLE memberParent = NULL /* IN */
+CorInfoInline canInline(CORINFO_METHOD_HANDLE callerHnd, /* IN */
+ CORINFO_METHOD_HANDLE calleeHnd, /* IN */
+ DWORD* pRestrictions /* OUT */
);
- // return the data member's instance offset
- unsigned getFieldOffset(
- CORINFO_FIELD_HANDLE field
- );
+// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all
+// inlining results when it returns INLINE_FAIL and INLINE_NEVER. All other results are reported by the
+// JIT.
+void reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd,
+ CORINFO_METHOD_HANDLE inlineeHnd,
+ CorInfoInline inlineResult,
+ const char* reason);
+
+// Returns false if the call is across security boundaries thus we cannot tailcall
+//
+// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)
+bool canTailCall(CORINFO_METHOD_HANDLE callerHnd, /* IN */
+ CORINFO_METHOD_HANDLE declaredCalleeHnd, /* IN */
+ CORINFO_METHOD_HANDLE exactCalleeHnd, /* IN */
+ bool fIsTailPrefix /* IN */
+ );
+
+// Reports whether or not a method can be tail called, and why.
+// canTailCall is responsible for reporting all results when it returns
+// false. All other results are reported by the JIT.
+void reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ bool fIsTailPrefix,
+ CorInfoTailCall tailCallResult,
+ const char* reason);
+
+// get individual exception handler
+void getEHinfo(CORINFO_METHOD_HANDLE ftn, /* IN */
+ unsigned EHnumber, /* IN */
+ CORINFO_EH_CLAUSE* clause /* OUT */
+ );
+
+// return class it belongs to
+CORINFO_CLASS_HANDLE getMethodClass(CORINFO_METHOD_HANDLE method);
+
+// return module it belongs to
+CORINFO_MODULE_HANDLE getMethodModule(CORINFO_METHOD_HANDLE method);
+
+// This function returns the offset of the specified method in the
+// vtable of it's owning class or interface.
+void getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
+ unsigned* offsetOfIndirection, /* OUT */
+ unsigned* offsetAfterIndirection /* OUT */
+ );
+
+// Find the virtual method in implementingClass that overrides virtualMethod.
+// Return null if devirtualization is not possible.
+CORINFO_METHOD_HANDLE resolveVirtualMethod(CORINFO_METHOD_HANDLE virtualMethod,
+ CORINFO_CLASS_HANDLE implementingClass,
+ CORINFO_CONTEXT_HANDLE ownerType);
+
+// If a method's attributes have (getMethodAttribs) CORINFO_FLG_INTRINSIC set,
+// getIntrinsicID() returns the intrinsic ID.
+// *pMustExpand tells whether or not JIT must expand the intrinsic.
+CorInfoIntrinsics getIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand = NULL /* OUT */
+ );
+
+// Is the given module the System.Numerics.Vectors module?
+// This defaults to false.
+bool isInSIMDModule(CORINFO_CLASS_HANDLE classHnd); /* { return false; } */
+
+// return the unmanaged calling convention for a PInvoke
+CorInfoUnmanagedCallConv getUnmanagedCallConv(CORINFO_METHOD_HANDLE method);
+
+// return if any marshaling is required for PInvoke methods. Note that
+// method == 0 => calli. The call site sig is only needed for the varargs or calli case
+BOOL pInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig);
+
+// Check constraints on method type arguments (only).
+// The parent class should be checked separately using satisfiesClassConstraints(parent).
+BOOL satisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, // the exact parent of the method
+ CORINFO_METHOD_HANDLE method);
+
+// Given a delegate target class, a target method parent class, a target method,
+// a delegate class, check if the method signature is compatible with the Invoke method of the delegate
+// (under the typical instantiation of any free type variables in the memberref signatures).
+BOOL isCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, /* type of the delegate target, if any */
+ CORINFO_CLASS_HANDLE methodParentCls, /* exact parent of the target method, if any */
+ CORINFO_METHOD_HANDLE method, /* (representative) target method, if any */
+ CORINFO_CLASS_HANDLE delegateCls, /* exact type of the delegate */
+ BOOL* pfIsOpenDelegate /* is the delegate open */
+ );
+
+// Determines whether the delegate creation obeys security transparency rules
+BOOL isDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd);
+
+// Indicates if the method is an instance of the generic
+// method that passes (or has passed) verification
+CorInfoInstantiationVerification isInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method /* IN */
+ );
+
+// Loads the constraints on a typical method definition, detecting cycles;
+// for use in verification.
+void initConstraintsForVerification(CORINFO_METHOD_HANDLE method, /* IN */
+ BOOL* pfHasCircularClassConstraints, /* OUT */
+ BOOL* pfHasCircularMethodConstraint /* OUT */
+ );
+
+// Returns enum whether the method does not require verification
+// Also see ICorModuleInfo::canSkipVerification
+CorInfoCanSkipVerificationResult canSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle);
+
+// load and restore the method
+void methodMustBeLoadedBeforeCodeIsRun(CORINFO_METHOD_HANDLE method);
+
+CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(CORINFO_METHOD_HANDLE method);
+
+// Returns the global cookie for the /GS unsafe buffer checks
+// The cookie might be a constant value (JIT), or a handle to memory location (Ngen)
+void getGSCookie(GSCookie* pCookieVal, // OUT
+ GSCookie** ppCookieVal // OUT
+ );
+
+/**********************************************************************************/
+//
+// ICorModuleInfo
+//
+/**********************************************************************************/
+
+// Resolve metadata token into runtime method handles. This function may not
+// return normally (e.g. it may throw) if it encounters invalid metadata or other
+// failures during token resolution.
+void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken);
+
+// Attempt to resolve a metadata token into a runtime method handle. Returns true
+// if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata
+// during token reoslution). This method should be used instead of `resolveToken` in
+// situations that need to be resilient to invalid metadata.
+bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken);
+
+// Signature information about the call sig
+void findSig(CORINFO_MODULE_HANDLE module, /* IN */
+ unsigned sigTOK, /* IN */
+ CORINFO_CONTEXT_HANDLE context, /* IN */
+ CORINFO_SIG_INFO* sig /* OUT */
+ );
+
+// for Varargs, the signature at the call site may differ from
+// the signature at the definition. Thus we need a way of
+// fetching the call site information
+void findCallSiteSig(CORINFO_MODULE_HANDLE module, /* IN */
+ unsigned methTOK, /* IN */
+ CORINFO_CONTEXT_HANDLE context, /* IN */
+ CORINFO_SIG_INFO* sig /* OUT */
+ );
- // TODO: jit64 should be switched to the same plan as the i386 jits - use
- // getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
- // The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
- bool isWriteBarrierHelperRequired(
- CORINFO_FIELD_HANDLE field);
+CORINFO_CLASS_HANDLE getTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken /* IN */);
+
+// Returns true if the module does not require verification
+//
+// If fQuickCheckOnlyWithoutCommit=TRUE, the function only checks that the
+// module does not currently require verification in the current AppDomain.
+// This decision could change in the future, and so should not be cached.
+// If it is cached, it should only be used as a hint.
+// This is only used by ngen for calculating certain hints.
+//
+
+// Returns enum whether the module does not require verification
+// Also see ICorMethodInfo::canSkipMethodVerification();
+CorInfoCanSkipVerificationResult canSkipVerification(CORINFO_MODULE_HANDLE module /* IN */
+ );
+
+// Checks if the given metadata token is valid
+BOOL isValidToken(CORINFO_MODULE_HANDLE module, /* IN */
+ unsigned metaTOK /* IN */
+ );
+
+// Checks if the given metadata token is valid StringRef
+BOOL isValidStringRef(CORINFO_MODULE_HANDLE module, /* IN */
+ unsigned metaTOK /* IN */
+ );
+
+BOOL shouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope);
+
+/**********************************************************************************/
+//
+// ICorClassInfo
+//
+/**********************************************************************************/
+
+// If the value class 'cls' is isomorphic to a primitive type it will
+// return that type, otherwise it will return CORINFO_TYPE_VALUECLASS
+CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE cls);
+
+// for completeness
+const char* getClassName(CORINFO_CLASS_HANDLE cls);
+
+// Append a (possibly truncated) representation of the type cls to the preallocated buffer ppBuf of length pnBufLen
+// If fNamespace=TRUE, include the namespace/enclosing classes
+// If fFullInst=TRUE (regardless of fNamespace and fAssembly), include namespace and assembly for any type parameters
+// If fAssembly=TRUE, suffix with a comma and the full assembly qualification
+// return size of representation
+int appendClassName(__deref_inout_ecount(*pnBufLen) WCHAR** ppBuf,
+ int* pnBufLen,
+ CORINFO_CLASS_HANDLE cls,
+ BOOL fNamespace,
+ BOOL fFullInst,
+ BOOL fAssembly);
+
+// Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) &
+// CORINFO_FLG_VALUECLASS, except faster.
+BOOL isValueClass(CORINFO_CLASS_HANDLE cls);
+
+// If this method returns true, JIT will do optimization to inline the check for
+// GetTypeFromHandle(handle) == obj.GetType()
+BOOL canInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls);
+
+// return flags (defined above, CORINFO_FLG_PUBLIC ...)
+DWORD getClassAttribs(CORINFO_CLASS_HANDLE cls);
+
+// Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value
+// of this type must be stack-allocated. This will generally be true only if the struct
+// contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows
+// an optimization: the JIT may assume that return buffer pointers for return types for which this predicate
+// returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return
+// buffers do not require GC write barriers.
+BOOL isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls);
+
+CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE cls);
+
+// Returns the assembly that contains the module "mod".
+CORINFO_ASSEMBLY_HANDLE getModuleAssembly(CORINFO_MODULE_HANDLE mod);
+
+// Returns the name of the assembly "assem".
+const char* getAssemblyName(CORINFO_ASSEMBLY_HANDLE assem);
+
+// Allocate and delete process-lifetime objects. Should only be
+// referred to from static fields, lest a leak occur.
+// Note that "LongLifetimeFree" does not execute destructors, if "obj"
+// is an array of a struct type with a destructor.
+void* LongLifetimeMalloc(size_t sz);
+void LongLifetimeFree(void* obj);
+
+size_t getClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE* pModule, void** ppIndirection);
+
+// return the number of bytes needed by an instance of the class
+unsigned getClassSize(CORINFO_CLASS_HANDLE cls);
+
+unsigned getClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint = FALSE);
+
+// This is only called for Value classes. It returns a boolean array
+// in representing of 'cls' from a GC perspective. The class is
+// assumed to be an array of machine words
+// (of length // getClassSize(cls) / sizeof(void*)),
+// 'gcPtrs' is a pointer to an array of BYTEs of this length.
+// getClassGClayout fills in this array so that gcPtrs[i] is set
+// to one of the CorInfoGCType values which is the GC type of
+// the i-th machine word of an object of type 'cls'
+// returns the number of GC pointers in the array
+unsigned getClassGClayout(CORINFO_CLASS_HANDLE cls, /* IN */
+ BYTE* gcPtrs /* OUT */
+ );
+
+// returns the number of instance fields in a class
+unsigned getClassNumInstanceFields(CORINFO_CLASS_HANDLE cls /* IN */
+ );
+
+CORINFO_FIELD_HANDLE getFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num);
+
+BOOL checkMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional);
+
+// returns the "NEW" helper optimized for "newCls."
+CorInfoHelpFunc getNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_HANDLE callerHandle);
+
+// returns the newArr (1-Dim array) helper optimized for "arrayCls."
+CorInfoHelpFunc getNewArrHelper(CORINFO_CLASS_HANDLE arrayCls);
+
+// returns the optimized "IsInstanceOf" or "ChkCast" helper
+CorInfoHelpFunc getCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing);
+
+// returns helper to trigger static constructor
+CorInfoHelpFunc getSharedCCtorHelper(CORINFO_CLASS_HANDLE clsHnd);
+
+CorInfoHelpFunc getSecurityPrologHelper(CORINFO_METHOD_HANDLE ftn);
+
+// This is not pretty. Boxing nullable<T> actually returns
+// a boxed<T> not a boxed Nullable<T>. This call allows the verifier
+// to call back to the EE on the 'box' instruction and get the transformed
+// type to use for verification.
+CORINFO_CLASS_HANDLE getTypeForBox(CORINFO_CLASS_HANDLE cls);
+
+// returns the correct box helper for a particular class. Note
+// that if this returns CORINFO_HELP_BOX, the JIT can assume
+// 'standard' boxing (allocate object and copy), and optimize
+CorInfoHelpFunc getBoxHelper(CORINFO_CLASS_HANDLE cls);
+
+// returns the unbox helper. If 'helperCopies' points to a true
+// value it means the JIT is requesting a helper that unboxes the
+// value into a particular location and thus has the signature
+// void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)
+// Otherwise (it is null or points at a FALSE value) it is requesting
+// a helper that returns a pointer to the unboxed data
+// void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)
+// The EE has the option of NOT returning the copy style helper
+// (But must be able to always honor the non-copy style helper)
+// The EE set 'helperCopies' on return to indicate what kind of
+// helper has been created.
+
+CorInfoHelpFunc getUnBoxHelper(CORINFO_CLASS_HANDLE cls);
+
+bool getReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_LOOKUP_KIND* pGenericLookupKind,
+ CorInfoHelpFunc id,
+ CORINFO_CONST_LOOKUP* pLookup);
+
+void getReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod,
+ CORINFO_CLASS_HANDLE delegateType,
+ CORINFO_LOOKUP* pLookup);
+
+const char* getHelperName(CorInfoHelpFunc);
+
+// This function tries to initialize the class (run the class constructor).
+// this function returns whether the JIT must insert helper calls before
+// accessing static field or method.
+//
+// See code:ICorClassInfo#ClassConstruction.
+CorInfoInitClassResult initClass(CORINFO_FIELD_HANDLE field, // Non-NULL - inquire about cctor trigger before static
+ // field access NULL - inquire about cctor trigger in
+ // method prolog
+ CORINFO_METHOD_HANDLE method, // Method referencing the field or prolog
+ CORINFO_CONTEXT_HANDLE context, // Exact context of method
+ BOOL speculative = FALSE // TRUE means don't actually run it
+ );
+
+// This used to be called "loadClass". This records the fact
+// that the class must be loaded (including restored if necessary) before we execute the
+// code that we are currently generating. When jitting code
+// the function loads the class immediately. When zapping code
+// the zapper will if necessary use the call to record the fact that we have
+// to do a fixup/restore before running the method currently being generated.
+//
+// This is typically used to ensure value types are loaded before zapped
+// code that manipulates them is executed, so that the GC can access information
+// about those value types.
+void classMustBeLoadedBeforeCodeIsRun(CORINFO_CLASS_HANDLE cls);
+
+// returns the class handle for the special builtin classes
+CORINFO_CLASS_HANDLE getBuiltinClass(CorInfoClassId classId);
+
+// "System.Int32" ==> CORINFO_TYPE_INT..
+CorInfoType getTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE cls);
+
+// TRUE if child is a subtype of parent
+// if parent is an interface, then does child implement / extend parent
+BOOL canCast(CORINFO_CLASS_HANDLE child, // subtype (extends parent)
+ CORINFO_CLASS_HANDLE parent // base type
+ );
- void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_ACCESS_FLAGS flags,
- CORINFO_FIELD_INFO *pResult
+// TRUE if cls1 and cls2 are considered equivalent types.
+BOOL areTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2);
+
+// returns is the intersection of cls1 and cls2.
+CORINFO_CLASS_HANDLE mergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2);
+
+// Given a class handle, returns the Parent type.
+// For COMObjectType, it returns Class Handle of System.Object.
+// Returns 0 if System.Object is passed in.
+CORINFO_CLASS_HANDLE getParentType(CORINFO_CLASS_HANDLE cls);
+
+// Returns the CorInfoType of the "child type". If the child type is
+// not a primitive type, *clsRet will be set.
+// Given an Array of Type Foo, returns Foo.
+// Given BYREF Foo, returns Foo
+CorInfoType getChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet);
+
+// Check constraints on type arguments of this class and parent classes
+BOOL satisfiesClassConstraints(CORINFO_CLASS_HANDLE cls);
+
+// Check if this is a single dimensional array type
+BOOL isSDArray(CORINFO_CLASS_HANDLE cls);
+
+// Get the numbmer of dimensions in an array
+unsigned getArrayRank(CORINFO_CLASS_HANDLE cls);
+
+// Get static field data for an array
+void* getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size);
+
+// Check Visibility rules.
+CorInfoIsAccessAllowedResult canAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_HELPER_DESC* pAccessHelper /* If canAccessMethod returns something
+ other than ALLOWED, then this is
+ filled in. */
+ );
+
+/**********************************************************************************/
+//
+// ICorFieldInfo
+//
+/**********************************************************************************/
+
+// this function is for debugging only. It returns the field name
+// and if 'moduleName' is non-null, it sets it to something that will
+// says which method (a class name, or a module name)
+const char* getFieldName(CORINFO_FIELD_HANDLE ftn, /* IN */
+ const char** moduleName /* OUT */
+ );
+
+// return class it belongs to
+CORINFO_CLASS_HANDLE getFieldClass(CORINFO_FIELD_HANDLE field);
+
+// Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set
+// the field's value class (if 'structType' == 0, then don't bother
+// the structure info).
+//
+// 'memberParent' is typically only set when verifying. It should be the
+// result of calling getMemberParent.
+CorInfoType getFieldType(CORINFO_FIELD_HANDLE field,
+ CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE memberParent = NULL /* IN */
+ );
+
+// return the data member's instance offset
+unsigned getFieldOffset(CORINFO_FIELD_HANDLE field);
+
+// TODO: jit64 should be switched to the same plan as the i386 jits - use
+// getClassGClayout to figure out the need for writebarrier helper, and inline the copying.
+// The interpretted value class copy is slow. Once this happens, USE_WRITE_BARRIER_HELPERS
+bool isWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field);
+
+void getFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_ACCESS_FLAGS flags,
+ CORINFO_FIELD_INFO* pResult);
+
+// Returns true iff "fldHnd" represents a static field.
+bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd);
+
+/*********************************************************************************/
+//
+// ICorDebugInfo
+//
+/*********************************************************************************/
+
+// Query the EE to find out where interesting break points
+// in the code are. The native compiler will ensure that these places
+// have a corresponding break point in native code.
+//
+// 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(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
+ unsigned int* cILOffsets, // [OUT] size of pILOffsets
+ DWORD** pILOffsets, // [OUT] IL offsets of interest
+ // jit MUST free with freeArray!
+ ICorDebugInfo::BoundaryTypes* implictBoundaries // [OUT] tell jit, all boundries of this type
+ );
+
+// Report back the mapping from IL to native code,
+// this map should include all boundaries that 'getBoundaries'
+// reported as interesting to the debugger.
+
+// Note that debugger (and profiler) is assuming that all of the
+// offsets form a contiguous block of memory, and that the
+// OffsetMapping is sorted in order of increasing native offset.
+void setBoundaries(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
+ ULONG32 cMap, // [IN] size of pMap
+ ICorDebugInfo::OffsetMapping* pMap // [IN] map including all points of interest.
+ // jit allocated with allocateArray, EE frees
+ );
+
+// Query the EE to find out the scope of local varables.
+// normally the JIT would trash variables after last use, but
+// under debugging, the JIT needs to keep them live over their
+// entire scope so that they can be inspected.
+//
+// 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(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
+ ULONG32* cVars, // [OUT] size of 'vars'
+ ICorDebugInfo::ILVarInfo** vars, // [OUT] scopes of variables of interest
+ // jit MUST free with freeArray!
+ bool* extendOthers // [OUT] it TRUE, then assume the scope
+ // of unmentioned vars is entire method
+ );
+
+// Report back to the EE the location of every variable.
+// note that the JIT might split lifetimes into different
+// locations etc.
+
+void setVars(CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
+ ULONG32 cVars, // [IN] size of 'vars'
+ ICorDebugInfo::NativeVarInfo* vars // [IN] map telling where local vars are stored at what points
+ // jit allocated with allocateArray, EE frees
+ );
+
+/*-------------------------- Misc ---------------------------------------*/
+
+// Used to allocate memory that needs to handed to the EE.
+// For eg, use this to allocated memory for reporting debug info,
+// which will be handed to the EE by setVars() and setBoundaries()
+void* allocateArray(ULONG cBytes);
+
+// JitCompiler will free arrays passed by the EE using this
+// For eg, The EE returns memory in getVars() and getBoundaries()
+// to the JitCompiler, which the JitCompiler should release using
+// freeArray()
+void freeArray(void* array);
+
+/*********************************************************************************/
+//
+// ICorArgInfo
+//
+/*********************************************************************************/
+
+// advance the pointer to the argument list.
+// a ptr of 0, is special and always means the first argument
+CORINFO_ARG_LIST_HANDLE getArgNext(CORINFO_ARG_LIST_HANDLE args /* IN */
+ );
+
+// Get the type of a particular argument
+// CORINFO_TYPE_UNDEF is returned when there are no more arguments
+// If the type returned is a primitive type (or an enum) *vcTypeRet set to NULL
+// otherwise it is set to the TypeHandle associted with the type
+// Enumerations will always look their underlying type (probably should fix this)
+// Otherwise vcTypeRet is the type as would be seen by the IL,
+// The return value is the type that is used for calling convention purposes
+// (Thus if the EE wants a value class to be passed like an int, then it will
+// return CORINFO_TYPE_INT
+CorInfoTypeWithMod getArgType(CORINFO_SIG_INFO* sig, /* IN */
+ CORINFO_ARG_LIST_HANDLE args, /* IN */
+ CORINFO_CLASS_HANDLE* vcTypeRet /* OUT */
);
- // Returns true iff "fldHnd" represents a static field.
- bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd);
-
- /*********************************************************************************/
- //
- // ICorDebugInfo
- //
- /*********************************************************************************/
-
- // Query the EE to find out where interesting break points
- // in the code are. The native compiler will ensure that these places
- // have a corresponding break point in native code.
- //
- // 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(
- CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
- unsigned int *cILOffsets, // [OUT] size of pILOffsets
- DWORD **pILOffsets, // [OUT] IL offsets of interest
- // jit MUST free with freeArray!
- ICorDebugInfo::BoundaryTypes *implictBoundaries // [OUT] tell jit, all boundries of this type
- );
+// If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it
+CORINFO_CLASS_HANDLE getArgClass(CORINFO_SIG_INFO* sig, /* IN */
+ CORINFO_ARG_LIST_HANDLE args /* IN */
+ );
- // Report back the mapping from IL to native code,
- // this map should include all boundaries that 'getBoundaries'
- // reported as interesting to the debugger.
-
- // Note that debugger (and profiler) is assuming that all of the
- // offsets form a contiguous block of memory, and that the
- // OffsetMapping is sorted in order of increasing native offset.
- void setBoundaries(
- CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
- ULONG32 cMap, // [IN] size of pMap
- ICorDebugInfo::OffsetMapping *pMap // [IN] map including all points of interest.
- // jit allocated with allocateArray, EE frees
- );
+// Returns type of HFA for valuetype
+CorInfoType getHFAType(CORINFO_CLASS_HANDLE hClass);
- // Query the EE to find out the scope of local varables.
- // normally the JIT would trash variables after last use, but
- // under debugging, the JIT needs to keep them live over their
- // entire scope so that they can be inspected.
- //
- // 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(
- CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
- ULONG32 *cVars, // [OUT] size of 'vars'
- ICorDebugInfo::ILVarInfo **vars, // [OUT] scopes of variables of interest
- // jit MUST free with freeArray!
- bool *extendOthers // [OUT] it TRUE, then assume the scope
- // of unmentioned vars is entire method
- );
-
- // Report back to the EE the location of every variable.
- // note that the JIT might split lifetimes into different
- // locations etc.
-
- void setVars(
- CORINFO_METHOD_HANDLE ftn, // [IN] method of interest
- ULONG32 cVars, // [IN] size of 'vars'
- ICorDebugInfo::NativeVarInfo *vars // [IN] map telling where local vars are stored at what points
- // jit allocated with allocateArray, EE frees
- );
-
- /*-------------------------- Misc ---------------------------------------*/
-
- // Used to allocate memory that needs to handed to the EE.
- // For eg, use this to allocated memory for reporting debug info,
- // which will be handed to the EE by setVars() and setBoundaries()
- void * allocateArray(
- ULONG cBytes
- );
+/*****************************************************************************
+* ICorErrorInfo contains methods to deal with SEH exceptions being thrown
+* from the corinfo interface. These methods may be called when an exception
+* with code EXCEPTION_COMPLUS is caught.
+*****************************************************************************/
- // JitCompiler will free arrays passed by the EE using this
- // For eg, The EE returns memory in getVars() and getBoundaries()
- // to the JitCompiler, which the JitCompiler should release using
- // freeArray()
- void freeArray(
- void *array
- );
-
- /*********************************************************************************/
- //
- // ICorArgInfo
- //
- /*********************************************************************************/
-
- // advance the pointer to the argument list.
- // a ptr of 0, is special and always means the first argument
- CORINFO_ARG_LIST_HANDLE getArgNext (
- CORINFO_ARG_LIST_HANDLE args /* IN */
- );
-
- // Get the type of a particular argument
- // CORINFO_TYPE_UNDEF is returned when there are no more arguments
- // If the type returned is a primitive type (or an enum) *vcTypeRet set to NULL
- // otherwise it is set to the TypeHandle associted with the type
- // Enumerations will always look their underlying type (probably should fix this)
- // Otherwise vcTypeRet is the type as would be seen by the IL,
- // The return value is the type that is used for calling convention purposes
- // (Thus if the EE wants a value class to be passed like an int, then it will
- // return CORINFO_TYPE_INT
- CorInfoTypeWithMod getArgType (
- CORINFO_SIG_INFO* sig, /* IN */
- CORINFO_ARG_LIST_HANDLE args, /* IN */
- CORINFO_CLASS_HANDLE *vcTypeRet /* OUT */
- );
-
- // If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it
- CORINFO_CLASS_HANDLE getArgClass (
- CORINFO_SIG_INFO* sig, /* IN */
- CORINFO_ARG_LIST_HANDLE args /* IN */
- );
-
- // Returns type of HFA for valuetype
- CorInfoType getHFAType (
- CORINFO_CLASS_HANDLE hClass
- );
-
- /*****************************************************************************
- * ICorErrorInfo contains methods to deal with SEH exceptions being thrown
- * from the corinfo interface. These methods may be called when an exception
- * with code EXCEPTION_COMPLUS is caught.
- *****************************************************************************/
+// Returns the HRESULT of the current exception
+HRESULT GetErrorHRESULT(struct _EXCEPTION_POINTERS* pExceptionPointers);
+
+// Fetches the message of the current exception
+// Returns the size of the message (including terminating null). This can be
+// greater than bufferLength if the buffer is insufficient.
+ULONG GetErrorMessage(__inout_ecount(bufferLength) LPWSTR buffer, ULONG bufferLength);
+
+// returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the
+// exception, abort some work (like the inlining) and continue compilation
+// returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE
+// things like ThreadStoppedException ...
+// returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE
+
+int FilterException(struct _EXCEPTION_POINTERS* pExceptionPointers);
+
+// Cleans up internal EE tracking when an exception is caught.
+void HandleException(struct _EXCEPTION_POINTERS* pExceptionPointers);
- // Returns the HRESULT of the current exception
- HRESULT GetErrorHRESULT(
- struct _EXCEPTION_POINTERS *pExceptionPointers
- );
-
- // Fetches the message of the current exception
- // Returns the size of the message (including terminating null). This can be
- // greater than bufferLength if the buffer is insufficient.
- ULONG GetErrorMessage(
- __inout_ecount(bufferLength) LPWSTR buffer,
- ULONG bufferLength
- );
-
- // returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the
- // exception, abort some work (like the inlining) and continue compilation
- // returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE
- // things like ThreadStoppedException ...
- // returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE
-
- int FilterException(
- struct _EXCEPTION_POINTERS *pExceptionPointers
- );
-
- // Cleans up internal EE tracking when an exception is caught.
- void HandleException(
- struct _EXCEPTION_POINTERS *pExceptionPointers
- );
-
- void ThrowExceptionForJitResult(
- HRESULT result);
-
- //Throws an exception defined by the given throw helper.
- void ThrowExceptionForHelper(
- const CORINFO_HELPER_DESC * throwHelper);
-
- // Runs the given function under an error trap. This allows the JIT to make calls
- // to interface functions that may throw exceptions without needing to be aware of
- // the EH ABI, exception types, etc. Returns true if the given function completed
- // successfully and false otherwise.
- bool runWithErrorTrap(
- void (*function)(void*), // The function to run
- void* parameter // The context parameter that will be passed to the function and the handler
- );
+void ThrowExceptionForJitResult(HRESULT result);
+
+// Throws an exception defined by the given throw helper.
+void ThrowExceptionForHelper(const CORINFO_HELPER_DESC* throwHelper);
+
+// Runs the given function under an error trap. This allows the JIT to make calls
+// to interface functions that may throw exceptions without needing to be aware of
+// the EH ABI, exception types, etc. Returns true if the given function completed
+// successfully and false otherwise.
+bool runWithErrorTrap(void (*function)(void*), // The function to run
+ void* parameter // The context parameter that will be passed to the function and the handler
+ );
/*****************************************************************************
* ICorStaticInfo contains EE interface methods which return values that are
@@ -809,54 +645,46 @@ public:
* assuming that all code versions are identical each time.)
*****************************************************************************/
- // Return details about EE internal data structures
- void getEEInfo(
- CORINFO_EE_INFO *pEEInfoOut
- );
+// Return details about EE internal data structures
+void getEEInfo(CORINFO_EE_INFO* pEEInfoOut);
+
+// Returns name of the JIT timer log
+LPCWSTR getJitTimeLogFilename();
- // Returns name of the JIT timer log
- LPCWSTR getJitTimeLogFilename();
-
- /*********************************************************************************/
- //
- // Diagnostic methods
- //
- /*********************************************************************************/
-
- // this function is for debugging only. Returns method token.
- // Returns mdMethodDefNil for dynamic methods.
- mdMethodDef getMethodDefFromMethod(
- CORINFO_METHOD_HANDLE hMethod
- );
-
- // this function is for debugging only. It returns the method name
- // and if 'moduleName' is non-null, it sets it to something that will
- // says which method (a class name, or a module name)
- const char* getMethodName (
- CORINFO_METHOD_HANDLE ftn, /* IN */
- const char **moduleName /* OUT */
- );
-
- // this function is for debugging only. It returns a value that
- // is will always be the same for a given method. It is used
- // to implement the 'jitRange' functionality
- unsigned getMethodHash (
- CORINFO_METHOD_HANDLE ftn /* IN */
- );
-
- // this function is for debugging only.
- size_t findNameOfToken (
- CORINFO_MODULE_HANDLE module, /* IN */
- mdToken metaTOK, /* IN */
- __out_ecount (FQNameCapacity) char * szFQName, /* OUT */
- size_t FQNameCapacity /* IN */
- );
-
- // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.
- bool getSystemVAmd64PassStructInRegisterDescriptor(
- /* IN */ CORINFO_CLASS_HANDLE structHnd,
- /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr
- );
+/*********************************************************************************/
+//
+// Diagnostic methods
+//
+/*********************************************************************************/
+
+// this function is for debugging only. Returns method token.
+// Returns mdMethodDefNil for dynamic methods.
+mdMethodDef getMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod);
+
+// this function is for debugging only. It returns the method name
+// and if 'moduleName' is non-null, it sets it to something that will
+// says which method (a class name, or a module name)
+const char* getMethodName(CORINFO_METHOD_HANDLE ftn, /* IN */
+ const char** moduleName /* OUT */
+ );
+
+// this function is for debugging only. It returns a value that
+// is will always be the same for a given method. It is used
+// to implement the 'jitRange' functionality
+unsigned getMethodHash(CORINFO_METHOD_HANDLE ftn /* IN */
+ );
+
+// this function is for debugging only.
+size_t findNameOfToken(CORINFO_MODULE_HANDLE module, /* IN */
+ mdToken metaTOK, /* IN */
+ __out_ecount(FQNameCapacity) char* szFQName, /* OUT */
+ size_t FQNameCapacity /* IN */
+ );
+
+// returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.
+bool getSystemVAmd64PassStructInRegisterDescriptor(
+ /* IN */ CORINFO_CLASS_HANDLE structHnd,
+ /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr);
/*****************************************************************************
* ICorDynamicInfo contains EE interface methods which return values that may
@@ -864,433 +692,331 @@ public:
* data; they must be requeried each time the EE is run.
*****************************************************************************/
- //
- // These methods return values to the JIT which are not constant
- // from session to session.
- //
- // These methods take an extra parameter : void **ppIndirection.
- // If a JIT supports generation of prejit code (install-o-jit), it
- // must pass a non-null value for this parameter, and check the
- // resulting value. If *ppIndirection is NULL, code should be
- // generated normally. If non-null, then the value of
- // *ppIndirection is an address in the cookie table, and the code
- // generator needs to generate an indirection through the table to
- // get the resulting value. In this case, the return result of the
- // function must NOT be directly embedded in the generated code.
- //
- // Note that if a JIT does not support prejit code generation, it
- // may ignore the extra parameter & pass the default of NULL - the
- // prejit ICorDynamicInfo implementation will see this & generate
- // an error if the jitter is used in a prejit scenario.
- //
-
- // Return details about EE internal data structures
-
- DWORD getThreadTLSIndex(
- void **ppIndirection = NULL
- );
+//
+// These methods return values to the JIT which are not constant
+// from session to session.
+//
+// These methods take an extra parameter : void **ppIndirection.
+// If a JIT supports generation of prejit code (install-o-jit), it
+// must pass a non-null value for this parameter, and check the
+// resulting value. If *ppIndirection is NULL, code should be
+// generated normally. If non-null, then the value of
+// *ppIndirection is an address in the cookie table, and the code
+// generator needs to generate an indirection through the table to
+// get the resulting value. In this case, the return result of the
+// function must NOT be directly embedded in the generated code.
+//
+// Note that if a JIT does not support prejit code generation, it
+// may ignore the extra parameter & pass the default of NULL - the
+// prejit ICorDynamicInfo implementation will see this & generate
+// an error if the jitter is used in a prejit scenario.
+//
- const void * getInlinedCallFrameVptr(
- void **ppIndirection = NULL
- );
+// Return details about EE internal data structures
- LONG * getAddrOfCaptureThreadGlobal(
- void **ppIndirection = NULL
- );
+DWORD getThreadTLSIndex(void** ppIndirection = NULL);
- SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module);
+const void* getInlinedCallFrameVptr(void** ppIndirection = NULL);
- // return the native entry point to an EE helper (see CorInfoHelpFunc)
- void* getHelperFtn (
- CorInfoHelpFunc ftnNum,
- void **ppIndirection = NULL
- );
+LONG* getAddrOfCaptureThreadGlobal(void** ppIndirection = NULL);
- // return a callable address of the function (native code). This function
- // may return a different value (depending on whether the method has
- // been JITed or not.
- void getFunctionEntryPoint(
- CORINFO_METHOD_HANDLE ftn, /* IN */
- CORINFO_CONST_LOOKUP * pResult, /* OUT */
- CORINFO_ACCESS_FLAGS accessFlags = CORINFO_ACCESS_ANY);
-
- // return a directly callable address. This can be used similarly to the
- // value returned by getFunctionEntryPoint() except that it is
- // guaranteed to be multi callable entrypoint.
- void getFunctionFixedEntryPoint(
- CORINFO_METHOD_HANDLE ftn,
- CORINFO_CONST_LOOKUP * pResult);
-
- // get the synchronization handle that is passed to monXstatic function
- void* getMethodSync(
- CORINFO_METHOD_HANDLE ftn,
- void **ppIndirection = NULL
- );
+SIZE_T* getAddrModuleDomainID(CORINFO_MODULE_HANDLE module);
- // get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).
- // Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used.
- CorInfoHelpFunc getLazyStringLiteralHelper(
- CORINFO_MODULE_HANDLE handle
- );
+// return the native entry point to an EE helper (see CorInfoHelpFunc)
+void* getHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection = NULL);
- CORINFO_MODULE_HANDLE embedModuleHandle(
- CORINFO_MODULE_HANDLE handle,
- void **ppIndirection = NULL
- );
+// return a callable address of the function (native code). This function
+// may return a different value (depending on whether the method has
+// been JITed or not.
+void getFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, /* IN */
+ CORINFO_CONST_LOOKUP* pResult, /* OUT */
+ CORINFO_ACCESS_FLAGS accessFlags = CORINFO_ACCESS_ANY);
- CORINFO_CLASS_HANDLE embedClassHandle(
- CORINFO_CLASS_HANDLE handle,
- void **ppIndirection = NULL
- );
+// return a directly callable address. This can be used similarly to the
+// value returned by getFunctionEntryPoint() except that it is
+// guaranteed to be multi callable entrypoint.
+void getFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult);
- CORINFO_METHOD_HANDLE embedMethodHandle(
- CORINFO_METHOD_HANDLE handle,
- void **ppIndirection = NULL
- );
+// get the synchronization handle that is passed to monXstatic function
+void* getMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection = NULL);
- CORINFO_FIELD_HANDLE embedFieldHandle(
- CORINFO_FIELD_HANDLE handle,
- void **ppIndirection = NULL
- );
+// get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).
+// Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used.
+CorInfoHelpFunc getLazyStringLiteralHelper(CORINFO_MODULE_HANDLE handle);
- // Given a module scope (module), a method handle (context) and
- // a metadata token (metaTOK), fetch the handle
- // (type, field or method) associated with the token.
- // If this is not possible at compile-time (because the current method's
- // code is shared and the token contains generic parameters)
- // then indicate how the handle should be looked up at run-time.
- //
- void embedGenericHandle(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- BOOL fEmbedParent, // TRUE - embeds parent type handle of the field/method handle
- CORINFO_GENERICHANDLE_RESULT * pResult);
-
- // Return information used to locate the exact enclosing type of the current method.
- // Used only to invoke .cctor method from code shared across generic instantiations
- // !needsRuntimeLookup statically known (enclosing type of method itself)
- // needsRuntimeLookup:
- // CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
- // CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
- // CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
- CORINFO_LOOKUP_KIND getLocationOfThisType(
- CORINFO_METHOD_HANDLE context
- );
+CORINFO_MODULE_HANDLE embedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection = NULL);
- // NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
- // deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
- // functionality of these methods.
+CORINFO_CLASS_HANDLE embedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection = NULL);
- // return the unmanaged target *if method has already been prelinked.*
- void* getPInvokeUnmanagedTarget(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection = NULL
- );
+CORINFO_METHOD_HANDLE embedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection = NULL);
- // return address of fixup area for late-bound PInvoke calls.
- void* getAddressOfPInvokeFixup(
- CORINFO_METHOD_HANDLE method,
- void **ppIndirection = NULL
- );
+CORINFO_FIELD_HANDLE embedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection = NULL);
- // return the address of the PInvoke target. May be a fixup area in the
- // case of late-bound PInvoke calls.
- void getAddressOfPInvokeTarget(
- CORINFO_METHOD_HANDLE method,
- CORINFO_CONST_LOOKUP *pLookup
- );
+// Given a module scope (module), a method handle (context) and
+// a metadata token (metaTOK), fetch the handle
+// (type, field or method) associated with the token.
+// If this is not possible at compile-time (because the current method's
+// code is shared and the token contains generic parameters)
+// then indicate how the handle should be looked up at run-time.
+//
+void embedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ BOOL fEmbedParent, // TRUE - embeds parent type handle of the field/method handle
+ CORINFO_GENERICHANDLE_RESULT* pResult);
- // Generate a cookie based on the signature that would needs to be passed
- // to CORINFO_HELP_PINVOKE_CALLI
- LPVOID GetCookieForPInvokeCalliSig(
- CORINFO_SIG_INFO* szMetaSig,
- void ** ppIndirection = NULL
- );
-
- // returns true if a VM cookie can be generated for it (might be false due to cross-module
- // inlining, in which case the inlining should be aborted)
- bool canGetCookieForPInvokeCalliSig(
- CORINFO_SIG_INFO* szMetaSig
- );
+// Return information used to locate the exact enclosing type of the current method.
+// Used only to invoke .cctor method from code shared across generic instantiations
+// !needsRuntimeLookup statically known (enclosing type of method itself)
+// needsRuntimeLookup:
+// CORINFO_LOOKUP_THISOBJ use vtable pointer of 'this' param
+// CORINFO_LOOKUP_CLASSPARAM use vtable hidden param
+// CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param
+CORINFO_LOOKUP_KIND getLocationOfThisType(CORINFO_METHOD_HANDLE context);
- // Gets a handle that is checked to see if the current method is
- // included in "JustMyCode"
- CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(
- CORINFO_METHOD_HANDLE method,
- CORINFO_JUST_MY_CODE_HANDLE**ppIndirection = NULL
- );
+// NOTE: the two methods below--getPInvokeUnmanagedTarget and getAddressOfPInvokeFixup--are
+// deprecated. New code should instead use getAddressOfPInvokeTarget, which subsumes the
+// functionality of these methods.
- // Gets a method handle that can be used to correlate profiling data.
- // This is the IP of a native method, or the address of the descriptor struct
- // for IL. Always guaranteed to be unique per process, and not to move. */
- void GetProfilingHandle(
- BOOL *pbHookFunction,
- void **pProfilerHandle,
- BOOL *pbIndirectedHandles
- );
+// return the unmanaged target *if method has already been prelinked.*
+void* getPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection = NULL);
- // Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values.
- void getCallInfo(
- // Token info
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
+// return address of fixup area for late-bound PInvoke calls.
+void* getAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection = NULL);
- //Generics info
- CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken,
+// return the address of the PInvoke target. May be a fixup area in the
+// case of late-bound PInvoke calls.
+void getAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup);
- //Security info
- CORINFO_METHOD_HANDLE callerHandle,
+// Generate a cookie based on the signature that would needs to be passed
+// to CORINFO_HELP_PINVOKE_CALLI
+LPVOID GetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection = NULL);
- //Jit info
- CORINFO_CALLINFO_FLAGS flags,
+// returns true if a VM cookie can be generated for it (might be false due to cross-module
+// inlining, in which case the inlining should be aborted)
+bool canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig);
- //out params
- CORINFO_CALL_INFO *pResult
- );
+// Gets a handle that is checked to see if the current method is
+// included in "JustMyCode"
+CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(CORINFO_METHOD_HANDLE method,
+ CORINFO_JUST_MY_CODE_HANDLE** ppIndirection = NULL);
- BOOL canAccessFamily(CORINFO_METHOD_HANDLE hCaller,
- CORINFO_CLASS_HANDLE hInstanceType);
+// Gets a method handle that can be used to correlate profiling data.
+// This is the IP of a native method, or the address of the descriptor struct
+// for IL. Always guaranteed to be unique per process, and not to move. */
+void GetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles);
- // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class
- // except reflection emitted classes and generics)
- BOOL isRIDClassDomainID(CORINFO_CLASS_HANDLE cls);
+// Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values.
+void getCallInfo(
+ // Token info
+ CORINFO_RESOLVED_TOKEN* pResolvedToken,
- // returns the class's domain ID for accessing shared statics
- unsigned getClassDomainID (
- CORINFO_CLASS_HANDLE cls,
- void **ppIndirection = NULL
- );
+ // Generics info
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,
+ // Security info
+ CORINFO_METHOD_HANDLE callerHandle,
- // return the data's address (for static fields only)
- void* getFieldAddress(
- CORINFO_FIELD_HANDLE field,
- void **ppIndirection = NULL
- );
+ // Jit info
+ CORINFO_CALLINFO_FLAGS flags,
- // registers a vararg sig & returns a VM cookie for it (which can contain other stuff)
- CORINFO_VARARGS_HANDLE getVarArgsHandle(
- CORINFO_SIG_INFO *pSig,
- void **ppIndirection = NULL
- );
+ // out params
+ CORINFO_CALL_INFO* pResult);
- // returns true if a VM cookie can be generated for it (might be false due to cross-module
- // inlining, in which case the inlining should be aborted)
- bool canGetVarArgsHandle(
- CORINFO_SIG_INFO *pSig
- );
+BOOL canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType);
- // Allocate a string literal on the heap and return a handle to it
- InfoAccessType constructStringLiteral(
- CORINFO_MODULE_HANDLE module,
- mdToken metaTok,
- void **ppValue
- );
+// Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class
+// except reflection emitted classes and generics)
+BOOL isRIDClassDomainID(CORINFO_CLASS_HANDLE cls);
- InfoAccessType emptyStringLiteral(
- void **ppValue
- );
+// returns the class's domain ID for accessing shared statics
+unsigned getClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection = NULL);
- // (static fields only) given that 'field' refers to thread local store,
- // return the ID (TLS index), which is used to find the begining of the
- // TLS data area for the particular DLL 'field' is associated with.
- DWORD getFieldThreadLocalStoreID (
- CORINFO_FIELD_HANDLE field,
- void **ppIndirection = NULL
- );
+// return the data's address (for static fields only)
+void* getFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection = NULL);
- // Sets another object to intercept calls to "self" and current method being compiled
- void setOverride(
- ICorDynamicInfo *pOverride,
- CORINFO_METHOD_HANDLE currentMethod
- );
+// registers a vararg sig & returns a VM cookie for it (which can contain other stuff)
+CORINFO_VARARGS_HANDLE getVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection = NULL);
- // Adds an active dependency from the context method's module to the given module
- // This is internal callback for the EE. JIT should not call it directly.
- void addActiveDependency(
- CORINFO_MODULE_HANDLE moduleFrom,
- CORINFO_MODULE_HANDLE moduleTo
- );
+// returns true if a VM cookie can be generated for it (might be false due to cross-module
+// inlining, in which case the inlining should be aborted)
+bool canGetVarArgsHandle(CORINFO_SIG_INFO* pSig);
+
+// Allocate a string literal on the heap and return a handle to it
+InfoAccessType constructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue);
- CORINFO_METHOD_HANDLE GetDelegateCtor(
- CORINFO_METHOD_HANDLE methHnd,
- CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_METHOD_HANDLE targetMethodHnd,
- DelegateCtorArgs * pCtorData
- );
+InfoAccessType emptyStringLiteral(void** ppValue);
- void MethodCompileComplete(
- CORINFO_METHOD_HANDLE methHnd
+// (static fields only) given that 'field' refers to thread local store,
+// return the ID (TLS index), which is used to find the begining of the
+// TLS data area for the particular DLL 'field' is associated with.
+DWORD getFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection = NULL);
+
+// Sets another object to intercept calls to "self" and current method being compiled
+void setOverride(ICorDynamicInfo* pOverride, CORINFO_METHOD_HANDLE currentMethod);
+
+// Adds an active dependency from the context method's module to the given module
+// This is internal callback for the EE. JIT should not call it directly.
+void addActiveDependency(CORINFO_MODULE_HANDLE moduleFrom, CORINFO_MODULE_HANDLE moduleTo);
+
+CORINFO_METHOD_HANDLE GetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
+ CORINFO_CLASS_HANDLE clsHnd,
+ CORINFO_METHOD_HANDLE targetMethodHnd,
+ DelegateCtorArgs* pCtorData);
+
+void MethodCompileComplete(CORINFO_METHOD_HANDLE methHnd);
+
+// return a thunk that will copy the arguments for the given signature.
+void* getTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags);
+
+// return memory manager that the JIT can use to allocate a regular memory
+IEEMemoryManager* getMemoryManager();
+
+// get a block of memory for the code, readonly data, and read-write data
+void allocMem(ULONG hotCodeSize, /* IN */
+ ULONG coldCodeSize, /* IN */
+ ULONG roDataSize, /* IN */
+ ULONG xcptnsCount, /* IN */
+ CorJitAllocMemFlag flag, /* IN */
+ void** hotCodeBlock, /* OUT */
+ void** coldCodeBlock, /* OUT */
+ void** roDataBlock /* OUT */
+ );
+
+// Reserve memory for the method/funclet's unwind information.
+// Note that this must be called before allocMem. It should be
+// called once for the main method, once for every funclet, and
+// once for every block of cold code for which allocUnwindInfo
+// will be called.
+//
+// This is necessary because jitted code must allocate all the
+// memory needed for the unwindInfo at the allocMem call.
+// For prejitted code we split up the unwinding information into
+// separate sections .rdata and .pdata.
+//
+void reserveUnwindInfo(BOOL isFunclet, /* IN */
+ BOOL isColdCode, /* IN */
+ ULONG unwindSize /* IN */
+ );
+
+// Allocate and initialize the .rdata and .pdata for this method or
+// funclet, and get the block of memory needed for the machine-specific
+// unwind information (the info for crawling the stack frame).
+// Note that allocMem must be called first.
+//
+// Parameters:
+//
+// pHotCode main method code buffer, always filled in
+// pColdCode cold code buffer, only filled in if this is cold code,
+// null otherwise
+// startOffset start of code block, relative to appropriate code buffer
+// (e.g. pColdCode if cold, pHotCode if hot).
+// endOffset end of code block, relative to appropriate code buffer
+// unwindSize size of unwind info pointed to by pUnwindBlock
+// pUnwindBlock pointer to unwind info
+// funcKind type of funclet (main method code, handler, filter)
+//
+void allocUnwindInfo(BYTE* pHotCode, /* IN */
+ BYTE* pColdCode, /* IN */
+ ULONG startOffset, /* IN */
+ ULONG endOffset, /* IN */
+ ULONG unwindSize, /* IN */
+ BYTE* pUnwindBlock, /* IN */
+ CorJitFuncKind funcKind /* IN */
+ );
+
+// Get a block of memory needed for the code manager information,
+// (the info for enumerating the GC pointers while crawling the
+// stack frame).
+// Note that allocMem must be called first
+void* allocGCInfo(size_t size /* IN */
+ );
+
+void yieldExecution();
+
+// Indicate how many exception handler blocks are to be returned.
+// This is guaranteed to be called before any 'setEHinfo' call.
+// Note that allocMem must be called before this method can be called.
+void setEHcount(unsigned cEH /* IN */
);
- // return a thunk that will copy the arguments for the given signature.
- void* getTailCallCopyArgsThunk (
- CORINFO_SIG_INFO *pSig,
- CorInfoHelperTailCallSpecialHandling flags
+// Set the values for one particular exception handler block.
+//
+// Handler regions should be lexically contiguous.
+// This is because FinallyIsUnwinding() uses lexicality to
+// determine if a "finally" clause is executing.
+void setEHinfo(unsigned EHnumber, /* IN */
+ const CORINFO_EH_CLAUSE* clause /* IN */
+ );
+
+// Level -> fatalError, Level 2 -> Error, Level 3 -> Warning
+// Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ...
+// returns non-zero if the logging succeeded
+BOOL logMsg(unsigned level, const char* fmt, va_list args);
+
+// do an assert. will return true if the code should retry (DebugBreak)
+// returns false, if the assert should be igored.
+int doAssert(const char* szFile, int iLine, const char* szExpr);
+
+void reportFatalError(CorJitResult result);
+
+/*
+struct ProfileBuffer // Also defined here: code:CORBBTPROF_BLOCK_DATA
+{
+ ULONG ILOffset;
+ ULONG ExecutionCount;
+};
+*/
+
+// allocate a basic block profile buffer where execution counts will be stored
+// for jitted basic blocks.
+HRESULT allocBBProfileBuffer(ULONG count, // The number of basic blocks that we have
+ ProfileBuffer** profileBuffer);
+
+// get profile information to be used for optimizing the current method. The format
+// of the buffer is the same as the format the JIT passes to allocBBProfileBuffer.
+HRESULT getBBProfileData(CORINFO_METHOD_HANDLE ftnHnd,
+ ULONG* count, // The number of basic blocks that we have
+ ProfileBuffer** profileBuffer,
+ ULONG* numRuns);
+
+// Associates a native call site, identified by its offset in the native code stream, with
+// the signature information and method handle the JIT used to lay out the call site. If
+// the call site has no signature information (e.g. a helper call) or has no method handle
+// (e.g. a CALLI P/Invoke), then null should be passed instead.
+void recordCallSite(ULONG instrOffset, /* IN */
+ CORINFO_SIG_INFO* callSig, /* IN */
+ CORINFO_METHOD_HANDLE methodHandle /* IN */
);
- // return memory manager that the JIT can use to allocate a regular memory
- IEEMemoryManager* getMemoryManager();
-
- // get a block of memory for the code, readonly data, and read-write data
- void allocMem (
- ULONG hotCodeSize, /* IN */
- ULONG coldCodeSize, /* IN */
- ULONG roDataSize, /* IN */
- ULONG xcptnsCount, /* IN */
- CorJitAllocMemFlag flag, /* IN */
- void ** hotCodeBlock, /* OUT */
- void ** coldCodeBlock, /* OUT */
- void ** roDataBlock /* OUT */
- );
-
- // Reserve memory for the method/funclet's unwind information.
- // Note that this must be called before allocMem. It should be
- // called once for the main method, once for every funclet, and
- // once for every block of cold code for which allocUnwindInfo
- // will be called.
- //
- // This is necessary because jitted code must allocate all the
- // memory needed for the unwindInfo at the allocMem call.
- // For prejitted code we split up the unwinding information into
- // separate sections .rdata and .pdata.
- //
- void reserveUnwindInfo (
- BOOL isFunclet, /* IN */
- BOOL isColdCode, /* IN */
- ULONG unwindSize /* IN */
- );
-
- // Allocate and initialize the .rdata and .pdata for this method or
- // funclet, and get the block of memory needed for the machine-specific
- // unwind information (the info for crawling the stack frame).
- // Note that allocMem must be called first.
- //
- // Parameters:
- //
- // pHotCode main method code buffer, always filled in
- // pColdCode cold code buffer, only filled in if this is cold code,
- // null otherwise
- // startOffset start of code block, relative to appropriate code buffer
- // (e.g. pColdCode if cold, pHotCode if hot).
- // endOffset end of code block, relative to appropriate code buffer
- // unwindSize size of unwind info pointed to by pUnwindBlock
- // pUnwindBlock pointer to unwind info
- // funcKind type of funclet (main method code, handler, filter)
- //
- void allocUnwindInfo (
- BYTE * pHotCode, /* IN */
- BYTE * pColdCode, /* IN */
- ULONG startOffset, /* IN */
- ULONG endOffset, /* IN */
- ULONG unwindSize, /* IN */
- BYTE * pUnwindBlock, /* IN */
- CorJitFuncKind funcKind /* IN */
- );
-
- // Get a block of memory needed for the code manager information,
- // (the info for enumerating the GC pointers while crawling the
- // stack frame).
- // Note that allocMem must be called first
- void * allocGCInfo (
- size_t size /* IN */
- );
-
- void yieldExecution();
-
- // Indicate how many exception handler blocks are to be returned.
- // This is guaranteed to be called before any 'setEHinfo' call.
- // Note that allocMem must be called before this method can be called.
- void setEHcount (
- unsigned cEH /* IN */
- );
-
- // Set the values for one particular exception handler block.
- //
- // Handler regions should be lexically contiguous.
- // This is because FinallyIsUnwinding() uses lexicality to
- // determine if a "finally" clause is executing.
- void setEHinfo (
- unsigned EHnumber, /* IN */
- const CORINFO_EH_CLAUSE *clause /* IN */
- );
-
- // Level -> fatalError, Level 2 -> Error, Level 3 -> Warning
- // Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ...
- // returns non-zero if the logging succeeded
- BOOL logMsg(unsigned level, const char* fmt, va_list args);
-
- // do an assert. will return true if the code should retry (DebugBreak)
- // returns false, if the assert should be igored.
- int doAssert(const char* szFile, int iLine, const char* szExpr);
-
- void reportFatalError(CorJitResult result);
-
- /*
- struct ProfileBuffer // Also defined here: code:CORBBTPROF_BLOCK_DATA
- {
- ULONG ILOffset;
- ULONG ExecutionCount;
- };
- */
-
- // allocate a basic block profile buffer where execution counts will be stored
- // for jitted basic blocks.
- HRESULT allocBBProfileBuffer (
- ULONG count, // The number of basic blocks that we have
- ProfileBuffer ** profileBuffer
- );
-
- // get profile information to be used for optimizing the current method. The format
- // of the buffer is the same as the format the JIT passes to allocBBProfileBuffer.
- HRESULT getBBProfileData(
- CORINFO_METHOD_HANDLE ftnHnd,
- ULONG * count, // The number of basic blocks that we have
- ProfileBuffer ** profileBuffer,
- ULONG * numRuns
- );
-
- // Associates a native call site, identified by its offset in the native code stream, with
- // the signature information and method handle the JIT used to lay out the call site. If
- // the call site has no signature information (e.g. a helper call) or has no method handle
- // (e.g. a CALLI P/Invoke), then null should be passed instead.
- void recordCallSite(
- ULONG instrOffset, /* IN */
- CORINFO_SIG_INFO * callSig, /* IN */
- CORINFO_METHOD_HANDLE methodHandle /* IN */
- );
-
- // A relocation is recorded if we are pre-jitting.
- // A jump thunk may be inserted if we are jitting
- void recordRelocation(
- void * location, /* IN */
- void * target, /* IN */
- WORD fRelocType, /* IN */
- WORD slotNum, /* IN */
- INT32 addlDelta /* IN */
- );
-
- WORD getRelocTypeHint(void * target);
-
- // A callback to identify the range of address known to point to
- // compiler-generated native entry points that call back into
- // MSIL.
- void getModuleNativeEntryPointRange(
- void ** pStart, /* OUT */
- void ** pEnd /* OUT */
- );
-
- // For what machine does the VM expect the JIT to generate code? The VM
- // returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
- // is cross-compiling (such as the case for crossgen), it will return a
- // different value than if it was compiling for the host architecture.
- //
- DWORD getExpectedTargetArchitecture();
-
- // Fetches extended flags for a particular compilation instance. Returns
- // the number of bytes written to the provided buffer.
- DWORD getJitFlags(
- CORJIT_FLAGS* flags, /* IN: Points to a buffer that will hold the extended flags. */
- DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
- version number for the CORJIT_FLAGS value. */
- );
+// A relocation is recorded if we are pre-jitting.
+// A jump thunk may be inserted if we are jitting
+void recordRelocation(void* location, /* IN */
+ void* target, /* IN */
+ WORD fRelocType, /* IN */
+ WORD slotNum, /* IN */
+ INT32 addlDelta /* IN */
+ );
+
+WORD getRelocTypeHint(void* target);
+
+// A callback to identify the range of address known to point to
+// compiler-generated native entry points that call back into
+// MSIL.
+void getModuleNativeEntryPointRange(void** pStart, /* OUT */
+ void** pEnd /* OUT */
+ );
+
+// For what machine does the VM expect the JIT to generate code? The VM
+// returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM
+// is cross-compiling (such as the case for crossgen), it will return a
+// different value than if it was compiling for the host architecture.
+//
+DWORD getExpectedTargetArchitecture();
+
+// Fetches extended flags for a particular compilation instance. Returns
+// the number of bytes written to the provided buffer.
+DWORD getJitFlags(CORJIT_FLAGS* flags, /* IN: Points to a buffer that will hold the extended flags. */
+ DWORD sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
+ version number for the CORJIT_FLAGS value. */
+ );
#endif // _ICorJitInfoImpl
diff --git a/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h b/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h
index 860f545fac..12e7100c2b 100644
--- a/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h
+++ b/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h
@@ -27,12 +27,12 @@ public:
InitialClear();
}
- LightWeightMapBuffer(const LightWeightMapBuffer &lwm)
+ LightWeightMapBuffer(const LightWeightMapBuffer& lwm)
{
InitialClear();
bufferLength = lwm.bufferLength;
- if((lwm.buffer!=nullptr)&&(lwm.bufferLength>0))
+ if ((lwm.buffer != nullptr) && (lwm.bufferLength > 0))
{
buffer = new unsigned char[lwm.bufferLength];
memcpy(buffer, lwm.buffer, lwm.bufferLength);
@@ -41,87 +41,87 @@ public:
~LightWeightMapBuffer()
{
- delete []buffer;
+ delete[] buffer;
}
- unsigned int AddBuffer(const unsigned char *buff, unsigned int len)
+ unsigned int AddBuffer(const unsigned char* buff, unsigned int len)
{
return AddBuffer(buff, len, false);
}
- unsigned int AddBuffer(const unsigned char *buff, unsigned int len, bool forceUnique)
+ unsigned int AddBuffer(const unsigned char* buff, unsigned int len, bool forceUnique)
{
- if(len == 0)
+ if (len == 0)
return -1;
- if(buff == nullptr)
+ if (buff == nullptr)
return -1;
- int index = Contains(buff, len); //See if there is already a copy of this data in our buffer
- if((index != -1)&&(!forceUnique))
+ int index = Contains(buff, len); // See if there is already a copy of this data in our buffer
+ if ((index != -1) && (!forceUnique))
return index;
- if(locked)
+ if (locked)
{
LogError("Added item that extended the buffer after it was locked by a call to GetBuffer()");
__debugbreak();
}
- unsigned int newbuffsize = bufferLength + sizeof(unsigned int) + len;
- unsigned char *newbuffer = new unsigned char[newbuffsize];
- unsigned int newOffset = bufferLength;
- if(bufferLength>0)
+ unsigned int newbuffsize = bufferLength + sizeof(unsigned int) + len;
+ unsigned char* newbuffer = new unsigned char[newbuffsize];
+ unsigned int newOffset = bufferLength;
+ if (bufferLength > 0)
memcpy(newbuffer, buffer, bufferLength);
memcpy(newbuffer + bufferLength + sizeof(unsigned int), buff, len);
- *((unsigned int *)(newbuffer + bufferLength)) = len;
+ *((unsigned int*)(newbuffer + bufferLength)) = len;
bufferLength += sizeof(unsigned int) + len;
- if(buffer!=nullptr)
- delete []buffer;
+ if (buffer != nullptr)
+ delete[] buffer;
buffer = newbuffer;
return newOffset + sizeof(unsigned int);
}
- unsigned char *GetBuffer(unsigned int offset)
+ unsigned char* GetBuffer(unsigned int offset)
{
- if(offset == (unsigned int)-1)
+ if (offset == (unsigned int)-1)
return nullptr;
- AssertCodeMsg(offset < bufferLength, EXCEPTIONCODE_LWM,
- "Hit offset bigger than bufferLength %u >= %u", offset, bufferLength);
+ AssertCodeMsg(offset < bufferLength, EXCEPTIONCODE_LWM, "Hit offset bigger than bufferLength %u >= %u", offset,
+ bufferLength);
locked = true;
// LogDebug("Address given %p", &buffer[offset]);
return &buffer[offset];
}
- int Contains(const unsigned char *buff, unsigned int len)
+ int Contains(const unsigned char* buff, unsigned int len)
{
#ifdef DEBUG_LWM
LogDebug("New call to Contains %d {", len);
- for(int i=0;i<len;i++)
+ for (int i = 0; i < len; i++)
LogDebug("0x%02x ", buff[len]);
LogDebug("}");
#endif
- if(len == 0)
+ if (len == 0)
return -1;
- if(bufferLength == 0)
+ if (bufferLength == 0)
return -1;
unsigned int offset = 0;
- while((offset+sizeof(unsigned int)+len) <= bufferLength)
+ while ((offset + sizeof(unsigned int) + len) <= bufferLength)
{
unsigned int buffChunkLen = *(unsigned int*)(&buffer[offset]);
#ifdef DEBUG_LWM
LogDebug("Investigating len %d @ %d", buffChunkLen, offset);
#endif
- if(buffChunkLen == len)
+ if (buffChunkLen == len)
{
#ifdef DEBUG_LWM
LogDebug("peering into {");
- for(int i=0;i<len;i++)
+ for (int i = 0; i < len; i++)
LogDebug("0x%02x ", buff[len]);
LogDebug("}");
#endif
- if(memcmp(&buffer[offset+sizeof(unsigned int)], buff, len)==0)
+ if (memcmp(&buffer[offset + sizeof(unsigned int)], buff, len) == 0)
{
#ifdef DEBUG_LWM
LogDebug("Found!");
#endif
- return offset+sizeof(unsigned int);
+ return offset + sizeof(unsigned int);
}
}
offset += sizeof(unsigned int) + buffChunkLen;
@@ -132,26 +132,26 @@ public:
return -1;
}
- void Unlock() //did you really mean to use this?
+ void Unlock() // did you really mean to use this?
{
locked = false;
}
protected:
-
void InitialClear()
{
- buffer = nullptr;
+ buffer = nullptr;
bufferLength = 0;
- locked = false;
+ locked = false;
}
- unsigned char* buffer; // TODO-Cleanup: this should really be a linked list; we reallocate it with every call to AddBuffer().
+ unsigned char* buffer; // TODO-Cleanup: this should really be a linked list; we reallocate it with every call to
+ // AddBuffer().
unsigned int bufferLength;
- bool locked;
+ bool locked;
};
-template<typename _Key, typename _Item>
+template <typename _Key, typename _Item>
class LightWeightMap : public LightWeightMapBuffer
{
public:
@@ -160,28 +160,28 @@ public:
InitialClear();
}
- LightWeightMap(const LightWeightMap &lwm)
+ LightWeightMap(const LightWeightMap& lwm)
{
InitialClear();
- numItems = lwm.numItems;
- strideSize = lwm.strideSize;
+ numItems = lwm.numItems;
+ strideSize = lwm.strideSize;
bufferLength = lwm.bufferLength;
- locked = false;
+ locked = false;
- pKeys = nullptr;
+ pKeys = nullptr;
pItems = nullptr;
- if(lwm.pKeys!=nullptr)
+ if (lwm.pKeys != nullptr)
{
pKeys = new _Key[numItems];
memcpy(pKeys, lwm.pKeys, numItems * sizeof(_Key));
}
- if(lwm.pItems!=nullptr)
+ if (lwm.pItems != nullptr)
{
pItems = new _Item[numItems];
memcpy(pItems, lwm.pItems, numItems * sizeof(_Item));
}
- if((lwm.buffer!=nullptr)&&(lwm.bufferLength>0))
+ if ((lwm.buffer != nullptr) && (lwm.bufferLength > 0))
{
buffer = new unsigned char[lwm.bufferLength];
memcpy(buffer, lwm.buffer, lwm.bufferLength);
@@ -190,17 +190,17 @@ public:
~LightWeightMap()
{
- if(pKeys!=nullptr)
- delete []pKeys;
- if(pItems!=nullptr)
- delete []pItems;
+ if (pKeys != nullptr)
+ delete[] pKeys;
+ if (pItems != nullptr)
+ delete[] pItems;
}
- void ReadFromArray(const unsigned char *rawData, unsigned int size)
+ void ReadFromArray(const unsigned char* rawData, unsigned int size)
{
- unsigned int sizeOfKey = sizeof(_Key);
- unsigned int sizeOfItem = sizeof(_Item);
- const unsigned char *ptr = rawData;
+ unsigned int sizeOfKey = sizeof(_Key);
+ unsigned int sizeOfItem = sizeof(_Item);
+ const unsigned char* ptr = rawData;
// The tag is optional, to roll forward previous formats which don't have
// the tag, but which also have the same format.
@@ -213,156 +213,154 @@ public:
ptr += sizeof(unsigned int);
strideSize = numItems;
- if(numItems > 0)
+ if (numItems > 0)
{
- //Read the buffersize
+ // Read the buffersize
memcpy(&bufferLength, ptr, sizeof(unsigned int));
ptr += sizeof(unsigned int);
AssertCodeMsg(pKeys == nullptr, EXCEPTIONCODE_LWM, "Found existing pKeys");
pKeys = new _Key[numItems];
- //Set the Keys
+ // Set the Keys
memcpy(pKeys, ptr, sizeOfKey * numItems);
ptr += sizeOfKey * numItems;
AssertCodeMsg(pItems == nullptr, EXCEPTIONCODE_LWM, "Found existing pItems");
pItems = new _Item[numItems];
- //Set the Items
+ // Set the Items
memcpy(pItems, ptr, sizeOfItem * numItems);
ptr += sizeOfItem * numItems;
AssertCodeMsg(buffer == nullptr, EXCEPTIONCODE_LWM, "Found existing buffer");
buffer = new unsigned char[bufferLength];
- //Read the buffer
+ // Read the buffer
memcpy(buffer, ptr, bufferLength * sizeof(unsigned char));
ptr += bufferLength * sizeof(unsigned char);
}
// If we have RTTI, we can make this assert report the correct type. No RTTI, though, when
// built with .NET Core, especially when built against the PAL.
- AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM,
- "%s - Ended with unexpected sizes %Ix != %x",
- "Unknown type" /*typeid(_Item).name()*/, ptr - rawData, size);
+ AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM, "%s - Ended with unexpected sizes %Ix != %x",
+ "Unknown type" /*typeid(_Item).name()*/, ptr - rawData, size);
}
unsigned int CalculateArraySize()
{
int size = 4 /* tag */ + sizeof(unsigned int) /* numItems */;
- if(numItems >0)
+ if (numItems > 0)
{
- size += sizeof(unsigned int); //size of bufferLength
- size += sizeof(_Key) * numItems; //size of keyset
- size += sizeof(_Item) * numItems; //size of itemset
- size += sizeof(unsigned char) * bufferLength; //bulk size of raw buffer
+ size += sizeof(unsigned int); // size of bufferLength
+ size += sizeof(_Key) * numItems; // size of keyset
+ size += sizeof(_Item) * numItems; // size of itemset
+ size += sizeof(unsigned char) * bufferLength; // bulk size of raw buffer
}
return size;
}
- unsigned int DumpToArray(unsigned char *bytes)
+ unsigned int DumpToArray(unsigned char* bytes)
{
- unsigned char *ptr = bytes;
- unsigned int size = CalculateArraySize();
+ unsigned char* ptr = bytes;
+ unsigned int size = CalculateArraySize();
- //Write the tag
+ // Write the tag
memcpy(ptr, "LWM1", 4);
ptr += 4;
- //Write the header
+ // Write the header
memcpy(ptr, &numItems, sizeof(unsigned int));
ptr += sizeof(unsigned int);
- if(numItems > 0)
+ if (numItems > 0)
{
- unsigned int sizeOfKey = sizeof(_Key);
+ unsigned int sizeOfKey = sizeof(_Key);
unsigned int sizeOfItem = sizeof(_Item);
- //Write the buffersize
+ // Write the buffersize
memcpy(ptr, &bufferLength, sizeof(unsigned int));
ptr += sizeof(unsigned int);
- //Write the Keys
+ // Write the Keys
memcpy(ptr, pKeys, sizeOfKey * numItems);
ptr += sizeOfKey * numItems;
- //Write the Items
+ // Write the Items
memcpy(ptr, pItems, sizeOfItem * numItems);
ptr += sizeOfItem * numItems;
- //Write the buffer
+ // Write the buffer
memcpy(ptr, buffer, bufferLength * sizeof(unsigned char));
ptr += bufferLength * sizeof(unsigned char);
}
// If we have RTTI, we can make this assert report the correct type. No RTTI, though, when
// built with .NET Core, especially when built against the PAL.
- AssertCodeMsg((ptr - bytes) == size, EXCEPTIONCODE_LWM,
- "%s - Ended with unexpected sizes %p != %x",
- "Unknown type" /*typeid(_Item).name()*/, (void*)(ptr - bytes), size);
+ AssertCodeMsg((ptr - bytes) == size, EXCEPTIONCODE_LWM, "%s - Ended with unexpected sizes %p != %x",
+ "Unknown type" /*typeid(_Item).name()*/, (void*)(ptr - bytes), size);
return size;
}
- //its worth noting that the acutal order of insert here doesnt meet what you migth expect. Its using memcmp, so
+ // its worth noting that the acutal order of insert here doesnt meet what you migth expect. Its using memcmp, so
// since we are on a little endian machine we'd use the lowest 8 bits as the first part of the key. This is
// a side effect of using the same code for large structs and DWORDS etc...
bool Add(_Key key, _Item item)
{
- //Make sure we have space left, expand if needed
- if(numItems == strideSize)
+ // Make sure we have space left, expand if needed
+ if (numItems == strideSize)
{
- _Key *tKeys = pKeys;
- _Item *tItems = pItems;
- pKeys = new _Key[(strideSize * 2) + 4];
+ _Key* tKeys = pKeys;
+ _Item* tItems = pItems;
+ pKeys = new _Key[(strideSize * 2) + 4];
memcpy(pKeys, tKeys, strideSize * sizeof(_Key));
pItems = new _Item[(strideSize * 2) + 4];
memcpy(pItems, tItems, strideSize * sizeof(_Item));
- strideSize = (strideSize * 2) + 4;
- delete []tKeys;
- delete []tItems;
+ strideSize = (strideSize * 2) + 4;
+ delete[] tKeys;
+ delete[] tItems;
}
unsigned int insert = 0;
- //Find the right place to insert O(n) version
-/* for(;insert < numItems; insert++)
- {
- int res = memcmp(&pKeys[insert], &key, sizeof(_Key));
- if(res == 0)
- return false;
- if(res>0)
- break;
- }
-*/
- //O(log n) version
+ // Find the right place to insert O(n) version
+ /* for(;insert < numItems; insert++)
+ {
+ int res = memcmp(&pKeys[insert], &key, sizeof(_Key));
+ if(res == 0)
+ return false;
+ if(res>0)
+ break;
+ }
+ */
+ // O(log n) version
int first = 0;
- int mid = 0;
- int last = numItems-1;
+ int mid = 0;
+ int last = numItems - 1;
while (first <= last)
{
- mid = (first + last) / 2; // compute mid point.
- int res = memcmp(&pKeys[mid], &key, sizeof(_Key));
-
- if (res < 0)
- first = mid + 1; // repeat search in top half.
- else if (res > 0)
- last = mid - 1; // repeat search in bottom half.
- else
- return false; // found it. return position /////
+ mid = (first + last) / 2; // compute mid point.
+ int res = memcmp(&pKeys[mid], &key, sizeof(_Key));
+
+ if (res < 0)
+ first = mid + 1; // repeat search in top half.
+ else if (res > 0)
+ last = mid - 1; // repeat search in bottom half.
+ else
+ return false; // found it. return position /////
}
insert = first;
- if(insert!=first)
+ if (insert != first)
{
LogDebug("index = %u f %u mid = %u l %u***************************", insert, first, mid, last);
__debugbreak();
}
- if(numItems>0)
+ if (numItems > 0)
{
- for(unsigned int i=numItems; i>insert; i--)
+ for (unsigned int i = numItems; i > insert; i--)
{
- pKeys[i] = pKeys[i-1];
- pItems[i] = pItems[i-1];
+ pKeys[i] = pKeys[i - 1];
+ pItems[i] = pItems[i - 1];
}
}
- pKeys[insert] = key;
+ pKeys[insert] = key;
pItems[insert] = item;
numItems++;
return true;
@@ -370,24 +368,24 @@ public:
int GetIndex(_Key key)
{
- if(numItems == 0)
+ if (numItems == 0)
return -1;
- //O(log n) version
+ // O(log n) version
int first = 0;
- int mid = 0;
- int last = numItems;
+ int mid = 0;
+ int last = numItems;
while (first <= last)
{
- mid = (first + last) / 2; // compute mid point.
- int res = memcmp(&pKeys[mid], &key, sizeof(_Key));
-
- if (res < 0)
- first = mid + 1; // repeat search in top half.
- else if (res > 0)
- last = mid - 1; // repeat search in bottom half.
- else
- return mid; // found it. return position /////
+ mid = (first + last) / 2; // compute mid point.
+ int res = memcmp(&pKeys[mid], &key, sizeof(_Key));
+
+ if (res < 0)
+ first = mid + 1; // repeat search in top half.
+ else if (res > 0)
+ last = mid - 1; // repeat search in bottom half.
+ else
+ return mid; // found it. return position /////
}
return -1; // Didn't find key
}
@@ -395,7 +393,7 @@ public:
_Item GetItem(int index)
{
AssertCodeMsg(index != -1, EXCEPTIONCODE_LWM, "Didn't find Key");
- return pItems[index]; // found it. return position /////
+ return pItems[index]; // found it. return position /////
}
_Key GetKey(int index)
@@ -410,12 +408,12 @@ public:
return GetItem(index);
}
- _Item *GetRawItems()
+ _Item* GetRawItems()
{
return pItems;
}
- _Key *GetRawKeys()
+ _Key* GetRawKeys()
{
return pKeys;
}
@@ -426,27 +424,26 @@ public:
}
private:
-
void InitialClear()
{
- numItems = 0;
+ numItems = 0;
strideSize = 0;
- pKeys = nullptr;
- pItems = nullptr;
+ pKeys = nullptr;
+ pItems = nullptr;
}
- unsigned int numItems; // Number of active items in the pKeys and pItems arrays.
- unsigned int strideSize; // Allocated count of items in the pKeys and pItems arrays.
- _Key *pKeys;
- _Item *pItems;
+ unsigned int numItems; // Number of active items in the pKeys and pItems arrays.
+ unsigned int strideSize; // Allocated count of items in the pKeys and pItems arrays.
+ _Key* pKeys;
+ _Item* pItems;
};
-
// Second implementation of LightWeightMap where the Key type is an unsigned int in the range [0 .. numItems - 1] (where
// numItems is the number of items stored in the map). Keys are not stored, since the index into the pItems array is
-// the key. Appending to the end of the map is O(1), since we don't have to search for it, and we don't have to move anything down.
+// the key. Appending to the end of the map is O(1), since we don't have to search for it, and we don't have to move
+// anything down.
-template<typename _Item>
+template <typename _Item>
class DenseLightWeightMap : public LightWeightMapBuffer
{
public:
@@ -455,19 +452,19 @@ public:
InitialClear();
}
- DenseLightWeightMap(const DenseLightWeightMap &lwm)
+ DenseLightWeightMap(const DenseLightWeightMap& lwm)
{
InitialClear();
- numItems = lwm.numItems;
- strideSize = lwm.strideSize;
+ numItems = lwm.numItems;
+ strideSize = lwm.strideSize;
bufferLength = lwm.bufferLength;
- if(lwm.pItems!=nullptr)
+ if (lwm.pItems != nullptr)
{
pItems = new _Item[numItems];
memcpy(pItems, lwm.pItems, numItems * sizeof(_Item));
}
- if((lwm.buffer!=nullptr)&&(lwm.bufferLength>0))
+ if ((lwm.buffer != nullptr) && (lwm.bufferLength > 0))
{
buffer = new unsigned char[lwm.bufferLength];
memcpy(buffer, lwm.buffer, lwm.bufferLength);
@@ -476,14 +473,14 @@ public:
~DenseLightWeightMap()
{
- if(pItems!=nullptr)
- delete []pItems;
+ if (pItems != nullptr)
+ delete[] pItems;
}
- void ReadFromArray(const unsigned char *rawData, unsigned int size)
+ void ReadFromArray(const unsigned char* rawData, unsigned int size)
{
- unsigned int sizeOfItem = sizeof(_Item);
- const unsigned char *ptr = rawData;
+ unsigned int sizeOfItem = sizeof(_Item);
+ const unsigned char* ptr = rawData;
// Check tag; if this is a v1 LWM, convert it to a DenseLightWeightMap in memory
if (0 != memcmp(ptr, "DWM1", 4))
@@ -497,59 +494,59 @@ public:
ptr += sizeof(unsigned int);
strideSize = numItems;
- if(numItems > 0)
+ if (numItems > 0)
{
- //Read the buffersize
+ // Read the buffersize
memcpy(&bufferLength, ptr, sizeof(unsigned int));
ptr += sizeof(unsigned int);
AssertCodeMsg(pItems == nullptr, EXCEPTIONCODE_LWM, "Found existing pItems");
pItems = new _Item[numItems];
- //Set the Items
+ // Set the Items
memcpy(pItems, ptr, sizeOfItem * numItems);
ptr += sizeOfItem * numItems;
AssertCodeMsg(buffer == nullptr, EXCEPTIONCODE_LWM, "Found existing buffer");
buffer = new unsigned char[bufferLength];
- //Read the buffer
+ // Read the buffer
memcpy(buffer, ptr, bufferLength * sizeof(unsigned char));
ptr += bufferLength * sizeof(unsigned char);
}
- AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", ptr - rawData, size);
+ AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x",
+ ptr - rawData, size);
}
private:
-
- void ReadFromArrayAndConvertLWM1(const unsigned char *rawData, unsigned int size)
+ void ReadFromArrayAndConvertLWM1(const unsigned char* rawData, unsigned int size)
{
- unsigned int sizeOfKey = sizeof(DWORD);
- unsigned int sizeOfItem = sizeof(_Item);
- const unsigned char *ptr = rawData;
+ unsigned int sizeOfKey = sizeof(DWORD);
+ unsigned int sizeOfItem = sizeof(_Item);
+ const unsigned char* ptr = rawData;
memcpy(&numItems, ptr, sizeof(unsigned int));
ptr += sizeof(unsigned int);
strideSize = numItems;
- if(numItems > 0)
+ if (numItems > 0)
{
- //Read the buffersize
+ // Read the buffersize
memcpy(&bufferLength, ptr, sizeof(unsigned int));
ptr += sizeof(unsigned int);
DWORD* tKeys = new DWORD[numItems];
- //Set the Keys
+ // Set the Keys
memcpy(tKeys, ptr, sizeOfKey * numItems);
ptr += sizeOfKey * numItems;
_Item* tItems = new _Item[numItems];
- //Set the Items
+ // Set the Items
memcpy(tItems, ptr, sizeOfItem * numItems);
ptr += sizeOfItem * numItems;
AssertCodeMsg(buffer == nullptr, EXCEPTIONCODE_LWM, "Found existing buffer");
buffer = new unsigned char[bufferLength];
- //Read the buffer
+ // Read the buffer
memcpy(buffer, ptr, bufferLength * sizeof(unsigned char));
ptr += bufferLength * sizeof(unsigned char);
@@ -567,7 +564,7 @@ private:
AssertCodeMsg(key < numItems, EXCEPTIONCODE_LWM, "Illegal key %d, numItems == %d", key, numItems);
AssertCodeMsg(!tKeySeen[key], EXCEPTIONCODE_LWM, "Duplicate key %d", key);
tKeySeen[key] = true;
- pItems[key] = tItems[index];
+ pItems[key] = tItems[index];
}
// Note that if we get here, we've seen every key [0 .. numItems - 1].
@@ -576,68 +573,69 @@ private:
delete[] tItems;
}
- AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", ptr - rawData, size);
+ AssertCodeMsg((ptr - rawData) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x",
+ ptr - rawData, size);
}
public:
-
unsigned int CalculateArraySize()
{
int size = 4 /* tag */ + sizeof(unsigned int) /* numItems */;
- if(numItems >0)
+ if (numItems > 0)
{
- size += sizeof(unsigned int); //size of bufferLength
- size += sizeof(_Item) * numItems; //size of itemset
- size += sizeof(unsigned char) * bufferLength; //bulk size of raw buffer
+ size += sizeof(unsigned int); // size of bufferLength
+ size += sizeof(_Item) * numItems; // size of itemset
+ size += sizeof(unsigned char) * bufferLength; // bulk size of raw buffer
}
return size;
}
- unsigned int DumpToArray(unsigned char *bytes)
+ unsigned int DumpToArray(unsigned char* bytes)
{
- unsigned char *ptr = bytes;
- unsigned int size = CalculateArraySize();
+ unsigned char* ptr = bytes;
+ unsigned int size = CalculateArraySize();
- //Write the tag
+ // Write the tag
memcpy(ptr, "DWM1", 4);
ptr += 4;
- //Write the header
+ // Write the header
memcpy(ptr, &numItems, sizeof(unsigned int));
ptr += sizeof(unsigned int);
- if(numItems > 0)
+ if (numItems > 0)
{
unsigned int sizeOfItem = sizeof(_Item);
- //Write the buffersize
+ // Write the buffersize
memcpy(ptr, &bufferLength, sizeof(unsigned int));
ptr += sizeof(unsigned int);
- //Write the Items
+ // Write the Items
memcpy(ptr, pItems, sizeOfItem * numItems);
ptr += sizeOfItem * numItems;
- //Write the buffer
+ // Write the buffer
memcpy(ptr, buffer, bufferLength * sizeof(unsigned char));
ptr += bufferLength * sizeof(unsigned char);
}
- AssertCodeMsg((ptr - bytes) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", ptr - bytes, size);
+ AssertCodeMsg((ptr - bytes) == size, EXCEPTIONCODE_LWM, "Ended with unexpected sizes %Ix != %x", ptr - bytes,
+ size);
return size;
}
bool Append(_Item item)
{
- //Make sure we have space left, expand if needed
+ // Make sure we have space left, expand if needed
if (numItems == strideSize)
{
// NOTE: if this is the first allocation, we'll just allocate 4 items. ok?
- _Item *tItems = pItems;
- pItems = new _Item[(strideSize * 2) + 4];
+ _Item* tItems = pItems;
+ pItems = new _Item[(strideSize * 2) + 4];
memcpy(pItems, tItems, strideSize * sizeof(_Item));
- strideSize = (strideSize * 2) + 4;
- delete []tItems;
+ strideSize = (strideSize * 2) + 4;
+ delete[] tItems;
}
pItems[numItems] = item;
@@ -656,7 +654,7 @@ public:
_Item GetItem(int index)
{
AssertCodeMsg(index != -1, EXCEPTIONCODE_LWM, "Didn't find Key");
- return pItems[index]; // found it. return position /////
+ return pItems[index]; // found it. return position /////
}
_Item Get(unsigned int key)
@@ -665,7 +663,7 @@ public:
return GetItem(index);
}
- _Item *GetRawItems()
+ _Item* GetRawItems()
{
return pItems;
}
@@ -676,12 +674,11 @@ public:
}
private:
-
void InitialClear()
{
- numItems = 0;
+ numItems = 0;
strideSize = 0;
- pItems = nullptr;
+ pItems = nullptr;
}
static int CompareKeys(unsigned int key1, unsigned int key2)
@@ -694,33 +691,33 @@ private:
return 0; // equal
}
- unsigned int numItems; // Number of active items in the pKeys and pItems arrays.
- unsigned int strideSize; // Allocated count of items in the pKeys and pItems arrays.
- _Item *pItems;
+ unsigned int numItems; // Number of active items in the pKeys and pItems arrays.
+ unsigned int strideSize; // Allocated count of items in the pKeys and pItems arrays.
+ _Item* pItems;
};
-#define dumpLWM(ptr,mapName) \
- if (ptr->mapName != nullptr) \
- { \
- printf("%s - %u\n", #mapName, ptr->mapName->GetCount()); \
- for (unsigned int i = 0; i < ptr->mapName->GetCount(); i++) \
- { \
- printf("%u-", i); \
- ptr->dmp##mapName(ptr->mapName->GetRawKeys()[i], ptr->mapName->GetRawItems()[i]); \
- printf("\n"); \
- } \
- }
-
-#define dumpLWMDense(ptr,mapName) \
- if (ptr->mapName != nullptr) \
- { \
- printf("%s - %u\n", #mapName, ptr->mapName->GetCount()); \
- for (unsigned int i = 0; i < ptr->mapName->GetCount(); i++) \
- { \
- printf("%u-", i); \
- ptr->dmp##mapName(i, ptr->mapName->GetRawItems()[i]); \
- printf("\n"); \
- } \
+#define dumpLWM(ptr, mapName) \
+ if (ptr->mapName != nullptr) \
+ { \
+ printf("%s - %u\n", #mapName, ptr->mapName->GetCount()); \
+ for (unsigned int i = 0; i < ptr->mapName->GetCount(); i++) \
+ { \
+ printf("%u-", i); \
+ ptr->dmp##mapName(ptr->mapName->GetRawKeys()[i], ptr->mapName->GetRawItems()[i]); \
+ printf("\n"); \
+ } \
+ }
+
+#define dumpLWMDense(ptr, mapName) \
+ if (ptr->mapName != nullptr) \
+ { \
+ printf("%s - %u\n", #mapName, ptr->mapName->GetCount()); \
+ for (unsigned int i = 0; i < ptr->mapName->GetCount(); i++) \
+ { \
+ printf("%u-", i); \
+ ptr->dmp##mapName(i, ptr->mapName->GetRawItems()[i]); \
+ printf("\n"); \
+ } \
}
#endif // _LightWeightMap
diff --git a/src/ToolBox/superpmi/superpmi-shared/logging.cpp b/src/ToolBox/superpmi/superpmi-shared/logging.cpp
index 69c321bb39..bd7de08da1 100644
--- a/src/ToolBox/superpmi/superpmi-shared/logging.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/logging.cpp
@@ -17,10 +17,10 @@
// that occur while logging will print a message to the console. Fatal errors trigger a debugbreak.
//
-bool Logger::s_initialized = false;
-UINT32 Logger::s_logLevel = LOGMASK_DEFAULT;
-HANDLE Logger::s_logFile = INVALID_HANDLE_VALUE;
-char *Logger::s_logFilePath = nullptr;
+bool Logger::s_initialized = false;
+UINT32 Logger::s_logLevel = LOGMASK_DEFAULT;
+HANDLE Logger::s_logFile = INVALID_HANDLE_VALUE;
+char* Logger::s_logFilePath = nullptr;
CRITICAL_SECTION Logger::s_critSec;
//
@@ -54,17 +54,12 @@ void Logger::Shutdown()
// Opens a log file at the given path and enables file-based logging, if the given path is valid.
//
/* static */
-void Logger::OpenLogFile(char *logFilePath)
+void Logger::OpenLogFile(char* logFilePath)
{
if (s_logFile == INVALID_HANDLE_VALUE && logFilePath != nullptr)
{
- s_logFile = CreateFileA(logFilePath,
- GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_DELETE,
- NULL,
- CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
- NULL);
+ s_logFile = CreateFileA(logFilePath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (s_logFile != INVALID_HANDLE_VALUE)
{
@@ -73,7 +68,8 @@ void Logger::OpenLogFile(char *logFilePath)
}
else
{
- fprintf(stderr, "WARNING: [Logger::OpenLogFile] Failed to open log file '%s'. GetLastError()=%u\n", logFilePath, GetLastError());
+ fprintf(stderr, "WARNING: [Logger::OpenLogFile] Failed to open log file '%s'. GetLastError()=%u\n",
+ logFilePath, GetLastError());
}
}
}
@@ -92,7 +88,8 @@ void Logger::CloseLogFile()
// We can call this before closing the handle because DeleteFile just marks the file
// for deletion, i.e. it does not actually get deleted until its last handle is closed.
if (!DeleteFileA(s_logFilePath))
- fprintf(stderr, "WARNING: [Logger::CloseLogFile] DeleteFile failed. GetLastError()=%u\n", GetLastError());
+ fprintf(stderr, "WARNING: [Logger::CloseLogFile] DeleteFile failed. GetLastError()=%u\n",
+ GetLastError());
}
if (!CloseHandle(s_logFile))
@@ -118,13 +115,13 @@ void Logger::CloseLogFile()
// to avoid looking up all the log levels and enabling them all by specifying all the individual characters.
//
/* static */
-UINT32 Logger::ParseLogLevelString(const char *specifierStr)
+UINT32 Logger::ParseLogLevelString(const char* specifierStr)
{
UINT32 logLevelMask = LOGMASK_NONE;
- if (strchr(specifierStr, 'q') == nullptr) // "Quiet" overrides all other specifiers
+ if (strchr(specifierStr, 'q') == nullptr) // "Quiet" overrides all other specifiers
{
- if (strchr(specifierStr, 'a') != nullptr) // "All" overrides the other specifiers
+ if (strchr(specifierStr, 'a') != nullptr) // "All" overrides the other specifiers
{
logLevelMask |= LOGMASK_ALL;
}
@@ -157,8 +154,7 @@ UINT32 Logger::ParseLogLevelString(const char *specifierStr)
}
/* static */
-void Logger::LogPrintf(const char *function, const char *file, int line,
- LogLevel level, const char *msg, ...)
+void Logger::LogPrintf(const char* function, const char* file, int line, LogLevel level, const char* msg, ...)
{
va_list argList;
va_start(argList, msg);
@@ -170,8 +166,8 @@ void Logger::LogPrintf(const char *function, const char *file, int line,
// main logging function that all other logging functions eventually funnel into.
//
/* static */
-void Logger::LogVprintf(const char *function, const char *file, int line,
- LogLevel level, va_list argList, const char *msg)
+void Logger::LogVprintf(
+ const char* function, const char* file, int line, LogLevel level, va_list argList, const char* msg)
{
if (!s_initialized)
{
@@ -182,42 +178,42 @@ void Logger::LogVprintf(const char *function, const char *file, int line,
// Capture this first to make the timestamp more accurately reflect the actual time of logging
time_t timestamp = time(nullptr);
- int fullMsgLen = _vscprintf(msg, argList) + 1; // This doesn't count the null terminator
- char *fullMsg = new char[fullMsgLen];
+ int fullMsgLen = _vscprintf(msg, argList) + 1; // This doesn't count the null terminator
+ char* fullMsg = new char[fullMsgLen];
_vsnprintf_s(fullMsg, fullMsgLen, fullMsgLen, msg, argList);
va_end(argList);
- const char *logLevelStr = "INVALID_LOGLEVEL";
+ const char* logLevelStr = "INVALID_LOGLEVEL";
switch (level)
{
- case LOGLEVEL_ERROR:
- logLevelStr = "ERROR";
- break;
+ case LOGLEVEL_ERROR:
+ logLevelStr = "ERROR";
+ break;
- case LOGLEVEL_WARNING:
- logLevelStr = "WARNING";
- break;
+ case LOGLEVEL_WARNING:
+ logLevelStr = "WARNING";
+ break;
- case LOGLEVEL_MISSING:
- logLevelStr = "MISSING";
- break;
+ case LOGLEVEL_MISSING:
+ logLevelStr = "MISSING";
+ break;
- case LOGLEVEL_ISSUE:
- logLevelStr = "ISSUE";
- break;
+ case LOGLEVEL_ISSUE:
+ logLevelStr = "ISSUE";
+ break;
- case LOGLEVEL_INFO:
- logLevelStr = "INFO";
- break;
+ case LOGLEVEL_INFO:
+ logLevelStr = "INFO";
+ break;
- case LOGLEVEL_VERBOSE:
- logLevelStr = "VERBOSE";
- break;
+ case LOGLEVEL_VERBOSE:
+ logLevelStr = "VERBOSE";
+ break;
- case LOGLEVEL_DEBUG:
- logLevelStr = "DEBUG";
- break;
+ case LOGLEVEL_DEBUG:
+ logLevelStr = "DEBUG";
+ break;
}
// NOTE: This implementation doesn't guarantee that log messages will be written in chronological
@@ -230,7 +226,7 @@ void Logger::LogVprintf(const char *function, const char *file, int line,
if (level & GetLogLevel())
{
// Sends error messages to stderr instead out stdout
- FILE *dest = (level <= LOGLEVEL_WARNING) ? stderr : stdout;
+ FILE* dest = (level <= LOGLEVEL_WARNING) ? stderr : stdout;
if (level < LOGLEVEL_INFO)
fprintf(dest, "%s: ", logLevelStr);
@@ -240,7 +236,7 @@ void Logger::LogVprintf(const char *function, const char *file, int line,
if (s_logFile != INVALID_HANDLE_VALUE)
{
#ifndef FEATURE_PAL // TODO: no localtime_s() or strftime() in PAL
- tm timeInfo;
+ tm timeInfo;
errno_t err = localtime_s(&timeInfo, &timestamp);
if (err != 0)
{
@@ -249,34 +245,35 @@ void Logger::LogVprintf(const char *function, const char *file, int line,
}
size_t timeStrBuffSize = 20 * sizeof(char);
- char *timeStr = (char *)malloc(timeStrBuffSize); // Use malloc so we can realloc if necessary
+ char* timeStr = (char*)malloc(timeStrBuffSize); // Use malloc so we can realloc if necessary
// This particular format string should always generate strings of the same size, but
// for the sake of robustness, we shouldn't rely on that assumption.
while (strftime(timeStr, timeStrBuffSize, "%Y-%m-%d %H:%M:%S", &timeInfo) == 0)
{
timeStrBuffSize *= 2;
- timeStr = (char *)realloc(timeStr, timeStrBuffSize);
+ timeStr = (char*)realloc(timeStr, timeStrBuffSize);
}
-#else // FEATURE_PAL
- const char *timeStr = "";
+#else // FEATURE_PAL
+ const char* timeStr = "";
#endif // FEATURE_PAL
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);
+ 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,
- timeStr, function, file, line, logLevelStr, fullMsg);
+ char* logEntry = new char[logEntryBuffSize];
+ sprintf_s(logEntry, logEntryBuffSize, logEntryFmtStr, timeStr, function, file, line, logLevelStr, fullMsg);
DWORD bytesWritten;
if (!WriteFile(s_logFile, logEntry, (DWORD)logEntryBuffSize - 1, &bytesWritten, nullptr))
- fprintf(stderr, "WARNING: [Logger::LogVprintf] Failed to write to log file. GetLastError()=%u\n", GetLastError());
+ fprintf(stderr, "WARNING: [Logger::LogVprintf] Failed to write to log file. GetLastError()=%u\n",
+ GetLastError());
if (!FlushFileBuffers(s_logFile))
- fprintf(stderr, "WARNING: [Logger::LogVprintf] Failed to flush log file. GetLastError()=%u\n", GetLastError());
+ fprintf(stderr, "WARNING: [Logger::LogVprintf] Failed to flush log file. GetLastError()=%u\n",
+ GetLastError());
delete[] logEntry;
@@ -298,8 +295,8 @@ CleanUp:
// Special helper for logging exceptions. This logs the exception message given as a debug message.
//
/* static */
-void Logger::LogExceptionMessage(const char *function, const char *file, int line,
- DWORD exceptionCode, const char *msg, ...)
+void Logger::LogExceptionMessage(
+ const char* function, const char* file, int line, DWORD exceptionCode, const char* msg, ...)
{
std::string fullMsg = "Exception thrown: ";
fullMsg += msg;
@@ -313,24 +310,24 @@ void Logger::LogExceptionMessage(const char *function, const char *file, int lin
// Logger for JIT issues. Identifies the issue type and logs the given message normally.
//
/* static */
-void IssueLogger::LogIssueHelper(const char *function, const char *file, int line,
- IssueType issue, const char *msg, ...)
+void IssueLogger::LogIssueHelper(
+ const char* function, const char* file, int line, IssueType issue, const char* msg, ...)
{
std::string fullMsg;
switch (issue)
{
- case ISSUE_ASSERT:
- fullMsg += "<ASSERT>";
- break;
+ case ISSUE_ASSERT:
+ fullMsg += "<ASSERT>";
+ break;
- case ISSUE_ASM_DIFF:
- fullMsg += "<ASM_DIFF>";
- break;
+ case ISSUE_ASM_DIFF:
+ fullMsg += "<ASM_DIFF>";
+ break;
- default:
- fullMsg += "<UNKNOWN_ISSUE_TYPE>";
- break;
+ default:
+ fullMsg += "<UNKNOWN_ISSUE_TYPE>";
+ break;
}
fullMsg += " ";
diff --git a/src/ToolBox/superpmi/superpmi-shared/logging.h b/src/ToolBox/superpmi/superpmi-shared/logging.h
index a2c388ee3e..dbde4af3fc 100644
--- a/src/ToolBox/superpmi/superpmi-shared/logging.h
+++ b/src/ToolBox/superpmi/superpmi-shared/logging.h
@@ -13,43 +13,42 @@
// General purpose logging macros
//
-#define LogMessage(level, ...) \
- Logger::LogPrintf(__func__, __FILE__, __LINE__, level, __VA_ARGS__)
+#define LogMessage(level, ...) Logger::LogPrintf(__func__, __FILE__, __LINE__, level, __VA_ARGS__)
-#define LogError(...) LogMessage(LOGLEVEL_ERROR, __VA_ARGS__)
+#define LogError(...) LogMessage(LOGLEVEL_ERROR, __VA_ARGS__)
#define LogWarning(...) LogMessage(LOGLEVEL_WARNING, __VA_ARGS__)
#define LogMissing(...) LogMessage(LOGLEVEL_MISSING, __VA_ARGS__)
-#define LogInfo(...) LogMessage(LOGLEVEL_INFO, __VA_ARGS__)
+#define LogInfo(...) LogMessage(LOGLEVEL_INFO, __VA_ARGS__)
#define LogVerbose(...) LogMessage(LOGLEVEL_VERBOSE, __VA_ARGS__)
-#define LogDebug(...) LogMessage(LOGLEVEL_DEBUG, __VA_ARGS__)
+#define LogDebug(...) LogMessage(LOGLEVEL_DEBUG, __VA_ARGS__)
-#define LogIssue(issue, msg, ...) \
- IssueLogger::LogIssueHelper(__FUNCTION__, __FILE__, __LINE__, issue, msg, __VA_ARGS__)
+#define LogIssue(issue, msg, ...) IssueLogger::LogIssueHelper(__FUNCTION__, __FILE__, __LINE__, issue, msg, __VA_ARGS__)
// Captures the exception message before throwing so we can log it at the point of occurrence
-#define LogException(exCode, msg, ...) \
- do { \
- Logger::LogExceptionMessage(__FUNCTION__, __FILE__, __LINE__, exCode, msg, __VA_ARGS__); \
- ThrowException(exCode, msg, __VA_ARGS__); \
+#define LogException(exCode, msg, ...) \
+ do \
+ { \
+ Logger::LogExceptionMessage(__FUNCTION__, __FILE__, __LINE__, exCode, msg, __VA_ARGS__); \
+ ThrowException(exCode, msg, __VA_ARGS__); \
} while (0)
// These are specified as flags so subsets of the logging functionality can be enabled/disabled at once
enum LogLevel : UINT32
{
- LOGLEVEL_ERROR = 0x00000001, // Internal fatal errors that are non-recoverable
- LOGLEVEL_WARNING = 0x00000002, // Internal conditions that are unusual, but not serious
- LOGLEVEL_MISSING = 0x00000004, // Failures to due to missing JIT-EE details
- LOGLEVEL_ISSUE = 0x00000008, // Issues found with the JIT, e.g. asm diffs, asserts
- LOGLEVEL_INFO = 0x00000010, // Notifications/summaries, e.g. 'Loaded 5 Jitted 4 FailedCompile 1'
- LOGLEVEL_VERBOSE = 0x00000020, // Status messages, e.g. 'Jit startup took 151.12ms'
- LOGLEVEL_DEBUG = 0x00000040 // Detailed output that's only useful for SuperPMI debugging
+ LOGLEVEL_ERROR = 0x00000001, // Internal fatal errors that are non-recoverable
+ LOGLEVEL_WARNING = 0x00000002, // Internal conditions that are unusual, but not serious
+ LOGLEVEL_MISSING = 0x00000004, // Failures to due to missing JIT-EE details
+ LOGLEVEL_ISSUE = 0x00000008, // Issues found with the JIT, e.g. asm diffs, asserts
+ LOGLEVEL_INFO = 0x00000010, // Notifications/summaries, e.g. 'Loaded 5 Jitted 4 FailedCompile 1'
+ LOGLEVEL_VERBOSE = 0x00000020, // Status messages, e.g. 'Jit startup took 151.12ms'
+ LOGLEVEL_DEBUG = 0x00000040 // Detailed output that's only useful for SuperPMI debugging
};
// Preset log level combinations
enum LogLevelMask : UINT32
{
LOGMASK_NONE = 0x00000000,
- LOGMASK_DEFAULT = (LOGLEVEL_DEBUG - 1), // Default is essentially "enable everything except debug"
+ LOGMASK_DEFAULT = (LOGLEVEL_DEBUG - 1), // Default is essentially "enable everything except debug"
LOGMASK_ALL = 0xffffffff
};
@@ -59,32 +58,40 @@ enum LogLevelMask : UINT32
class Logger
{
private:
- static bool s_initialized;
- static UINT32 s_logLevel;
- static HANDLE s_logFile;
- static char *s_logFilePath;
+ static bool s_initialized;
+ static UINT32 s_logLevel;
+ static HANDLE s_logFile;
+ static char* s_logFilePath;
static CRITICAL_SECTION s_critSec;
public:
static void Initialize();
static void Shutdown();
- static void OpenLogFile(char *logFilePath);
+ static void OpenLogFile(char* logFilePath);
static void CloseLogFile();
- static UINT32 ParseLogLevelString(const char *specifierStr);
- static void SetLogLevel(UINT32 logLevelMask) { s_logLevel = logLevelMask; }
- static UINT32 GetLogLevel() { return s_logLevel; }
+ static UINT32 ParseLogLevelString(const char* specifierStr);
+ static void SetLogLevel(UINT32 logLevelMask)
+ {
+ s_logLevel = logLevelMask;
+ }
+ static UINT32 GetLogLevel()
+ {
+ return s_logLevel;
+ }
// Return true if all specified log levels are enabled.
- static bool IsLogLevelEnabled(UINT32 logLevelMask) { return (logLevelMask & GetLogLevel()) == logLevelMask; }
-
- static void LogPrintf(const char *function, const char *file, int line,
- LogLevel level, const char *msg, ...);
- static void LogVprintf(const char *function, const char *file, int line,
- LogLevel level, va_list argList, const char *msg);
- static void LogExceptionMessage(const char *function, const char *file, int line,
- DWORD exceptionCode, const char *msg, ...);
+ static bool IsLogLevelEnabled(UINT32 logLevelMask)
+ {
+ return (logLevelMask & GetLogLevel()) == logLevelMask;
+ }
+
+ static void LogPrintf(const char* function, const char* file, int line, LogLevel level, const char* msg, ...);
+ static void LogVprintf(
+ const char* function, const char* file, int line, LogLevel level, va_list argList, const char* msg);
+ static void LogExceptionMessage(
+ const char* function, const char* file, int line, DWORD exceptionCode, const char* msg, ...);
};
enum IssueType
@@ -101,8 +108,7 @@ enum IssueType
class IssueLogger
{
public:
- static void LogIssueHelper(const char *function, const char *file, int line,
- IssueType issue, const char *msg, ...);
+ static void LogIssueHelper(const char* function, const char* file, int line, IssueType issue, const char* msg, ...);
};
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/mclist.cpp b/src/ToolBox/superpmi/superpmi-shared/mclist.cpp
index 511893fc96..b8141a57bd 100644
--- a/src/ToolBox/superpmi/superpmi-shared/mclist.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/mclist.cpp
@@ -11,14 +11,14 @@
#include "mclist.h"
#include "logging.h"
-bool MCList::processArgAsMCL(char *input, int *count, int **list)
+bool MCList::processArgAsMCL(char* input, int* count, int** list)
{
// If it contains only '0-9', '-', ',' try to see it as a range list, else try to load as a file
bool isRangeList = true;
size_t len = strlen(input);
- for (unsigned int i=0; (i < len) && isRangeList; i++)
+ for (unsigned int i = 0; (i < len) && isRangeList; i++)
{
if ((input[i] != '-') && (input[i] != ',') && (!isdigit((unsigned char)input[i])))
isRangeList = false;
@@ -26,36 +26,36 @@ bool MCList::processArgAsMCL(char *input, int *count, int **list)
if (isRangeList)
{
- //Count items
- *count = 0;
+ // Count items
+ *count = 0;
unsigned rangeStart = 0;
- bool inRange = false;
- unsigned scratch = 0;
- bool foundDigit = false;
+ bool inRange = false;
+ unsigned scratch = 0;
+ bool foundDigit = false;
- char *tail = input+len;
+ char* tail = input + len;
- for(char* head = input; head <= tail; head++)
+ for (char* head = input; head <= tail; head++)
{
- scratch = 0;
+ scratch = 0;
foundDigit = false;
- while((head<=tail)&&(isdigit((unsigned char)*head)))
+ while ((head <= tail) && (isdigit((unsigned char)*head)))
{
- scratch = (scratch*10)+((*head)-'0');
+ scratch = (scratch * 10) + ((*head) - '0');
foundDigit = true;
head++;
}
- if(foundDigit)
+ if (foundDigit)
{
- if(inRange)
+ if (inRange)
{
inRange = false;
- if(rangeStart>=scratch)
+ if (rangeStart >= scratch)
{
LogError("Invalid range in '%s'", input);
return false;
}
- (*count) += scratch-rangeStart;
+ (*count) += scratch - rangeStart;
}
else
{
@@ -63,7 +63,7 @@ bool MCList::processArgAsMCL(char *input, int *count, int **list)
(*count)++;
}
}
- if(*head == '-')
+ if (*head == '-')
inRange = true;
}
@@ -73,42 +73,42 @@ bool MCList::processArgAsMCL(char *input, int *count, int **list)
return false;
}
- inRange = false;
+ inRange = false;
rangeStart = 0;
- int *ll = new int[*count];
- *list = ll;
+ int* ll = new int[*count];
+ *list = ll;
int index = 0;
ll[index] = 0;
- for(char* head = input; head <= tail; head++)
+ for (char* head = input; head <= tail; head++)
{
- scratch = 0;
+ scratch = 0;
foundDigit = false;
- while((head<=tail)&&(isdigit((unsigned char)*head)))
+ while ((head <= tail) && (isdigit((unsigned char)*head)))
{
- scratch = (scratch*10)+((*head)-'0');
+ scratch = (scratch * 10) + ((*head) - '0');
foundDigit = true;
head++;
}
- if(foundDigit)
+ if (foundDigit)
{
- if(inRange)
+ if (inRange)
{
inRange = false;
- for(unsigned int i=rangeStart+1;i<=scratch;i++)
- ll[index++] = i;
+ for (unsigned int i = rangeStart + 1; i <= scratch; i++)
+ ll[index++] = i;
}
else
{
- rangeStart = scratch;
+ rangeStart = scratch;
ll[index++] = scratch;
}
}
- if(*head == '-')
+ if (*head == '-')
inRange = true;
}
- if(inRange)
+ if (inRange)
{
LogError("Found invalid external range in '%s'", input);
return false;
@@ -117,10 +117,10 @@ bool MCList::processArgAsMCL(char *input, int *count, int **list)
}
else
{
- char *lastdot = strrchr(input,'.');
- if(lastdot != nullptr && _stricmp(lastdot, ".mcl")==0)
+ char* lastdot = strrchr(input, '.');
+ if (lastdot != nullptr && _stricmp(lastdot, ".mcl") == 0)
{
- //Read MCLFile
+ // Read MCLFile
if (!getLineData(input, count, list))
return false;
if (*count >= 0)
@@ -129,8 +129,8 @@ bool MCList::processArgAsMCL(char *input, int *count, int **list)
return false;
}
-checkMCL: //check that mcl list is increasing only
- int *ll = (*list);
+checkMCL: // check that mcl list is increasing only
+ int* ll = (*list);
if (ll[0] == 0)
{
LogError("MCL list needs to start from 1!");
@@ -138,7 +138,7 @@ checkMCL: //check that mcl list is increasing only
}
for (int i = 1; i < *count; i++)
{
- if (ll[i-1] >= ll[i])
+ if (ll[i - 1] >= ll[i])
{
LogError("MCL list must be increasing.. found %d -> %d", ll[i - 1], ll[i]);
return false;
@@ -148,12 +148,13 @@ checkMCL: //check that mcl list is increasing only
}
// Returns true on success, false on failure.
-// On success, sets *pIndexCount to the number of indices read, and *pIndexes to a new array with all the indices read. The caller must
-// free the memory with delete[].
+// On success, sets *pIndexCount to the number of indices read, and *pIndexes to a new array with all the indices read.
+// The caller must free the memory with delete[].
/* static */
-bool MCList::getLineData(const char *nameOfInput, /* OUT */ int *pIndexCount, /* OUT */ int **pIndexes)
+bool MCList::getLineData(const char* nameOfInput, /* OUT */ int* pIndexCount, /* OUT */ int** pIndexes)
{
- HANDLE hFile = CreateFileA(nameOfInput, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+ HANDLE hFile = CreateFileA(nameOfInput, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
LogError("Unable to open '%s'. GetLastError()=%u", nameOfInput, GetLastError());
@@ -172,7 +173,7 @@ bool MCList::getLineData(const char *nameOfInput, /* OUT */ int *pIndexCount, /*
return false;
}
- int sz = DataTemp.u.LowPart;
+ int sz = DataTemp.u.LowPart;
char* buff = new char[sz];
DWORD bytesRead;
if (ReadFile(hFile, buff, sz, &bytesRead, nullptr) == 0)
@@ -198,17 +199,17 @@ bool MCList::getLineData(const char *nameOfInput, /* OUT */ int *pIndexCount, /*
}
}
- int* indexes = new int[lineCount];
- int indexCount = 0;
- int i = 0;
+ int* indexes = new int[lineCount];
+ int indexCount = 0;
+ int i = 0;
while (i < sz)
{
- //seek the first number on the line. This will skip empty lines and lines with no digits.
+ // seek the first number on the line. This will skip empty lines and lines with no digits.
while (!isdigit((unsigned char)buff[i]))
i++;
- //read in the number
+ // read in the number
indexes[indexCount++] = atoi(&buff[i]);
- //seek to the start of next line
+ // seek to the start of next line
while ((i < sz) && (buff[i] != '\n'))
i++;
i++;
@@ -216,11 +217,11 @@ bool MCList::getLineData(const char *nameOfInput, /* OUT */ int *pIndexCount, /*
delete[] buff;
*pIndexCount = indexCount;
- *pIndexes = indexes;
+ *pIndexes = indexes;
return true;
}
-void MCList::InitializeMCL(char *filename)
+void MCList::InitializeMCL(char* filename)
{
hMCLFile = CreateFileA(filename, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hMCLFile == INVALID_HANDLE_VALUE)
@@ -233,8 +234,8 @@ void MCList::AddMethodToMCL(int methodIndex)
{
if (hMCLFile != INVALID_HANDLE_VALUE)
{
- char strMethodIndex[12];
- DWORD charCount = 0;
+ char strMethodIndex[12];
+ DWORD charCount = 0;
DWORD bytesWritten = 0;
charCount = sprintf_s(strMethodIndex, sizeof(strMethodIndex), "%d\r\n", methodIndex);
diff --git a/src/ToolBox/superpmi/superpmi-shared/mclist.h b/src/ToolBox/superpmi/superpmi-shared/mclist.h
index 93b2879569..dd5073bbc0 100644
--- a/src/ToolBox/superpmi/superpmi-shared/mclist.h
+++ b/src/ToolBox/superpmi/superpmi-shared/mclist.h
@@ -13,23 +13,23 @@
class MCList
{
public:
- static bool processArgAsMCL(char *input, int *count, int **list);
+ static bool processArgAsMCL(char* input, int* count, int** list);
MCList()
{
- //Initialize the static file handle
+ // Initialize the static file handle
hMCLFile = INVALID_HANDLE_VALUE;
}
- //Methods to create an MCL file
- void InitializeMCL(char *filename);
+ // Methods to create an MCL file
+ void InitializeMCL(char* filename);
void AddMethodToMCL(int methodIndex);
void CloseMCL();
private:
- static bool getLineData(const char *nameOfInput, /* OUT */ int *pIndexCount, /* OUT */ int **pIndexes);
+ static bool getLineData(const char* nameOfInput, /* OUT */ int* pIndexCount, /* OUT */ int** pIndexes);
- //File handle for MCL file
+ // File handle for MCL file
HANDLE hMCLFile;
};
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
index 8638e0d825..e60ef83fc9 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
@@ -15,32 +15,39 @@
#include "lightweightmap.h"
#include "callutils.h"
-struct { int packetID; const char *message; } retiredPackets[] =
-{
- { 6, "CanEmbedModuleHandleForHelper id 6 superseded by GetLazyStringLiteralHelper id 147 on 12/20/2013" },
- { 13, "CheckMethodModifier id 13 superseded by id 142 on 2013/07/04. Re-record input with newer shim." },
- { 14, "CompileMethod id 14 superseded by id 141 on 2013/07/03. Re-record input with newer shim." },
- { 24, "FindNameOfToken id 24 superseded by id 145 on 2013/07/19. Re-record input with newer shim. Adjusted members to be proper." },
- { 28, "GetArgClass id 28 superseded by id 139 on 2013/07/03. Re-record input with newer shim." },
- { 30, "GetArgType id 30 superseded by id 140 on 2013/07/03. Re-record input with newer shim." },
- { 93, "GetUnBoxHelper2 id 93 unused. 2016/02/19. Re-record input with newer shim." },
- { 104, "IsValidToken id 104 superseded by id 144 on 2013/07/19. Re-record input with newer shim. Adjusted members to be proper." },
- { 141, "CompileMethod id 141 superseded by id 142 on 2013/07/09. Re-record input with newer shim. We basically reset lots of other stuff too. :-)" },
+struct
+{
+ int packetID;
+ const char* message;
+} retiredPackets[] = {
+ {6, "CanEmbedModuleHandleForHelper id 6 superseded by GetLazyStringLiteralHelper id 147 on 12/20/2013"},
+ {13, "CheckMethodModifier id 13 superseded by id 142 on 2013/07/04. Re-record input with newer shim."},
+ {14, "CompileMethod id 14 superseded by id 141 on 2013/07/03. Re-record input with newer shim."},
+ {24, "FindNameOfToken id 24 superseded by id 145 on 2013/07/19. Re-record input with newer shim. Adjusted members "
+ "to be proper."},
+ {28, "GetArgClass id 28 superseded by id 139 on 2013/07/03. Re-record input with newer shim."},
+ {30, "GetArgType id 30 superseded by id 140 on 2013/07/03. Re-record input with newer shim."},
+ {93, "GetUnBoxHelper2 id 93 unused. 2016/02/19. Re-record input with newer shim."},
+ {104, "IsValidToken id 104 superseded by id 144 on 2013/07/19. Re-record input with newer shim. Adjusted members "
+ "to be proper."},
+ {141, "CompileMethod id 141 superseded by id 142 on 2013/07/09. Re-record input with newer shim. We basically "
+ "reset lots of other stuff too. :-)"},
};
int retiredPacketCount = 7;
-#define sparseMC //Support filling in details where guesses are okay and will still generate good code. (i.e. helper function addresses)
+#define sparseMC // Support filling in details where guesses are okay and will still generate good code. (i.e. helper
+ // function addresses)
#if 0
// Enable these to get verbose logging during record or playback.
-#define DEBUG_REC(x) \
- printf("rec"); \
- x; \
+#define DEBUG_REC(x) \
+ printf("rec"); \
+ x; \
printf("\n");
-#define DEBUG_REP(x) \
- printf("rep"); \
- x; \
+#define DEBUG_REP(x) \
+ printf("rep"); \
+ x; \
printf("\n");
#else
#define DEBUG_REC(x)
@@ -51,10 +58,10 @@ MethodContext::MethodContext()
{
methodSize = 0;
- #define LWM(map,key,value) map = nullptr;
- #include "lwmlist.h"
+#define LWM(map, key, value) map = nullptr;
+#include "lwmlist.h"
- cr = new CompileResult();
+ cr = new CompileResult();
index = -1;
}
@@ -65,93 +72,95 @@ MethodContext::~MethodContext()
void MethodContext::Destroy()
{
- #define LWM(map,key,value) if (map != nullptr) delete map;
- #include "lwmlist.h"
+#define LWM(map, key, value) \
+ if (map != nullptr) \
+ delete map;
+#include "lwmlist.h"
delete cr;
}
-#define sparseAddLen(target) \
- if (target != nullptr) \
- { \
- if (target->GetCount() != 0) \
- totalLen += target->CalculateArraySize() + 6; /* packet canary from lightweightmap + packet marker */ \
+#define sparseAddLen(target) \
+ if (target != nullptr) \
+ { \
+ if (target->GetCount() != 0) \
+ totalLen += target->CalculateArraySize() + 6; /* packet canary from lightweightmap + packet marker */ \
}
-#define sparseWriteFile(target) \
- if (target != nullptr) \
- { \
- if (target->GetCount() != 0) \
- { \
- buff2[buffIndex++] = (unsigned char) Packet_##target; \
- unsigned int loc = target->DumpToArray(&buff2[buffIndex + 4]); \
- memcpy(&buff2[buffIndex], &loc, sizeof(unsigned int)); \
- buffIndex += 4 + loc; \
- buff2[buffIndex++] = 0x42; \
- } \
+#define sparseWriteFile(target) \
+ if (target != nullptr) \
+ { \
+ if (target->GetCount() != 0) \
+ { \
+ buff2[buffIndex++] = (unsigned char)Packet_##target; \
+ unsigned int loc = target->DumpToArray(&buff2[buffIndex + 4]); \
+ memcpy(&buff2[buffIndex], &loc, sizeof(unsigned int)); \
+ buffIndex += 4 + loc; \
+ buff2[buffIndex++] = 0x42; \
+ } \
}
-#define sparseWriteFileCR(target) \
- if (cr != nullptr) \
- { \
- if (cr->target != nullptr) \
- { \
- if (cr->target->GetCount() != 0) \
- { \
- buff2[buffIndex++] = (unsigned char) PacketCR_##target; \
- unsigned int loc = cr->target->DumpToArray(&buff2[buffIndex + 4]); \
- memcpy(&buff2[buffIndex], &loc, sizeof(unsigned int)); \
- buffIndex += 4 + loc; \
- buff2[buffIndex++] = 0x42; \
- } \
- } \
+#define sparseWriteFileCR(target) \
+ if (cr != nullptr) \
+ { \
+ if (cr->target != nullptr) \
+ { \
+ if (cr->target->GetCount() != 0) \
+ { \
+ buff2[buffIndex++] = (unsigned char)PacketCR_##target; \
+ unsigned int loc = cr->target->DumpToArray(&buff2[buffIndex + 4]); \
+ memcpy(&buff2[buffIndex], &loc, sizeof(unsigned int)); \
+ buffIndex += 4 + loc; \
+ buff2[buffIndex++] = 0x42; \
+ } \
+ } \
}
-#define sparseReadFile(target, key, value) \
- case Packet_##target: \
- { \
- target = new LightWeightMap<key, value>(); \
- target->ReadFromArray(&buff2[buffIndex], localsize); \
- break; \
+#define sparseReadFile(target, key, value) \
+ case Packet_##target: \
+ { \
+ target = new LightWeightMap<key, value>(); \
+ target->ReadFromArray(&buff2[buffIndex], localsize); \
+ break; \
}
-#define sparseReadFileCR(target, key, value) \
- case PacketCR_##target: \
- { \
- cr->target = new LightWeightMap<key, value>(); \
- cr->target->ReadFromArray(&buff2[buffIndex], localsize); \
- break; \
+#define sparseReadFileCR(target, key, value) \
+ case PacketCR_##target: \
+ { \
+ cr->target = new LightWeightMap<key, value>(); \
+ cr->target->ReadFromArray(&buff2[buffIndex], localsize); \
+ break; \
}
-#define sparseReadFileDense(target, value) \
- case Packet_##target: \
- { \
- target = new DenseLightWeightMap<value>(); \
- target->ReadFromArray(&buff2[buffIndex], localsize); \
- break; \
+#define sparseReadFileDense(target, value) \
+ case Packet_##target: \
+ { \
+ target = new DenseLightWeightMap<value>(); \
+ target->ReadFromArray(&buff2[buffIndex], localsize); \
+ break; \
}
-#define sparseReadFileCRDense(target, value) \
- case PacketCR_##target: \
- { \
- cr->target = new DenseLightWeightMap<value>(); \
- cr->target->ReadFromArray(&buff2[buffIndex], localsize); \
- break; \
+#define sparseReadFileCRDense(target, value) \
+ case PacketCR_##target: \
+ { \
+ cr->target = new DenseLightWeightMap<value>(); \
+ cr->target->ReadFromArray(&buff2[buffIndex], localsize); \
+ break; \
}
unsigned int MethodContext::calculateFileSize()
{
- //Calculate file size
+ // Calculate file size
unsigned int totalLen = 0;
- #define LWM(map,key,value) sparseAddLen(map)
- #include "lwmlist.h"
+#define LWM(map, key, value) sparseAddLen(map)
+#include "lwmlist.h"
- //Compile Result members
+ // Compile Result members
if (cr != nullptr)
{
- #define LWM(map,key,value) sparseAddLen(cr->map);
- #include "crlwmlist.h"
+#define LWM(map, key, value) sparseAddLen(cr->map);
+#include "crlwmlist.h"
}
return totalLen;
@@ -159,28 +168,30 @@ unsigned int MethodContext::calculateFileSize()
unsigned int MethodContext::calculateRawFileSize()
{
- return 2 /* leading magic cookie 'm', 'c' */ + 4 /* 4-byte data length */ + calculateFileSize() + 2 /* end canary '4', '2' */;
+ return 2 /* leading magic cookie 'm', 'c' */ + 4 /* 4-byte data length */ + calculateFileSize() +
+ 2 /* end canary '4', '2' */;
}
unsigned int MethodContext::saveToFile(HANDLE hFile)
{
unsigned int totalLen = calculateFileSize();
- unsigned int totalFileSize = 2 /* leading magic cookie 'm', 'c' */ + 4 /* 4-byte data length */ + totalLen + 2 /* end canary '4', '2' */;
-
- DWORD bytesWritten = 0;
- unsigned int buffIndex = 0;
- unsigned char *buff2 = new unsigned char[totalFileSize];
- buff2[buffIndex++] = 'm';
- buff2[buffIndex++] = 'c';
+ unsigned int totalFileSize =
+ 2 /* leading magic cookie 'm', 'c' */ + 4 /* 4-byte data length */ + totalLen + 2 /* end canary '4', '2' */;
+
+ DWORD bytesWritten = 0;
+ unsigned int buffIndex = 0;
+ unsigned char* buff2 = new unsigned char[totalFileSize];
+ buff2[buffIndex++] = 'm';
+ buff2[buffIndex++] = 'c';
memcpy(&buff2[buffIndex], &totalLen, sizeof(unsigned int));
buffIndex += 4;
- #define LWM(map,key,value) sparseWriteFile(map)
- #include "lwmlist.h"
+#define LWM(map, key, value) sparseWriteFile(map)
+#include "lwmlist.h"
- //Compile Result members
- #define LWM(map,key,value) sparseWriteFileCR(map);
- #include "crlwmlist.h"
+// Compile Result members
+#define LWM(map, key, value) sparseWriteFileCR(map);
+#include "crlwmlist.h"
// Write the end canary
buff2[buffIndex++] = '4';
@@ -189,7 +200,7 @@ unsigned int MethodContext::saveToFile(HANDLE hFile)
Assert(buffIndex == totalFileSize);
WriteFile(hFile, buff2, totalFileSize, &bytesWritten, NULL);
- delete[]buff2;
+ delete[] buff2;
return bytesWritten;
}
@@ -200,8 +211,8 @@ unsigned int MethodContext::saveToFile(HANDLE hFile)
bool MethodContext::Initialize(int loadedCount, unsigned char* buff, DWORD size, /* OUT */ MethodContext** ppmc)
{
MethodContext* mc = new MethodContext();
- mc->index = loadedCount;
- *ppmc = mc;
+ mc->index = loadedCount;
+ *ppmc = mc;
return mc->Initialize(loadedCount, buff, size);
}
@@ -209,8 +220,8 @@ bool MethodContext::Initialize(int loadedCount, unsigned char* buff, DWORD size,
bool MethodContext::Initialize(int loadedCount, HANDLE hFile, /* OUT */ MethodContext** ppmc)
{
MethodContext* mc = new MethodContext();
- mc->index = loadedCount;
- *ppmc = mc;
+ mc->index = loadedCount;
+ *ppmc = mc;
return mc->Initialize(loadedCount, hFile);
}
@@ -221,11 +232,11 @@ bool MethodContext::Initialize(int loadedCount, unsigned char* buff, DWORD size)
struct Param
{
unsigned char* buff;
- DWORD size;
+ DWORD size;
MethodContext* pThis;
} param;
- param.buff = buff;
- param.size = size;
+ param.buff = buff;
+ param.size = size;
param.pThis = this;
PAL_TRY(Param*, pParam, &param)
@@ -248,7 +259,7 @@ bool MethodContext::Initialize(int loadedCount, HANDLE hFile)
struct Param
{
- HANDLE hFile;
+ HANDLE hFile;
MethodContext* pThis;
} param;
param.hFile = hFile;
@@ -270,27 +281,28 @@ bool MethodContext::Initialize(int loadedCount, HANDLE hFile)
void MethodContext::MethodInitHelperFile(HANDLE hFile)
{
- DWORD bytesRead;
- char buff[512];
+ DWORD bytesRead;
+ char buff[512];
unsigned int totalLen = 0;
- AssertCode(ReadFile(hFile, buff, 2 + sizeof(unsigned int), &bytesRead, NULL) == TRUE, EXCEPTIONCODE_MC); //Read Magic number and totalLen
+ AssertCode(ReadFile(hFile, buff, 2 + sizeof(unsigned int), &bytesRead, NULL) == TRUE,
+ EXCEPTIONCODE_MC); // Read Magic number and totalLen
AssertCodeMsg((buff[0] == 'm') && (buff[1] == 'c'), EXCEPTIONCODE_MC, "Didn't find magic number");
memcpy(&totalLen, &buff[2], sizeof(unsigned int));
- unsigned char *buff2 = new unsigned char[totalLen + 2]; //total + End Canary
+ unsigned char* buff2 = new unsigned char[totalLen + 2]; // total + End Canary
AssertCode(ReadFile(hFile, buff2, totalLen + 2, &bytesRead, NULL) == TRUE, EXCEPTIONCODE_MC);
AssertCodeMsg((buff2[totalLen] == '4') && (buff2[totalLen + 1] == '2'), EXCEPTIONCODE_MC, "Didn't find end canary");
MethodInitHelper(buff2, totalLen);
}
-void MethodContext::MethodInitHelper(unsigned char *buff2, unsigned int totalLen)
+void MethodContext::MethodInitHelper(unsigned char* buff2, unsigned int totalLen)
{
MethodContext::MethodContext();
- unsigned int buffIndex = 0;
- unsigned int localsize = 0;
- unsigned char canary = 0xff;
- unsigned char *buff3 = nullptr;
+ unsigned int buffIndex = 0;
+ unsigned int localsize = 0;
+ unsigned char canary = 0xff;
+ unsigned char* buff3 = nullptr;
while (buffIndex < totalLen)
{
@@ -300,79 +312,82 @@ void MethodContext::MethodInitHelper(unsigned char *buff2, unsigned int totalLen
switch (packetType)
{
- #define LWM(map,key,value) sparseReadFile(map,key,value)
- #define DENSELWM(map,value) sparseReadFileDense(map,value)
- #include "lwmlist.h"
+#define LWM(map, key, value) sparseReadFile(map, key, value)
+#define DENSELWM(map, value) sparseReadFileDense(map, value)
+#include "lwmlist.h"
- #define LWM(map,key,value) sparseReadFileCR(map,key,value)
- #define DENSELWM(map,value) sparseReadFileCRDense(map,value)
- #include "crlwmlist.h"
+#define LWM(map, key, value) sparseReadFileCR(map, key, value)
+#define DENSELWM(map, value) sparseReadFileCRDense(map, value)
+#include "crlwmlist.h"
- default:
- for (int i = 0; i < retiredPacketCount; i++)
- {
- AssertCodeMsg(retiredPackets[i].packetID != packetType, EXCEPTIONCODE_MC, "Ran into retired packet %u '%s'", packetType, retiredPackets[i].message);
- }
- LogException(EXCEPTIONCODE_MC, "Read ran into unknown packet type %u. Are you using a newer recorder?", packetType);
- // break;
+ default:
+ for (int i = 0; i < retiredPacketCount; i++)
+ {
+ AssertCodeMsg(retiredPackets[i].packetID != packetType, EXCEPTIONCODE_MC,
+ "Ran into retired packet %u '%s'", packetType, retiredPackets[i].message);
+ }
+ LogException(EXCEPTIONCODE_MC, "Read ran into unknown packet type %u. Are you using a newer recorder?",
+ packetType);
+ // break;
}
buffIndex += localsize;
canary = buff2[buffIndex++];
AssertCodeMsg(canary == 0x42, EXCEPTIONCODE_MC, "Didn't find trailing canary for map");
}
- AssertCodeMsg((buff2[buffIndex++] == '4') && (buff2[buffIndex++] == '2'), EXCEPTIONCODE_MC, "Didn't find trailing canary for map");
- delete[]buff2;
-}
-
-#define dumpStat(target) \
- if (target != nullptr) \
- { \
- if (target->GetCount() > 0) \
- { \
- int t = sprintf_s(buff, len, "%u", target->GetCount()); \
- buff += t; \
- len -= t; \
- } \
- } \
- { \
- *buff++ = ','; \
- len--; \
- } \
- if (target != nullptr) \
- { \
- int t = sprintf_s(buff, len, "%u", target->CalculateArraySize()); \
- buff += t; \
- len -= t; \
- } \
- { \
- *buff++ = ','; \
- len--; \
+ AssertCodeMsg((buff2[buffIndex++] == '4') && (buff2[buffIndex++] == '2'), EXCEPTIONCODE_MC,
+ "Didn't find trailing canary for map");
+ delete[] buff2;
+}
+
+#define dumpStat(target) \
+ if (target != nullptr) \
+ { \
+ if (target->GetCount() > 0) \
+ { \
+ int t = sprintf_s(buff, len, "%u", target->GetCount()); \
+ buff += t; \
+ len -= t; \
+ } \
+ } \
+ { \
+ *buff++ = ','; \
+ len--; \
+ } \
+ if (target != nullptr) \
+ { \
+ int t = sprintf_s(buff, len, "%u", target->CalculateArraySize()); \
+ buff += t; \
+ len -= t; \
+ } \
+ { \
+ *buff++ = ','; \
+ len--; \
}
// Dump statistics about each LightWeightMap to the buffer: count of elements, and total size in bytes of map.
-int MethodContext::dumpStatToBuffer(char *buff, int len)
+int MethodContext::dumpStatToBuffer(char* buff, int len)
{
- char *obuff = buff;
- //assumption of enough buffer.. :-|
+ char* obuff = buff;
+// assumption of enough buffer.. :-|
- #define LWM(map,key,value) dumpStat(map)
- #include "lwmlist.h"
+#define LWM(map, key, value) dumpStat(map)
+#include "lwmlist.h"
- //Compile Result members
- #define LWM(map,key,value) dumpStat(cr->map);
- #include "crlwmlist.h"
+// Compile Result members
+#define LWM(map, key, value) dumpStat(cr->map);
+#include "crlwmlist.h"
return (int)(buff - obuff);
}
-int MethodContext::dumpStatTitleToBuffer(char *buff, int len)
+int MethodContext::dumpStatTitleToBuffer(char* buff, int len)
{
- const char *title =
+ const char* title =
- #define LWM(map,key,value) #map "," #map " SZ,"
- #include "lwmlist.h"
+#define LWM(map, key, value) #map "," #map " SZ,"
+#include "lwmlist.h"
- #define LWM(map,key,value) "CR_" #map ",CR_" #map " SZ,"
- #include "crlwmlist.h"
+#define LWM(map, key, value) "CR_" #map ",CR_" #map " SZ,"
+#include "crlwmlist.h"
;
@@ -386,26 +401,29 @@ int MethodContext::dumpStatTitleToBuffer(char *buff, int len)
return titleLen;
}
-#define softMapEqual(a) \
- if (a != nullptr) \
- { \
- if (other->a == nullptr) return false; \
- if (a->GetCount() != other->a->GetCount()) return false; \
- } \
- else if (other->a != nullptr) return false;
-
+#define softMapEqual(a) \
+ if (a != nullptr) \
+ { \
+ if (other->a == nullptr) \
+ return false; \
+ if (a->GetCount() != other->a->GetCount()) \
+ return false; \
+ } \
+ else if (other->a != nullptr) \
+ return false;
-bool MethodContext::Equal(MethodContext *other)
+bool MethodContext::Equal(MethodContext* other)
{
- //returns true if equal. Note this is permissive, that is to say that we may reason that too many things are equal. Adding more detailed checks would cause us to reason more things as unique;
+ // returns true if equal. Note this is permissive, that is to say that we may reason that too many things are
+ // equal. Adding more detailed checks would cause us to reason more things as unique;
- //Compare MethodInfo's first.
+ // Compare MethodInfo's first.
CORINFO_METHOD_INFO otherInfo;
- unsigned otherFlags = 0;
+ unsigned otherFlags = 0;
other->repCompileMethod(&otherInfo, &otherFlags);
CORINFO_METHOD_INFO ourInfo;
- unsigned ourFlags = 0;
+ unsigned ourFlags = 0;
repCompileMethod(&ourInfo, &ourFlags);
if (otherInfo.ILCodeSize != ourInfo.ILCodeSize)
@@ -421,8 +439,8 @@ bool MethodContext::Equal(MethodContext *other)
if (otherInfo.options != ourInfo.options)
return false;
for (unsigned int j = 0; j < otherInfo.ILCodeSize; j++)
- if (otherInfo.ILCode[j] != ourInfo.ILCode[j])
- return false;
+ if (otherInfo.ILCode[j] != ourInfo.ILCode[j])
+ return false;
if (otherInfo.maxStack != ourInfo.maxStack)
return false;
if (otherInfo.regionKind != ourInfo.regionKind)
@@ -438,16 +456,16 @@ bool MethodContext::Equal(MethodContext *other)
if (otherFlags != ourFlags)
return false;
- //Now compare the other maps to "estimate" equality.
+// Now compare the other maps to "estimate" equality.
- #define LWM(map,key,value) softMapEqual(map)
- #include "lwmlist.h"
+#define LWM(map, key, value) softMapEqual(map)
+#include "lwmlist.h"
- //Compile Result members
- #define LWM(map,key,value) softMapEqual(cr->map)
- #include "crlwmlist.h"
+// Compile Result members
+#define LWM(map, key, value) softMapEqual(cr->map)
+#include "crlwmlist.h"
- //Base case is we "match"
+ // Base case is we "match"
return true;
}
@@ -483,12 +501,12 @@ void MethodContext::recEnvironment()
if (Environment == nullptr)
Environment = new DenseLightWeightMap<Agnostic_Environment>();
- char *l_EnvStr;
- char *l_val;
+ char* l_EnvStr;
+ char* l_val;
#ifdef FEATURE_PAL
l_EnvStr = GetEnvironmentStringsA();
-#else // !FEATURE_PAL
+#else // !FEATURE_PAL
l_EnvStr = GetEnvironmentStrings();
#endif // !FEATURE_PAL
@@ -499,26 +517,29 @@ void MethodContext::recEnvironment()
int count = 0;
while (true)
{
- if (*l_str == 0) break;
- while (*l_str != 0) l_str++;
+ if (*l_str == 0)
+ break;
+ while (*l_str != 0)
+ l_str++;
l_str++;
count++;
}
for (int i = 0; i < count; i++)
{
- if ((_strnicmp(l_EnvStr, "complus_", 8) == 0) || (_strnicmp(l_EnvStr, "dbflag", 6) == 0) || (_strnicmp(l_EnvStr, "BVT_TEST_ID", 11) == 0))
+ if ((_strnicmp(l_EnvStr, "complus_", 8) == 0) || (_strnicmp(l_EnvStr, "dbflag", 6) == 0) ||
+ (_strnicmp(l_EnvStr, "BVT_TEST_ID", 11) == 0))
{
- char *val = l_EnvStr;
+ char* val = l_EnvStr;
while (*val != '=')
val++;
- *val++ = 0;
- int nameind = Environment->AddBuffer((unsigned char*)l_EnvStr, (int)strlen(l_EnvStr) + 1);
- int valind = Environment->AddBuffer((unsigned char*)val, (int)strlen(val) + 1);
+ *val++ = 0;
+ int nameind = Environment->AddBuffer((unsigned char*)l_EnvStr, (int)strlen(l_EnvStr) + 1);
+ int valind = Environment->AddBuffer((unsigned char*)val, (int)strlen(val) + 1);
Agnostic_Environment value;
value.name_index = nameind;
- value.val_index = valind;
- DWORD key = (DWORD)Environment->GetCount();
+ value.val_index = valind;
+ DWORD key = (DWORD)Environment->GetCount();
Environment->Append(value);
DEBUG_REC(dmpEnvironment(key, value));
l_EnvStr = val;
@@ -532,7 +553,7 @@ void MethodContext::recEnvironment()
void MethodContext::dmpEnvironment(DWORD key, const Agnostic_Environment& value)
{
printf("Environment key %u, value '%s' '%s'", key, (LPCSTR)Environment->GetBuffer(value.name_index),
- (LPCSTR)Environment->GetBuffer(value.val_index));
+ (LPCSTR)Environment->GetBuffer(value.val_index));
Environment->Unlock();
}
void MethodContext::repEnvironmentSet()
@@ -545,20 +566,21 @@ void MethodContext::repEnvironmentSet()
val = Environment->Get((DWORD)i);
DEBUG_REP(dmpEnvironment(i, val));
- SetEnvironmentVariableA((LPCSTR)Environment->GetBuffer(val.name_index), (LPCSTR)Environment->GetBuffer(val.val_index));
+ SetEnvironmentVariableA((LPCSTR)Environment->GetBuffer(val.name_index),
+ (LPCSTR)Environment->GetBuffer(val.val_index));
}
}
int MethodContext::repGetTestID()
{
- //CLR Test asset only - we capture the testID via smarty-environnent (BVT_TEST_ID) during record time
- //This procedure returns the test id if found and -1 otherwise
+ // CLR Test asset only - we capture the testID via smarty-environnent (BVT_TEST_ID) during record time
+ //This procedure returns the test id if found and -1 otherwise
if (Environment == nullptr)
return -1;
Agnostic_Environment val;
- LPCSTR key;
- int value = -1;
+ LPCSTR key;
+ int value = -1;
for (unsigned int i = 0; i < Environment->GetCount(); i++)
{
val = Environment->Get((DWORD)i);
@@ -607,44 +629,68 @@ void MethodContext::dumpToConsole(int mcNumber)
}
printf("\n");
- #define LWM(map,key,value) dumpLWM(this,map)
- #define DENSELWM(map,value) dumpLWMDense(this,map)
- #include "lwmlist.h"
+#define LWM(map, key, value) dumpLWM(this, map)
+#define DENSELWM(map, value) dumpLWMDense(this, map)
+#include "lwmlist.h"
- //Compile Result members
- #define LWM(map,key,value) dumpLWM(this->cr,map)
- #define DENSELWM(map,value) dumpLWMDense(this->cr,map)
- #include "crlwmlist.h"
+// Compile Result members
+#define LWM(map, key, value) dumpLWM(this->cr, map)
+#define DENSELWM(map, value) dumpLWMDense(this->cr, map)
+#include "crlwmlist.h"
}
const char* toString(CorInfoType cit)
{
switch (cit)
{
- case CORINFO_TYPE_UNDEF : return "undef";
- case CORINFO_TYPE_VOID : return "void";
- case CORINFO_TYPE_BOOL : return "bool";
- case CORINFO_TYPE_CHAR : return "char";
- case CORINFO_TYPE_BYTE : return "byte";
- case CORINFO_TYPE_UBYTE : return "ubyte";
- case CORINFO_TYPE_SHORT : return "short";
- case CORINFO_TYPE_USHORT : return "ushort";
- case CORINFO_TYPE_INT : return "int";
- case CORINFO_TYPE_UINT : return "uint";
- case CORINFO_TYPE_LONG : return "long";
- case CORINFO_TYPE_ULONG : return "ulong";
- case CORINFO_TYPE_NATIVEINT : return "nativeint";
- case CORINFO_TYPE_NATIVEUINT : return "nativeuint";
- case CORINFO_TYPE_FLOAT : return "float";
- case CORINFO_TYPE_DOUBLE : return "double";
- case CORINFO_TYPE_STRING : return "string";
- case CORINFO_TYPE_PTR : return "ptr";
- case CORINFO_TYPE_BYREF : return "byref";
- case CORINFO_TYPE_VALUECLASS : return "valueclass";
- case CORINFO_TYPE_CLASS : return "class";
- case CORINFO_TYPE_REFANY : return "refany";
- case CORINFO_TYPE_VAR : return "var";
- default : return "UNKNOWN";
+ case CORINFO_TYPE_UNDEF:
+ return "undef";
+ case CORINFO_TYPE_VOID:
+ return "void";
+ case CORINFO_TYPE_BOOL:
+ return "bool";
+ case CORINFO_TYPE_CHAR:
+ return "char";
+ case CORINFO_TYPE_BYTE:
+ return "byte";
+ case CORINFO_TYPE_UBYTE:
+ return "ubyte";
+ case CORINFO_TYPE_SHORT:
+ return "short";
+ case CORINFO_TYPE_USHORT:
+ return "ushort";
+ case CORINFO_TYPE_INT:
+ return "int";
+ case CORINFO_TYPE_UINT:
+ return "uint";
+ case CORINFO_TYPE_LONG:
+ return "long";
+ case CORINFO_TYPE_ULONG:
+ return "ulong";
+ case CORINFO_TYPE_NATIVEINT:
+ return "nativeint";
+ case CORINFO_TYPE_NATIVEUINT:
+ return "nativeuint";
+ case CORINFO_TYPE_FLOAT:
+ return "float";
+ case CORINFO_TYPE_DOUBLE:
+ return "double";
+ case CORINFO_TYPE_STRING:
+ return "string";
+ case CORINFO_TYPE_PTR:
+ return "ptr";
+ case CORINFO_TYPE_BYREF:
+ return "byref";
+ case CORINFO_TYPE_VALUECLASS:
+ return "valueclass";
+ case CORINFO_TYPE_CLASS:
+ return "class";
+ case CORINFO_TYPE_REFANY:
+ return "refany";
+ case CORINFO_TYPE_VAR:
+ return "var";
+ default:
+ return "UNKNOWN";
}
}
@@ -652,91 +698,99 @@ unsigned int toCorInfoSize(CorInfoType cit)
{
switch (cit)
{
- case CORINFO_TYPE_BOOL:
- case CORINFO_TYPE_BYTE:
- case CORINFO_TYPE_UBYTE:
- return 1;
-
- case CORINFO_TYPE_CHAR:
- case CORINFO_TYPE_SHORT:
- case CORINFO_TYPE_USHORT:
- return 2;
-
- case CORINFO_TYPE_FLOAT:
- case CORINFO_TYPE_INT:
- case CORINFO_TYPE_UINT:
- return 4;
-
- case CORINFO_TYPE_DOUBLE:
- case CORINFO_TYPE_LONG:
- case CORINFO_TYPE_ULONG:
- return 8;
-
- case CORINFO_TYPE_NATIVEINT:
- case CORINFO_TYPE_NATIVEUINT:
- case CORINFO_TYPE_PTR:
- case CORINFO_TYPE_BYREF:
- case CORINFO_TYPE_CLASS:
- return sizeof(void *);
-
- case CORINFO_TYPE_STRING:
- case CORINFO_TYPE_VALUECLASS:
- case CORINFO_TYPE_REFANY:
- case CORINFO_TYPE_UNDEF:
- case CORINFO_TYPE_VOID:
- default:
- __debugbreak();
- return 0;
+ case CORINFO_TYPE_BOOL:
+ case CORINFO_TYPE_BYTE:
+ case CORINFO_TYPE_UBYTE:
+ return 1;
+
+ case CORINFO_TYPE_CHAR:
+ case CORINFO_TYPE_SHORT:
+ case CORINFO_TYPE_USHORT:
+ return 2;
+
+ case CORINFO_TYPE_FLOAT:
+ case CORINFO_TYPE_INT:
+ case CORINFO_TYPE_UINT:
+ return 4;
+
+ case CORINFO_TYPE_DOUBLE:
+ case CORINFO_TYPE_LONG:
+ case CORINFO_TYPE_ULONG:
+ return 8;
+
+ case CORINFO_TYPE_NATIVEINT:
+ case CORINFO_TYPE_NATIVEUINT:
+ case CORINFO_TYPE_PTR:
+ case CORINFO_TYPE_BYREF:
+ case CORINFO_TYPE_CLASS:
+ return sizeof(void*);
+
+ case CORINFO_TYPE_STRING:
+ case CORINFO_TYPE_VALUECLASS:
+ case CORINFO_TYPE_REFANY:
+ case CORINFO_TYPE_UNDEF:
+ case CORINFO_TYPE_VOID:
+ default:
+ __debugbreak();
+ return 0;
}
return -1;
}
-void MethodContext::recCompileMethod(CORINFO_METHOD_INFO *info, unsigned flags)
+void MethodContext::recCompileMethod(CORINFO_METHOD_INFO* info, unsigned flags)
{
if (CompileMethod == nullptr)
CompileMethod = new LightWeightMap<DWORD, Agnostic_CompileMethod>();
Agnostic_CompileMethod value;
- value.info.ftn = (DWORDLONG)info->ftn;
- value.info.scope = (DWORDLONG)info->scope;
- value.info.ILCode_offset = (DWORD)CompileMethod->AddBuffer(info->ILCode, info->ILCodeSize);
- value.info.ILCodeSize = (DWORD)info->ILCodeSize;
- value.info.maxStack = (DWORD)info->maxStack;
- value.info.EHcount = (DWORD)info->EHcount;
- value.info.options = (DWORD)info->options;
- value.info.regionKind = (DWORD)info->regionKind;
- value.info.args.callConv = (DWORD)info->args.callConv;
- value.info.args.retTypeClass = (DWORDLONG)info->args.retTypeClass;
- value.info.args.retTypeSigClass = (DWORDLONG)info->args.retTypeSigClass;
- value.info.args.retType = (DWORD)info->args.retType;
- value.info.args.flags = (DWORD)info->args.flags;
- value.info.args.numArgs = (DWORD)info->args.numArgs;
+ value.info.ftn = (DWORDLONG)info->ftn;
+ value.info.scope = (DWORDLONG)info->scope;
+ value.info.ILCode_offset = (DWORD)CompileMethod->AddBuffer(info->ILCode, info->ILCodeSize);
+ value.info.ILCodeSize = (DWORD)info->ILCodeSize;
+ value.info.maxStack = (DWORD)info->maxStack;
+ value.info.EHcount = (DWORD)info->EHcount;
+ value.info.options = (DWORD)info->options;
+ value.info.regionKind = (DWORD)info->regionKind;
+ value.info.args.callConv = (DWORD)info->args.callConv;
+ value.info.args.retTypeClass = (DWORDLONG)info->args.retTypeClass;
+ value.info.args.retTypeSigClass = (DWORDLONG)info->args.retTypeSigClass;
+ value.info.args.retType = (DWORD)info->args.retType;
+ value.info.args.flags = (DWORD)info->args.flags;
+ value.info.args.numArgs = (DWORD)info->args.numArgs;
value.info.args.sigInst_classInstCount = (DWORD)info->args.sigInst.classInstCount;
- value.info.args.sigInst_classInst_Index = CompileMethod->AddBuffer((unsigned char*)info->args.sigInst.classInst, info->args.sigInst.classInstCount * 8); // porting issue
+ value.info.args.sigInst_classInst_Index =
+ CompileMethod->AddBuffer((unsigned char*)info->args.sigInst.classInst,
+ info->args.sigInst.classInstCount * 8); // porting issue
value.info.args.sigInst_methInstCount = (DWORD)info->args.sigInst.methInstCount;
- value.info.args.sigInst_methInst_Index = CompileMethod->AddBuffer((unsigned char*)info->args.sigInst.methInst, info->args.sigInst.methInstCount * 8); // porting issue
- value.info.args.args = (DWORDLONG)info->args.args;
- value.info.args.cbSig = (DWORD)info->args.cbSig;
- value.info.args.pSig = (DWORD)CompileMethod->AddBuffer((unsigned char *)info->args.pSig, info->args.cbSig);
- value.info.args.scope = (DWORDLONG)info->args.scope;
- value.info.args.token = (DWORD)info->args.token;
- value.info.locals.callConv = (DWORD)info->locals.callConv;
+ value.info.args.sigInst_methInst_Index =
+ CompileMethod->AddBuffer((unsigned char*)info->args.sigInst.methInst,
+ info->args.sigInst.methInstCount * 8); // porting issue
+ value.info.args.args = (DWORDLONG)info->args.args;
+ value.info.args.cbSig = (DWORD)info->args.cbSig;
+ value.info.args.pSig = (DWORD)CompileMethod->AddBuffer((unsigned char*)info->args.pSig, info->args.cbSig);
+ value.info.args.scope = (DWORDLONG)info->args.scope;
+ value.info.args.token = (DWORD)info->args.token;
+ value.info.locals.callConv = (DWORD)info->locals.callConv;
value.info.locals.retTypeClass = (DWORDLONG)info->locals.retTypeClass;
- value.info.locals.retTypeSigClass = (DWORDLONG)info->locals.retTypeSigClass;
- value.info.locals.retType = (DWORD)info->locals.retType;
- value.info.locals.flags = (DWORD)info->locals.flags;
- value.info.locals.numArgs = (DWORD)info->locals.numArgs;
+ value.info.locals.retTypeSigClass = (DWORDLONG)info->locals.retTypeSigClass;
+ value.info.locals.retType = (DWORD)info->locals.retType;
+ value.info.locals.flags = (DWORD)info->locals.flags;
+ value.info.locals.numArgs = (DWORD)info->locals.numArgs;
value.info.locals.sigInst_classInstCount = (DWORD)info->locals.sigInst.classInstCount;
- value.info.locals.sigInst_classInst_Index = CompileMethod->AddBuffer((unsigned char*)info->locals.sigInst.classInst, info->locals.sigInst.classInstCount * 8); // porting issue
+ value.info.locals.sigInst_classInst_Index =
+ CompileMethod->AddBuffer((unsigned char*)info->locals.sigInst.classInst,
+ info->locals.sigInst.classInstCount * 8); // porting issue
value.info.locals.sigInst_methInstCount = (DWORD)info->locals.sigInst.methInstCount;
- value.info.locals.sigInst_methInst_Index = CompileMethod->AddBuffer((unsigned char*)info->locals.sigInst.methInst, info->locals.sigInst.methInstCount * 8); // porting issue
- value.info.locals.args = (DWORDLONG)info->locals.args;
+ value.info.locals.sigInst_methInst_Index =
+ CompileMethod->AddBuffer((unsigned char*)info->locals.sigInst.methInst,
+ info->locals.sigInst.methInstCount * 8); // porting issue
+ value.info.locals.args = (DWORDLONG)info->locals.args;
value.info.locals.cbSig = (DWORD)info->locals.cbSig;
- value.info.locals.pSig = (DWORD)CompileMethod->AddBuffer((unsigned char *)info->locals.pSig, info->locals.cbSig);
+ value.info.locals.pSig = (DWORD)CompileMethod->AddBuffer((unsigned char*)info->locals.pSig, info->locals.cbSig);
value.info.locals.scope = (DWORDLONG)info->locals.scope;
value.info.locals.token = (DWORD)info->locals.token;
- value.flags = (DWORD)flags;
+ value.flags = (DWORD)flags;
CompileMethod->Add(0, value);
DEBUG_REC(dmpCompileMethod(0, value));
@@ -744,98 +798,75 @@ 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} "
- "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} "
+ "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,
- value.info.ftn,
- value.info.scope,
- value.info.ILCode_offset,
- value.info.ILCodeSize,
- value.info.maxStack,
- value.info.EHcount,
- value.info.options,
- value.info.regionKind,
- value.info.args.callConv,
- value.info.args.retTypeClass,
- value.info.args.retTypeSigClass,
- value.info.args.retType,
- toString((CorInfoType)value.info.args.retType),
- value.info.args.flags,
- value.info.args.numArgs,
- value.info.args.sigInst_classInstCount,
- value.info.args.sigInst_classInst_Index,
- value.info.args.sigInst_methInstCount,
- value.info.args.sigInst_methInst_Index,
- value.info.args.args,
- value.info.args.cbSig,
- value.info.args.pSig,
- value.info.args.scope,
- value.info.args.token,
- value.info.locals.callConv,
- value.info.locals.retTypeClass,
- value.info.locals.retTypeSigClass,
- value.info.locals.retType,
- toString((CorInfoType)value.info.locals.retType),
- value.info.locals.flags,
- value.info.locals.numArgs,
- value.info.locals.sigInst_classInstCount,
- value.info.locals.sigInst_classInst_Index,
- value.info.locals.sigInst_methInstCount,
- value.info.locals.sigInst_methInst_Index,
- value.info.locals.args,
- value.info.locals.cbSig,
- value.info.locals.pSig,
- value.info.locals.scope,
- value.info.locals.token,
- value.flags);
-}
-void MethodContext::repCompileMethod(CORINFO_METHOD_INFO *info, unsigned *flags)
+ key, value.info.ftn, value.info.scope, value.info.ILCode_offset, value.info.ILCodeSize, value.info.maxStack,
+ value.info.EHcount, value.info.options, value.info.regionKind, value.info.args.callConv,
+ value.info.args.retTypeClass, value.info.args.retTypeSigClass, value.info.args.retType,
+ toString((CorInfoType)value.info.args.retType), value.info.args.flags, value.info.args.numArgs,
+ value.info.args.sigInst_classInstCount, value.info.args.sigInst_classInst_Index,
+ value.info.args.sigInst_methInstCount, value.info.args.sigInst_methInst_Index, value.info.args.args,
+ value.info.args.cbSig, value.info.args.pSig, value.info.args.scope, value.info.args.token,
+ value.info.locals.callConv, value.info.locals.retTypeClass, value.info.locals.retTypeSigClass,
+ value.info.locals.retType, toString((CorInfoType)value.info.locals.retType), value.info.locals.flags,
+ value.info.locals.numArgs, value.info.locals.sigInst_classInstCount,
+ value.info.locals.sigInst_classInst_Index, value.info.locals.sigInst_methInstCount,
+ value.info.locals.sigInst_methInst_Index, value.info.locals.args, value.info.locals.cbSig,
+ value.info.locals.pSig, value.info.locals.scope, value.info.locals.token, value.flags);
+}
+void MethodContext::repCompileMethod(CORINFO_METHOD_INFO* info, unsigned* flags)
{
Agnostic_CompileMethod value;
- value = CompileMethod->Get((DWORD)0); //The only item in this set is a single group of inputs to CompileMethod
-
- info->ftn = (CORINFO_METHOD_HANDLE)value.info.ftn;
- info->scope = (CORINFO_MODULE_HANDLE)value.info.scope;
- info->ILCode = CompileMethod->GetBuffer(value.info.ILCode_offset);
- info->ILCodeSize = (unsigned)value.info.ILCodeSize;
- methodSize = info->ILCodeSize;
- info->maxStack = (unsigned)value.info.maxStack;
- info->EHcount = (unsigned)value.info.EHcount;
- info->options = (CorInfoOptions)value.info.options;
- info->regionKind = (CorInfoRegionKind)value.info.regionKind;
- info->args.callConv = (CorInfoCallConv)value.info.args.callConv;
- info->args.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeClass;
- info->args.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeSigClass;
- info->args.retType = (CorInfoType)value.info.args.retType;
- info->args.flags = (unsigned)value.info.args.flags;
- info->args.numArgs = (unsigned)value.info.args.numArgs;
+ value = CompileMethod->Get((DWORD)0); // The only item in this set is a single group of inputs to CompileMethod
+
+ info->ftn = (CORINFO_METHOD_HANDLE)value.info.ftn;
+ info->scope = (CORINFO_MODULE_HANDLE)value.info.scope;
+ info->ILCode = CompileMethod->GetBuffer(value.info.ILCode_offset);
+ info->ILCodeSize = (unsigned)value.info.ILCodeSize;
+ methodSize = info->ILCodeSize;
+ info->maxStack = (unsigned)value.info.maxStack;
+ info->EHcount = (unsigned)value.info.EHcount;
+ info->options = (CorInfoOptions)value.info.options;
+ info->regionKind = (CorInfoRegionKind)value.info.regionKind;
+ info->args.callConv = (CorInfoCallConv)value.info.args.callConv;
+ info->args.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeClass;
+ info->args.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeSigClass;
+ info->args.retType = (CorInfoType)value.info.args.retType;
+ info->args.flags = (unsigned)value.info.args.flags;
+ info->args.numArgs = (unsigned)value.info.args.numArgs;
info->args.sigInst.classInstCount = (unsigned)value.info.args.sigInst_classInstCount;
- info->args.sigInst.classInst = (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.args.sigInst_classInst_Index);
+ info->args.sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.args.sigInst_classInst_Index);
info->args.sigInst.methInstCount = (unsigned)value.info.args.sigInst_methInstCount;
- info->args.sigInst.methInst = (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.args.sigInst_methInst_Index);
- info->args.args = (CORINFO_ARG_LIST_HANDLE)value.info.args.args;
- info->args.cbSig = (unsigned int)value.info.args.cbSig;
- info->args.pSig = (PCCOR_SIGNATURE)CompileMethod->GetBuffer(value.info.args.pSig);
- info->args.scope = (CORINFO_MODULE_HANDLE)value.info.args.scope;
- info->args.token = (mdToken)value.info.args.token;
- info->locals.callConv = (CorInfoCallConv)value.info.locals.callConv;
- info->locals.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeClass;
- info->locals.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeSigClass;
- info->locals.retType = (CorInfoType)value.info.locals.retType;
- info->locals.flags = (unsigned)value.info.locals.flags;
- info->locals.numArgs = (unsigned)value.info.locals.numArgs;
+ info->args.sigInst.methInst =
+ (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.args.sigInst_methInst_Index);
+ info->args.args = (CORINFO_ARG_LIST_HANDLE)value.info.args.args;
+ info->args.cbSig = (unsigned int)value.info.args.cbSig;
+ info->args.pSig = (PCCOR_SIGNATURE)CompileMethod->GetBuffer(value.info.args.pSig);
+ info->args.scope = (CORINFO_MODULE_HANDLE)value.info.args.scope;
+ info->args.token = (mdToken)value.info.args.token;
+ info->locals.callConv = (CorInfoCallConv)value.info.locals.callConv;
+ info->locals.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeClass;
+ info->locals.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeSigClass;
+ info->locals.retType = (CorInfoType)value.info.locals.retType;
+ info->locals.flags = (unsigned)value.info.locals.flags;
+ info->locals.numArgs = (unsigned)value.info.locals.numArgs;
info->locals.sigInst.classInstCount = (unsigned)value.info.locals.sigInst_classInstCount;
- info->locals.sigInst.classInst = (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.locals.sigInst_classInst_Index);
+ info->locals.sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.locals.sigInst_classInst_Index);
info->locals.sigInst.methInstCount = (unsigned)value.info.locals.sigInst_methInstCount;
- info->locals.sigInst.methInst = (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.locals.sigInst_methInst_Index);
- info->locals.args = (CORINFO_ARG_LIST_HANDLE)value.info.locals.args;
+ info->locals.sigInst.methInst =
+ (CORINFO_CLASS_HANDLE*)CompileMethod->GetBuffer(value.info.locals.sigInst_methInst_Index);
+ info->locals.args = (CORINFO_ARG_LIST_HANDLE)value.info.locals.args;
info->locals.cbSig = (unsigned int)value.info.locals.cbSig;
- info->locals.pSig = (PCCOR_SIGNATURE)CompileMethod->GetBuffer(value.info.locals.pSig);
+ info->locals.pSig = (PCCOR_SIGNATURE)CompileMethod->GetBuffer(value.info.locals.pSig);
info->locals.scope = (CORINFO_MODULE_HANDLE)value.info.locals.scope;
info->locals.token = (mdToken)value.info.locals.token;
- *flags = (unsigned)value.flags;
+ *flags = (unsigned)value.flags;
DEBUG_REP(dmpCompileMethod(0, value));
}
@@ -853,9 +884,11 @@ void MethodContext::dmpGetMethodClass(DWORDLONG key, DWORDLONG value)
}
CORINFO_CLASS_HANDLE MethodContext::repGetMethodClass(CORINFO_METHOD_HANDLE methodHandle)
{
- AssertCodeMsg(GetMethodClass != nullptr, EXCEPTIONCODE_MC, "Found a null GetMethodClass. Probably missing a fatTrigger for %016llX.", (DWORDLONG)methodHandle);
+ AssertCodeMsg(GetMethodClass != nullptr, EXCEPTIONCODE_MC,
+ "Found a null GetMethodClass. Probably missing a fatTrigger for %016llX.", (DWORDLONG)methodHandle);
int index = GetMethodClass->GetIndex((DWORDLONG)methodHandle);
- AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger", (DWORDLONG)methodHandle);
+ AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger",
+ (DWORDLONG)methodHandle);
CORINFO_CLASS_HANDLE value = (CORINFO_CLASS_HANDLE)GetMethodClass->Get((DWORDLONG)methodHandle);
DEBUG_REP(dmpGetMethodClass((DWORDLONG)methodHandle, (DWORDLONG)value));
return value;
@@ -875,9 +908,11 @@ void MethodContext::dmpGetClassAttribs(DWORDLONG key, DWORD value)
}
DWORD MethodContext::repGetClassAttribs(CORINFO_CLASS_HANDLE classHandle)
{
- AssertCodeMsg(GetClassAttribs != nullptr, EXCEPTIONCODE_MC, "Found a null GetMethodClass. Probably missing a fatTrigger for %016llX.", (DWORDLONG)classHandle);
+ AssertCodeMsg(GetClassAttribs != nullptr, EXCEPTIONCODE_MC,
+ "Found a null GetMethodClass. Probably missing a fatTrigger for %016llX.", (DWORDLONG)classHandle);
int index = GetClassAttribs->GetIndex((DWORDLONG)classHandle);
- AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger", (DWORDLONG)classHandle);
+ AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger",
+ (DWORDLONG)classHandle);
DWORD value = (DWORD)GetClassAttribs->Get((DWORDLONG)classHandle);
DEBUG_REP(dmpGetClassAttribs((DWORDLONG)classHandle, value));
return value;
@@ -897,9 +932,12 @@ void MethodContext::dmpGetMethodAttribs(DWORDLONG key, DWORD value)
}
DWORD MethodContext::repGetMethodAttribs(CORINFO_METHOD_HANDLE methodHandle)
{
- AssertCodeMsg(GetMethodAttribs != nullptr, EXCEPTIONCODE_MC, "Found a null GetMethodAttribs. Probably missing a fatTrigger for %016llX.", (DWORDLONG)methodHandle);
+ AssertCodeMsg(GetMethodAttribs != nullptr, EXCEPTIONCODE_MC,
+ "Found a null GetMethodAttribs. Probably missing a fatTrigger for %016llX.",
+ (DWORDLONG)methodHandle);
int index = GetMethodAttribs->GetIndex((DWORDLONG)methodHandle);
- AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger", (DWORDLONG)methodHandle);
+ AssertCodeMsg(index != -1, EXCEPTIONCODE_MC, "Didn't find %016llX. Probably missing a fatTrigger",
+ (DWORDLONG)methodHandle);
DWORD value = (DWORD)GetMethodAttribs->Get((DWORDLONG)methodHandle);
DEBUG_REP(dmpGetMethodAttribs((DWORDLONG)methodHandle, value));
if (cr->repSetMethodAttribs(methodHandle) == CORINFO_FLG_BAD_INLINEE)
@@ -907,8 +945,11 @@ DWORD MethodContext::repGetMethodAttribs(CORINFO_METHOD_HANDLE methodHandle)
return value;
}
-//Note - the jit will call freearray on the array we give back....
-void MethodContext::recGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDebugInfo::ILVarInfo **vars_in, bool *extendOthers)
+// Note - the jit will call freearray on the array we give back....
+void MethodContext::recGetVars(CORINFO_METHOD_HANDLE ftn,
+ ULONG32* cVars,
+ ICorDebugInfo::ILVarInfo** vars_in,
+ bool* extendOthers)
{
if (GetVars == nullptr)
GetVars = new LightWeightMap<DWORDLONG, Agnostic_GetVars>();
@@ -916,7 +957,8 @@ void MethodContext::recGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDe
Agnostic_GetVars value;
value.cVars = (DWORD)*cVars;
- value.vars_offset = (DWORD)GetVars->AddBuffer((unsigned char*)*vars_in, sizeof(ICorDebugInfo::ILVarInfo) * (*cVars));
+ value.vars_offset =
+ (DWORD)GetVars->AddBuffer((unsigned char*)*vars_in, sizeof(ICorDebugInfo::ILVarInfo) * (*cVars));
value.extendOthers = (DWORD)*extendOthers;
GetVars->Add((DWORDLONG)ftn, value);
@@ -924,14 +966,17 @@ void MethodContext::recGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDe
}
void MethodContext::dmpGetVars(DWORDLONG key, const Agnostic_GetVars& value)
{
- ICorDebugInfo::ILVarInfo *vars = (ICorDebugInfo::ILVarInfo *)GetVars->GetBuffer(value.vars_offset);
+ ICorDebugInfo::ILVarInfo* vars = (ICorDebugInfo::ILVarInfo*)GetVars->GetBuffer(value.vars_offset);
printf("GetVars key ftn-%016llX, value cVars-%u extendOthers-%u (", key, value.cVars, value.extendOthers);
for (unsigned int i = 0; i < value.cVars; i++)
printf("(%u %u %u %u)", i, vars[i].startOffset, vars[i].endOffset, vars[i].varNumber);
printf(")");
GetVars->Unlock();
}
-void MethodContext::repGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDebugInfo::ILVarInfo **vars_in, bool *extendOthers)
+void MethodContext::repGetVars(CORINFO_METHOD_HANDLE ftn,
+ ULONG32* cVars,
+ ICorDebugInfo::ILVarInfo** vars_in,
+ bool* extendOthers)
{
Agnostic_GetVars value;
if (GetVars == nullptr)
@@ -939,16 +984,19 @@ void MethodContext::repGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDe
*cVars = 0;
return;
}
- value = GetVars->Get((DWORDLONG)ftn);
+ value = GetVars->Get((DWORDLONG)ftn);
*cVars = (ULONG32)value.cVars;
if (*cVars > 0)
- *vars_in = (ICorDebugInfo::ILVarInfo *)GetVars->GetBuffer(value.vars_offset);
+ *vars_in = (ICorDebugInfo::ILVarInfo*)GetVars->GetBuffer(value.vars_offset);
*extendOthers = value.extendOthers != 0;
DEBUG_REP(dmpGetVars((DWORDLONG)ftn, value));
}
-//Note - the jit will call freearray on the array we give back....
-void MethodContext::recGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cILOffsets, DWORD **pILOffsets, ICorDebugInfo::BoundaryTypes *implictBoundaries)
+// Note - the jit will call freearray on the array we give back....
+void MethodContext::recGetBoundaries(CORINFO_METHOD_HANDLE ftn,
+ unsigned int* cILOffsets,
+ DWORD** pILOffsets,
+ ICorDebugInfo::BoundaryTypes* implictBoundaries)
{
if (GetBoundaries == nullptr)
GetBoundaries = new LightWeightMap<DWORDLONG, Agnostic_GetBoundaries>();
@@ -956,7 +1004,8 @@ void MethodContext::recGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cI
Agnostic_GetBoundaries value;
value.cILOffsets = (DWORD)*cILOffsets;
- value.pILOffset_offset = (DWORD)GetBoundaries->AddBuffer((unsigned char*)*pILOffsets, sizeof(DWORD)*(*cILOffsets));
+ value.pILOffset_offset =
+ (DWORD)GetBoundaries->AddBuffer((unsigned char*)*pILOffsets, sizeof(DWORD) * (*cILOffsets));
value.implicitBoundaries = *implictBoundaries;
GetBoundaries->Add((DWORDLONG)ftn, value);
@@ -965,7 +1014,7 @@ void MethodContext::recGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cI
void MethodContext::dmpGetBoundaries(DWORDLONG key, const Agnostic_GetBoundaries& value)
{
printf("GetBoundaries key ftn-%016llX, value cnt-%u imp-%u{", key, value.cILOffsets, value.implicitBoundaries);
- DWORD *bnd = (DWORD *)GetBoundaries->GetBuffer(value.pILOffset_offset);
+ DWORD* bnd = (DWORD*)GetBoundaries->GetBuffer(value.pILOffset_offset);
for (unsigned int i = 0; i < value.cILOffsets; i++)
{
printf("%u", bnd[i]);
@@ -975,7 +1024,10 @@ void MethodContext::dmpGetBoundaries(DWORDLONG key, const Agnostic_GetBoundaries
GetBoundaries->Unlock();
printf("}");
}
-void MethodContext::repGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cILOffsets, DWORD **pILOffsets, ICorDebugInfo::BoundaryTypes *implictBoundaries)
+void MethodContext::repGetBoundaries(CORINFO_METHOD_HANDLE ftn,
+ unsigned int* cILOffsets,
+ DWORD** pILOffsets,
+ ICorDebugInfo::BoundaryTypes* implictBoundaries)
{
Agnostic_GetBoundaries value;
@@ -983,22 +1035,27 @@ void MethodContext::repGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cI
*cILOffsets = (unsigned int)value.cILOffsets;
if (*cILOffsets > 0)
- *pILOffsets = (DWORD *)GetBoundaries->GetBuffer(value.pILOffset_offset);
+ *pILOffsets = (DWORD*)GetBoundaries->GetBuffer(value.pILOffset_offset);
*implictBoundaries = (ICorDebugInfo::BoundaryTypes)value.implicitBoundaries;
DEBUG_REP(dmpGetBoundaries((DWORDLONG)ftn, value));
}
-void MethodContext::recInitClass(CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, CORINFO_CONTEXT_HANDLE context, BOOL speculative, CorInfoInitClassResult result)
+void MethodContext::recInitClass(CORINFO_FIELD_HANDLE field,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CONTEXT_HANDLE context,
+ BOOL speculative,
+ CorInfoInitClassResult result)
{
if (InitClass == nullptr)
InitClass = new LightWeightMap<Agnostic_InitClass, DWORD>();
Agnostic_InitClass key;
- ZeroMemory(&key, sizeof(Agnostic_InitClass)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
- key.field = (DWORDLONG)field;
- key.method = (DWORDLONG)method;
- key.context = (DWORDLONG)context;
+ ZeroMemory(&key, sizeof(Agnostic_InitClass)); // We use the input structs as a key and use memcmp to compare.. so we
+ // need to zero out padding too
+ key.field = (DWORDLONG)field;
+ key.method = (DWORDLONG)method;
+ key.context = (DWORDLONG)context;
key.speculative = (DWORD)speculative;
InitClass->Add(key, (DWORD)result);
@@ -1006,16 +1063,21 @@ void MethodContext::recInitClass(CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HAND
}
void MethodContext::dmpInitClass(const Agnostic_InitClass& key, DWORD value)
{
- printf("InitClass key fld-%016llX meth-%016llX con-%016llX spec-%u, value res-%u", key.field, key.method, key.context, key.speculative, value);
+ printf("InitClass key fld-%016llX meth-%016llX con-%016llX spec-%u, value res-%u", key.field, key.method,
+ key.context, key.speculative, value);
}
-CorInfoInitClassResult MethodContext::repInitClass(CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, CORINFO_CONTEXT_HANDLE context, BOOL speculative)
+CorInfoInitClassResult MethodContext::repInitClass(CORINFO_FIELD_HANDLE field,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CONTEXT_HANDLE context,
+ BOOL speculative)
{
Agnostic_InitClass key;
- ZeroMemory(&key, sizeof(Agnostic_InitClass)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_InitClass)); // We use the input structs as a key and use memcmp to compare.. so we
+ // need to zero out padding too
- key.field = (DWORDLONG)field;
- key.method = (DWORDLONG)method;
- key.context = (DWORDLONG)context;
+ key.field = (DWORDLONG)field;
+ key.method = (DWORDLONG)method;
+ key.context = (DWORDLONG)context;
key.speculative = (DWORD)speculative;
AssertCodeMsg(InitClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)key.method);
@@ -1026,22 +1088,22 @@ CorInfoInitClassResult MethodContext::repInitClass(CORINFO_FIELD_HANDLE field, C
return result;
}
-void MethodContext::recGetMethodName(CORINFO_METHOD_HANDLE ftn, char *methodname, const char **moduleName)
+void MethodContext::recGetMethodName(CORINFO_METHOD_HANDLE ftn, char* methodname, const char** moduleName)
{
if (GetMethodName == nullptr)
GetMethodName = new LightWeightMap<DLD, DD>();
- DD value;
+ DD value;
DLD key;
key.A = (DWORDLONG)ftn;
key.B = (moduleName != nullptr);
if (methodname != nullptr)
- value.A = GetMethodName->AddBuffer((unsigned char *)methodname, (DWORD)strlen(methodname) + 1);
+ value.A = GetMethodName->AddBuffer((unsigned char*)methodname, (DWORD)strlen(methodname) + 1);
else
value.A = (DWORD)-1;
if (moduleName != nullptr)
- value.B = GetMethodName->AddBuffer((unsigned char *)*moduleName, (DWORD)strlen(*moduleName) + 1);
+ value.B = GetMethodName->AddBuffer((unsigned char*)*moduleName, (DWORD)strlen(*moduleName) + 1);
else
value.B = (DWORD)-1;
@@ -1050,16 +1112,17 @@ void MethodContext::recGetMethodName(CORINFO_METHOD_HANDLE ftn, char *methodname
}
void MethodContext::dmpGetMethodName(DLD key, DD value)
{
- unsigned char *methodName = (unsigned char *)GetMethodName->GetBuffer(value.A);
- unsigned char *moduleName = (unsigned char *)GetMethodName->GetBuffer(value.B);
- printf("GetMethodName key - ftn-%016llX modNonNull-%u, value meth-'%s', mod-'%s'", key.A, key.B, methodName, moduleName);
+ unsigned char* methodName = (unsigned char*)GetMethodName->GetBuffer(value.A);
+ unsigned char* moduleName = (unsigned char*)GetMethodName->GetBuffer(value.B);
+ printf("GetMethodName key - ftn-%016llX modNonNull-%u, value meth-'%s', mod-'%s'", key.A, key.B, methodName,
+ moduleName);
GetMethodName->Unlock();
}
-const char *MethodContext::repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char **moduleName)
+const char* MethodContext::repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char** moduleName)
{
const char* result = "hackishMethodName";
- DD value;
- DLD key;
+ DD value;
+ DLD key;
key.A = (DWORDLONG)ftn;
key.B = (moduleName != nullptr);
@@ -1075,20 +1138,20 @@ const char *MethodContext::repGetMethodName(CORINFO_METHOD_HANDLE ftn, const cha
{
value = GetMethodName->Get(key);
if (moduleName != nullptr)
- *moduleName = (const char *)GetMethodName->GetBuffer(value.B);
- result = (const char *)GetMethodName->GetBuffer(value.A);
+ *moduleName = (const char*)GetMethodName->GetBuffer(value.B);
+ result = (const char*)GetMethodName->GetBuffer(value.A);
}
DEBUG_REP(dmpGetMethodName(key, value));
return result;
}
-void MethodContext::recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result)
+void MethodContext::recGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes, DWORD result)
{
if (GetJitFlags == nullptr)
GetJitFlags = new LightWeightMap<DWORD, DD>();
DD value;
- value.A = (DWORD)GetJitFlags->AddBuffer((unsigned char *)jitFlags, sizeInBytes);
+ value.A = (DWORD)GetJitFlags->AddBuffer((unsigned char*)jitFlags, sizeInBytes);
value.B = result;
// NOTE: getJitFlags() is expected to be idempotent per method, so the mapping key is always
@@ -1098,14 +1161,14 @@ void MethodContext::recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DW
}
void MethodContext::dmpGetJitFlags(DWORD key, DD value)
{
- CORJIT_FLAGS *jitflags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A);
+ 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)
+DWORD MethodContext::repGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes)
{
- DD value = GetJitFlags->Get((DWORD)0);
- CORJIT_FLAGS *resultFlags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A);
+ DD value = GetJitFlags->Get((DWORD)0);
+ CORJIT_FLAGS* resultFlags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A);
memcpy(jitFlags, resultFlags, value.B);
DEBUG_REP(dmpGetJitFlags((DWORD)0, value));
return value.B;
@@ -1119,36 +1182,42 @@ void MethodContext::recGetJitTimeLogFilename(LPCWSTR tempFileName)
DWORD name_index = -1;
if (tempFileName != nullptr)
{
- name_index = (DWORD)GetJitTimeLogFilename->AddBuffer((unsigned char *)tempFileName, (DWORD)wcslen(tempFileName) + 2);
+ name_index =
+ (DWORD)GetJitTimeLogFilename->AddBuffer((unsigned char*)tempFileName, (DWORD)wcslen(tempFileName) + 2);
}
GetJitTimeLogFilename->Add((DWORD)0, name_index);
DEBUG_REC(dmpGetJitTimeLogFilename((DWORD)0, name_index));
}
void MethodContext::dmpGetJitTimeLogFilename(DWORD key, DWORD value)
{
- unsigned char *fileName = nullptr;
+ unsigned char* fileName = nullptr;
if (value != 0)
- fileName = (unsigned char *)GetJitTimeLogFilename->GetBuffer(value);
+ fileName = (unsigned char*)GetJitTimeLogFilename->GetBuffer(value);
printf("GetJitTimeLogFilename key %u, value '%s'", key, fileName);
GetJitTimeLogFilename->Unlock();
}
LPCWSTR MethodContext::repGetJitTimeLogFilename()
{
- DWORD offset = GetJitTimeLogFilename->Get((DWORD)0);
- LPCWSTR value = nullptr;
+ DWORD offset = GetJitTimeLogFilename->Get((DWORD)0);
+ LPCWSTR value = nullptr;
if (offset != 0)
value = (LPCWSTR)GetJitTimeLogFilename->GetBuffer(offset);
DEBUG_REP(dmpGetJitTimeLogFilename((DWORD)0, offset));
return value;
}
-void MethodContext::recCanInline(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, DWORD *pRestrictions, CorInfoInline response, DWORD exceptionCode)
+void MethodContext::recCanInline(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ DWORD* pRestrictions,
+ CorInfoInline response,
+ DWORD exceptionCode)
{
if (CanInline == nullptr)
CanInline = new LightWeightMap<DLDL, Agnostic_CanInline>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
Agnostic_CanInline value;
key.A = (DWORDLONG)callerHnd;
@@ -1158,20 +1227,25 @@ void MethodContext::recCanInline(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD
value.Restrictions = (DWORD)*pRestrictions;
else
value.Restrictions = (DWORD)0;
- value.result = (DWORD)response;
- value.exceptionCode = (DWORD)exceptionCode;
+ value.result = (DWORD)response;
+ value.exceptionCode = (DWORD)exceptionCode;
CanInline->Add(key, value);
DEBUG_REC(dmpCanInline(key, value));
}
void MethodContext::dmpCanInline(DLDL key, const Agnostic_CanInline& value)
{
- printf("CanInline key - callerHnd-%016llX calleeHnd-%016llX, value pRestrictions-%u result-%u exceptionCode-%08X", key.A, key.B, value.Restrictions, value.result, value.exceptionCode);
+ printf("CanInline key - callerHnd-%016llX calleeHnd-%016llX, value pRestrictions-%u result-%u exceptionCode-%08X",
+ key.A, key.B, value.Restrictions, value.result, value.exceptionCode);
}
-CorInfoInline MethodContext::repCanInline(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, DWORD* pRestrictions, DWORD *exceptionCode)
+CorInfoInline MethodContext::repCanInline(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ DWORD* pRestrictions,
+ DWORD* exceptionCode)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
Agnostic_CanInline value;
key.A = (DWORDLONG)callerHnd;
@@ -1181,9 +1255,10 @@ CorInfoInline MethodContext::repCanInline(CORINFO_METHOD_HANDLE callerHnd, CORIN
{
#ifdef sparseMC
LogDebug("Sparse - repCanInline saying INLINE_FAIL");
- return INLINE_FAIL; //if we have no info, its pretty safe to say we can't inline it.
+ return INLINE_FAIL; // if we have no info, its pretty safe to say we can't inline it.
#else
- LogException(EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in canInline", key.A, key.B);
+ LogException(EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in canInline",
+ key.A, key.B);
#endif
}
@@ -1192,135 +1267,127 @@ CorInfoInline MethodContext::repCanInline(CORINFO_METHOD_HANDLE callerHnd, CORIN
*exceptionCode = value.exceptionCode;
if (pRestrictions != nullptr)
- *pRestrictions = (DWORD)value.Restrictions;
+ *pRestrictions = (DWORD)value.Restrictions;
CorInfoInline response = (CorInfoInline)value.result;
DEBUG_REP(dmpCanInline(key, value));
return response;
}
-void MethodContext::recResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, DWORD exceptionCode)
+void MethodContext::recResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWORD exceptionCode)
{
if (ResolveToken == nullptr)
ResolveToken = new LightWeightMap<Agnostic_CORINFO_RESOLVED_TOKENin, Agnostic_CORINFO_RESOLVED_TOKENout>();
Agnostic_CORINFO_RESOLVED_TOKENin key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_RESOLVED_TOKENout value;
key.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.token = (DWORD)pResolvedToken->token;
- key.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.token = (DWORD)pResolvedToken->token;
+ key.tokenType = (DWORD)pResolvedToken->tokenType;
- value.hClass = (DWORDLONG)pResolvedToken->hClass;
+ value.hClass = (DWORDLONG)pResolvedToken->hClass;
value.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- value.hField = (DWORDLONG)pResolvedToken->hField;
- value.pTypeSpec_Index = (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ value.hField = (DWORDLONG)pResolvedToken->hField;
+ value.pTypeSpec_Index =
+ (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
value.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- value.pMethodSpec_Index = (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
- value.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
+ value.pMethodSpec_Index =
+ (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ value.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
value.exceptionCode = (DWORD)exceptionCode;
ResolveToken->Add(key, value);
DEBUG_REC(dmpResolveToken(key, value));
}
-void MethodContext::dmpResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const Agnostic_CORINFO_RESOLVED_TOKENout& value)
-{
- printf("ResolveToken key tc-%016llX ts-%016llX tok-%08X tt-%u",
- key.tokenContext,
- key.tokenScope,
- key.token,
- key.tokenType);
- printf(", value cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u excp-%08X",
- value.hClass,
- value.hMethod,
- value.hField,
- value.pTypeSpec_Index,
- value.cbTypeSpec,
- value.pMethodSpec_Index,
- value.cbMethodSpec,
- value.exceptionCode);
-}
-void MethodContext::repResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, DWORD *exceptionCode)
+void MethodContext::dmpResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key,
+ const Agnostic_CORINFO_RESOLVED_TOKENout& value)
+{
+ printf("ResolveToken key tc-%016llX ts-%016llX tok-%08X tt-%u", key.tokenContext, key.tokenScope, key.token,
+ key.tokenType);
+ printf(", value cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u excp-%08X", value.hClass,
+ value.hMethod, value.hField, value.pTypeSpec_Index, value.cbTypeSpec, value.pMethodSpec_Index,
+ value.cbMethodSpec, value.exceptionCode);
+}
+void MethodContext::repResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWORD* exceptionCode)
{
Agnostic_CORINFO_RESOLVED_TOKENin key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_RESOLVED_TOKENout value;
key.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.token = (DWORD)pResolvedToken->token;
- key.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.token = (DWORD)pResolvedToken->token;
+ key.tokenType = (DWORD)pResolvedToken->tokenType;
AssertCodeMsg(ResolveToken->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %x", pResolvedToken->token);
value = ResolveToken->Get(key);
- pResolvedToken->hClass = (CORINFO_CLASS_HANDLE)value.hClass;
- pResolvedToken->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
- pResolvedToken->hField = (CORINFO_FIELD_HANDLE)value.hField;
- pResolvedToken->pTypeSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pTypeSpec_Index);
- pResolvedToken->cbTypeSpec = (ULONG)value.cbTypeSpec;
- pResolvedToken->pMethodSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pMethodSpec_Index);
+ pResolvedToken->hClass = (CORINFO_CLASS_HANDLE)value.hClass;
+ pResolvedToken->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
+ pResolvedToken->hField = (CORINFO_FIELD_HANDLE)value.hField;
+ pResolvedToken->pTypeSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pTypeSpec_Index);
+ pResolvedToken->cbTypeSpec = (ULONG)value.cbTypeSpec;
+ pResolvedToken->pMethodSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pMethodSpec_Index);
pResolvedToken->cbMethodSpec = (ULONG)value.cbMethodSpec;
- *exceptionCode = (DWORD)value.exceptionCode;
+ *exceptionCode = (DWORD)value.exceptionCode;
DEBUG_REP(dmpResolveToken(key, value));
}
-void MethodContext::recTryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool success)
+void MethodContext::recTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool success)
{
if (TryResolveToken == nullptr)
TryResolveToken = new LightWeightMap<Agnostic_CORINFO_RESOLVED_TOKENin, Agnostic_CORINFO_RESOLVED_TOKENout>();
Agnostic_CORINFO_RESOLVED_TOKENin key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_RESOLVED_TOKENout value;
key.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.token = (DWORD)pResolvedToken->token;
- key.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.token = (DWORD)pResolvedToken->token;
+ key.tokenType = (DWORD)pResolvedToken->tokenType;
- value.hClass = (DWORDLONG)pResolvedToken->hClass;
+ value.hClass = (DWORDLONG)pResolvedToken->hClass;
value.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- value.hField = (DWORDLONG)pResolvedToken->hField;
- value.pTypeSpec_Index = (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ value.hField = (DWORDLONG)pResolvedToken->hField;
+ value.pTypeSpec_Index =
+ (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
value.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- value.pMethodSpec_Index = (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
- value.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
+ value.pMethodSpec_Index =
+ (DWORD)ResolveToken->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ value.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
value.exceptionCode = success ? 0 : 1;
TryResolveToken->Add(key, value);
DEBUG_REC(dmpTryResolveToken(key, value));
}
-void MethodContext::dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const Agnostic_CORINFO_RESOLVED_TOKENout& value)
-{
- printf("TryResolveToken key tc-%016llX ts-%016llX tok-%08X tt-%u",
- key.tokenContext,
- key.tokenScope,
- key.token,
- key.tokenType);
- printf(", value cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u failed-%u",
- value.hClass,
- value.hMethod,
- value.hField,
- value.pTypeSpec_Index,
- value.cbTypeSpec,
- value.pMethodSpec_Index,
- value.cbMethodSpec,
- value.exceptionCode);
-}
-bool MethodContext::repTryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken)
+void MethodContext::dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key,
+ const Agnostic_CORINFO_RESOLVED_TOKENout& value)
+{
+ printf("TryResolveToken key tc-%016llX ts-%016llX tok-%08X tt-%u", key.tokenContext, key.tokenScope, key.token,
+ key.tokenType);
+ printf(", value cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u failed-%u", value.hClass,
+ value.hMethod, value.hField, value.pTypeSpec_Index, value.cbTypeSpec, value.pMethodSpec_Index,
+ value.cbMethodSpec, value.exceptionCode);
+}
+bool MethodContext::repTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
Agnostic_CORINFO_RESOLVED_TOKENin key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKENin)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_RESOLVED_TOKENout value;
key.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.token = (DWORD)pResolvedToken->token;
- key.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.token = (DWORD)pResolvedToken->token;
+ key.tokenType = (DWORD)pResolvedToken->tokenType;
// Best-effort: if the `tryResolveToken` map is missing or the key is not found therein,
// fall back to the `resolveToken` map.
@@ -1334,181 +1401,198 @@ bool MethodContext::repTryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken)
value = ResolveToken->Get(key);
}
- pResolvedToken->hClass = (CORINFO_CLASS_HANDLE)value.hClass;
- pResolvedToken->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
- pResolvedToken->hField = (CORINFO_FIELD_HANDLE)value.hField;
- pResolvedToken->pTypeSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pTypeSpec_Index);
- pResolvedToken->cbTypeSpec = (ULONG)value.cbTypeSpec;
- pResolvedToken->pMethodSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pMethodSpec_Index);
+ pResolvedToken->hClass = (CORINFO_CLASS_HANDLE)value.hClass;
+ pResolvedToken->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
+ pResolvedToken->hField = (CORINFO_FIELD_HANDLE)value.hField;
+ pResolvedToken->pTypeSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pTypeSpec_Index);
+ pResolvedToken->cbTypeSpec = (ULONG)value.cbTypeSpec;
+ pResolvedToken->pMethodSpec = (PCCOR_SIGNATURE)ResolveToken->GetBuffer(value.pMethodSpec_Index);
pResolvedToken->cbMethodSpec = (ULONG)value.cbMethodSpec;
DEBUG_REP(dmpTryResolveToken(key, value));
return (DWORD)value.exceptionCode == 0;
}
-void MethodContext::recGetCallInfo(
- CORINFO_RESOLVED_TOKEN *pResolvedToken,
- CORINFO_RESOLVED_TOKEN *pConstrainedResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_CALLINFO_FLAGS flags,
- CORINFO_CALL_INFO *pResult,
- DWORD exceptionCode)
+void MethodContext::recGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_CALLINFO_FLAGS flags,
+ CORINFO_CALL_INFO* pResult,
+ DWORD exceptionCode)
{
if (GetCallInfo == nullptr)
GetCallInfo = new LightWeightMap<Agnostic_GetCallInfo, Agnostic_CORINFO_CALL_INFO>();
Agnostic_GetCallInfo key;
- ZeroMemory(&key, sizeof(Agnostic_GetCallInfo)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetCallInfo)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
Agnostic_CORINFO_CALL_INFO value;
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
if (pConstrainedResolvedToken != nullptr)
{
key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)pConstrainedResolvedToken->tokenContext;
- key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)pConstrainedResolvedToken->tokenScope;
- key.ConstrainedResolvedToken.token = (DWORD)pConstrainedResolvedToken->token;
- key.ConstrainedResolvedToken.tokenType = (DWORD)pConstrainedResolvedToken->tokenType;
- key.ConstrainedResolvedToken.hClass = (DWORDLONG)pConstrainedResolvedToken->hClass;
- key.ConstrainedResolvedToken.hMethod = (DWORDLONG)pConstrainedResolvedToken->hMethod;
- key.ConstrainedResolvedToken.hField = (DWORDLONG)pConstrainedResolvedToken->hField;
- key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)GetCallInfo->AddBuffer((unsigned char*)pConstrainedResolvedToken->pTypeSpec, pConstrainedResolvedToken->cbTypeSpec);
+ key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)pConstrainedResolvedToken->tokenScope;
+ key.ConstrainedResolvedToken.token = (DWORD)pConstrainedResolvedToken->token;
+ key.ConstrainedResolvedToken.tokenType = (DWORD)pConstrainedResolvedToken->tokenType;
+ key.ConstrainedResolvedToken.hClass = (DWORDLONG)pConstrainedResolvedToken->hClass;
+ key.ConstrainedResolvedToken.hMethod = (DWORDLONG)pConstrainedResolvedToken->hMethod;
+ key.ConstrainedResolvedToken.hField = (DWORDLONG)pConstrainedResolvedToken->hField;
+ key.ConstrainedResolvedToken.typeSpec_Index =
+ (DWORD)GetCallInfo->AddBuffer((unsigned char*)pConstrainedResolvedToken->pTypeSpec,
+ pConstrainedResolvedToken->cbTypeSpec);
key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)pConstrainedResolvedToken->cbTypeSpec;
- key.ConstrainedResolvedToken.methodSpec_Index = (DWORD)GetCallInfo->AddBuffer((unsigned char*)pConstrainedResolvedToken->pMethodSpec, pConstrainedResolvedToken->cbMethodSpec);
+ key.ConstrainedResolvedToken.methodSpec_Index =
+ (DWORD)GetCallInfo->AddBuffer((unsigned char*)pConstrainedResolvedToken->pMethodSpec,
+ pConstrainedResolvedToken->cbMethodSpec);
key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)pConstrainedResolvedToken->cbMethodSpec;
}
else
{
- key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)0;
- key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)0;
- key.ConstrainedResolvedToken.token = (DWORD)0;
- key.ConstrainedResolvedToken.tokenType = (DWORD)0;
- key.ConstrainedResolvedToken.hClass = (DWORDLONG)0;
- key.ConstrainedResolvedToken.hMethod = (DWORDLONG)0;
- key.ConstrainedResolvedToken.hField = (DWORDLONG)0;
- key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)0;
- key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)0;
+ key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.token = (DWORD)0;
+ key.ConstrainedResolvedToken.tokenType = (DWORD)0;
+ key.ConstrainedResolvedToken.hClass = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.hMethod = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.hField = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)0;
key.ConstrainedResolvedToken.methodSpec_Index = (DWORD)0;
- key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)0;
+ key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)0;
}
key.callerHandle = (DWORDLONG)callerHandle;
- key.flags = (DWORD)flags;
+ key.flags = (DWORD)flags;
if (exceptionCode == 0)
{
- value.hMethod = (DWORDLONG)pResult->hMethod;
- value.methodFlags = (DWORD)pResult->methodFlags;
- value.classFlags = (DWORD)pResult->classFlags;
- value.sig.callConv = (DWORD)pResult->sig.callConv;
- value.sig.retTypeClass = (DWORDLONG)pResult->sig.retTypeClass;
- value.sig.retTypeSigClass = (DWORDLONG)pResult->sig.retTypeSigClass;
- value.sig.retType = (DWORD)pResult->sig.retType;
- value.sig.flags = (DWORD)pResult->sig.flags;
- value.sig.numArgs = (DWORD)pResult->sig.numArgs;
+ value.hMethod = (DWORDLONG)pResult->hMethod;
+ value.methodFlags = (DWORD)pResult->methodFlags;
+ value.classFlags = (DWORD)pResult->classFlags;
+ value.sig.callConv = (DWORD)pResult->sig.callConv;
+ value.sig.retTypeClass = (DWORDLONG)pResult->sig.retTypeClass;
+ value.sig.retTypeSigClass = (DWORDLONG)pResult->sig.retTypeSigClass;
+ value.sig.retType = (DWORD)pResult->sig.retType;
+ value.sig.flags = (DWORD)pResult->sig.flags;
+ value.sig.numArgs = (DWORD)pResult->sig.numArgs;
value.sig.sigInst_classInstCount = (DWORD)pResult->sig.sigInst.classInstCount;
- value.sig.sigInst_classInst_Index = GetCallInfo->AddBuffer((unsigned char*)pResult->sig.sigInst.classInst, pResult->sig.sigInst.classInstCount * 8); //porting issue
+ value.sig.sigInst_classInst_Index =
+ GetCallInfo->AddBuffer((unsigned char*)pResult->sig.sigInst.classInst,
+ pResult->sig.sigInst.classInstCount * 8); // porting issue
value.sig.sigInst_methInstCount = (DWORD)pResult->sig.sigInst.methInstCount;
- value.sig.sigInst_methInst_Index = GetCallInfo->AddBuffer((unsigned char*)pResult->sig.sigInst.methInst, pResult->sig.sigInst.methInstCount * 8); //porting issue
- value.sig.args = (DWORDLONG)pResult->sig.args;
+ value.sig.sigInst_methInst_Index =
+ GetCallInfo->AddBuffer((unsigned char*)pResult->sig.sigInst.methInst,
+ pResult->sig.sigInst.methInstCount * 8); // porting issue
+ value.sig.args = (DWORDLONG)pResult->sig.args;
value.sig.cbSig = (DWORD)pResult->sig.cbSig;
- value.sig.pSig = (DWORD)GetCallInfo->AddBuffer((unsigned char *)pResult->sig.pSig, pResult->sig.cbSig);
+ value.sig.pSig = (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResult->sig.pSig, pResult->sig.cbSig);
value.sig.scope = (DWORDLONG)pResult->sig.scope;
value.sig.token = (DWORD)pResult->sig.token;
if (flags & CORINFO_CALLINFO_VERIFICATION)
{
- value.verMethodFlags = (DWORD)pResult->verMethodFlags;
- value.verSig.callConv = (DWORD)pResult->verSig.callConv;
- value.verSig.retTypeClass = (DWORDLONG)pResult->verSig.retTypeClass;
- value.verSig.retTypeSigClass = (DWORDLONG)pResult->verSig.retTypeSigClass;
- value.verSig.retType = (DWORD)pResult->verSig.retType;
- value.verSig.flags = (DWORD)pResult->verSig.flags;
- value.verSig.numArgs = (DWORD)pResult->verSig.numArgs;
+ value.verMethodFlags = (DWORD)pResult->verMethodFlags;
+ value.verSig.callConv = (DWORD)pResult->verSig.callConv;
+ value.verSig.retTypeClass = (DWORDLONG)pResult->verSig.retTypeClass;
+ value.verSig.retTypeSigClass = (DWORDLONG)pResult->verSig.retTypeSigClass;
+ value.verSig.retType = (DWORD)pResult->verSig.retType;
+ value.verSig.flags = (DWORD)pResult->verSig.flags;
+ value.verSig.numArgs = (DWORD)pResult->verSig.numArgs;
value.verSig.sigInst_classInstCount = (DWORD)pResult->verSig.sigInst.classInstCount;
- value.verSig.sigInst_classInst_Index = GetCallInfo->AddBuffer((unsigned char*)pResult->verSig.sigInst.classInst, pResult->verSig.sigInst.classInstCount * 8); //porting issue
+ value.verSig.sigInst_classInst_Index =
+ GetCallInfo->AddBuffer((unsigned char*)pResult->verSig.sigInst.classInst,
+ pResult->verSig.sigInst.classInstCount * 8); // porting issue
value.verSig.sigInst_methInstCount = (DWORD)pResult->verSig.sigInst.methInstCount;
- value.verSig.sigInst_methInst_Index = GetCallInfo->AddBuffer((unsigned char*)pResult->verSig.sigInst.methInst, pResult->verSig.sigInst.methInstCount * 8); //porting issue
- value.verSig.args = (DWORDLONG)pResult->verSig.args;
+ value.verSig.sigInst_methInst_Index =
+ GetCallInfo->AddBuffer((unsigned char*)pResult->verSig.sigInst.methInst,
+ pResult->verSig.sigInst.methInstCount * 8); // porting issue
+ value.verSig.args = (DWORDLONG)pResult->verSig.args;
value.verSig.cbSig = (DWORD)pResult->verSig.cbSig;
- value.verSig.pSig = (DWORD)GetCallInfo->AddBuffer((unsigned char *)pResult->verSig.pSig, pResult->verSig.cbSig);
+ value.verSig.pSig =
+ (DWORD)GetCallInfo->AddBuffer((unsigned char*)pResult->verSig.pSig, pResult->verSig.cbSig);
value.verSig.scope = (DWORDLONG)pResult->verSig.scope;
value.verSig.token = (DWORD)pResult->verSig.token;
}
else
{
- value.verMethodFlags = (DWORD)0;
- value.verSig.callConv = (DWORD)0;
- value.verSig.retTypeClass = (DWORDLONG)0;
- value.verSig.retTypeSigClass = (DWORDLONG)0;
- value.verSig.retType = (DWORD)0;
- value.verSig.flags = (DWORD)0;
- value.verSig.numArgs = (DWORD)0;
- value.verSig.sigInst_classInstCount = (DWORD)0;
+ value.verMethodFlags = (DWORD)0;
+ value.verSig.callConv = (DWORD)0;
+ value.verSig.retTypeClass = (DWORDLONG)0;
+ value.verSig.retTypeSigClass = (DWORDLONG)0;
+ value.verSig.retType = (DWORD)0;
+ value.verSig.flags = (DWORD)0;
+ value.verSig.numArgs = (DWORD)0;
+ value.verSig.sigInst_classInstCount = (DWORD)0;
value.verSig.sigInst_classInst_Index = (DWORD)0;
- value.verSig.sigInst_methInstCount = (DWORD)0;
- value.verSig.sigInst_methInst_Index = (DWORD)0;
- value.verSig.args = (DWORDLONG)0;
- value.verSig.cbSig = (DWORD)0;
- value.verSig.pSig = (DWORD)0;
- value.verSig.scope = (DWORDLONG)0;
- value.verSig.token = (DWORD)0;
+ value.verSig.sigInst_methInstCount = (DWORD)0;
+ value.verSig.sigInst_methInst_Index = (DWORD)0;
+ value.verSig.args = (DWORDLONG)0;
+ value.verSig.cbSig = (DWORD)0;
+ value.verSig.pSig = (DWORD)0;
+ value.verSig.scope = (DWORDLONG)0;
+ value.verSig.token = (DWORD)0;
}
- value.accessAllowed = (DWORD)pResult->accessAllowed;
+ value.accessAllowed = (DWORD)pResult->accessAllowed;
value.callsiteCalloutHelper.helperNum = (DWORD)pResult->callsiteCalloutHelper.helperNum;
- value.callsiteCalloutHelper.numArgs = (DWORD)pResult->callsiteCalloutHelper.numArgs;
+ value.callsiteCalloutHelper.numArgs = (DWORD)pResult->callsiteCalloutHelper.numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
value.callsiteCalloutHelper.args[i].constant = (DWORDLONG)pResult->callsiteCalloutHelper.args[i].constant;
- value.callsiteCalloutHelper.args[i].argType = (DWORD)pResult->callsiteCalloutHelper.args[i].argType;
+ value.callsiteCalloutHelper.args[i].argType = (DWORD)pResult->callsiteCalloutHelper.args[i].argType;
}
value.thisTransform = (DWORD)pResult->thisTransform;
- value.kind = (DWORD)pResult->kind;
- value.nullInstanceCheck = (DWORD)pResult->nullInstanceCheck;
- value.contextHandle = (DWORDLONG)pResult->contextHandle;
- value.exactContextNeedsRuntimeLookup = (DWORD)pResult->exactContextNeedsRuntimeLookup;
+ value.kind = (DWORD)pResult->kind;
+ value.nullInstanceCheck = (DWORD)pResult->nullInstanceCheck;
+ value.contextHandle = (DWORDLONG)pResult->contextHandle;
+ value.exactContextNeedsRuntimeLookup = (DWORD)pResult->exactContextNeedsRuntimeLookup;
value.stubLookup.lookupKind.needsRuntimeLookup = (DWORD)pResult->stubLookup.lookupKind.needsRuntimeLookup;
- value.stubLookup.lookupKind.runtimeLookupKind = (DWORD)pResult->stubLookup.lookupKind.runtimeLookupKind;
+ value.stubLookup.lookupKind.runtimeLookupKind = (DWORD)pResult->stubLookup.lookupKind.runtimeLookupKind;
if (pResult->stubLookup.lookupKind.needsRuntimeLookup)
{
value.stubLookup.constLookup.accessType = (DWORD)0;
- value.stubLookup.constLookup.handle = (DWORDLONG)0;
+ value.stubLookup.constLookup.handle = (DWORDLONG)0;
- value.stubLookup.runtimeLookup.signature = (DWORDLONG)pResult->stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on value
- value.stubLookup.runtimeLookup.helper = (DWORD)pResult->stubLookup.runtimeLookup.helper;
+ value.stubLookup.runtimeLookup.signature =
+ (DWORDLONG)pResult->stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on
+ // value
+ value.stubLookup.runtimeLookup.helper = (DWORD)pResult->stubLookup.runtimeLookup.helper;
value.stubLookup.runtimeLookup.indirections = (DWORD)pResult->stubLookup.runtimeLookup.indirections;
- value.stubLookup.runtimeLookup.testForNull = (DWORD)pResult->stubLookup.runtimeLookup.testForNull;
+ value.stubLookup.runtimeLookup.testForNull = (DWORD)pResult->stubLookup.runtimeLookup.testForNull;
value.stubLookup.runtimeLookup.testForFixup = (DWORD)pResult->stubLookup.runtimeLookup.testForFixup;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
value.stubLookup.runtimeLookup.offsets[i] = (DWORDLONG)pResult->stubLookup.runtimeLookup.offsets[i];
}
else
{
- value.stubLookup.runtimeLookup.signature = (DWORDLONG)0;
- value.stubLookup.runtimeLookup.helper = (DWORD)0;
+ value.stubLookup.runtimeLookup.signature = (DWORDLONG)0;
+ value.stubLookup.runtimeLookup.helper = (DWORD)0;
value.stubLookup.runtimeLookup.indirections = (DWORD)0;
- value.stubLookup.runtimeLookup.testForNull = (DWORD)0;
+ value.stubLookup.runtimeLookup.testForNull = (DWORD)0;
value.stubLookup.runtimeLookup.testForFixup = (DWORD)0;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
value.stubLookup.runtimeLookup.offsets[i] = (DWORDLONG)0;
value.stubLookup.constLookup.accessType = (DWORD)pResult->stubLookup.constLookup.accessType;
- value.stubLookup.constLookup.handle = (DWORDLONG)pResult->stubLookup.constLookup.handle;
+ value.stubLookup.constLookup.handle = (DWORDLONG)pResult->stubLookup.constLookup.handle;
}
value.instParamLookup.accessType = (DWORD)pResult->instParamLookup.accessType;
- value.instParamLookup.handle = (DWORDLONG)pResult->instParamLookup.handle;
- value.secureDelegateInvoke = (DWORD)pResult->secureDelegateInvoke;
+ value.instParamLookup.handle = (DWORDLONG)pResult->instParamLookup.handle;
+ value.secureDelegateInvoke = (DWORD)pResult->secureDelegateInvoke;
}
else
ZeroMemory(&value, sizeof(Agnostic_CORINFO_CALL_INFO));
@@ -1520,197 +1604,180 @@ void MethodContext::recGetCallInfo(
void MethodContext::dmpGetCallInfo(const Agnostic_GetCallInfo& key, const Agnostic_CORINFO_CALL_INFO& value)
{
printf("GetCallInfo key"
- " rt{tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u}"
+ " rt{tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u}"
" crt{tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u}"
" ch-%016llX flg-%08X",
- key.ResolvedToken.tokenContext,
- key.ResolvedToken.tokenScope,
- key.ResolvedToken.token,
- key.ResolvedToken.tokenType,
- key.ResolvedToken.hClass,
- key.ResolvedToken.hMethod,
- key.ResolvedToken.hField,
- key.ResolvedToken.typeSpec_Index,
- key.ResolvedToken.cbTypeSpec,
- key.ResolvedToken.methodSpec_Index,
- key.ResolvedToken.cbMethodSpec,
- key.ConstrainedResolvedToken.tokenContext,
- key.ConstrainedResolvedToken.tokenScope,
- key.ConstrainedResolvedToken.token,
- key.ConstrainedResolvedToken.tokenType,
- key.ConstrainedResolvedToken.hClass,
- key.ConstrainedResolvedToken.hMethod,
- key.ConstrainedResolvedToken.hField,
- key.ConstrainedResolvedToken.typeSpec_Index,
- key.ConstrainedResolvedToken.cbTypeSpec,
- key.ConstrainedResolvedToken.methodSpec_Index,
- key.ConstrainedResolvedToken.cbMethodSpec,
- key.callerHandle,
- key.flags);
+ key.ResolvedToken.tokenContext, key.ResolvedToken.tokenScope, key.ResolvedToken.token,
+ key.ResolvedToken.tokenType, key.ResolvedToken.hClass, key.ResolvedToken.hMethod, key.ResolvedToken.hField,
+ key.ResolvedToken.typeSpec_Index, key.ResolvedToken.cbTypeSpec, key.ResolvedToken.methodSpec_Index,
+ key.ResolvedToken.cbMethodSpec, key.ConstrainedResolvedToken.tokenContext,
+ key.ConstrainedResolvedToken.tokenScope, key.ConstrainedResolvedToken.token,
+ key.ConstrainedResolvedToken.tokenType, key.ConstrainedResolvedToken.hClass,
+ key.ConstrainedResolvedToken.hMethod, key.ConstrainedResolvedToken.hField,
+ key.ConstrainedResolvedToken.typeSpec_Index, key.ConstrainedResolvedToken.cbTypeSpec,
+ key.ConstrainedResolvedToken.methodSpec_Index, key.ConstrainedResolvedToken.cbMethodSpec, key.callerHandle,
+ key.flags);
printf(", value mth-%016llX, mf-%08X cf-%08X"
- " sig{flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u args-%016llX scp-%016llX tok-%08X}"
+ " sig{flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u args-%016llX scp-%016llX tok-%08X}"
" vsig{flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u args-%016llX scp-%016llX tok-%08X}"
" ipl{at-%08X hnd-%016llX}"
" sdi-%08X"
" excp-%08X",
- value.hMethod,
- value.methodFlags,
- value.classFlags,
- value.sig.flags,
- value.sig.numArgs,
- value.sig.sigInst_classInstCount,
- value.sig.sigInst_classInst_Index,
- value.sig.sigInst_methInstCount,
- value.sig.sigInst_methInst_Index,
- value.sig.args,
- value.sig.scope,
- value.sig.token,
- value.verSig.flags,
- value.verSig.numArgs,
- value.verSig.sigInst_classInstCount,
- value.verSig.sigInst_classInst_Index,
- value.verSig.sigInst_methInstCount,
- value.verSig.sigInst_methInst_Index,
- value.verSig.args,
- value.verSig.scope,
- value.verSig.token,
- value.instParamLookup.accessType,
- value.instParamLookup.handle,
- value.secureDelegateInvoke,
- value.exceptionCode);
-}
-void MethodContext::repGetCallInfo(
- CORINFO_RESOLVED_TOKEN *pResolvedToken,
- CORINFO_RESOLVED_TOKEN *pConstrainedResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_CALLINFO_FLAGS flags,
- CORINFO_CALL_INFO *pResult,
- DWORD *exceptionCode)
+ value.hMethod, value.methodFlags, value.classFlags, value.sig.flags, value.sig.numArgs,
+ value.sig.sigInst_classInstCount, value.sig.sigInst_classInst_Index, value.sig.sigInst_methInstCount,
+ value.sig.sigInst_methInst_Index, value.sig.args, value.sig.scope, value.sig.token, value.verSig.flags,
+ value.verSig.numArgs, value.verSig.sigInst_classInstCount, value.verSig.sigInst_classInst_Index,
+ value.verSig.sigInst_methInstCount, value.verSig.sigInst_methInst_Index, value.verSig.args,
+ value.verSig.scope, value.verSig.token, value.instParamLookup.accessType, value.instParamLookup.handle,
+ value.secureDelegateInvoke, value.exceptionCode);
+}
+void MethodContext::repGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_CALLINFO_FLAGS flags,
+ CORINFO_CALL_INFO* pResult,
+ DWORD* exceptionCode)
{
Agnostic_GetCallInfo key;
- ZeroMemory(&key, sizeof(Agnostic_GetCallInfo)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetCallInfo)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
Agnostic_CORINFO_CALL_INFO value;
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)GetCallInfo->Contains((unsigned char *)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)GetCallInfo->Contains((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)GetCallInfo->Contains((unsigned char *)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)GetCallInfo->Contains((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
if (pConstrainedResolvedToken != nullptr)
{
key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)pConstrainedResolvedToken->tokenContext;
- key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)pConstrainedResolvedToken->tokenScope;
- key.ConstrainedResolvedToken.token = (DWORD)pConstrainedResolvedToken->token;
- key.ConstrainedResolvedToken.tokenType = (DWORD)pConstrainedResolvedToken->tokenType;
- key.ConstrainedResolvedToken.hClass = (DWORDLONG)pConstrainedResolvedToken->hClass;
- key.ConstrainedResolvedToken.hMethod = (DWORDLONG)pConstrainedResolvedToken->hMethod;
- key.ConstrainedResolvedToken.hField = (DWORDLONG)pConstrainedResolvedToken->hField;
- key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)GetCallInfo->Contains((unsigned char *)pConstrainedResolvedToken->pTypeSpec, pConstrainedResolvedToken->cbTypeSpec);
+ key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)pConstrainedResolvedToken->tokenScope;
+ key.ConstrainedResolvedToken.token = (DWORD)pConstrainedResolvedToken->token;
+ key.ConstrainedResolvedToken.tokenType = (DWORD)pConstrainedResolvedToken->tokenType;
+ key.ConstrainedResolvedToken.hClass = (DWORDLONG)pConstrainedResolvedToken->hClass;
+ key.ConstrainedResolvedToken.hMethod = (DWORDLONG)pConstrainedResolvedToken->hMethod;
+ key.ConstrainedResolvedToken.hField = (DWORDLONG)pConstrainedResolvedToken->hField;
+ key.ConstrainedResolvedToken.typeSpec_Index =
+ (DWORD)GetCallInfo->Contains((unsigned char*)pConstrainedResolvedToken->pTypeSpec,
+ pConstrainedResolvedToken->cbTypeSpec);
key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)pConstrainedResolvedToken->cbTypeSpec;
- key.ConstrainedResolvedToken.methodSpec_Index = (DWORD)GetCallInfo->Contains((unsigned char *)pConstrainedResolvedToken->pMethodSpec, pConstrainedResolvedToken->cbMethodSpec);
+ key.ConstrainedResolvedToken.methodSpec_Index =
+ (DWORD)GetCallInfo->Contains((unsigned char*)pConstrainedResolvedToken->pMethodSpec,
+ pConstrainedResolvedToken->cbMethodSpec);
key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)pConstrainedResolvedToken->cbMethodSpec;
}
else
{
- key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)0;
- key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)0;
- key.ConstrainedResolvedToken.token = (DWORD)0;
- key.ConstrainedResolvedToken.tokenType = (DWORD)0;
- key.ConstrainedResolvedToken.hClass = (DWORDLONG)0;
- key.ConstrainedResolvedToken.hMethod = (DWORDLONG)0;
- key.ConstrainedResolvedToken.hField = (DWORDLONG)0;
- key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)0;
- key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)0;
+ key.ConstrainedResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.token = (DWORD)0;
+ key.ConstrainedResolvedToken.tokenType = (DWORD)0;
+ key.ConstrainedResolvedToken.hClass = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.hMethod = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.hField = (DWORDLONG)0;
+ key.ConstrainedResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ConstrainedResolvedToken.cbTypeSpec = (DWORD)0;
key.ConstrainedResolvedToken.methodSpec_Index = (DWORD)0;
- key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)0;
+ key.ConstrainedResolvedToken.cbMethodSpec = (DWORD)0;
}
key.callerHandle = (DWORDLONG)callerHandle;
- key.flags = (DWORD)flags;
+ key.flags = (DWORD)flags;
- AssertCodeMsg(GetCallInfo->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %08x, %016llx. Probably a missing exception in GetCallInfo", key.ResolvedToken.token, key.ResolvedToken.hClass);
+ AssertCodeMsg(GetCallInfo->GetIndex(key) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %08x, %016llx. Probably a missing exception in GetCallInfo", key.ResolvedToken.token,
+ key.ResolvedToken.hClass);
value = GetCallInfo->Get(key);
- pResult->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
- pResult->methodFlags = (unsigned)value.methodFlags;
- pResult->classFlags = (unsigned)value.classFlags;
- pResult->sig.callConv = (CorInfoCallConv)value.sig.callConv;
- pResult->sig.retTypeClass = (CORINFO_CLASS_HANDLE)value.sig.retTypeClass;
- pResult->sig.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.sig.retTypeSigClass;
- pResult->sig.retType = (CorInfoType)value.sig.retType;
- pResult->sig.flags = (unsigned)value.sig.flags;
- pResult->sig.numArgs = (unsigned)value.sig.numArgs;
+ pResult->hMethod = (CORINFO_METHOD_HANDLE)value.hMethod;
+ pResult->methodFlags = (unsigned)value.methodFlags;
+ pResult->classFlags = (unsigned)value.classFlags;
+ pResult->sig.callConv = (CorInfoCallConv)value.sig.callConv;
+ pResult->sig.retTypeClass = (CORINFO_CLASS_HANDLE)value.sig.retTypeClass;
+ pResult->sig.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.sig.retTypeSigClass;
+ pResult->sig.retType = (CorInfoType)value.sig.retType;
+ pResult->sig.flags = (unsigned)value.sig.flags;
+ pResult->sig.numArgs = (unsigned)value.sig.numArgs;
pResult->sig.sigInst.classInstCount = (unsigned)value.sig.sigInst_classInstCount;
pResult->sig.sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.sig.sigInst_classInst_Index);
pResult->sig.sigInst.methInstCount = (unsigned)value.sig.sigInst_methInstCount;
pResult->sig.sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.sig.sigInst_methInst_Index);
- pResult->sig.args = (CORINFO_ARG_LIST_HANDLE)value.sig.args;
- pResult->sig.cbSig = (unsigned int)value.sig.cbSig;
- pResult->sig.pSig = (PCCOR_SIGNATURE)GetCallInfo->GetBuffer(value.sig.pSig);
- pResult->sig.scope = (CORINFO_MODULE_HANDLE)value.sig.scope;
- pResult->sig.token = (mdToken)value.sig.token;
+ pResult->sig.args = (CORINFO_ARG_LIST_HANDLE)value.sig.args;
+ pResult->sig.cbSig = (unsigned int)value.sig.cbSig;
+ pResult->sig.pSig = (PCCOR_SIGNATURE)GetCallInfo->GetBuffer(value.sig.pSig);
+ pResult->sig.scope = (CORINFO_MODULE_HANDLE)value.sig.scope;
+ pResult->sig.token = (mdToken)value.sig.token;
if (flags & CORINFO_CALLINFO_VERIFICATION)
{
- pResult->verMethodFlags = (unsigned)value.verMethodFlags;
- pResult->verSig.callConv = (CorInfoCallConv)value.verSig.callConv;
- pResult->verSig.retTypeClass = (CORINFO_CLASS_HANDLE)value.verSig.retTypeClass;
- pResult->verSig.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.verSig.retTypeSigClass;
- pResult->verSig.retType = (CorInfoType)value.verSig.retType;
- pResult->verSig.flags = (unsigned)value.verSig.flags;
- pResult->verSig.numArgs = (unsigned)value.verSig.numArgs;
+ pResult->verMethodFlags = (unsigned)value.verMethodFlags;
+ pResult->verSig.callConv = (CorInfoCallConv)value.verSig.callConv;
+ pResult->verSig.retTypeClass = (CORINFO_CLASS_HANDLE)value.verSig.retTypeClass;
+ pResult->verSig.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.verSig.retTypeSigClass;
+ pResult->verSig.retType = (CorInfoType)value.verSig.retType;
+ pResult->verSig.flags = (unsigned)value.verSig.flags;
+ pResult->verSig.numArgs = (unsigned)value.verSig.numArgs;
pResult->verSig.sigInst.classInstCount = (unsigned)value.verSig.sigInst_classInstCount;
- pResult->verSig.sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.verSig.sigInst_classInst_Index);
+ pResult->verSig.sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.verSig.sigInst_classInst_Index);
pResult->verSig.sigInst.methInstCount = (unsigned)value.verSig.sigInst_methInstCount;
- pResult->verSig.sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.verSig.sigInst_methInst_Index);
- pResult->verSig.args = (CORINFO_ARG_LIST_HANDLE)value.verSig.args;
+ pResult->verSig.sigInst.methInst =
+ (CORINFO_CLASS_HANDLE*)GetCallInfo->GetBuffer(value.verSig.sigInst_methInst_Index);
+ pResult->verSig.args = (CORINFO_ARG_LIST_HANDLE)value.verSig.args;
pResult->verSig.cbSig = (unsigned int)value.verSig.cbSig;
- pResult->verSig.pSig = (PCCOR_SIGNATURE)GetCallInfo->GetBuffer(value.verSig.pSig);
+ pResult->verSig.pSig = (PCCOR_SIGNATURE)GetCallInfo->GetBuffer(value.verSig.pSig);
pResult->verSig.scope = (CORINFO_MODULE_HANDLE)value.verSig.scope;
pResult->verSig.token = (mdToken)value.verSig.token;
}
- pResult->accessAllowed = (CorInfoIsAccessAllowedResult)value.accessAllowed;
+ pResult->accessAllowed = (CorInfoIsAccessAllowedResult)value.accessAllowed;
pResult->callsiteCalloutHelper.helperNum = (CorInfoHelpFunc)value.callsiteCalloutHelper.helperNum;
- pResult->callsiteCalloutHelper.numArgs = (unsigned)value.callsiteCalloutHelper.numArgs;
+ pResult->callsiteCalloutHelper.numArgs = (unsigned)value.callsiteCalloutHelper.numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
pResult->callsiteCalloutHelper.args[i].constant = (size_t)value.callsiteCalloutHelper.args[i].constant;
- pResult->callsiteCalloutHelper.args[i].argType = (CorInfoAccessAllowedHelperArgType)value.callsiteCalloutHelper.args[i].argType;
+ pResult->callsiteCalloutHelper.args[i].argType =
+ (CorInfoAccessAllowedHelperArgType)value.callsiteCalloutHelper.args[i].argType;
}
- pResult->thisTransform = (CORINFO_THIS_TRANSFORM)value.thisTransform;
- pResult->kind = (CORINFO_CALL_KIND)value.kind;
- pResult->nullInstanceCheck = (BOOL)value.nullInstanceCheck;
- pResult->contextHandle = (CORINFO_CONTEXT_HANDLE)value.contextHandle;
- pResult->exactContextNeedsRuntimeLookup = (BOOL)value.exactContextNeedsRuntimeLookup;
+ pResult->thisTransform = (CORINFO_THIS_TRANSFORM)value.thisTransform;
+ pResult->kind = (CORINFO_CALL_KIND)value.kind;
+ pResult->nullInstanceCheck = (BOOL)value.nullInstanceCheck;
+ pResult->contextHandle = (CORINFO_CONTEXT_HANDLE)value.contextHandle;
+ pResult->exactContextNeedsRuntimeLookup = (BOOL)value.exactContextNeedsRuntimeLookup;
pResult->stubLookup.lookupKind.needsRuntimeLookup = value.stubLookup.lookupKind.needsRuntimeLookup != 0;
- pResult->stubLookup.lookupKind.runtimeLookupKind = (CORINFO_RUNTIME_LOOKUP_KIND)value.stubLookup.lookupKind.runtimeLookupKind;
+ pResult->stubLookup.lookupKind.runtimeLookupKind =
+ (CORINFO_RUNTIME_LOOKUP_KIND)value.stubLookup.lookupKind.runtimeLookupKind;
if (pResult->stubLookup.lookupKind.needsRuntimeLookup)
{
- pResult->stubLookup.runtimeLookup.signature = (LPVOID)value.stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on valuevalue.stubLookup.runtimeLookup.signature;
- pResult->stubLookup.runtimeLookup.helper = (CorInfoHelpFunc)value.stubLookup.runtimeLookup.helper;
+ pResult->stubLookup.runtimeLookup.signature =
+ (LPVOID)value.stubLookup.runtimeLookup.signature; // needs to be a more flexible copy based on
+ // valuevalue.stubLookup.runtimeLookup.signature;
+ pResult->stubLookup.runtimeLookup.helper = (CorInfoHelpFunc)value.stubLookup.runtimeLookup.helper;
pResult->stubLookup.runtimeLookup.indirections = (WORD)value.stubLookup.runtimeLookup.indirections;
- pResult->stubLookup.runtimeLookup.testForNull = value.stubLookup.runtimeLookup.testForNull != 0;
+ pResult->stubLookup.runtimeLookup.testForNull = value.stubLookup.runtimeLookup.testForNull != 0;
pResult->stubLookup.runtimeLookup.testForFixup = value.stubLookup.runtimeLookup.testForFixup != 0;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
pResult->stubLookup.runtimeLookup.offsets[i] = (SIZE_T)value.stubLookup.runtimeLookup.offsets[i];
}
else
{
pResult->stubLookup.constLookup.accessType = (InfoAccessType)value.stubLookup.constLookup.accessType;
- pResult->stubLookup.constLookup.handle = (CORINFO_GENERIC_HANDLE)value.stubLookup.constLookup.handle;
+ pResult->stubLookup.constLookup.handle = (CORINFO_GENERIC_HANDLE)value.stubLookup.constLookup.handle;
}
if (pResult->kind == CORINFO_VIRTUALCALL_STUB)
{
- cr->CallTargetTypes->Add((DWORDLONG)pResult->codePointerLookup.constLookup.addr, (DWORD)CORINFO_VIRTUALCALL_STUB);
+ cr->CallTargetTypes->Add((DWORDLONG)pResult->codePointerLookup.constLookup.addr,
+ (DWORD)CORINFO_VIRTUALCALL_STUB);
}
pResult->instParamLookup.accessType = (InfoAccessType)value.instParamLookup.accessType;
- pResult->instParamLookup.handle = (CORINFO_GENERIC_HANDLE)value.instParamLookup.handle;
- pResult->secureDelegateInvoke = (BOOL)value.secureDelegateInvoke;
- *exceptionCode = (DWORD)value.exceptionCode;
+ pResult->instParamLookup.handle = (CORINFO_GENERIC_HANDLE)value.instParamLookup.handle;
+ pResult->secureDelegateInvoke = (BOOL)value.secureDelegateInvoke;
+ *exceptionCode = (DWORD)value.exceptionCode;
DEBUG_REP(dmpGetCallInfo(key, value));
}
@@ -1727,24 +1794,24 @@ void MethodContext::repGetCallInfo(
// If this fails to find a recorded call to getCallInfo with the given method handle, this will throw an
// exception.
//
-void MethodContext::repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CALL_INFO *pResult)
+void MethodContext::repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CALL_INFO* pResult)
{
if (GetCallInfo != nullptr)
{
for (unsigned int i = 0; i < GetCallInfo->GetCount(); i++)
{
- Agnostic_GetCallInfo key = GetCallInfo->GetKey(i);
+ Agnostic_GetCallInfo key = GetCallInfo->GetKey(i);
Agnostic_CORINFO_CALL_INFO val = GetCallInfo->GetItem(i);
if ((CORINFO_METHOD_HANDLE)val.hMethod == methodHandle)
{
CORINFO_RESOLVED_TOKEN resolvedToken;
- DWORD exceptionCode;
+ DWORD exceptionCode;
resolvedToken.tokenContext = (CORINFO_CONTEXT_HANDLE)key.ResolvedToken.tokenContext;
- resolvedToken.tokenScope = (CORINFO_MODULE_HANDLE)key.ResolvedToken.tokenScope;
- resolvedToken.token = (mdToken)key.ResolvedToken.token;
- resolvedToken.tokenType = (CorInfoTokenKind)key.ResolvedToken.tokenType;
+ resolvedToken.tokenScope = (CORINFO_MODULE_HANDLE)key.ResolvedToken.tokenScope;
+ resolvedToken.token = (mdToken)key.ResolvedToken.token;
+ resolvedToken.tokenType = (CorInfoTokenKind)key.ResolvedToken.tokenType;
repResolveToken(&resolvedToken, &exceptionCode);
@@ -1752,27 +1819,24 @@ void MethodContext::repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodH
// then we won't be able to replay it. In that case, we'll need to pass a null pointer into
// repGetCallInfo for constrainedResolvedToken, instead of just passing the address of our
// local (but meaningless) constrainedResolvedToken struct.
- CORINFO_RESOLVED_TOKEN constrainedResolvedToken;
- CORINFO_RESOLVED_TOKEN *pConstrainedResolvedToken = nullptr;
+ CORINFO_RESOLVED_TOKEN constrainedResolvedToken;
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken = nullptr;
- if (key.ConstrainedResolvedToken.tokenContext != 0 &&
- key.ConstrainedResolvedToken.tokenScope != 0)
+ if (key.ConstrainedResolvedToken.tokenContext != 0 && key.ConstrainedResolvedToken.tokenScope != 0)
{
- constrainedResolvedToken.tokenContext = (CORINFO_CONTEXT_HANDLE)key.ConstrainedResolvedToken.tokenContext;
- constrainedResolvedToken.tokenScope = (CORINFO_MODULE_HANDLE)key.ConstrainedResolvedToken.tokenScope;
- constrainedResolvedToken.token = (mdToken)key.ConstrainedResolvedToken.token;
+ constrainedResolvedToken.tokenContext =
+ (CORINFO_CONTEXT_HANDLE)key.ConstrainedResolvedToken.tokenContext;
+ constrainedResolvedToken.tokenScope =
+ (CORINFO_MODULE_HANDLE)key.ConstrainedResolvedToken.tokenScope;
+ constrainedResolvedToken.token = (mdToken)key.ConstrainedResolvedToken.token;
constrainedResolvedToken.tokenType = (CorInfoTokenKind)key.ConstrainedResolvedToken.tokenType;
- pConstrainedResolvedToken = &constrainedResolvedToken;
+ pConstrainedResolvedToken = &constrainedResolvedToken;
repResolveToken(pConstrainedResolvedToken, &exceptionCode);
}
- repGetCallInfo(&resolvedToken,
- pConstrainedResolvedToken,
- (CORINFO_METHOD_HANDLE)key.callerHandle,
- (CORINFO_CALLINFO_FLAGS)key.flags,
- pResult,
- &exceptionCode);
+ repGetCallInfo(&resolvedToken, pConstrainedResolvedToken, (CORINFO_METHOD_HANDLE)key.callerHandle,
+ (CORINFO_CALLINFO_FLAGS)key.flags, pResult, &exceptionCode);
return;
}
}
@@ -1782,14 +1846,13 @@ void MethodContext::repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodH
LogException(EXCEPTIONCODE_MC, "Didn't find key %016llX.", methodHandle);
}
-
void MethodContext::recGetIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand, CorInfoIntrinsics result)
{
if (GetIntrinsicID == nullptr)
GetIntrinsicID = new LightWeightMap<DWORDLONG, DD>();
DD value;
- value.A = (pMustExpand != nullptr) ? (DWORD) (*pMustExpand ? 1 : 0) : (DWORD)0;
+ value.A = (pMustExpand != nullptr) ? (DWORD)(*pMustExpand ? 1 : 0) : (DWORD)0;
value.B = (DWORD)result;
GetIntrinsicID->Add((DWORDLONG)method, value);
@@ -1802,7 +1865,8 @@ void MethodContext::dmpGetIntrinsicID(DWORDLONG key, DD value)
CorInfoIntrinsics MethodContext::repGetIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand)
{
AssertCodeMsg(GetIntrinsicID != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)method);
- AssertCodeMsg(GetIntrinsicID->GetIndex((DWORDLONG)method) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)method);
+ AssertCodeMsg(GetIntrinsicID->GetIndex((DWORDLONG)method) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)method);
DD value;
value = GetIntrinsicID->Get((DWORDLONG)method);
@@ -1831,7 +1895,8 @@ void MethodContext::dmpIsInSIMDModule(DWORDLONG key, DWORD value)
BOOL MethodContext::repIsInSIMDModule(CORINFO_CLASS_HANDLE cls)
{
AssertCodeMsg(IsInSIMDModule != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)cls);
- AssertCodeMsg(IsInSIMDModule->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(IsInSIMDModule->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)cls);
BOOL result = (BOOL)IsInSIMDModule->Get((DWORDLONG)cls);
DEBUG_REP(dmpIsInSIMDModule((DWORDLONG)cls, (DWORD)result));
return result;
@@ -1857,7 +1922,8 @@ CorInfoUnmanagedCallConv MethodContext::repGetUnmanagedCallConv(CORINFO_METHOD_H
LogDebug("Sparse - repGetUnmanagedCallConv returning CORINFO_UNMANAGED_CALLCONV_STDCALL");
return CORINFO_UNMANAGED_CALLCONV_STDCALL;
#else
- LogException(EXCEPTIONCODE_MC, "Found a null GetUnmanagedCallConv. Probably missing a fatTrigger for %016llX.", (DWORDLONG)method);
+ LogException(EXCEPTIONCODE_MC, "Found a null GetUnmanagedCallConv. Probably missing a fatTrigger for %016llX.",
+ (DWORDLONG)method);
#endif
}
CorInfoUnmanagedCallConv result = (CorInfoUnmanagedCallConv)GetUnmanagedCallConv->Get((DWORDLONG)method);
@@ -1865,7 +1931,8 @@ CorInfoUnmanagedCallConv MethodContext::repGetUnmanagedCallConv(CORINFO_METHOD_H
return result;
}
-void MethodContext::recIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method, CorInfoInstantiationVerification result)
+void MethodContext::recIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method,
+ CorInfoInstantiationVerification result)
{
if (IsInstantiationOfVerifiedGeneric == nullptr)
IsInstantiationOfVerifiedGeneric = new LightWeightMap<DWORDLONG, DWORD>();
@@ -1879,7 +1946,8 @@ void MethodContext::dmpIsInstantiationOfVerifiedGeneric(DWORDLONG key, DWORD val
}
CorInfoInstantiationVerification MethodContext::repIsInstantiationOfVerifiedGeneric(CORINFO_METHOD_HANDLE method)
{
- CorInfoInstantiationVerification result = (CorInfoInstantiationVerification)IsInstantiationOfVerifiedGeneric->Get((DWORDLONG)method);
+ CorInfoInstantiationVerification result =
+ (CorInfoInstantiationVerification)IsInstantiationOfVerifiedGeneric->Get((DWORDLONG)method);
DEBUG_REP(dmpIsInstantiationOfVerifiedGeneric((DWORDLONG)method, (DWORD)result));
return result;
}
@@ -1898,8 +1966,8 @@ void MethodContext::dmpAsCorInfoType(DWORDLONG key, DWORD value)
}
CorInfoType MethodContext::repAsCorInfoType(CORINFO_CLASS_HANDLE cls)
{
- AssertCodeMsg((AsCorInfoType != nullptr) && (AsCorInfoType->GetIndex((DWORDLONG)cls) != -1),
- EXCEPTIONCODE_MC, "Didn't find %016llX. Probable cached value in JIT issue", (DWORDLONG)cls);
+ AssertCodeMsg((AsCorInfoType != nullptr) && (AsCorInfoType->GetIndex((DWORDLONG)cls) != -1), EXCEPTIONCODE_MC,
+ "Didn't find %016llX. Probable cached value in JIT issue", (DWORDLONG)cls);
CorInfoType result = (CorInfoType)AsCorInfoType->Get((DWORDLONG)cls);
DEBUG_REP(dmpAsCorInfoType((DWORDLONG)cls, (DWORD)result));
return result;
@@ -1919,8 +1987,8 @@ void MethodContext::dmpIsValueClass(DWORDLONG key, DWORD value)
}
BOOL MethodContext::repIsValueClass(CORINFO_CLASS_HANDLE cls)
{
- AssertCodeMsg((IsValueClass != nullptr) && (IsValueClass->GetIndex((DWORDLONG)cls) != -1),
- EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg((IsValueClass != nullptr) && (IsValueClass->GetIndex((DWORDLONG)cls) != -1), EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)cls);
BOOL result = (BOOL)IsValueClass->Get((DWORDLONG)cls);
DEBUG_REP(dmpIsValueClass((DWORDLONG)cls, (DWORD)result));
@@ -1941,8 +2009,11 @@ void MethodContext::dmpIsStructRequiringStackAllocRetBuf(DWORDLONG key, DWORD va
}
BOOL MethodContext::repIsStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls)
{
- AssertCodeMsg(IsStructRequiringStackAllocRetBuf != nullptr, EXCEPTIONCODE_MC, "Found a null IsStructRequiringStackAllocRetBuf. Probably missing a fatTrigger for %016llX.", (DWORDLONG)cls);
- AssertCodeMsg(IsStructRequiringStackAllocRetBuf->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(IsStructRequiringStackAllocRetBuf != nullptr, EXCEPTIONCODE_MC,
+ "Found a null IsStructRequiringStackAllocRetBuf. Probably missing a fatTrigger for %016llX.",
+ (DWORDLONG)cls);
+ AssertCodeMsg(IsStructRequiringStackAllocRetBuf->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)cls);
BOOL result = (BOOL)IsStructRequiringStackAllocRetBuf->Get((DWORDLONG)cls);
DEBUG_REP(dmpIsStructRequiringStackAllocRetBuf((DWORDLONG)cls, (DWORD)result));
return result;
@@ -1963,7 +2034,8 @@ void MethodContext::dmpGetClassSize(DWORDLONG key, DWORD val)
unsigned MethodContext::repGetClassSize(CORINFO_CLASS_HANDLE cls)
{
AssertCodeMsg(GetClassSize != nullptr, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
- AssertCodeMsg(GetClassSize->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetClassSize->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)cls);
unsigned result = (unsigned)GetClassSize->Get((DWORDLONG)cls);
DEBUG_REP(dmpGetClassSize((DWORDLONG)cls, (DWORD)result));
return result;
@@ -1983,8 +2055,10 @@ void MethodContext::dmpGetClassNumInstanceFields(DWORDLONG key, DWORD value)
}
unsigned MethodContext::repGetClassNumInstanceFields(CORINFO_CLASS_HANDLE cls)
{
- AssertCodeMsg(GetClassNumInstanceFields != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)cls);
- AssertCodeMsg(GetClassNumInstanceFields->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetClassNumInstanceFields != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)cls);
+ AssertCodeMsg(GetClassNumInstanceFields->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)cls);
unsigned result = (unsigned)GetClassNumInstanceFields->Get((DWORDLONG)cls);
DEBUG_REP(dmpGetClassNumInstanceFields((DWORDLONG)cls, (DWORD)result));
@@ -2060,7 +2134,7 @@ void MethodContext::dmpGetTypeForBox(DWORDLONG key, DWORDLONG value)
{
printf("GetTypeForBox key cls-%016llX, value res-%016llX", key, value);
}
-CORINFO_CLASS_HANDLE MethodContext::repGetTypeForBox(CORINFO_CLASS_HANDLE cls)
+CORINFO_CLASS_HANDLE MethodContext::repGetTypeForBox(CORINFO_CLASS_HANDLE cls)
{
CORINFO_CLASS_HANDLE result = (CORINFO_CLASS_HANDLE)GetTypeForBox->Get((DWORDLONG)cls);
DEBUG_REP(dmpGetTypeForBox((DWORDLONG)cls, (DWORDLONG)result));
@@ -2086,7 +2160,7 @@ CorInfoHelpFunc MethodContext::repGetBoxHelper(CORINFO_CLASS_HANDLE cls)
return result;
}
-void MethodContext::recGetBuiltinClass(CorInfoClassId classId, CORINFO_CLASS_HANDLE result)
+void MethodContext::recGetBuiltinClass(CorInfoClassId classId, CORINFO_CLASS_HANDLE result)
{
if (GetBuiltinClass == nullptr)
GetBuiltinClass = new LightWeightMap<DWORD, DWORDLONG>();
@@ -2119,8 +2193,10 @@ void MethodContext::dmpGetTypeForPrimitiveValueClass(DWORDLONG key, DWORD value)
}
CorInfoType MethodContext::repGetTypeForPrimitiveValueClass(CORINFO_CLASS_HANDLE cls)
{
- AssertCodeMsg(GetTypeForPrimitiveValueClass != nullptr, EXCEPTIONCODE_MC, "Encountered an empty LWM while looking for %016llX", (DWORDLONG)cls);
- AssertCodeMsg(GetTypeForPrimitiveValueClass->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetTypeForPrimitiveValueClass != nullptr, EXCEPTIONCODE_MC,
+ "Encountered an empty LWM while looking for %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetTypeForPrimitiveValueClass->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)cls);
CorInfoType result = (CorInfoType)GetTypeForPrimitiveValueClass->Get((DWORDLONG)cls);
DEBUG_REP(dmpGetTypeForPrimitiveValueClass((DWORDLONG)cls, (DWORD)result));
return result;
@@ -2132,7 +2208,6 @@ void MethodContext::recGetParentType(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HAN
GetParentType = new LightWeightMap<DWORDLONG, DWORDLONG>();
GetParentType->Add((DWORDLONG)cls, (DWORDLONG)result);
-
}
void MethodContext::dmpGetParentType(DWORDLONG key, DWORDLONG value)
{
@@ -2180,7 +2255,8 @@ void MethodContext::dmpGetFieldClass(DWORDLONG key, DWORDLONG value)
CORINFO_CLASS_HANDLE MethodContext::repGetFieldClass(CORINFO_FIELD_HANDLE field)
{
AssertCodeMsg(GetFieldClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)field);
- AssertCodeMsg(GetFieldClass->GetIndex((DWORDLONG)field) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)field);
+ AssertCodeMsg(GetFieldClass->GetIndex((DWORDLONG)field) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)field);
CORINFO_CLASS_HANDLE temp = (CORINFO_CLASS_HANDLE)GetFieldClass->Get((DWORDLONG)field);
DEBUG_REP(dmpGetFieldClass((DWORDLONG)field, (DWORDLONG)temp));
return temp;
@@ -2200,8 +2276,8 @@ void MethodContext::dmpGetFieldOffset(DWORDLONG key, DWORD value)
}
unsigned MethodContext::repGetFieldOffset(CORINFO_FIELD_HANDLE field)
{
- AssertCodeMsg((GetFieldOffset != nullptr) && (GetFieldOffset->GetIndex((DWORDLONG)field) != -1),
- EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)field);
+ AssertCodeMsg((GetFieldOffset != nullptr) && (GetFieldOffset->GetIndex((DWORDLONG)field) != -1), EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)field);
unsigned temp = (unsigned)GetFieldOffset->Get((DWORDLONG)field);
DEBUG_REP(dmpGetFieldOffset((DWORDLONG)field, (DWORD)temp));
@@ -2224,8 +2300,10 @@ void MethodContext::dmpGetLazyStringLiteralHelper(DWORDLONG key, DWORD value)
CorInfoHelpFunc MethodContext::repGetLazyStringLiteralHelper(CORINFO_MODULE_HANDLE handle)
{
- AssertCodeMsg(GetLazyStringLiteralHelper != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)handle);
- AssertCodeMsg(GetLazyStringLiteralHelper->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)handle);
+ AssertCodeMsg(GetLazyStringLiteralHelper != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)handle);
+ AssertCodeMsg(GetLazyStringLiteralHelper->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)handle);
CorInfoHelpFunc temp = (CorInfoHelpFunc)GetLazyStringLiteralHelper->Get((DWORDLONG)handle);
DEBUG_REP(dmpGetLazyStringLiteralHelper((DWORDLONG)handle, temp));
return temp;
@@ -2248,13 +2326,11 @@ CorInfoHelpFunc MethodContext::repGetUnBoxHelper(CORINFO_CLASS_HANDLE cls)
return temp;
}
-void MethodContext::recGetReadyToRunHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_LOOKUP_KIND * pGenericLookupKind,
- CorInfoHelpFunc id,
- CORINFO_CONST_LOOKUP * pLookup,
- bool result
- )
+void MethodContext::recGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_LOOKUP_KIND* pGenericLookupKind,
+ CorInfoHelpFunc id,
+ CORINFO_CONST_LOOKUP* pLookup,
+ bool result)
{
LogError("getReadyToRunHelper NYI");
@@ -2263,28 +2339,24 @@ void MethodContext::recGetReadyToRunHelper(
if (GetReadyToRunHelper == nullptr)
GetReadyToRunHelper = new LightWeightMap<DWORDLONG, DWORD>();
- //GetReadyToRunHelper->Add((DWORDLONG)cls, result);
+ // GetReadyToRunHelper->Add((DWORDLONG)cls, result);
}
void MethodContext::dmpGetReadyToRunHelper(DWORDLONG key, DWORD value)
{
LogError("getReadyToRunHelper NYI");
}
-bool MethodContext::repGetReadyToRunHelper(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_LOOKUP_KIND * pGenericLookupKind,
- CorInfoHelpFunc id,
- CORINFO_CONST_LOOKUP * pLookup
- )
+bool MethodContext::repGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_LOOKUP_KIND* pGenericLookupKind,
+ CorInfoHelpFunc id,
+ CORINFO_CONST_LOOKUP* pLookup)
{
LogError("getReadyToRunHelper NYI");
return false;
}
-void MethodContext::recGetReadyToRunDelegateCtorHelper(
- CORINFO_RESOLVED_TOKEN * pTargetMethod,
- CORINFO_CLASS_HANDLE delegateType,
- CORINFO_LOOKUP * pLookup
- )
+void MethodContext::recGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod,
+ CORINFO_CLASS_HANDLE delegateType,
+ CORINFO_LOOKUP* pLookup)
{
LogError("GetReadyToRunDelegateCtorHelper NYI");
@@ -2293,22 +2365,20 @@ void MethodContext::recGetReadyToRunDelegateCtorHelper(
if (GetReadyToRunDelegateCtorHelper == nullptr)
GetReadyToRunDelegateCtorHelper = new LightWeightMap<DWORDLONG, DWORD>();
- //GetReadyToRunDelegateCtorHelper->Add((DWORDLONG)delegateType, result);
+ // GetReadyToRunDelegateCtorHelper->Add((DWORDLONG)delegateType, result);
}
void MethodContext::dmpGetReadyToRunDelegateCtorHelper(DWORDLONG key, DWORD value)
{
LogError("getReadyToRunDelegateCtorHelper NYI");
}
-void MethodContext::repGetReadyToRunDelegateCtorHelper(
- CORINFO_RESOLVED_TOKEN * pTargetMethod,
- CORINFO_CLASS_HANDLE delegateType,
- CORINFO_LOOKUP * pLookup
- )
+void MethodContext::repGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod,
+ CORINFO_CLASS_HANDLE delegateType,
+ CORINFO_LOOKUP* pLookup)
{
LogError("getReadyToRunDelegateCtorHelper NYI");
}
-void MethodContext::recGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirection, void *result)
+void MethodContext::recGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection, void* result)
{
if (GetHelperFtn == nullptr)
GetHelperFtn = new LightWeightMap<DWORD, DLDL>();
@@ -2324,7 +2394,7 @@ void MethodContext::dmpGetHelperFtn(DWORD key, DLDL value)
{
printf("GetHelperFtn key ftn-%u, value ppi-%016llX res-%016llX", key, value.A, value.B);
}
-void* MethodContext::repGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirection)
+void* MethodContext::repGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
if ((GetHelperFtn == nullptr) || (GetHelperFtn->GetIndex((DWORD)ftnNum) == -1))
{
@@ -2337,10 +2407,10 @@ void* MethodContext::repGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirectio
#endif
}
- DLDL value = (DLDL)GetHelperFtn->Get((DWORD)ftnNum);
- *ppIndirection = (void *)value.A;
+ DLDL value = (DLDL)GetHelperFtn->Get((DWORD)ftnNum);
+ *ppIndirection = (void*)value.A;
DEBUG_REP(dmpGetHelperFtn((DWORD)ftnNum, value));
- return (void *)value.B;
+ return (void*)value.B;
}
//
@@ -2363,14 +2433,14 @@ void* MethodContext::repGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirectio
// lower 32 bits of the target address.
// - This might not work correctly with method contexts recorded via NGen compilation.
//
-bool MethodContext::fndGetHelperFtn(void *functionAddress, CorInfoHelpFunc *pResult)
+bool MethodContext::fndGetHelperFtn(void* functionAddress, CorInfoHelpFunc* pResult)
{
if (GetHelperFtn != nullptr)
{
for (unsigned int i = 0; i < GetHelperFtn->GetCount(); i++)
{
DWORD key = GetHelperFtn->GetKey(i);
- DLDL val = GetHelperFtn->GetItem(i);
+ DLDL val = GetHelperFtn->GetItem(i);
// TODO-Cleanup: this only compares the function addresses, and doesn't account for
// ppIndirection, which will break if the helper is a dynamic helper function.
@@ -2386,7 +2456,9 @@ bool MethodContext::fndGetHelperFtn(void *functionAddress, CorInfoHelpFunc *pRes
return false;
}
-void MethodContext::recGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection, CORINFO_JUST_MY_CODE_HANDLE result)
+void MethodContext::recGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method,
+ CORINFO_JUST_MY_CODE_HANDLE** ppIndirection,
+ CORINFO_JUST_MY_CODE_HANDLE result)
{
if (GetJustMyCodeHandle == nullptr)
GetJustMyCodeHandle = new LightWeightMap<DWORDLONG, DLDL>();
@@ -2400,26 +2472,30 @@ void MethodContext::dmpGetJustMyCodeHandle(DWORDLONG key, DLDL value)
{
printf("GetJustMyCodeHandle key ftn-%016llX, value pp-%016llX, res-%016llX", key, value.A, value.B);
}
-CORINFO_JUST_MY_CODE_HANDLE MethodContext::repGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection)
+CORINFO_JUST_MY_CODE_HANDLE MethodContext::repGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method,
+ CORINFO_JUST_MY_CODE_HANDLE** ppIndirection)
{
- DLDL temp = (DLDL)GetJustMyCodeHandle->Get((DWORDLONG)method);
- *ppIndirection = (CORINFO_JUST_MY_CODE_HANDLE *)temp.A;
+ DLDL temp = (DLDL)GetJustMyCodeHandle->Get((DWORDLONG)method);
+ *ppIndirection = (CORINFO_JUST_MY_CODE_HANDLE*)temp.A;
CORINFO_JUST_MY_CODE_HANDLE result = (CORINFO_JUST_MY_CODE_HANDLE)temp.B;
DEBUG_REP(dmpGetJustMyCodeHandle((DWORDLONG)method, temp));
return result;
}
-void MethodContext::recGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult, CORINFO_ACCESS_FLAGS accessFlags)
+void MethodContext::recGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn,
+ CORINFO_CONST_LOOKUP* pResult,
+ CORINFO_ACCESS_FLAGS accessFlags)
{
if (GetFunctionEntryPoint == nullptr)
GetFunctionEntryPoint = new LightWeightMap<DLD, DLD>();
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
+ 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
DLD value;
- key.A = (DWORDLONG)ftn;
- key.B = (DWORD)accessFlags;
- value.A = (DWORDLONG)pResult->addr; //First union member
+ key.A = (DWORDLONG)ftn;
+ key.B = (DWORD)accessFlags;
+ value.A = (DWORDLONG)pResult->addr; // First union member
value.B = (DWORD)pResult->accessType;
GetFunctionEntryPoint->Add(key, value);
DEBUG_REC(dmpGetFunctionEntryPoint(key, value));
@@ -2428,10 +2504,13 @@ void MethodContext::dmpGetFunctionEntryPoint(DLD key, DLD value)
{
printf("GetFunctionEntryPoint key ftn-%016llX af-%08X, value add-%016llX at-%u", key.A, key.B, value.A, value.B);
}
-void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult, CORINFO_ACCESS_FLAGS accessFlags)
+void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn,
+ CORINFO_CONST_LOOKUP* pResult,
+ CORINFO_ACCESS_FLAGS accessFlags)
{
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
+ 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
DLD value;
key.A = (DWORDLONG)ftn;
key.B = (DWORD)accessFlags;
@@ -2441,7 +2520,7 @@ void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_
#ifdef sparseMC
LogDebug("Sparse - repGetFunctionEntryPoint fabricated result for request.");
pResult->accessType = (InfoAccessType)IAT_PVALUE;
- pResult->addr = (void *)((DWORDLONG)ftn + 0x1c);
+ pResult->addr = (void*)((DWORDLONG)ftn + 0x1c);
return;
#else
LogException(EXCEPTIONCODE_MC, "Didn't find %016llX, %8x", (DWORDLONG)ftn, accessFlags);
@@ -2459,7 +2538,7 @@ void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_
{
LogDebug("Sparse - repGetFunctionEntryPoint fabricated result for request.");
pResult->accessType = (InfoAccessType)IAT_PVALUE;
- pResult->addr = (void *)((DWORDLONG)ftn + 0x1c);
+ pResult->addr = (void*)((DWORDLONG)ftn + 0x1c);
return;
}
#else
@@ -2469,7 +2548,7 @@ void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_
value = GetFunctionEntryPoint->Get(key);
pResult->accessType = (InfoAccessType)value.B;
- pResult->addr = (void *)value.A;
+ pResult->addr = (void*)value.A;
DEBUG_REP(dmpGetFunctionEntryPoint(key, value));
}
@@ -2503,7 +2582,7 @@ void MethodContext::repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_
// are only 32-bit deltas, what you'll usually end up seeing is that, after SuperPMI has applied
// these fixups, the lower 32 bits of method addresses will match, but the upper 32 bits will differ.
//
-bool MethodContext::fndGetFunctionEntryPoint(DLD value, CORINFO_METHOD_HANDLE *pResult)
+bool MethodContext::fndGetFunctionEntryPoint(DLD value, CORINFO_METHOD_HANDLE* pResult)
{
if (GetFunctionEntryPoint != nullptr)
{
@@ -2525,15 +2604,19 @@ bool MethodContext::fndGetFunctionEntryPoint(DLD value, CORINFO_METHOD_HANDLE *p
return false;
}
-void MethodContext::recConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void *pValue, InfoAccessType result)
+void MethodContext::recConstructStringLiteral(CORINFO_MODULE_HANDLE module,
+ mdToken metaTok,
+ void* pValue,
+ InfoAccessType result)
{
if (ConstructStringLiteral == nullptr)
ConstructStringLiteral = new LightWeightMap<DLD, DLD>();
DLD temp;
- ZeroMemory(&temp, sizeof(DLD)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&temp, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
DLD temp2;
- temp.A = (DWORDLONG)module;
- temp.B = (DWORD)metaTok;
+ temp.A = (DWORDLONG)module;
+ temp.B = (DWORD)metaTok;
temp2.A = (DWORDLONG)pValue;
temp2.B = (DWORD)result;
@@ -2544,22 +2627,25 @@ void MethodContext::dmpConstructStringLiteral(DLD key, DLD value)
{
printf("ConstructStringLiteral key mod-%016llX tok-%08X, value pp-%016llX iat-%u", key.A, key.B, value.A, value.B);
}
-InfoAccessType MethodContext::repConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void **ppValue)
+InfoAccessType MethodContext::repConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue)
{
DLD temp;
- ZeroMemory(&temp, sizeof(DLD)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&temp, sizeof(DLD)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
DLD temp2;
temp.A = (DWORDLONG)module;
temp.B = (DWORD)metaTok;
- AssertCodeMsg(ConstructStringLiteral != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)module);
- AssertCodeMsg(ConstructStringLiteral->GetIndex(temp) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)module);
- temp2 = ConstructStringLiteral->Get(temp);
- *ppValue = (void *)temp2.A;
+ AssertCodeMsg(ConstructStringLiteral != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)module);
+ AssertCodeMsg(ConstructStringLiteral->GetIndex(temp) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)module);
+ temp2 = ConstructStringLiteral->Get(temp);
+ *ppValue = (void*)temp2.A;
DEBUG_REP(dmpConstructStringLiteral(temp, temp2));
return (InfoAccessType)temp2.B;
}
-void MethodContext::recEmptyStringLiteral(void **pValue, InfoAccessType result)
+void MethodContext::recEmptyStringLiteral(void** pValue, InfoAccessType result)
{
if (EmptyStringLiteral == nullptr)
EmptyStringLiteral = new DenseLightWeightMap<DLD>();
@@ -2573,45 +2659,52 @@ void MethodContext::dmpEmptyStringLiteral(DWORD key, DLD value)
{
printf("EmptyStringLiteral key %u, value pVal-%016llX res-%u", key, value.A, value.B);
}
-InfoAccessType MethodContext::repEmptyStringLiteral(void **ppValue)
+InfoAccessType MethodContext::repEmptyStringLiteral(void** ppValue)
{
// TODO-Cleanup: sketchy if someone calls this twice
DLD temp2;
- temp2 = EmptyStringLiteral->Get((DWORD)0);
- *ppValue = (void *)temp2.A;
+ temp2 = EmptyStringLiteral->Get((DWORD)0);
+ *ppValue = (void*)temp2.A;
return (InfoAccessType)temp2.B;
}
-void MethodContext::recGetArgType(CORINFO_SIG_INFO *sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE *vcTypeRet, CorInfoTypeWithMod result, DWORD exceptionCode)
+void MethodContext::recGetArgType(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE* vcTypeRet,
+ CorInfoTypeWithMod result,
+ DWORD exceptionCode)
{
if (GetArgType == nullptr)
GetArgType = new LightWeightMap<Agnostic_GetArgType, Agnostic_GetArgType_Value>();
Agnostic_GetArgType key;
- ZeroMemory(&key, sizeof(Agnostic_GetArgType)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetArgType)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
Agnostic_GetArgType_Value value;
- //Only setting values for things the EE seems to pay attention to... this is necessary since some of the values
- //are unset and fail our precise comparisions...
- key.sig.callConv = (DWORD)0;
- key.sig.retTypeClass = (DWORDLONG)0;
- key.sig.retTypeSigClass = (DWORDLONG)0;
- key.sig.retType = (DWORD)0;
- key.sig.flags = (DWORD)sig->flags;
- key.sig.numArgs = (DWORD)sig->numArgs;
+ // Only setting values for things the EE seems to pay attention to... this is necessary since some of the values
+ //are unset and fail our precise comparisions...
+ key.sig.callConv = (DWORD)0;
+ key.sig.retTypeClass = (DWORDLONG)0;
+ key.sig.retTypeSigClass = (DWORDLONG)0;
+ key.sig.retType = (DWORD)0;
+ key.sig.flags = (DWORD)sig->flags;
+ key.sig.numArgs = (DWORD)sig->numArgs;
key.sig.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- key.sig.sigInst_classInst_Index = (DWORD)GetArgType->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
+ key.sig.sigInst_classInst_Index =
+ (DWORD)GetArgType->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
key.sig.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- key.sig.sigInst_methInst_Index = (DWORD)GetArgType->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
- key.sig.args = (DWORDLONG)0;
+ key.sig.sigInst_methInst_Index =
+ (DWORD)GetArgType->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
+ key.sig.args = (DWORDLONG)0;
key.sig.cbSig = (DWORD)0;
- key.sig.pSig = -1;
+ key.sig.pSig = -1;
key.sig.scope = (DWORDLONG)sig->scope;
key.sig.token = (DWORD)0;
- key.args = (DWORDLONG)args;
+ key.args = (DWORDLONG)args;
- value.vcTypeRet = (DWORDLONG)*vcTypeRet;
- value.result = (DWORD)result;
+ value.vcTypeRet = (DWORDLONG)*vcTypeRet;
+ value.result = (DWORD)result;
value.exceptionCode = (DWORD)exceptionCode;
GetArgType->Add(key, value);
@@ -2619,47 +2712,49 @@ void MethodContext::recGetArgType(CORINFO_SIG_INFO *sig, CORINFO_ARG_LIST_HANDLE
}
void MethodContext::dmpGetArgType(const Agnostic_GetArgType& key, const Agnostic_GetArgType_Value& value)
{
- printf("GetArgType key flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u scp-%016llX arg-%016llX",
- key.sig.flags,
- key.sig.numArgs,
- key.sig.sigInst_classInstCount,
- key.sig.sigInst_classInst_Index,
- key.sig.sigInst_methInstCount,
- key.sig.sigInst_methInst_Index,
- key.sig.scope,
- key.args);
+ printf("GetArgType key flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u scp-%016llX arg-%016llX", key.sig.flags,
+ key.sig.numArgs, key.sig.sigInst_classInstCount, key.sig.sigInst_classInst_Index,
+ key.sig.sigInst_methInstCount, key.sig.sigInst_methInst_Index, key.sig.scope, key.args);
printf(", value rt-%016llX ci-%u excp-%08X", value.vcTypeRet, value.result, value.exceptionCode);
}
-CorInfoTypeWithMod MethodContext::repGetArgType(CORINFO_SIG_INFO *sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE *vcTypeRet, DWORD *exceptionCode)
+CorInfoTypeWithMod MethodContext::repGetArgType(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE* vcTypeRet,
+ DWORD* exceptionCode)
{
Agnostic_GetArgType key;
- ZeroMemory(&key, sizeof(Agnostic_GetArgType)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetArgType)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
Agnostic_GetArgType_Value value;
- AssertCodeMsg(GetArgType != nullptr, EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in getArgType", key.sig.scope, key.args);
- key.sig.callConv = (DWORD)0;
- key.sig.retTypeClass = (DWORDLONG)0;
- key.sig.retTypeSigClass = (DWORDLONG)0;
- key.sig.retType = (DWORD)0;
- key.sig.flags = (DWORD)sig->flags;
- key.sig.numArgs = (DWORD)sig->numArgs;
+ AssertCodeMsg(GetArgType != nullptr, EXCEPTIONCODE_MC,
+ "Didn't find %016llx, %016llx. probably a missing exception in getArgType", key.sig.scope, key.args);
+ key.sig.callConv = (DWORD)0;
+ key.sig.retTypeClass = (DWORDLONG)0;
+ key.sig.retTypeSigClass = (DWORDLONG)0;
+ key.sig.retType = (DWORD)0;
+ key.sig.flags = (DWORD)sig->flags;
+ key.sig.numArgs = (DWORD)sig->numArgs;
key.sig.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- key.sig.sigInst_classInst_Index = (DWORD)GetArgType->Contains((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
+ key.sig.sigInst_classInst_Index =
+ (DWORD)GetArgType->Contains((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
key.sig.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- key.sig.sigInst_methInst_Index = (DWORD)GetArgType->Contains((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
- key.sig.args = (DWORDLONG)0;
+ key.sig.sigInst_methInst_Index =
+ (DWORD)GetArgType->Contains((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
+ key.sig.args = (DWORDLONG)0;
key.sig.cbSig = (DWORD)0;
- key.sig.pSig = -1;
+ key.sig.pSig = -1;
key.sig.scope = (DWORDLONG)sig->scope;
key.sig.token = (DWORD)0;
- key.args = (DWORDLONG)args;
+ key.args = (DWORDLONG)args;
- AssertCodeMsg(GetArgType->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in getArgType", key.sig.scope, key.args);
+ AssertCodeMsg(GetArgType->GetIndex(key) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llx, %016llx. probably a missing exception in getArgType", key.sig.scope, key.args);
- value = GetArgType->Get(key);
- *vcTypeRet = (CORINFO_CLASS_HANDLE)value.vcTypeRet;
+ value = GetArgType->Get(key);
+ *vcTypeRet = (CORINFO_CLASS_HANDLE)value.vcTypeRet;
CorInfoTypeWithMod temp = (CorInfoTypeWithMod)value.result;
- *exceptionCode = (DWORD)value.exceptionCode;
+ *exceptionCode = (DWORD)value.exceptionCode;
DEBUG_REP(dmpGetArgType(key, value));
return temp;
@@ -2683,31 +2778,34 @@ CORINFO_ARG_LIST_HANDLE MethodContext::repGetArgNext(CORINFO_ARG_LIST_HANDLE arg
DEBUG_REP(dmpGetArgNext((DWORDLONG)args, (DWORDLONG)temp));
return temp;
}
-void MethodContext::recGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO *sig, CORINFO_CLASS_HANDLE memberParent)
+void MethodContext::recGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_HANDLE memberParent)
{
if (GetMethodSig == nullptr)
GetMethodSig = new LightWeightMap<DLDL, Agnostic_CORINFO_SIG_INFO>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
Agnostic_CORINFO_SIG_INFO value;
key.A = (DWORDLONG)ftn;
key.B = (DWORDLONG)memberParent;
- value.callConv = (DWORD)sig->callConv;
- value.retTypeClass = (DWORDLONG)sig->retTypeClass;
- value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
- value.retType = (DWORD)sig->retType;
- value.flags = (DWORD)sig->flags;
- value.numArgs = (DWORD)sig->numArgs;
- value.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- value.sigInst_classInst_Index = GetMethodSig->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8); //porting issue
+ value.callConv = (DWORD)sig->callConv;
+ value.retTypeClass = (DWORDLONG)sig->retTypeClass;
+ value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
+ value.retType = (DWORD)sig->retType;
+ value.flags = (DWORD)sig->flags;
+ value.numArgs = (DWORD)sig->numArgs;
+ value.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
+ value.sigInst_classInst_Index = GetMethodSig->AddBuffer((unsigned char*)sig->sigInst.classInst,
+ sig->sigInst.classInstCount * 8); // porting issue
value.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- value.sigInst_methInst_Index = GetMethodSig->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8); //porting issue
- value.args = (DWORDLONG)sig->args;
+ value.sigInst_methInst_Index =
+ GetMethodSig->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8); // porting issue
+ value.args = (DWORDLONG)sig->args;
value.cbSig = (DWORD)sig->cbSig;
- value.pSig = (DWORD)GetMethodSig->AddBuffer((unsigned char *)sig->pSig, sig->cbSig);
+ value.pSig = (DWORD)GetMethodSig->AddBuffer((unsigned char*)sig->pSig, sig->cbSig);
value.scope = (DWORDLONG)sig->scope;
value.token = (DWORD)sig->token;
@@ -2716,29 +2814,18 @@ void MethodContext::recGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO
}
void MethodContext::dmpGetMethodSig(DLDL key, const Agnostic_CORINFO_SIG_INFO& value)
{
- printf("GetMethodSig key ftn-%016llX prt-%016llX, value cc-%u rtc-%016llX rts-%016llX rt-%u(%s) flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u args-%016llX sig-%u pSig-%u scp-%016llX tok-%08X",
- key.A, key.B,
- value.callConv,
- value.retTypeClass,
- value.retTypeSigClass,
- value.retType,
- toString((CorInfoType)value.retType),
- value.flags,
- value.numArgs,
- value.sigInst_classInstCount,
- value.sigInst_classInst_Index,
- value.sigInst_methInstCount,
- value.sigInst_methInst_Index,
- value.args,
- value.cbSig,
- value.pSig,
- value.scope,
- value.token);
-}
-void MethodContext::repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO *sig, CORINFO_CLASS_HANDLE memberParent)
+ printf("GetMethodSig key ftn-%016llX prt-%016llX, value cc-%u rtc-%016llX rts-%016llX rt-%u(%s) flg-%08X na-%u "
+ "cc-%u ci-%u mc-%u mi-%u args-%016llX sig-%u pSig-%u scp-%016llX tok-%08X",
+ key.A, key.B, value.callConv, value.retTypeClass, value.retTypeSigClass, value.retType,
+ toString((CorInfoType)value.retType), value.flags, value.numArgs, value.sigInst_classInstCount,
+ value.sigInst_classInst_Index, value.sigInst_methInstCount, value.sigInst_methInst_Index, value.args,
+ value.cbSig, value.pSig, value.scope, value.token);
+}
+void MethodContext::repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_HANDLE memberParent)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
Agnostic_CORINFO_SIG_INFO value;
key.A = (DWORDLONG)ftn;
@@ -2746,54 +2833,60 @@ void MethodContext::repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO
value = GetMethodSig->Get(key);
- sig->callConv = (CorInfoCallConv)value.callConv;
- sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
- sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
- sig->retType = (CorInfoType)value.retType;
- sig->flags = (unsigned)value.flags;
- sig->numArgs = (unsigned)value.numArgs;
+ sig->callConv = (CorInfoCallConv)value.callConv;
+ sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
+ sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
+ sig->retType = (CorInfoType)value.retType;
+ sig->flags = (unsigned)value.flags;
+ sig->numArgs = (unsigned)value.numArgs;
sig->sigInst.classInstCount = (unsigned)value.sigInst_classInstCount;
- sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetMethodSig->GetBuffer(value.sigInst_classInst_Index);
- sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
- sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetMethodSig->GetBuffer(value.sigInst_methInst_Index);
- sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
- sig->cbSig = (unsigned int)value.cbSig;
- sig->pSig = (PCCOR_SIGNATURE)GetMethodSig->GetBuffer(value.pSig);
- sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
- sig->token = (mdToken)value.token;
+ sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetMethodSig->GetBuffer(value.sigInst_classInst_Index);
+ sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
+ sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetMethodSig->GetBuffer(value.sigInst_methInst_Index);
+ sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
+ sig->cbSig = (unsigned int)value.cbSig;
+ sig->pSig = (PCCOR_SIGNATURE)GetMethodSig->GetBuffer(value.pSig);
+ sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
+ sig->token = (mdToken)value.token;
DEBUG_REP(dmpGetMethodSig(key, value));
}
-void MethodContext::recGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE result, DWORD exceptionCode)
+void MethodContext::recGetArgClass(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE result,
+ DWORD exceptionCode)
{
if (GetArgClass == nullptr)
GetArgClass = new LightWeightMap<Agnostic_GetArgClass, Agnostic_GetArgClass_Value>();
Agnostic_GetArgClass key;
- ZeroMemory(&key, sizeof(Agnostic_GetArgClass)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetArgClass)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
Agnostic_GetArgClass_Value value;
- //Only setting values for things the EE seems to pay attention to... this is necessary since some of the values
- //are unset and fail our precise comparisions...
- key.sig.callConv = (DWORD)0;
- key.sig.retTypeClass = (DWORDLONG)0;
- key.sig.retTypeSigClass = (DWORDLONG)0;
- key.sig.retType = (DWORD)0;
- key.sig.flags = (DWORD)0;
- key.sig.numArgs = (DWORD)0;
+ // Only setting values for things the EE seems to pay attention to... this is necessary since some of the values
+ //are unset and fail our precise comparisions...
+ key.sig.callConv = (DWORD)0;
+ key.sig.retTypeClass = (DWORDLONG)0;
+ key.sig.retTypeSigClass = (DWORDLONG)0;
+ key.sig.retType = (DWORD)0;
+ key.sig.flags = (DWORD)0;
+ key.sig.numArgs = (DWORD)0;
key.sig.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- key.sig.sigInst_classInst_Index = (DWORD)GetArgClass->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
+ key.sig.sigInst_classInst_Index =
+ (DWORD)GetArgClass->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
key.sig.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- key.sig.sigInst_methInst_Index = (DWORD)GetArgClass->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
- key.sig.args = (DWORDLONG)0;
+ key.sig.sigInst_methInst_Index =
+ (DWORD)GetArgClass->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
+ key.sig.args = (DWORDLONG)0;
key.sig.cbSig = (DWORD)0;
- key.sig.pSig = -1;
+ key.sig.pSig = -1;
key.sig.scope = (DWORDLONG)sig->scope;
key.sig.token = (DWORD)0;
- key.args = (DWORDLONG)args;
+ key.args = (DWORDLONG)args;
- value.result = (DWORDLONG)result;
+ value.result = (DWORDLONG)result;
value.exceptionCode = exceptionCode;
GetArgClass->Add(key, value);
@@ -2801,42 +2894,47 @@ void MethodContext::recGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDL
}
void MethodContext::dmpGetArgClass(const Agnostic_GetArgClass& key, const Agnostic_GetArgClass_Value& value)
{
- printf("GetArgClass key cc-%u ci-%u mc-%u mi-%u scp-%016llX args-%016llX",
- key.sig.sigInst_classInstCount,
- key.sig.sigInst_classInst_Index,
- key.sig.sigInst_methInstCount,
- key.sig.sigInst_methInst_Index,
- key.sig.scope,
- key.args);
+ printf("GetArgClass key cc-%u ci-%u mc-%u mi-%u scp-%016llX args-%016llX", key.sig.sigInst_classInstCount,
+ key.sig.sigInst_classInst_Index, key.sig.sigInst_methInstCount, key.sig.sigInst_methInst_Index,
+ key.sig.scope, key.args);
printf(", value %016llX excp-%08X", value.result, value.exceptionCode);
}
-CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, DWORD *exceptionCode)
+CORINFO_CLASS_HANDLE MethodContext::repGetArgClass(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ DWORD* exceptionCode)
{
Agnostic_GetArgClass key;
- ZeroMemory(&key, sizeof(Agnostic_GetArgClass)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- AssertCodeMsg(GetArgClass != nullptr, EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.sig.scope, key.args);
- key.sig.callConv = (DWORD)0;
- key.sig.retTypeClass = (DWORDLONG)0;
- key.sig.retTypeSigClass = (DWORDLONG)0;
- key.sig.retType = (DWORD)0;
- key.sig.flags = (DWORD)0;
- key.sig.numArgs = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_GetArgClass)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
+
+ AssertCodeMsg(GetArgClass != nullptr, EXCEPTIONCODE_MC,
+ "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.sig.scope,
+ key.args);
+ key.sig.callConv = (DWORD)0;
+ key.sig.retTypeClass = (DWORDLONG)0;
+ key.sig.retTypeSigClass = (DWORDLONG)0;
+ key.sig.retType = (DWORD)0;
+ key.sig.flags = (DWORD)0;
+ key.sig.numArgs = (DWORD)0;
key.sig.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- key.sig.sigInst_classInst_Index = (DWORD)GetArgClass->Contains((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
+ key.sig.sigInst_classInst_Index =
+ (DWORD)GetArgClass->Contains((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8);
key.sig.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- key.sig.sigInst_methInst_Index = (DWORD)GetArgClass->Contains((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
- key.sig.args = (DWORDLONG)0;
+ key.sig.sigInst_methInst_Index =
+ (DWORD)GetArgClass->Contains((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8);
+ key.sig.args = (DWORDLONG)0;
key.sig.cbSig = (DWORD)0;
- key.sig.pSig = -1;
+ key.sig.pSig = -1;
key.sig.scope = (DWORDLONG)sig->scope;
key.sig.token = (DWORD)0;
- key.args = (DWORDLONG)args;
+ key.args = (DWORDLONG)args;
- AssertCodeMsg(GetArgClass->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.sig.scope, key.args);
+ AssertCodeMsg(GetArgClass->GetIndex(key) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llx, %016llx. probably a missing exception in getArgClass", key.sig.scope,
+ key.args);
Agnostic_GetArgClass_Value value = GetArgClass->Get(key);
- *exceptionCode = value.exceptionCode;
+ *exceptionCode = value.exceptionCode;
DEBUG_REP(dmpGetArgClass(key, value));
return (CORINFO_CLASS_HANDLE)value.result;
@@ -2863,14 +2961,18 @@ 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);
+ 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)
+void MethodContext::recGetMethodInfo(CORINFO_METHOD_HANDLE ftn,
+ CORINFO_METHOD_INFO* info,
+ bool result,
+ DWORD exceptionCode)
{
if (GetMethodInfo == nullptr)
GetMethodInfo = new LightWeightMap<DWORDLONG, Agnostic_GetMethodInfo>();
@@ -2880,46 +2982,54 @@ void MethodContext::recGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_I
if (result)
{
- value.info.ftn = (DWORDLONG)info->ftn;
- value.info.scope = (DWORDLONG)info->scope;
- value.info.ILCode_offset = (DWORD)GetMethodInfo->AddBuffer(info->ILCode, info->ILCodeSize);
- value.info.ILCodeSize = (DWORD)info->ILCodeSize;
- value.info.maxStack = (DWORD)info->maxStack;
- value.info.EHcount = (DWORD)info->EHcount;
- value.info.options = (DWORD)info->options;
- value.info.regionKind = (DWORD)info->regionKind;
- value.info.args.callConv = (DWORD)info->args.callConv;
- value.info.args.retTypeClass = (DWORDLONG)info->args.retTypeClass;
- value.info.args.retTypeSigClass = (DWORDLONG)info->args.retTypeSigClass;
- value.info.args.retType = (DWORD)info->args.retType;
- value.info.args.flags = (DWORD)info->args.flags;
- value.info.args.numArgs = (DWORD)info->args.numArgs;
+ value.info.ftn = (DWORDLONG)info->ftn;
+ value.info.scope = (DWORDLONG)info->scope;
+ value.info.ILCode_offset = (DWORD)GetMethodInfo->AddBuffer(info->ILCode, info->ILCodeSize);
+ value.info.ILCodeSize = (DWORD)info->ILCodeSize;
+ value.info.maxStack = (DWORD)info->maxStack;
+ value.info.EHcount = (DWORD)info->EHcount;
+ value.info.options = (DWORD)info->options;
+ value.info.regionKind = (DWORD)info->regionKind;
+ value.info.args.callConv = (DWORD)info->args.callConv;
+ value.info.args.retTypeClass = (DWORDLONG)info->args.retTypeClass;
+ value.info.args.retTypeSigClass = (DWORDLONG)info->args.retTypeSigClass;
+ value.info.args.retType = (DWORD)info->args.retType;
+ value.info.args.flags = (DWORD)info->args.flags;
+ value.info.args.numArgs = (DWORD)info->args.numArgs;
value.info.args.sigInst_classInstCount = (DWORD)info->args.sigInst.classInstCount;
- value.info.args.sigInst_classInst_Index = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->args.sigInst.classInst, info->args.sigInst.classInstCount * 8); //porting issue
+ value.info.args.sigInst_classInst_Index =
+ (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->args.sigInst.classInst,
+ info->args.sigInst.classInstCount * 8); // porting issue
value.info.args.sigInst_methInstCount = (DWORD)info->args.sigInst.methInstCount;
- value.info.args.sigInst_methInst_Index = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->args.sigInst.methInst, info->args.sigInst.methInstCount * 8); //porting issue
- value.info.args.args = (DWORDLONG)info->args.args;
- value.info.args.cbSig = (DWORD)info->args.cbSig;
- value.info.args.pSig = (DWORD)GetMethodInfo->AddBuffer((unsigned char *)info->args.pSig, info->args.cbSig);
- value.info.args.scope = (DWORDLONG)info->args.scope;
- value.info.args.token = (DWORD)info->args.token;
+ value.info.args.sigInst_methInst_Index =
+ (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->args.sigInst.methInst,
+ info->args.sigInst.methInstCount * 8); // porting issue
+ value.info.args.args = (DWORDLONG)info->args.args;
+ value.info.args.cbSig = (DWORD)info->args.cbSig;
+ value.info.args.pSig = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->args.pSig, info->args.cbSig);
+ value.info.args.scope = (DWORDLONG)info->args.scope;
+ value.info.args.token = (DWORD)info->args.token;
value.info.locals.callConv = (DWORD)info->locals.callConv;
- value.info.locals.retTypeClass = (DWORDLONG)info->locals.retTypeClass;
- value.info.locals.retTypeSigClass = (DWORDLONG)info->locals.retTypeSigClass;
- value.info.locals.retType = (DWORD)info->locals.retType;
- value.info.locals.flags = (DWORD)info->locals.flags;
- value.info.locals.numArgs = (DWORD)info->locals.numArgs;
+ value.info.locals.retTypeClass = (DWORDLONG)info->locals.retTypeClass;
+ value.info.locals.retTypeSigClass = (DWORDLONG)info->locals.retTypeSigClass;
+ value.info.locals.retType = (DWORD)info->locals.retType;
+ value.info.locals.flags = (DWORD)info->locals.flags;
+ value.info.locals.numArgs = (DWORD)info->locals.numArgs;
value.info.locals.sigInst_classInstCount = (DWORD)info->locals.sigInst.classInstCount;
- value.info.locals.sigInst_classInst_Index = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->locals.sigInst.classInst, info->locals.sigInst.classInstCount * 8); //porting issue
+ value.info.locals.sigInst_classInst_Index =
+ (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->locals.sigInst.classInst,
+ info->locals.sigInst.classInstCount * 8); // porting issue
value.info.locals.sigInst_methInstCount = (DWORD)info->locals.sigInst.methInstCount;
- value.info.locals.sigInst_methInst_Index = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->locals.sigInst.methInst, info->locals.sigInst.methInstCount * 8); //porting issue
- value.info.locals.args = (DWORDLONG)info->locals.args;
+ value.info.locals.sigInst_methInst_Index =
+ (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->locals.sigInst.methInst,
+ info->locals.sigInst.methInstCount * 8); // porting issue
+ value.info.locals.args = (DWORDLONG)info->locals.args;
value.info.locals.cbSig = (DWORD)info->locals.cbSig;
- value.info.locals.pSig = (DWORD)GetMethodInfo->AddBuffer((unsigned char *)info->locals.pSig, info->locals.cbSig);
+ value.info.locals.pSig = (DWORD)GetMethodInfo->AddBuffer((unsigned char*)info->locals.pSig, info->locals.cbSig);
value.info.locals.scope = (DWORDLONG)info->locals.scope;
value.info.locals.token = (DWORD)info->locals.token;
}
- value.result = result;
+ value.result = result;
value.exceptionCode = (DWORD)exceptionCode;
GetMethodInfo->Add((DWORDLONG)ftn, value);
@@ -2929,329 +3039,319 @@ void MethodContext::dmpGetMethodInfo(DWORDLONG key, const Agnostic_GetMethodInfo
{
printf("GetMethodInfo key ftn-%016llX", key);
printf(", value res-%u ftn-%016llX scp-%016llX ilo-%u ils-%u ms-%u ehc-%u opt-%08X 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} "
- "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} "
+ "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} "
"excp-%08X",
- value.result,
- value.info.ftn,
- value.info.scope,
- value.info.ILCode_offset,
- value.info.ILCodeSize,
- value.info.maxStack,
- value.info.EHcount,
- value.info.options,
- value.info.regionKind,
- value.info.args.callConv,
- value.info.args.retTypeClass,
- value.info.args.retTypeSigClass,
- value.info.args.retType,
- toString((CorInfoType)value.info.args.retType),
- value.info.args.flags,
- value.info.args.numArgs,
- value.info.args.sigInst_classInstCount,
- value.info.args.sigInst_classInst_Index,
- value.info.args.sigInst_methInstCount,
- value.info.args.sigInst_methInst_Index,
- value.info.args.args,
- value.info.args.cbSig,
- value.info.args.pSig,
- value.info.args.scope,
- value.info.args.token,
- value.info.locals.callConv,
- value.info.locals.retTypeClass,
- value.info.locals.retTypeSigClass,
- value.info.locals.retType,
- toString((CorInfoType)value.info.locals.retType),
- value.info.locals.flags,
- value.info.locals.numArgs,
- value.info.locals.sigInst_classInstCount,
- value.info.locals.sigInst_classInst_Index,
- value.info.locals.sigInst_methInstCount,
- value.info.locals.sigInst_methInst_Index,
- value.info.locals.args,
- value.info.locals.cbSig,
- value.info.locals.pSig,
- value.info.locals.scope,
- value.info.locals.token,
- value.exceptionCode);
-}
-bool MethodContext::repGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO *info, DWORD *exceptionCode)
+ value.result, value.info.ftn, value.info.scope, value.info.ILCode_offset, value.info.ILCodeSize,
+ value.info.maxStack, value.info.EHcount, value.info.options, value.info.regionKind, value.info.args.callConv,
+ value.info.args.retTypeClass, value.info.args.retTypeSigClass, value.info.args.retType,
+ toString((CorInfoType)value.info.args.retType), value.info.args.flags, value.info.args.numArgs,
+ value.info.args.sigInst_classInstCount, value.info.args.sigInst_classInst_Index,
+ value.info.args.sigInst_methInstCount, value.info.args.sigInst_methInst_Index, value.info.args.args,
+ value.info.args.cbSig, value.info.args.pSig, value.info.args.scope, value.info.args.token,
+ value.info.locals.callConv, value.info.locals.retTypeClass, value.info.locals.retTypeSigClass,
+ value.info.locals.retType, toString((CorInfoType)value.info.locals.retType), value.info.locals.flags,
+ value.info.locals.numArgs, value.info.locals.sigInst_classInstCount,
+ value.info.locals.sigInst_classInst_Index, value.info.locals.sigInst_methInstCount,
+ value.info.locals.sigInst_methInst_Index, value.info.locals.args, value.info.locals.cbSig,
+ value.info.locals.pSig, value.info.locals.scope, value.info.locals.token, value.exceptionCode);
+}
+bool MethodContext::repGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO* info, DWORD* exceptionCode)
{
Agnostic_GetMethodInfo value;
- AssertCodeMsg(GetMethodInfo != nullptr, EXCEPTIONCODE_MC, "Didn't find %016llx. probably a missing exception in getMethodInfo", (DWORDLONG)ftn);
- AssertCodeMsg(GetMethodInfo->GetIndex((DWORDLONG)ftn) != -1, EXCEPTIONCODE_MC, "Didn't find %016llx. probably a missing exception in getMethodInfo", (DWORDLONG)ftn);
+ AssertCodeMsg(GetMethodInfo != nullptr, EXCEPTIONCODE_MC,
+ "Didn't find %016llx. probably a missing exception in getMethodInfo", (DWORDLONG)ftn);
+ AssertCodeMsg(GetMethodInfo->GetIndex((DWORDLONG)ftn) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llx. probably a missing exception in getMethodInfo", (DWORDLONG)ftn);
value = GetMethodInfo->Get((DWORDLONG)ftn);
if (value.result)
{
- info->ftn = (CORINFO_METHOD_HANDLE)value.info.ftn;
- info->scope = (CORINFO_MODULE_HANDLE)value.info.scope;
- info->ILCode = GetMethodInfo->GetBuffer(value.info.ILCode_offset);
- info->ILCodeSize = (unsigned)value.info.ILCodeSize;
- info->maxStack = (unsigned)value.info.maxStack;
- info->EHcount = (unsigned)value.info.EHcount;
- info->options = (CorInfoOptions)value.info.options;
- info->regionKind = (CorInfoRegionKind)value.info.regionKind;
- info->args.callConv = (CorInfoCallConv)value.info.args.callConv;
- info->args.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeClass;
- info->args.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeSigClass;
- info->args.retType = (CorInfoType)value.info.args.retType;
- info->args.flags = (unsigned)value.info.args.flags;
- info->args.numArgs = (unsigned)value.info.args.numArgs;
+ info->ftn = (CORINFO_METHOD_HANDLE)value.info.ftn;
+ info->scope = (CORINFO_MODULE_HANDLE)value.info.scope;
+ info->ILCode = GetMethodInfo->GetBuffer(value.info.ILCode_offset);
+ info->ILCodeSize = (unsigned)value.info.ILCodeSize;
+ info->maxStack = (unsigned)value.info.maxStack;
+ info->EHcount = (unsigned)value.info.EHcount;
+ info->options = (CorInfoOptions)value.info.options;
+ info->regionKind = (CorInfoRegionKind)value.info.regionKind;
+ info->args.callConv = (CorInfoCallConv)value.info.args.callConv;
+ info->args.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeClass;
+ info->args.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.args.retTypeSigClass;
+ info->args.retType = (CorInfoType)value.info.args.retType;
+ info->args.flags = (unsigned)value.info.args.flags;
+ info->args.numArgs = (unsigned)value.info.args.numArgs;
info->args.sigInst.classInstCount = (unsigned)value.info.args.sigInst_classInstCount;
- info->args.sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.args.sigInst_classInst_Index);
+ info->args.sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.args.sigInst_classInst_Index);
info->args.sigInst.methInstCount = (unsigned)value.info.args.sigInst_methInstCount;
- info->args.sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.args.sigInst_methInst_Index);
- info->args.args = (CORINFO_ARG_LIST_HANDLE)value.info.args.args;
- info->args.cbSig = (unsigned int)value.info.args.cbSig;
- info->args.pSig = (PCCOR_SIGNATURE)GetMethodInfo->GetBuffer(value.info.args.pSig);
- info->args.scope = (CORINFO_MODULE_HANDLE)value.info.args.scope;
- info->args.token = (mdToken)value.info.args.token;
- info->locals.callConv = (CorInfoCallConv)value.info.locals.callConv;
- info->locals.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeClass;
- info->locals.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeSigClass;
- info->locals.retType = (CorInfoType)value.info.locals.retType;
- info->locals.flags = (unsigned)value.info.locals.flags;
- info->locals.numArgs = (unsigned)value.info.locals.numArgs;
+ info->args.sigInst.methInst =
+ (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.args.sigInst_methInst_Index);
+ info->args.args = (CORINFO_ARG_LIST_HANDLE)value.info.args.args;
+ info->args.cbSig = (unsigned int)value.info.args.cbSig;
+ info->args.pSig = (PCCOR_SIGNATURE)GetMethodInfo->GetBuffer(value.info.args.pSig);
+ info->args.scope = (CORINFO_MODULE_HANDLE)value.info.args.scope;
+ info->args.token = (mdToken)value.info.args.token;
+ info->locals.callConv = (CorInfoCallConv)value.info.locals.callConv;
+ info->locals.retTypeClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeClass;
+ info->locals.retTypeSigClass = (CORINFO_CLASS_HANDLE)value.info.locals.retTypeSigClass;
+ info->locals.retType = (CorInfoType)value.info.locals.retType;
+ info->locals.flags = (unsigned)value.info.locals.flags;
+ info->locals.numArgs = (unsigned)value.info.locals.numArgs;
info->locals.sigInst.classInstCount = (unsigned)value.info.locals.sigInst_classInstCount;
- info->locals.sigInst.classInst = (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.locals.sigInst_classInst_Index);
+ info->locals.sigInst.classInst =
+ (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.locals.sigInst_classInst_Index);
info->locals.sigInst.methInstCount = (unsigned)value.info.locals.sigInst_methInstCount;
- info->locals.sigInst.methInst = (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.locals.sigInst_methInst_Index);
- info->locals.args = (CORINFO_ARG_LIST_HANDLE)value.info.locals.args;
+ info->locals.sigInst.methInst =
+ (CORINFO_CLASS_HANDLE*)GetMethodInfo->GetBuffer(value.info.locals.sigInst_methInst_Index);
+ info->locals.args = (CORINFO_ARG_LIST_HANDLE)value.info.locals.args;
info->locals.cbSig = (unsigned int)value.info.locals.cbSig;
- info->locals.pSig = (PCCOR_SIGNATURE)GetMethodInfo->GetBuffer(value.info.locals.pSig);
+ info->locals.pSig = (PCCOR_SIGNATURE)GetMethodInfo->GetBuffer(value.info.locals.pSig);
info->locals.scope = (CORINFO_MODULE_HANDLE)value.info.locals.scope;
info->locals.token = (mdToken)value.info.locals.token;
}
- bool result = (bool)value.result;
+ bool result = (bool)value.result;
*exceptionCode = (DWORD)value.exceptionCode;
DEBUG_REP(dmpGetMethodInfo((DWORDLONG)ftn, value));
return result;
}
-void MethodContext::recGetNewHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CorInfoHelpFunc result)
+void MethodContext::recGetNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CorInfoHelpFunc result)
{
if (GetNewHelper == nullptr)
GetNewHelper = new LightWeightMap<Agnostic_GetNewHelper, DWORD>();
Agnostic_GetNewHelper key;
- ZeroMemory(&key, sizeof(Agnostic_GetNewHelper)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.ResolvedToken.tokenContext = (DWORDLONG)0;
- key.ResolvedToken.tokenScope = (DWORDLONG)0;
- key.ResolvedToken.token = (DWORD)0;
- key.ResolvedToken.tokenType = (DWORD)0;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)0;
- key.ResolvedToken.hField = (DWORDLONG)0;
- key.ResolvedToken.typeSpec_Index = (DWORD)0;
- key.ResolvedToken.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_GetNewHelper)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
+
+ key.ResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ResolvedToken.token = (DWORD)0;
+ key.ResolvedToken.tokenType = (DWORD)0;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)0;
+ key.ResolvedToken.hField = (DWORDLONG)0;
+ key.ResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ResolvedToken.cbTypeSpec = (DWORD)0;
key.ResolvedToken.methodSpec_Index = (DWORD)0;
- key.ResolvedToken.cbMethodSpec = (DWORD)0;
- key.callerHandle = (DWORDLONG)callerHandle;
+ key.ResolvedToken.cbMethodSpec = (DWORD)0;
+ key.callerHandle = (DWORDLONG)callerHandle;
GetNewHelper->Add(key, (DWORD)result);
DEBUG_REC(dmpGetNewHelper(key, (DWORD)result));
}
void MethodContext::dmpGetNewHelper(const Agnostic_GetNewHelper& key, DWORD value)
{
- printf("GetNewHelper key cls-%016llX chan-%016llX, value res-%u", key.ResolvedToken.hClass, key.callerHandle, value);
+ printf("GetNewHelper key cls-%016llX chan-%016llX, value res-%u", key.ResolvedToken.hClass, key.callerHandle,
+ value);
}
-CorInfoHelpFunc MethodContext::repGetNewHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle)
+CorInfoHelpFunc MethodContext::repGetNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle)
{
Agnostic_GetNewHelper key;
- ZeroMemory(&key, sizeof(Agnostic_GetNewHelper)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.ResolvedToken.tokenContext = (DWORDLONG)0;
- key.ResolvedToken.tokenScope = (DWORDLONG)0;
- key.ResolvedToken.token = (DWORD)0;
- key.ResolvedToken.tokenType = (DWORD)0;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)0;
- key.ResolvedToken.hField = (DWORDLONG)0;
- key.ResolvedToken.typeSpec_Index = (DWORD)0;
- key.ResolvedToken.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_GetNewHelper)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
+
+ key.ResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ResolvedToken.token = (DWORD)0;
+ key.ResolvedToken.tokenType = (DWORD)0;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)0;
+ key.ResolvedToken.hField = (DWORDLONG)0;
+ key.ResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ResolvedToken.cbTypeSpec = (DWORD)0;
key.ResolvedToken.methodSpec_Index = (DWORD)0;
- key.ResolvedToken.cbMethodSpec = (DWORD)0;
- key.callerHandle = (DWORDLONG)callerHandle;
+ key.ResolvedToken.cbMethodSpec = (DWORD)0;
+ key.callerHandle = (DWORDLONG)callerHandle;
- AssertCodeMsg(GetNewHelper != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)key.ResolvedToken.hClass);
- AssertCodeMsg(GetNewHelper->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.ResolvedToken.hClass);
+ AssertCodeMsg(GetNewHelper != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)key.ResolvedToken.hClass);
+ AssertCodeMsg(GetNewHelper->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)key.ResolvedToken.hClass);
CorInfoHelpFunc value = (CorInfoHelpFunc)GetNewHelper->Get(key);
DEBUG_REP(dmpGetNewHelper(key, value));
return value;
}
-void MethodContext::recEmbedGenericHandle(CORINFO_RESOLVED_TOKEN *pResolvedToken, BOOL fEmbedParent, CORINFO_GENERICHANDLE_RESULT *pResult)
+void MethodContext::recEmbedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ BOOL fEmbedParent,
+ CORINFO_GENERICHANDLE_RESULT* pResult)
{
if (EmbedGenericHandle == nullptr)
EmbedGenericHandle = new LightWeightMap<Agnostic_EmbedGenericHandle, Agnostic_CORINFO_GENERICHANDLE_RESULT>();
Agnostic_EmbedGenericHandle key;
- ZeroMemory(&key, sizeof(Agnostic_EmbedGenericHandle)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_EmbedGenericHandle)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_GENERICHANDLE_RESULT value;
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)EmbedGenericHandle->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)EmbedGenericHandle->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)EmbedGenericHandle->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)EmbedGenericHandle->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.fEmbedParent = (DWORD)fEmbedParent;
+ key.fEmbedParent = (DWORD)fEmbedParent;
value.lookup.lookupKind.needsRuntimeLookup = (DWORD)pResult->lookup.lookupKind.needsRuntimeLookup;
- value.lookup.lookupKind.runtimeLookupKind = (DWORD)pResult->lookup.lookupKind.runtimeLookupKind;
+ value.lookup.lookupKind.runtimeLookupKind = (DWORD)pResult->lookup.lookupKind.runtimeLookupKind;
if (pResult->lookup.lookupKind.needsRuntimeLookup)
{
value.lookup.constLookup.accessType = (DWORD)0;
- value.lookup.constLookup.handle = (DWORDLONG)0;
- //copy the runtimeLookup view of the union
- value.lookup.runtimeLookup.signature = (DWORDLONG)pResult->lookup.runtimeLookup.signature;
- value.lookup.runtimeLookup.helper = (DWORD)pResult->lookup.runtimeLookup.helper;
+ value.lookup.constLookup.handle = (DWORDLONG)0;
+ // copy the runtimeLookup view of the union
+ value.lookup.runtimeLookup.signature = (DWORDLONG)pResult->lookup.runtimeLookup.signature;
+ value.lookup.runtimeLookup.helper = (DWORD)pResult->lookup.runtimeLookup.helper;
value.lookup.runtimeLookup.indirections = (DWORD)pResult->lookup.runtimeLookup.indirections;
- value.lookup.runtimeLookup.testForNull = (DWORD)pResult->lookup.runtimeLookup.testForNull;
+ value.lookup.runtimeLookup.testForNull = (DWORD)pResult->lookup.runtimeLookup.testForNull;
value.lookup.runtimeLookup.testForFixup = (DWORD)pResult->lookup.runtimeLookup.testForFixup;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
value.lookup.runtimeLookup.offsets[i] = (DWORDLONG)pResult->lookup.runtimeLookup.offsets[i];
}
else
{
- value.lookup.runtimeLookup.signature = (DWORDLONG)0;
- value.lookup.runtimeLookup.helper = (DWORD)0;
+ value.lookup.runtimeLookup.signature = (DWORDLONG)0;
+ value.lookup.runtimeLookup.helper = (DWORD)0;
value.lookup.runtimeLookup.indirections = (DWORD)0;
- value.lookup.runtimeLookup.testForNull = (DWORD)0;
+ value.lookup.runtimeLookup.testForNull = (DWORD)0;
value.lookup.runtimeLookup.testForFixup = (DWORD)0;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
value.lookup.runtimeLookup.offsets[i] = (DWORDLONG)0;
- //copy the constLookup view of the union
+ // copy the constLookup view of the union
value.lookup.constLookup.accessType = (DWORD)pResult->lookup.constLookup.accessType;
- value.lookup.constLookup.handle = (DWORDLONG)pResult->lookup.constLookup.handle;
+ value.lookup.constLookup.handle = (DWORDLONG)pResult->lookup.constLookup.handle;
}
value.compileTimeHandle = (DWORDLONG)pResult->compileTimeHandle;
- value.handleType = (DWORD)pResult->handleType;
+ value.handleType = (DWORD)pResult->handleType;
EmbedGenericHandle->Add(key, value);
DEBUG_REC(dmpEmbedGenericHandle(key, value));
}
-void MethodContext::dmpEmbedGenericHandle(const Agnostic_EmbedGenericHandle& key, const Agnostic_CORINFO_GENERICHANDLE_RESULT& value)
-{
- printf("EmbedGenericHandle key rt{tokCon-%016llX tokScp-%016llX tok-%08X tokTyp-%08X cls-%016llX ftn-%016llX fld-%016llX tsi-%u cbts-%u msi-%u cbms-%u} emb-%u",
- key.ResolvedToken.tokenContext,
- key.ResolvedToken.tokenScope,
- key.ResolvedToken.token,
- key.ResolvedToken.tokenType,
- key.ResolvedToken.hClass,
- key.ResolvedToken.hMethod,
- key.ResolvedToken.hField,
- key.ResolvedToken.typeSpec_Index,
- key.ResolvedToken.cbTypeSpec,
- key.ResolvedToken.methodSpec_Index,
- key.ResolvedToken.cbMethodSpec,
- key.fEmbedParent);
- printf(", value nrl-%u rlk-%u", value.lookup.lookupKind.needsRuntimeLookup, value.lookup.lookupKind.runtimeLookupKind);
+void MethodContext::dmpEmbedGenericHandle(const Agnostic_EmbedGenericHandle& key,
+ const Agnostic_CORINFO_GENERICHANDLE_RESULT& value)
+{
+ printf("EmbedGenericHandle key rt{tokCon-%016llX tokScp-%016llX tok-%08X tokTyp-%08X cls-%016llX ftn-%016llX "
+ "fld-%016llX tsi-%u cbts-%u msi-%u cbms-%u} emb-%u",
+ key.ResolvedToken.tokenContext, key.ResolvedToken.tokenScope, key.ResolvedToken.token,
+ key.ResolvedToken.tokenType, key.ResolvedToken.hClass, key.ResolvedToken.hMethod, key.ResolvedToken.hField,
+ key.ResolvedToken.typeSpec_Index, key.ResolvedToken.cbTypeSpec, key.ResolvedToken.methodSpec_Index,
+ key.ResolvedToken.cbMethodSpec, key.fEmbedParent);
+ printf(", value nrl-%u rlk-%u", value.lookup.lookupKind.needsRuntimeLookup,
+ value.lookup.lookupKind.runtimeLookupKind);
if (value.lookup.lookupKind.needsRuntimeLookup)
{
- printf(" sig-%016llX hlp-%u ind-%u tfn-%u tff-%u { ",
- value.lookup.runtimeLookup.signature,
- value.lookup.runtimeLookup.helper,
- value.lookup.runtimeLookup.indirections,
- value.lookup.runtimeLookup.testForNull,
- value.lookup.runtimeLookup.testForFixup);
+ printf(" sig-%016llX hlp-%u ind-%u tfn-%u tff-%u { ", value.lookup.runtimeLookup.signature,
+ value.lookup.runtimeLookup.helper, value.lookup.runtimeLookup.indirections,
+ value.lookup.runtimeLookup.testForNull, value.lookup.runtimeLookup.testForFixup);
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
printf("%016llX ", value.lookup.runtimeLookup.offsets[i]);
printf("}");
}
else
{
- printf(" at-%u han-%016llX",
- value.lookup.constLookup.accessType,
- value.lookup.constLookup.handle);
+ printf(" at-%u han-%016llX", value.lookup.constLookup.accessType, value.lookup.constLookup.handle);
}
printf(" cth-%016llX ht-%u", value.compileTimeHandle, value.handleType);
}
-void MethodContext::repEmbedGenericHandle(CORINFO_RESOLVED_TOKEN *pResolvedToken, BOOL fEmbedParent, CORINFO_GENERICHANDLE_RESULT *pResult)
+void MethodContext::repEmbedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ BOOL fEmbedParent,
+ CORINFO_GENERICHANDLE_RESULT* pResult)
{
Agnostic_EmbedGenericHandle key;
- ZeroMemory(&key, sizeof(Agnostic_EmbedGenericHandle)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_EmbedGenericHandle)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CORINFO_GENERICHANDLE_RESULT value;
AssertCodeMsg(EmbedGenericHandle != nullptr, EXCEPTIONCODE_MC, "Encountered an empty LWM while looking for ...");
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)EmbedGenericHandle->Contains((unsigned char *)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)EmbedGenericHandle->Contains((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)EmbedGenericHandle->Contains((unsigned char *)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)EmbedGenericHandle->Contains((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.fEmbedParent = (DWORD)fEmbedParent;
+ key.fEmbedParent = (DWORD)fEmbedParent;
AssertCodeMsg(EmbedGenericHandle->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find ...");
value = EmbedGenericHandle->Get(key);
pResult->lookup.lookupKind.needsRuntimeLookup = value.lookup.lookupKind.needsRuntimeLookup != 0;
- pResult->lookup.lookupKind.runtimeLookupKind = (CORINFO_RUNTIME_LOOKUP_KIND)value.lookup.lookupKind.runtimeLookupKind;
+ pResult->lookup.lookupKind.runtimeLookupKind =
+ (CORINFO_RUNTIME_LOOKUP_KIND)value.lookup.lookupKind.runtimeLookupKind;
if (pResult->lookup.lookupKind.needsRuntimeLookup)
{
- //copy the runtimeLookup view of the union
- pResult->lookup.runtimeLookup.signature = (LPVOID)value.lookup.runtimeLookup.signature;
- pResult->lookup.runtimeLookup.helper = (CorInfoHelpFunc)value.lookup.runtimeLookup.helper;
+ // copy the runtimeLookup view of the union
+ pResult->lookup.runtimeLookup.signature = (LPVOID)value.lookup.runtimeLookup.signature;
+ pResult->lookup.runtimeLookup.helper = (CorInfoHelpFunc)value.lookup.runtimeLookup.helper;
pResult->lookup.runtimeLookup.indirections = (WORD)value.lookup.runtimeLookup.indirections;
- pResult->lookup.runtimeLookup.testForNull = value.lookup.runtimeLookup.testForNull != 0;
+ pResult->lookup.runtimeLookup.testForNull = value.lookup.runtimeLookup.testForNull != 0;
pResult->lookup.runtimeLookup.testForFixup = value.lookup.runtimeLookup.testForFixup != 0;
- for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
+ for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
pResult->lookup.runtimeLookup.offsets[i] = (size_t)value.lookup.runtimeLookup.offsets[i];
}
else
{
pResult->lookup.constLookup.accessType = (InfoAccessType)value.lookup.constLookup.accessType;
- pResult->lookup.constLookup.handle = (CORINFO_GENERIC_HANDLE)value.lookup.constLookup.handle;
+ pResult->lookup.constLookup.handle = (CORINFO_GENERIC_HANDLE)value.lookup.constLookup.handle;
}
pResult->compileTimeHandle = (CORINFO_GENERIC_HANDLE)value.compileTimeHandle;
- pResult->handleType = (CorInfoGenericHandleType)value.handleType;
+ pResult->handleType = (CorInfoGenericHandleType)value.handleType;
DEBUG_REP(dmpEmbedGenericHandle(key, value));
}
-void MethodContext::recGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE *clause)
+void MethodContext::recGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause)
{
if (GetEHinfo == nullptr)
GetEHinfo = new LightWeightMap<DLD, Agnostic_CORINFO_EH_CLAUSE>();
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
+ 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
Agnostic_CORINFO_EH_CLAUSE value;
key.A = (DWORDLONG)ftn;
key.B = (DWORD)EHnumber;
- value.Flags = (DWORD)clause->Flags;
- value.TryOffset = (DWORD)clause->TryOffset;
- value.TryLength = (DWORD)clause->TryLength;
+ value.Flags = (DWORD)clause->Flags;
+ value.TryOffset = (DWORD)clause->TryOffset;
+ value.TryLength = (DWORD)clause->TryLength;
value.HandlerOffset = (DWORD)clause->HandlerOffset;
value.HandlerLength = (DWORD)clause->HandlerLength;
- value.ClassToken = (DWORD)clause->ClassToken;
+ value.ClassToken = (DWORD)clause->ClassToken;
GetEHinfo->Add(key, value);
DEBUG_REC(dmpGetEHinfo(key, value));
}
void MethodContext::dmpGetEHinfo(DLD key, const Agnostic_CORINFO_EH_CLAUSE& value)
{
- printf("GetEHinfo key ftn-%016llX ehn-%u, value flg-%u to-%u tl-%u ho-%u hl-%u ct-%u",
- key.A, key.B, value.Flags, value.TryOffset, value.TryLength, value.HandlerOffset, value.HandlerLength, value.ClassToken);
+ printf("GetEHinfo key ftn-%016llX ehn-%u, value flg-%u to-%u tl-%u ho-%u hl-%u ct-%u", key.A, key.B, value.Flags,
+ value.TryOffset, value.TryLength, value.HandlerOffset, value.HandlerLength, value.ClassToken);
}
-void MethodContext::repGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE *clause)
+void MethodContext::repGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause)
{
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
+ 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
Agnostic_CORINFO_EH_CLAUSE value;
key.A = (DWORDLONG)ftn;
@@ -3259,16 +3359,18 @@ void MethodContext::repGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, C
value = GetEHinfo->Get(key);
- clause->Flags = (CORINFO_EH_CLAUSE_FLAGS)value.Flags;
- clause->TryOffset = (DWORD)value.TryOffset;
- clause->TryLength = (DWORD)value.TryLength;
+ clause->Flags = (CORINFO_EH_CLAUSE_FLAGS)value.Flags;
+ clause->TryOffset = (DWORD)value.TryOffset;
+ clause->TryLength = (DWORD)value.TryLength;
clause->HandlerOffset = (DWORD)value.HandlerOffset;
clause->HandlerLength = (DWORD)value.HandlerLength;
- clause->ClassToken = (DWORD)value.ClassToken;
+ clause->ClassToken = (DWORD)value.ClassToken;
DEBUG_REP(dmpGetEHinfo(key, value));
}
-void MethodContext::recGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsigned *offsetOfIndirection, unsigned* offsetAfterIndirection)
+void MethodContext::recGetMethodVTableOffset(CORINFO_METHOD_HANDLE method,
+ unsigned* offsetOfIndirection,
+ unsigned* offsetAfterIndirection)
{
if (GetMethodVTableOffset == nullptr)
GetMethodVTableOffset = new LightWeightMap<DWORDLONG, DD>();
@@ -3283,21 +3385,27 @@ void MethodContext::dmpGetMethodVTableOffset(DWORDLONG key, DD value)
{
printf("GetMethodVTableOffset key ftn-%016llX, value offi-%u, offa-%u", key, value.A, value.B);
}
-void MethodContext::repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsigned *offsetOfIndirection, unsigned* offsetAfterIndirection)
+void MethodContext::repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method,
+ unsigned* offsetOfIndirection,
+ unsigned* offsetAfterIndirection)
{
DD value;
- AssertCodeMsg(GetMethodVTableOffset != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)method);
- AssertCodeMsg(GetMethodVTableOffset->GetIndex((DWORDLONG)method) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)method);
+ AssertCodeMsg(GetMethodVTableOffset != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)method);
+ AssertCodeMsg(GetMethodVTableOffset->GetIndex((DWORDLONG)method) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)method);
value = GetMethodVTableOffset->Get((DWORDLONG)method);
- *offsetOfIndirection = (unsigned)value.A;
+ *offsetOfIndirection = (unsigned)value.A;
*offsetAfterIndirection = (unsigned)value.B;
DEBUG_REP(dmpGetMethodVTableOffset((DWORDLONG)method, value));
}
-void MethodContext::recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
- CORINFO_CONTEXT_HANDLE ownerType, CORINFO_METHOD_HANDLE result)
+void MethodContext::recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod,
+ CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType,
+ CORINFO_METHOD_HANDLE result)
{
if (ResolveVirtualMethod == nullptr)
{
@@ -3305,31 +3413,33 @@ void MethodContext::recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CO
}
Agnostic_ResolveVirtualMethod key;
- key.virtualMethod = (DWORDLONG)virtMethod;
+ key.virtualMethod = (DWORDLONG)virtMethod;
key.implementingClass = (DWORDLONG)implClass;
- key.ownerType = (DWORDLONG)ownerType;
- ResolveVirtualMethod->Add(key, (DWORDLONG) result);
+ key.ownerType = (DWORDLONG)ownerType;
+ ResolveVirtualMethod->Add(key, (DWORDLONG)result);
DEBUG_REC(dmpResolveVirtualMethod(key, result));
}
void MethodContext::dmpResolveVirtualMethod(const Agnostic_ResolveVirtualMethod& key, DWORDLONG value)
{
printf("ResolveVirtualMethod virtMethod-%016llX, implClass-%016llX, ownerType--%01611X, result-%016llX",
- key.virtualMethod, key.implementingClass, key.ownerType, value);
+ key.virtualMethod, key.implementingClass, key.ownerType, value);
}
-CORINFO_METHOD_HANDLE MethodContext::repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
- CORINFO_CONTEXT_HANDLE ownerType)
+CORINFO_METHOD_HANDLE MethodContext::repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod,
+ CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType)
{
Agnostic_ResolveVirtualMethod key;
- key.virtualMethod = (DWORDLONG)virtMethod;
+ key.virtualMethod = (DWORDLONG)virtMethod;
key.implementingClass = (DWORDLONG)implClass;
- key.ownerType = (DWORDLONG)ownerType;
+ key.ownerType = (DWORDLONG)ownerType;
- AssertCodeMsg(ResolveVirtualMethod != nullptr, EXCEPTIONCODE_MC, "No ResolveVirtualMap map for %016llX-%016llX-%016llX",
- key.virtualMethod, key.implementingClass, key.ownerType);
+ AssertCodeMsg(ResolveVirtualMethod != nullptr, EXCEPTIONCODE_MC,
+ "No ResolveVirtualMap map for %016llX-%016llX-%016llX", key.virtualMethod, key.implementingClass,
+ key.ownerType);
AssertCodeMsg(ResolveVirtualMethod->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX-%016llx-%016llX",
- key.virtualMethod, key.implementingClass, key.ownerType);
+ key.virtualMethod, key.implementingClass, key.ownerType);
DWORDLONG result = ResolveVirtualMethod->Get(key);
DEBUG_REP(dmpResolveVirtualMethod(key, result));
@@ -3337,25 +3447,26 @@ CORINFO_METHOD_HANDLE MethodContext::repResolveVirtualMethod(CORINFO_METHOD_HAND
return (CORINFO_METHOD_HANDLE)result;
}
-void MethodContext::recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_CLASS_HANDLE result)
+void MethodContext::recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CLASS_HANDLE result)
{
if (GetTokenTypeAsHandle == nullptr)
GetTokenTypeAsHandle = new LightWeightMap<Agnostic_CORINFO_RESOLVED_TOKEN, DWORDLONG>();
Agnostic_CORINFO_RESOLVED_TOKEN key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKEN)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.tokenContext = (DWORDLONG)0;
- key.tokenScope = (DWORDLONG)0;
- key.token = (DWORD)0;
- key.tokenType = (DWORD)0;
- key.hClass = (DWORDLONG)0;
- key.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.hField = (DWORDLONG)pResolvedToken->hField;
- key.typeSpec_Index = (DWORD)0;
- key.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKEN)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.tokenContext = (DWORDLONG)0;
+ key.tokenScope = (DWORDLONG)0;
+ key.token = (DWORD)0;
+ key.tokenType = (DWORD)0;
+ key.hClass = (DWORDLONG)0;
+ key.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.hField = (DWORDLONG)pResolvedToken->hField;
+ key.typeSpec_Index = (DWORD)0;
+ key.cbTypeSpec = (DWORD)0;
key.methodSpec_Index = (DWORD)0;
- key.cbMethodSpec = (DWORD)0;
+ key.cbMethodSpec = (DWORD)0;
GetTokenTypeAsHandle->Add(key, (DWORDLONG)result);
}
@@ -3363,143 +3474,139 @@ void MethodContext::dmpGetTokenTypeAsHandle(const Agnostic_CORINFO_RESOLVED_TOKE
{
printf("GetTokenTypeAsHandle key ftn-%016llX fld-%016llX, value cls-%016llX", key.hMethod, key.hField, value);
}
-CORINFO_CLASS_HANDLE MethodContext::repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken)
+CORINFO_CLASS_HANDLE MethodContext::repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken)
{
Agnostic_CORINFO_RESOLVED_TOKEN key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKEN)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.tokenContext = (DWORDLONG)0;
- key.tokenScope = (DWORDLONG)0;
- key.token = (DWORD)0;
- key.tokenType = (DWORD)0;
- key.hClass = (DWORDLONG)0;
- key.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.hField = (DWORDLONG)pResolvedToken->hField;
- key.typeSpec_Index = (DWORD)0;
- key.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_RESOLVED_TOKEN)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.tokenContext = (DWORDLONG)0;
+ key.tokenScope = (DWORDLONG)0;
+ key.token = (DWORD)0;
+ key.tokenType = (DWORD)0;
+ key.hClass = (DWORDLONG)0;
+ key.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.hField = (DWORDLONG)pResolvedToken->hField;
+ key.typeSpec_Index = (DWORD)0;
+ key.cbTypeSpec = (DWORD)0;
key.methodSpec_Index = (DWORD)0;
- key.cbMethodSpec = (DWORD)0;
+ key.cbMethodSpec = (DWORD)0;
CORINFO_CLASS_HANDLE value = (CORINFO_CLASS_HANDLE)GetTokenTypeAsHandle->Get(key);
return value;
}
-void MethodContext::recGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_ACCESS_FLAGS flags,
- CORINFO_FIELD_INFO *pResult)
+void MethodContext::recGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_ACCESS_FLAGS flags,
+ CORINFO_FIELD_INFO* pResult)
{
if (GetFieldInfo == nullptr)
GetFieldInfo = new LightWeightMap<Agnostic_GetFieldInfo, Agnostic_CORINFO_FIELD_INFO>();
Agnostic_GetFieldInfo key;
- ZeroMemory(&key, sizeof(Agnostic_GetFieldInfo)); //Since dd has nested structs, and we use memcmp to compare, we need to zero out the padding bytes too
+ ZeroMemory(&key, sizeof(Agnostic_GetFieldInfo)); // Since dd has nested structs, and we use memcmp to compare, we
+ // need to zero out the padding bytes too
Agnostic_CORINFO_FIELD_INFO value;
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)GetFieldInfo->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)GetFieldInfo->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)GetFieldInfo->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)GetFieldInfo->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.callerHandle = (DWORDLONG)callerHandle;
- key.flags = (DWORD)flags;
-
- value.fieldAccessor = (DWORD)pResult->fieldAccessor;
- value.fieldFlags = (DWORD)pResult->fieldFlags;
- value.helper = (DWORD)pResult->helper;
- value.offset = (DWORD)pResult->offset;
- value.fieldType = (DWORD)pResult->fieldType;
- value.structType = (DWORDLONG)pResult->structType;
- value.accessAllowed = (DWORD)pResult->accessAllowed;
+ key.callerHandle = (DWORDLONG)callerHandle;
+ key.flags = (DWORD)flags;
+
+ value.fieldAccessor = (DWORD)pResult->fieldAccessor;
+ value.fieldFlags = (DWORD)pResult->fieldFlags;
+ value.helper = (DWORD)pResult->helper;
+ value.offset = (DWORD)pResult->offset;
+ value.fieldType = (DWORD)pResult->fieldType;
+ value.structType = (DWORDLONG)pResult->structType;
+ value.accessAllowed = (DWORD)pResult->accessAllowed;
value.accessCalloutHelper.helperNum = (DWORD)pResult->accessCalloutHelper.helperNum;
- value.accessCalloutHelper.numArgs = (DWORD)pResult->accessCalloutHelper.numArgs;
+ value.accessCalloutHelper.numArgs = (DWORD)pResult->accessCalloutHelper.numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
value.accessCalloutHelper.args[i].constant = (DWORDLONG)pResult->accessCalloutHelper.args[i].constant;
- value.accessCalloutHelper.args[i].argType = (DWORD)pResult->accessCalloutHelper.args[i].argType;
+ value.accessCalloutHelper.args[i].argType = (DWORD)pResult->accessCalloutHelper.args[i].argType;
}
GetFieldInfo->Add(key, value);
DEBUG_REC(dmpGetFieldInfo(key, value));
}
void MethodContext::dmpGetFieldInfo(const Agnostic_GetFieldInfo& key, const Agnostic_CORINFO_FIELD_INFO& value)
{
- printf("GetFieldInfo key ch-%016llX flg-%08X rt{tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX tsi-%u cbts-%u msi-%u cbms-%u}",
- key.callerHandle,
- key.flags,
- key.ResolvedToken.tokenContext,
- key.ResolvedToken.tokenScope,
- key.ResolvedToken.token,
- key.ResolvedToken.tokenType,
- key.ResolvedToken.hClass,
- key.ResolvedToken.hMethod,
- key.ResolvedToken.hField,
- key.ResolvedToken.typeSpec_Index,
- key.ResolvedToken.cbTypeSpec,
- key.ResolvedToken.methodSpec_Index,
- key.ResolvedToken.cbMethodSpec);
-
- printf(", value fa-%u fflg-%08X hlp-%u off-%u fT-%u(%s) sT-%016llX aa-%u hnum-%u na-%u {",
- value.fieldAccessor,
- value.fieldFlags,
- value.helper,
- value.offset,
- value.fieldType,
- toString((CorInfoType)value.fieldType),
- value.structType,
- value.accessAllowed,
- value.accessCalloutHelper.helperNum,
- value.accessCalloutHelper.numArgs);
+ printf("GetFieldInfo key ch-%016llX flg-%08X rt{tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX "
+ "fld-%016llX tsi-%u cbts-%u msi-%u cbms-%u}",
+ key.callerHandle, key.flags, key.ResolvedToken.tokenContext, key.ResolvedToken.tokenScope,
+ key.ResolvedToken.token, key.ResolvedToken.tokenType, key.ResolvedToken.hClass, key.ResolvedToken.hMethod,
+ key.ResolvedToken.hField, key.ResolvedToken.typeSpec_Index, key.ResolvedToken.cbTypeSpec,
+ key.ResolvedToken.methodSpec_Index, key.ResolvedToken.cbMethodSpec);
+
+ printf(", value fa-%u fflg-%08X hlp-%u off-%u fT-%u(%s) sT-%016llX aa-%u hnum-%u na-%u {", value.fieldAccessor,
+ value.fieldFlags, value.helper, value.offset, value.fieldType, toString((CorInfoType)value.fieldType),
+ value.structType, value.accessAllowed, value.accessCalloutHelper.helperNum,
+ value.accessCalloutHelper.numArgs);
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
switch ((CorInfoAccessAllowedHelperArgType)value.accessCalloutHelper.args[i].argType)
{
- default:
- printf("{%u: illegal}", i);
- break;
- case CORINFO_HELPER_ARG_TYPE_Field:
- printf("{%u: fld-%016llX}", i, value.accessCalloutHelper.args[i].constant);
- break;
- case CORINFO_HELPER_ARG_TYPE_Method:
- printf("{%u: mth-%016llX}", i, value.accessCalloutHelper.args[i].constant);
- break;
- case CORINFO_HELPER_ARG_TYPE_Class:
- printf("{%u: cls-%016llX}", i, value.accessCalloutHelper.args[i].constant);
- break;
- case CORINFO_HELPER_ARG_TYPE_Module:
- printf("{%u: mod-%016llX}", i, value.accessCalloutHelper.args[i].constant);
- break;
- case CORINFO_HELPER_ARG_TYPE_Const:
- printf("{%u: const-%016llX}", i, value.accessCalloutHelper.args[i].constant);
- break;
+ default:
+ printf("{%u: illegal}", i);
+ break;
+ case CORINFO_HELPER_ARG_TYPE_Field:
+ printf("{%u: fld-%016llX}", i, value.accessCalloutHelper.args[i].constant);
+ break;
+ case CORINFO_HELPER_ARG_TYPE_Method:
+ printf("{%u: mth-%016llX}", i, value.accessCalloutHelper.args[i].constant);
+ break;
+ case CORINFO_HELPER_ARG_TYPE_Class:
+ printf("{%u: cls-%016llX}", i, value.accessCalloutHelper.args[i].constant);
+ break;
+ case CORINFO_HELPER_ARG_TYPE_Module:
+ printf("{%u: mod-%016llX}", i, value.accessCalloutHelper.args[i].constant);
+ break;
+ case CORINFO_HELPER_ARG_TYPE_Const:
+ printf("{%u: const-%016llX}", i, value.accessCalloutHelper.args[i].constant);
+ break;
}
}
printf("}");
}
-void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_ACCESS_FLAGS flags,
- CORINFO_FIELD_INFO *pResult)
+void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_ACCESS_FLAGS flags,
+ CORINFO_FIELD_INFO* pResult)
{
Agnostic_GetFieldInfo key;
- ZeroMemory(&key, sizeof(Agnostic_GetFieldInfo)); //Since dd has nested structs, and we use memcmp to compare, we need to zero out the padding bytes too
+ ZeroMemory(&key, sizeof(Agnostic_GetFieldInfo)); // Since dd has nested structs, and we use memcmp to compare, we
+ // need to zero out the padding bytes too
Agnostic_CORINFO_FIELD_INFO value;
AssertCodeMsg(GetFieldInfo != nullptr, EXCEPTIONCODE_MC, "Didn't find %x", pResolvedToken->token);
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)GetFieldInfo->Contains((unsigned char *)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)GetFieldInfo->Contains((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)GetFieldInfo->Contains((unsigned char *)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)GetFieldInfo->Contains((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.callerHandle = (DWORDLONG)callerHandle;
- key.flags = (DWORD)flags;
+ key.callerHandle = (DWORDLONG)callerHandle;
+ key.flags = (DWORD)flags;
DWORD origFlag = key.flags;
@@ -3516,7 +3623,8 @@ void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORI
key.flags = origFlag ^ ((DWORD)CORINFO_ACCESS_THIS | (DWORD)CORINFO_ACCESS_UNWRAP);
if (GetFieldInfo->GetIndex(key) != -1)
{
- LogDebug("Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_UNWRAP|CORINFO_ACCESS_THIS");
+ LogDebug(
+ "Sparse - repGetFieldInfo found value with inverted CORINFO_ACCESS_UNWRAP|CORINFO_ACCESS_THIS");
}
else
{
@@ -3538,24 +3646,27 @@ void MethodContext::repGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORI
value = GetFieldInfo->Get(key);
- pResult->fieldAccessor = (CORINFO_FIELD_ACCESSOR)value.fieldAccessor;
- pResult->fieldFlags = (unsigned)value.fieldFlags;
- pResult->helper = (CorInfoHelpFunc)value.helper;
- pResult->offset = (DWORD)value.offset;
- pResult->fieldType = (CorInfoType)value.fieldType;
- pResult->structType = (CORINFO_CLASS_HANDLE)value.structType;
- pResult->accessAllowed = (CorInfoIsAccessAllowedResult)value.accessAllowed;
+ pResult->fieldAccessor = (CORINFO_FIELD_ACCESSOR)value.fieldAccessor;
+ pResult->fieldFlags = (unsigned)value.fieldFlags;
+ pResult->helper = (CorInfoHelpFunc)value.helper;
+ pResult->offset = (DWORD)value.offset;
+ pResult->fieldType = (CorInfoType)value.fieldType;
+ pResult->structType = (CORINFO_CLASS_HANDLE)value.structType;
+ pResult->accessAllowed = (CorInfoIsAccessAllowedResult)value.accessAllowed;
pResult->accessCalloutHelper.helperNum = (CorInfoHelpFunc)value.accessCalloutHelper.helperNum;
- pResult->accessCalloutHelper.numArgs = (unsigned)value.accessCalloutHelper.numArgs;
+ pResult->accessCalloutHelper.numArgs = (unsigned)value.accessCalloutHelper.numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
pResult->accessCalloutHelper.args[i].constant = (size_t)value.accessCalloutHelper.args[i].constant;
- pResult->accessCalloutHelper.args[i].argType = (CorInfoAccessAllowedHelperArgType)value.accessCalloutHelper.args[i].argType;
+ pResult->accessCalloutHelper.args[i].argType =
+ (CorInfoAccessAllowedHelperArgType)value.accessCalloutHelper.args[i].argType;
}
DEBUG_REP(dmpGetFieldInfo(key, value));
}
-void MethodContext::recEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void **ppIndirection, CORINFO_METHOD_HANDLE result)
+void MethodContext::recEmbedMethodHandle(CORINFO_METHOD_HANDLE handle,
+ void** ppIndirection,
+ CORINFO_METHOD_HANDLE result)
{
if (EmbedMethodHandle == nullptr)
EmbedMethodHandle = new LightWeightMap<DWORDLONG, DLDL>();
@@ -3565,7 +3676,7 @@ void MethodContext::recEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void **pp
value.A = (DWORDLONG)0;
else
value.A = (DWORDLONG)*ppIndirection;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
EmbedMethodHandle->Add((DWORDLONG)handle, value);
DEBUG_REC(dmpEmbedMethodHandle((DWORDLONG)handle, value));
@@ -3574,21 +3685,23 @@ void MethodContext::dmpEmbedMethodHandle(DWORDLONG key, DLDL value)
{
printf("EmbedMethodHandle key ftn-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-CORINFO_METHOD_HANDLE MethodContext::repEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void **ppIndirection)
+CORINFO_METHOD_HANDLE MethodContext::repEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection)
{
DLDL value;
- AssertCodeMsg(EmbedMethodHandle != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)handle);
- AssertCodeMsg(EmbedMethodHandle->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)handle);
+ AssertCodeMsg(EmbedMethodHandle != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)handle);
+ AssertCodeMsg(EmbedMethodHandle->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)handle);
value = EmbedMethodHandle->Get((DWORDLONG)handle);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
DEBUG_REP(dmpEmbedMethodHandle((DWORDLONG)handle, value));
return (CORINFO_METHOD_HANDLE)value.B;
}
-void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndirection, void *result, CorInfoType cit)
+void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection, void* result, CorInfoType cit)
{
if (GetFieldAddress == nullptr)
GetFieldAddress = new LightWeightMap<DWORDLONG, Agnostic_GetFieldAddress>();
@@ -3598,44 +3711,55 @@ void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndi
value.ppIndirection = (DWORDLONG)0;
else
value.ppIndirection = (DWORDLONG)*ppIndirection;
- value.fieldAddress = (DWORDLONG)result;
+ value.fieldAddress = (DWORDLONG)result;
value.fieldValue = (DWORD)-1;
// Make an attempt at stashing a copy of the value
- if (result > (void*)0xffff) //TODO-Cleanup: sometimes there is a field offset?
+ if (result > (void*)0xffff) // TODO-Cleanup: sometimes there is a field offset?
{
DWORDLONG scratch = 0x4242424242424242;
switch (cit)
{
- case CORINFO_TYPE_BOOL:
- case CORINFO_TYPE_BYTE:
- case CORINFO_TYPE_UBYTE:
- value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(BYTE), true);//important to not merge two fields into one address
- break;
- case CORINFO_TYPE_CHAR:
- case CORINFO_TYPE_SHORT:
- case CORINFO_TYPE_USHORT:
- value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(WORD), true);//important to not merge two fields into one address
- break;
- case CORINFO_TYPE_INT:
- case CORINFO_TYPE_UINT:
- case CORINFO_TYPE_FLOAT:
- value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(DWORD), true);//important to not merge two fields into one address
- break;
- case CORINFO_TYPE_LONG:
- case CORINFO_TYPE_ULONG:
- case CORINFO_TYPE_DOUBLE:
- value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(DWORDLONG), true);//important to not merge two fields into one address
- break;
- case CORINFO_TYPE_NATIVEINT:
- case CORINFO_TYPE_NATIVEUINT:
- case CORINFO_TYPE_PTR:
- value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(size_t), true);//important to not merge two fields into one address
- GetFieldAddress->AddBuffer((unsigned char*)&scratch, sizeof(DWORD)); //Padding out the data so we can read it back "safetly" on x64
- break;
- default:
- break;
+ case CORINFO_TYPE_BOOL:
+ case CORINFO_TYPE_BYTE:
+ case CORINFO_TYPE_UBYTE:
+ value.fieldValue =
+ (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(BYTE),
+ true); // important to not merge two fields into one address
+ break;
+ case CORINFO_TYPE_CHAR:
+ case CORINFO_TYPE_SHORT:
+ case CORINFO_TYPE_USHORT:
+ value.fieldValue =
+ (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(WORD),
+ true); // important to not merge two fields into one address
+ break;
+ case CORINFO_TYPE_INT:
+ case CORINFO_TYPE_UINT:
+ case CORINFO_TYPE_FLOAT:
+ value.fieldValue =
+ (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(DWORD),
+ true); // important to not merge two fields into one address
+ break;
+ case CORINFO_TYPE_LONG:
+ case CORINFO_TYPE_ULONG:
+ case CORINFO_TYPE_DOUBLE:
+ value.fieldValue =
+ (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(DWORDLONG),
+ true); // important to not merge two fields into one address
+ break;
+ case CORINFO_TYPE_NATIVEINT:
+ case CORINFO_TYPE_NATIVEUINT:
+ case CORINFO_TYPE_PTR:
+ value.fieldValue =
+ (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(size_t),
+ true); // important to not merge two fields into one address
+ GetFieldAddress->AddBuffer((unsigned char*)&scratch, sizeof(DWORD)); // Padding out the data so we can
+ // read it back "safetly" on x64
+ break;
+ default:
+ break;
}
}
GetFieldAddress->Add((DWORDLONG)field, value);
@@ -3643,17 +3767,18 @@ void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndi
}
void MethodContext::dmpGetFieldAddress(DWORDLONG key, const Agnostic_GetFieldAddress& value)
{
- printf("GetFieldAddress key fld-%016llX, value ppi-%016llX addr-%016llX val-%u", key, value.ppIndirection, value.fieldAddress, value.fieldValue);
+ printf("GetFieldAddress key fld-%016llX, value ppi-%016llX addr-%016llX val-%u", key, value.ppIndirection,
+ value.fieldAddress, value.fieldValue);
}
-void* MethodContext::repGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndirection)
+void* MethodContext::repGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection)
{
Agnostic_GetFieldAddress value;
value = GetFieldAddress->Get((DWORDLONG)field);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.ppIndirection;
- void *temp;
+ *ppIndirection = (void*)value.ppIndirection;
+ void* temp;
if (value.fieldValue != (DWORD)-1)
{
@@ -3667,16 +3792,16 @@ void* MethodContext::repGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppInd
return temp;
}
-void MethodContext::recGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE *gcPtrs, unsigned len, unsigned result)
+void MethodContext::recGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE* gcPtrs, unsigned len, unsigned result)
{
if (GetClassGClayout == nullptr)
GetClassGClayout = new LightWeightMap<DWORDLONG, Agnostic_GetClassGClayout>();
Agnostic_GetClassGClayout value;
- value.gcPtrs_Index = (DWORD)GetClassGClayout->AddBuffer((unsigned char*)gcPtrs, len*sizeof(BYTE));
- value.len = (DWORD)len;
- value.valCount = (DWORD)result;
+ value.gcPtrs_Index = (DWORD)GetClassGClayout->AddBuffer((unsigned char*)gcPtrs, len * sizeof(BYTE));
+ value.len = (DWORD)len;
+ value.valCount = (DWORD)result;
GetClassGClayout->Add((DWORDLONG)cls, value);
DEBUG_REC(dmpGetClassGClayout((DWORDLONG)cls, value));
@@ -3686,7 +3811,7 @@ void MethodContext::dmpGetClassGClayout(DWORDLONG key, const Agnostic_GetClassGC
printf("GetClassGCLayout key %016llX, value len %u cnt %u {", key, value.len, value.valCount);
if (value.gcPtrs_Index != -1)
{
- BYTE *ptr = (BYTE *)GetClassGClayout->GetBuffer(value.gcPtrs_Index);
+ BYTE* ptr = (BYTE*)GetClassGClayout->GetBuffer(value.gcPtrs_Index);
for (unsigned int i = 0; i < value.len; i++)
{
printf("0x%02x", ptr[i]);
@@ -3697,22 +3822,23 @@ void MethodContext::dmpGetClassGClayout(DWORDLONG key, const Agnostic_GetClassGC
}
printf("}");
}
-unsigned MethodContext::repGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE *gcPtrs)
+unsigned MethodContext::repGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE* gcPtrs)
{
Agnostic_GetClassGClayout value;
AssertCodeMsg(GetClassGClayout != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)cls);
- AssertCodeMsg(GetClassGClayout->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetClassGClayout->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)cls);
value = GetClassGClayout->Get((DWORDLONG)cls);
- unsigned int len = (unsigned int)value.len;
+ unsigned int len = (unsigned int)value.len;
unsigned int index = (unsigned int)value.gcPtrs_Index;
if (index != -1)
{
- BYTE *ptr = (BYTE *)GetClassGClayout->GetBuffer(index);
+ BYTE* ptr = (BYTE*)GetClassGClayout->GetBuffer(index);
for (unsigned int i = 0; i < len; i++)
- gcPtrs[i] = ptr[i];
+ gcPtrs[i] = ptr[i];
}
DEBUG_REP(dmpGetClassGClayout((DWORDLONG)cls, value));
return (unsigned)value.valCount;
@@ -3723,7 +3849,8 @@ void MethodContext::recGetClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BO
if (GetClassAlignmentRequirement == nullptr)
GetClassAlignmentRequirement = new LightWeightMap<DLD, DWORD>();
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
+ 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)cls;
key.B = (DWORD)fDoubleAlignHint;
@@ -3738,7 +3865,8 @@ void MethodContext::dmpGetClassAlignmentRequirement(DLD key, DWORD value)
unsigned MethodContext::repGetClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint)
{
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
+ 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)cls;
key.B = (DWORD)fDoubleAlignHint;
@@ -3747,36 +3875,41 @@ unsigned MethodContext::repGetClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls
return result;
}
-void MethodContext::recCanAccessClass(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_HELPER_DESC *pAccessHelper, CorInfoIsAccessAllowedResult result)
+void MethodContext::recCanAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_HELPER_DESC* pAccessHelper,
+ CorInfoIsAccessAllowedResult result)
{
if (CanAccessClass == nullptr)
CanAccessClass = new LightWeightMap<Agnostic_CanAccessClassIn, Agnostic_CanAccessClassOut>();
Agnostic_CanAccessClassIn key;
- ZeroMemory(&key, sizeof(Agnostic_CanAccessClassIn)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CanAccessClassIn)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CanAccessClassOut value;
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)CanAccessClass->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)CanAccessClass->AddBuffer((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)CanAccessClass->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)CanAccessClass->AddBuffer((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.callerHandle = (DWORDLONG)callerHandle;
+ key.callerHandle = (DWORDLONG)callerHandle;
value.AccessHelper.helperNum = (DWORD)pAccessHelper->helperNum;
- value.AccessHelper.numArgs = (DWORD)pAccessHelper->numArgs;
+ value.AccessHelper.numArgs = (DWORD)pAccessHelper->numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
value.AccessHelper.args[i].constant = (DWORDLONG)pAccessHelper->args[i].constant;
- value.AccessHelper.args[i].argType = (DWORD)pAccessHelper->args[i].argType;
+ value.AccessHelper.args[i].argType = (DWORD)pAccessHelper->args[i].argType;
}
value.result = (DWORD)result;
@@ -3785,85 +3918,82 @@ void MethodContext::recCanAccessClass(CORINFO_RESOLVED_TOKEN *pResolvedToken, CO
}
void MethodContext::dmpCanAccessClass(const Agnostic_CanAccessClassIn& key, const Agnostic_CanAccessClassOut& value)
{
- printf("CanAccessClass key tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u mi-%u ms-%u",
- key.ResolvedToken.tokenContext,
- key.ResolvedToken.tokenScope,
- key.ResolvedToken.token,
- key.ResolvedToken.tokenType,
- key.ResolvedToken.hClass,
- key.ResolvedToken.hMethod,
- key.ResolvedToken.hField,
- key.ResolvedToken.typeSpec_Index,
- key.ResolvedToken.cbTypeSpec,
- key.ResolvedToken.methodSpec_Index,
- key.ResolvedToken.cbMethodSpec);
- printf(", value hnum-%u na-%u {",
- value.AccessHelper.helperNum,
- value.AccessHelper.numArgs);
+ printf("CanAccessClass key tc-%016llX ts-%016llX tok-%08X tt-%u cls-%016llX meth-%016llX fld-%016llX ti-%u ts-%u "
+ "mi-%u ms-%u",
+ key.ResolvedToken.tokenContext, key.ResolvedToken.tokenScope, key.ResolvedToken.token,
+ key.ResolvedToken.tokenType, key.ResolvedToken.hClass, key.ResolvedToken.hMethod, key.ResolvedToken.hField,
+ key.ResolvedToken.typeSpec_Index, key.ResolvedToken.cbTypeSpec, key.ResolvedToken.methodSpec_Index,
+ key.ResolvedToken.cbMethodSpec);
+ printf(", value hnum-%u na-%u {", value.AccessHelper.helperNum, value.AccessHelper.numArgs);
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
- printf("{%016llX %u}",
- value.AccessHelper.args[i].constant,
- value.AccessHelper.args[i].argType);
+ printf("{%016llX %u}", value.AccessHelper.args[i].constant, value.AccessHelper.args[i].argType);
}
printf("} res-%u", value.result);
}
-CorInfoIsAccessAllowedResult MethodContext::repCanAccessClass(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_HELPER_DESC *pAccessHelper)
+CorInfoIsAccessAllowedResult MethodContext::repCanAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_HELPER_DESC* pAccessHelper)
{
Agnostic_CanAccessClassIn key;
- ZeroMemory(&key, sizeof(Agnostic_CanAccessClassIn)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CanAccessClassIn)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_CanAccessClassOut value;
- AssertCodeMsg(CanAccessClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)pResolvedToken->hClass);
+ AssertCodeMsg(CanAccessClass != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)pResolvedToken->hClass);
key.ResolvedToken.tokenContext = (DWORDLONG)pResolvedToken->tokenContext;
- key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
- key.ResolvedToken.token = (DWORD)pResolvedToken->token;
- key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
- key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
- key.ResolvedToken.typeSpec_Index = (DWORD)CanAccessClass->Contains((unsigned char *)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
+ key.ResolvedToken.tokenScope = (DWORDLONG)pResolvedToken->tokenScope;
+ key.ResolvedToken.token = (DWORD)pResolvedToken->token;
+ key.ResolvedToken.tokenType = (DWORD)pResolvedToken->tokenType;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)pResolvedToken->hMethod;
+ key.ResolvedToken.hField = (DWORDLONG)pResolvedToken->hField;
+ key.ResolvedToken.typeSpec_Index =
+ (DWORD)CanAccessClass->Contains((unsigned char*)pResolvedToken->pTypeSpec, pResolvedToken->cbTypeSpec);
key.ResolvedToken.cbTypeSpec = (DWORD)pResolvedToken->cbTypeSpec;
- key.ResolvedToken.methodSpec_Index = (DWORD)CanAccessClass->Contains((unsigned char *)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
+ key.ResolvedToken.methodSpec_Index =
+ (DWORD)CanAccessClass->Contains((unsigned char*)pResolvedToken->pMethodSpec, pResolvedToken->cbMethodSpec);
key.ResolvedToken.cbMethodSpec = (DWORD)pResolvedToken->cbMethodSpec;
- key.callerHandle = (DWORDLONG)callerHandle;
+ key.callerHandle = (DWORDLONG)callerHandle;
- AssertCodeMsg(CanAccessClass->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)pResolvedToken->hClass);
+ AssertCodeMsg(CanAccessClass->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)pResolvedToken->hClass);
value = CanAccessClass->Get(key);
pAccessHelper->helperNum = (CorInfoHelpFunc)value.AccessHelper.helperNum;
- pAccessHelper->numArgs = (unsigned)value.AccessHelper.numArgs;
+ pAccessHelper->numArgs = (unsigned)value.AccessHelper.numArgs;
for (int i = 0; i < CORINFO_ACCESS_ALLOWED_MAX_ARGS; i++)
{
pAccessHelper->args[i].constant = (size_t)value.AccessHelper.args[i].constant;
- pAccessHelper->args[i].argType = (CorInfoAccessAllowedHelperArgType)value.AccessHelper.args[i].argType;
+ pAccessHelper->args[i].argType = (CorInfoAccessAllowedHelperArgType)value.AccessHelper.args[i].argType;
}
CorInfoIsAccessAllowedResult temp = (CorInfoIsAccessAllowedResult)value.result;
DEBUG_REP(dmpCanAccessClass(key, value));
return temp;
}
-void MethodContext::recGetCastingHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, bool fThrowing, CorInfoHelpFunc result)
+void MethodContext::recGetCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing, CorInfoHelpFunc result)
{
if (GetCastingHelper == nullptr)
GetCastingHelper = new LightWeightMap<Agnostic_GetCastingHelper, DWORD>();
Agnostic_GetCastingHelper key;
- ZeroMemory(&key, sizeof(Agnostic_GetCastingHelper)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.ResolvedToken.tokenContext = (DWORDLONG)0;
- key.ResolvedToken.tokenScope = (DWORDLONG)0;
- key.ResolvedToken.token = (DWORD)0;
- key.ResolvedToken.tokenType = (DWORD)0;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)0;
- key.ResolvedToken.hField = (DWORDLONG)0;
- key.ResolvedToken.typeSpec_Index = (DWORD)0;
- key.ResolvedToken.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_GetCastingHelper)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.ResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ResolvedToken.token = (DWORD)0;
+ key.ResolvedToken.tokenType = (DWORD)0;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)0;
+ key.ResolvedToken.hField = (DWORDLONG)0;
+ key.ResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ResolvedToken.cbTypeSpec = (DWORD)0;
key.ResolvedToken.methodSpec_Index = (DWORD)0;
- key.ResolvedToken.cbMethodSpec = (DWORD)0;
- key.fThrowing = (DWORD)fThrowing;
+ key.ResolvedToken.cbMethodSpec = (DWORD)0;
+ key.fThrowing = (DWORD)fThrowing;
GetCastingHelper->Add(key, (DWORD)result);
}
@@ -3871,29 +4001,32 @@ void MethodContext::dmpGetCastingHelper(const Agnostic_GetCastingHelper& key, DW
{
printf("GetCastingHelper key cls-%016llX, thw-%u, value res-%u", key.ResolvedToken.hClass, key.fThrowing, value);
}
-CorInfoHelpFunc MethodContext::repGetCastingHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, bool fThrowing)
+CorInfoHelpFunc MethodContext::repGetCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing)
{
Agnostic_GetCastingHelper key;
- ZeroMemory(&key, sizeof(Agnostic_GetCastingHelper)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.ResolvedToken.tokenContext = (DWORDLONG)0;
- key.ResolvedToken.tokenScope = (DWORDLONG)0;
- key.ResolvedToken.token = (DWORD)0;
- key.ResolvedToken.tokenType = (DWORD)0;
- key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
- key.ResolvedToken.hMethod = (DWORDLONG)0;
- key.ResolvedToken.hField = (DWORDLONG)0;
- key.ResolvedToken.typeSpec_Index = (DWORD)0;
- key.ResolvedToken.cbTypeSpec = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_GetCastingHelper)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.ResolvedToken.tokenContext = (DWORDLONG)0;
+ key.ResolvedToken.tokenScope = (DWORDLONG)0;
+ key.ResolvedToken.token = (DWORD)0;
+ key.ResolvedToken.tokenType = (DWORD)0;
+ key.ResolvedToken.hClass = (DWORDLONG)pResolvedToken->hClass;
+ key.ResolvedToken.hMethod = (DWORDLONG)0;
+ key.ResolvedToken.hField = (DWORDLONG)0;
+ key.ResolvedToken.typeSpec_Index = (DWORD)0;
+ key.ResolvedToken.cbTypeSpec = (DWORD)0;
key.ResolvedToken.methodSpec_Index = (DWORD)0;
- key.ResolvedToken.cbMethodSpec = (DWORD)0;
- key.fThrowing = (DWORD)fThrowing;
+ key.ResolvedToken.cbMethodSpec = (DWORD)0;
+ key.fThrowing = (DWORD)fThrowing;
CorInfoHelpFunc value = (CorInfoHelpFunc)GetCastingHelper->Get(key);
return value;
}
-void MethodContext::recEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void **ppIndirection, CORINFO_MODULE_HANDLE result)
+void MethodContext::recEmbedModuleHandle(CORINFO_MODULE_HANDLE handle,
+ void** ppIndirection,
+ CORINFO_MODULE_HANDLE result)
{
if (EmbedModuleHandle == nullptr)
EmbedModuleHandle = new LightWeightMap<DWORDLONG, DLDL>();
@@ -3903,7 +4036,7 @@ void MethodContext::recEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void **pp
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
EmbedModuleHandle->Add((DWORDLONG)handle, value);
}
@@ -3911,7 +4044,7 @@ void MethodContext::dmpEmbedModuleHandle(DWORDLONG key, DLDL value)
{
printf("EmbedModuleHandle key mod-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-CORINFO_MODULE_HANDLE MethodContext::repEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void **ppIndirection)
+CORINFO_MODULE_HANDLE MethodContext::repEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection)
{
DLDL value;
@@ -3919,10 +4052,9 @@ CORINFO_MODULE_HANDLE MethodContext::repEmbedModuleHandle(CORINFO_MODULE_HANDLE
if (ppIndirection != nullptr)
*ppIndirection = (void*)value.A;
return (CORINFO_MODULE_HANDLE)value.B;
-
}
-void MethodContext::recEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void **ppIndirection, CORINFO_CLASS_HANDLE result)
+void MethodContext::recEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection, CORINFO_CLASS_HANDLE result)
{
if (EmbedClassHandle == nullptr)
EmbedClassHandle = new LightWeightMap<DWORDLONG, DLDL>();
@@ -3932,7 +4064,7 @@ void MethodContext::recEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void **ppIn
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
EmbedClassHandle->Add((DWORDLONG)handle, value);
DEBUG_REC(dmpEmbedClassHandle((DWORDLONG)handle, value));
@@ -3941,12 +4073,13 @@ void MethodContext::dmpEmbedClassHandle(DWORDLONG key, DLDL value)
{
printf("EmbedClassHandle key cls-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-CORINFO_CLASS_HANDLE MethodContext::repEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void **ppIndirection)
+CORINFO_CLASS_HANDLE MethodContext::repEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection)
{
DLDL value;
AssertCodeMsg(EmbedClassHandle != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)handle);
- AssertCodeMsg(EmbedClassHandle->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)handle);
+ AssertCodeMsg(EmbedClassHandle->GetIndex((DWORDLONG)handle) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)handle);
value = EmbedClassHandle->Get((DWORDLONG)handle);
if (ppIndirection != nullptr)
*ppIndirection = (void*)value.A;
@@ -3954,27 +4087,31 @@ CORINFO_CLASS_HANDLE MethodContext::repEmbedClassHandle(CORINFO_CLASS_HANDLE han
return (CORINFO_CLASS_HANDLE)value.B;
}
-void MethodContext::recPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig, BOOL result)
+void MethodContext::recPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method,
+ CORINFO_SIG_INFO* callSiteSig,
+ BOOL result)
{
if (PInvokeMarshalingRequired == nullptr)
PInvokeMarshalingRequired = new LightWeightMap<Agnostic_PInvokeMarshalingRequired, DWORD>();
Agnostic_PInvokeMarshalingRequired key;
- ZeroMemory(&key, sizeof(Agnostic_PInvokeMarshalingRequired)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.method = (DWORDLONG)method;
- key.callSiteSig.callConv = (DWORD)0;
- key.callSiteSig.retTypeClass = (DWORDLONG)0;
- key.callSiteSig.retTypeSigClass = (DWORDLONG)0;
- key.callSiteSig.retType = (DWORD)0;
- key.callSiteSig.flags = (DWORD)0;
- key.callSiteSig.numArgs = (DWORD)0;
- key.callSiteSig.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_PInvokeMarshalingRequired)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.method = (DWORDLONG)method;
+ key.callSiteSig.callConv = (DWORD)0;
+ key.callSiteSig.retTypeClass = (DWORDLONG)0;
+ key.callSiteSig.retTypeSigClass = (DWORDLONG)0;
+ key.callSiteSig.retType = (DWORD)0;
+ key.callSiteSig.flags = (DWORD)0;
+ key.callSiteSig.numArgs = (DWORD)0;
+ key.callSiteSig.sigInst_classInstCount = (DWORD)0;
key.callSiteSig.sigInst_classInst_Index = (DWORD)0;
- key.callSiteSig.sigInst_methInstCount = (DWORD)0;
- key.callSiteSig.sigInst_methInst_Index = (DWORD)0;
- key.callSiteSig.args = (DWORDLONG)0;
- key.callSiteSig.pSig = (DWORD)PInvokeMarshalingRequired->AddBuffer((unsigned char*)callSiteSig->pSig, callSiteSig->cbSig);
+ key.callSiteSig.sigInst_methInstCount = (DWORD)0;
+ key.callSiteSig.sigInst_methInst_Index = (DWORD)0;
+ key.callSiteSig.args = (DWORDLONG)0;
+ key.callSiteSig.pSig =
+ (DWORD)PInvokeMarshalingRequired->AddBuffer((unsigned char*)callSiteSig->pSig, callSiteSig->cbSig);
key.callSiteSig.cbSig = (DWORD)callSiteSig->cbSig;
key.callSiteSig.scope = (DWORDLONG)callSiteSig->scope;
key.callSiteSig.token = (DWORD)0;
@@ -3984,34 +4121,33 @@ void MethodContext::recPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, C
}
void MethodContext::dmpPInvokeMarshalingRequired(const Agnostic_PInvokeMarshalingRequired& key, DWORD value)
{
- printf("PInvokeMarshalingRequired key mth-%016llX scp-%016llX sig-%u, value res-%u",
- key.method,
- key.callSiteSig.scope,
- key.callSiteSig.pSig,
- value);
+ printf("PInvokeMarshalingRequired key mth-%016llX scp-%016llX sig-%u, value res-%u", key.method,
+ key.callSiteSig.scope, key.callSiteSig.pSig, value);
}
-//Note the jit interface implementation seems to only care about scope and pSig from callSiteSig
+// Note the jit interface implementation seems to only care about scope and pSig from callSiteSig
BOOL MethodContext::repPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig)
{
- if (PInvokeMarshalingRequired == nullptr)//so when we replay checked on free, we throw from lwm
- return TRUE; // TODO-Cleanup: hackish...
+ if (PInvokeMarshalingRequired == nullptr) // so when we replay checked on free, we throw from lwm
+ return TRUE; // TODO-Cleanup: hackish...
Agnostic_PInvokeMarshalingRequired key;
- ZeroMemory(&key, sizeof(Agnostic_PInvokeMarshalingRequired)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.method = (DWORDLONG)method;
- key.callSiteSig.callConv = (DWORD)0;
- key.callSiteSig.retTypeClass = (DWORDLONG)0;
- key.callSiteSig.retTypeSigClass = (DWORDLONG)0;
- key.callSiteSig.retType = (DWORD)0;
- key.callSiteSig.flags = (DWORD)0;
- key.callSiteSig.numArgs = (DWORD)0;
- key.callSiteSig.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_PInvokeMarshalingRequired)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.method = (DWORDLONG)method;
+ key.callSiteSig.callConv = (DWORD)0;
+ key.callSiteSig.retTypeClass = (DWORDLONG)0;
+ key.callSiteSig.retTypeSigClass = (DWORDLONG)0;
+ key.callSiteSig.retType = (DWORD)0;
+ key.callSiteSig.flags = (DWORD)0;
+ key.callSiteSig.numArgs = (DWORD)0;
+ key.callSiteSig.sigInst_classInstCount = (DWORD)0;
key.callSiteSig.sigInst_classInst_Index = (DWORD)0;
- key.callSiteSig.sigInst_methInstCount = (DWORD)0;
- key.callSiteSig.sigInst_methInst_Index = (DWORD)0;
- key.callSiteSig.args = (DWORDLONG)0;
- key.callSiteSig.pSig = (DWORD)PInvokeMarshalingRequired->Contains((unsigned char*)callSiteSig->pSig, callSiteSig->cbSig);
+ key.callSiteSig.sigInst_methInstCount = (DWORD)0;
+ key.callSiteSig.sigInst_methInst_Index = (DWORD)0;
+ key.callSiteSig.args = (DWORDLONG)0;
+ key.callSiteSig.pSig =
+ (DWORD)PInvokeMarshalingRequired->Contains((unsigned char*)callSiteSig->pSig, callSiteSig->cbSig);
key.callSiteSig.cbSig = (DWORD)callSiteSig->cbSig;
key.callSiteSig.scope = (DWORDLONG)callSiteSig->scope;
key.callSiteSig.token = (DWORD)0;
@@ -4021,32 +4157,38 @@ BOOL MethodContext::repPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, C
return value;
}
-void MethodContext::recFindSig(CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig)
+void MethodContext::recFindSig(CORINFO_MODULE_HANDLE module,
+ unsigned sigTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig)
{
if (FindSig == nullptr)
FindSig = new LightWeightMap<Agnostic_FindSig, Agnostic_CORINFO_SIG_INFO>();
Agnostic_FindSig key;
- ZeroMemory(&key, sizeof(Agnostic_FindSig)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_FindSig)); // We use the input structs as a key and use memcmp to compare.. so we
+ // need to zero out padding too
Agnostic_CORINFO_SIG_INFO value;
- key.module = (DWORDLONG)module;
- key.sigTOK = (DWORD)sigTOK;
+ key.module = (DWORDLONG)module;
+ key.sigTOK = (DWORD)sigTOK;
key.context = (DWORDLONG)context;
- value.callConv = (DWORD)sig->callConv;
- value.retTypeClass = (DWORDLONG)sig->retTypeClass;
- value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
- value.retType = (DWORD)sig->retType;
- value.flags = (DWORD)sig->flags;
- value.numArgs = (DWORD)sig->numArgs;
+ value.callConv = (DWORD)sig->callConv;
+ value.retTypeClass = (DWORDLONG)sig->retTypeClass;
+ value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
+ value.retType = (DWORD)sig->retType;
+ value.flags = (DWORD)sig->flags;
+ value.numArgs = (DWORD)sig->numArgs;
value.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- value.sigInst_classInst_Index = FindSig->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8); //porting issue
+ value.sigInst_classInst_Index =
+ FindSig->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8); // porting issue
value.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- value.sigInst_methInst_Index = FindSig->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8); //porting issue
- value.args = (DWORDLONG)sig->args;
+ value.sigInst_methInst_Index =
+ FindSig->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8); // porting issue
+ value.args = (DWORDLONG)sig->args;
value.cbSig = (DWORD)sig->cbSig;
- value.pSig = (DWORD)FindSig->AddBuffer((unsigned char *)sig->pSig, sig->cbSig);
+ value.pSig = (DWORD)FindSig->AddBuffer((unsigned char*)sig->pSig, sig->cbSig);
value.scope = (DWORDLONG)sig->scope;
value.token = (DWORD)sig->token;
@@ -4056,86 +4198,79 @@ void MethodContext::recFindSig(CORINFO_MODULE_HANDLE module, unsigned sigTOK, CO
void MethodContext::dmpFindSig(const Agnostic_FindSig& key, const Agnostic_CORINFO_SIG_INFO& value)
{
printf("FindSig key module-%016llX sigTOK-%08X context-%016llX", key.module, key.sigTOK, key.context);
- printf(", value callConv-%08X retTypeClass-%016llX retTypeSigClass-%016llX retType-%u(%s) flags-%08X numArgs-%08X classInstCount-%08X classInd-%08X "
+ printf(", value callConv-%08X retTypeClass-%016llX retTypeSigClass-%016llX retType-%u(%s) flags-%08X numArgs-%08X "
+ "classInstCount-%08X classInd-%08X "
"methInstCount-%08X methInd-%08X args-%016llX cbSig-%08X pSig-%08X scope-%016llX token-%08X",
- value.callConv,
- value.retTypeClass,
- value.retTypeSigClass,
- value.retType,
- toString((CorInfoType)value.retType),
- value.flags,
- value.numArgs,
- value.sigInst_classInstCount,
- value.sigInst_classInst_Index,
- value.sigInst_methInstCount,
- value.sigInst_methInst_Index,
- value.args,
- value.cbSig,
- value.pSig,
- value.scope,
- value.token);
-}
-void MethodContext::repFindSig(CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig)
+ value.callConv, value.retTypeClass, value.retTypeSigClass, value.retType,
+ toString((CorInfoType)value.retType), value.flags, value.numArgs, value.sigInst_classInstCount,
+ value.sigInst_classInst_Index, value.sigInst_methInstCount, value.sigInst_methInst_Index, value.args,
+ value.cbSig, value.pSig, value.scope, value.token);
+}
+void MethodContext::repFindSig(CORINFO_MODULE_HANDLE module,
+ unsigned sigTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig)
{
Agnostic_FindSig key;
- ZeroMemory(&key, sizeof(Agnostic_FindSig)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_FindSig)); // We use the input structs as a key and use memcmp to compare.. so we
+ // need to zero out padding too
Agnostic_CORINFO_SIG_INFO value;
- key.module = (DWORDLONG)module;
- key.sigTOK = (DWORD)sigTOK;
+ key.module = (DWORDLONG)module;
+ key.sigTOK = (DWORD)sigTOK;
key.context = (DWORDLONG)context;
value = FindSig->Get(key);
- sig->callConv = (CorInfoCallConv)value.callConv;
- sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
- sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
- sig->retType = (CorInfoType)value.retType;
- sig->flags = (unsigned)value.flags;
- sig->numArgs = (unsigned)value.numArgs;
+ sig->callConv = (CorInfoCallConv)value.callConv;
+ sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
+ sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
+ sig->retType = (CorInfoType)value.retType;
+ sig->flags = (unsigned)value.flags;
+ sig->numArgs = (unsigned)value.numArgs;
sig->sigInst.classInstCount = (unsigned)value.sigInst_classInstCount;
- sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)FindSig->GetBuffer(value.sigInst_classInst_Index);
- sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
- sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)FindSig->GetBuffer(value.sigInst_methInst_Index);
- sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
- sig->cbSig = (unsigned int)value.cbSig;
- sig->pSig = (PCCOR_SIGNATURE)FindSig->GetBuffer(value.pSig);
- sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
- sig->token = (mdToken)value.token;
+ sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)FindSig->GetBuffer(value.sigInst_classInst_Index);
+ sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
+ sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)FindSig->GetBuffer(value.sigInst_methInst_Index);
+ sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
+ sig->cbSig = (unsigned int)value.cbSig;
+ sig->pSig = (PCCOR_SIGNATURE)FindSig->GetBuffer(value.pSig);
+ sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
+ sig->token = (mdToken)value.token;
DEBUG_REP(dmpFindSig(key, value));
}
-void MethodContext::recGetEEInfo(CORINFO_EE_INFO *pEEInfoOut)
+void MethodContext::recGetEEInfo(CORINFO_EE_INFO* pEEInfoOut)
{
if (GetEEInfo == nullptr)
GetEEInfo = new LightWeightMap<DWORD, Agnostic_CORINFO_EE_INFO>();
Agnostic_CORINFO_EE_INFO value;
- value.inlinedCallFrameInfo.size = (DWORD)pEEInfoOut->inlinedCallFrameInfo.size;
- value.inlinedCallFrameInfo.offsetOfGSCookie = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie;
- value.inlinedCallFrameInfo.offsetOfFrameVptr = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr;
- value.inlinedCallFrameInfo.offsetOfFrameLink = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink;
- value.inlinedCallFrameInfo.offsetOfCallSiteSP = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfCallSiteSP;
+ value.inlinedCallFrameInfo.size = (DWORD)pEEInfoOut->inlinedCallFrameInfo.size;
+ value.inlinedCallFrameInfo.offsetOfGSCookie = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie;
+ value.inlinedCallFrameInfo.offsetOfFrameVptr = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr;
+ value.inlinedCallFrameInfo.offsetOfFrameLink = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink;
+ value.inlinedCallFrameInfo.offsetOfCallSiteSP = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfCallSiteSP;
value.inlinedCallFrameInfo.offsetOfCalleeSavedFP = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfCalleeSavedFP;
- value.inlinedCallFrameInfo.offsetOfCallTarget = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfCallTarget;
+ value.inlinedCallFrameInfo.offsetOfCallTarget = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfCallTarget;
value.inlinedCallFrameInfo.offsetOfReturnAddress = (DWORD)pEEInfoOut->inlinedCallFrameInfo.offsetOfReturnAddress;
- value.offsetOfThreadFrame = (DWORD)pEEInfoOut->offsetOfThreadFrame;
- value.offsetOfGCState = (DWORD)pEEInfoOut->offsetOfGCState;
- value.offsetOfDelegateInstance = (DWORD)pEEInfoOut->offsetOfDelegateInstance;
- value.offsetOfDelegateFirstTarget = (DWORD)pEEInfoOut->offsetOfDelegateFirstTarget;
- value.offsetOfSecureDelegateIndirectCell = (DWORD)pEEInfoOut->offsetOfSecureDelegateIndirectCell;
- value.offsetOfTransparentProxyRP = (DWORD)pEEInfoOut->offsetOfTransparentProxyRP;
- value.offsetOfRealProxyServer = (DWORD)pEEInfoOut->offsetOfRealProxyServer;
- value.offsetOfObjArrayData = (DWORD)pEEInfoOut->offsetOfObjArrayData;
- value.sizeOfReversePInvokeFrame = (DWORD)pEEInfoOut->sizeOfReversePInvokeFrame;
- value.osPageSize = (DWORD)pEEInfoOut->osPageSize;
- value.maxUncheckedOffsetForNullObject = (DWORD)pEEInfoOut->maxUncheckedOffsetForNullObject;
- value.targetAbi = (DWORD)pEEInfoOut->targetAbi;
- value.osType = (DWORD)pEEInfoOut->osType;
- value.osMajor = (DWORD)pEEInfoOut->osMajor;
- value.osMinor = (DWORD)pEEInfoOut->osMinor;
- value.osBuild = (DWORD)pEEInfoOut->osBuild;
+ value.offsetOfThreadFrame = (DWORD)pEEInfoOut->offsetOfThreadFrame;
+ value.offsetOfGCState = (DWORD)pEEInfoOut->offsetOfGCState;
+ value.offsetOfDelegateInstance = (DWORD)pEEInfoOut->offsetOfDelegateInstance;
+ value.offsetOfDelegateFirstTarget = (DWORD)pEEInfoOut->offsetOfDelegateFirstTarget;
+ value.offsetOfSecureDelegateIndirectCell = (DWORD)pEEInfoOut->offsetOfSecureDelegateIndirectCell;
+ value.offsetOfTransparentProxyRP = (DWORD)pEEInfoOut->offsetOfTransparentProxyRP;
+ value.offsetOfRealProxyServer = (DWORD)pEEInfoOut->offsetOfRealProxyServer;
+ value.offsetOfObjArrayData = (DWORD)pEEInfoOut->offsetOfObjArrayData;
+ value.sizeOfReversePInvokeFrame = (DWORD)pEEInfoOut->sizeOfReversePInvokeFrame;
+ value.osPageSize = (DWORD)pEEInfoOut->osPageSize;
+ value.maxUncheckedOffsetForNullObject = (DWORD)pEEInfoOut->maxUncheckedOffsetForNullObject;
+ value.targetAbi = (DWORD)pEEInfoOut->targetAbi;
+ value.osType = (DWORD)pEEInfoOut->osType;
+ value.osMajor = (DWORD)pEEInfoOut->osMajor;
+ value.osMinor = (DWORD)pEEInfoOut->osMinor;
+ value.osBuild = (DWORD)pEEInfoOut->osBuild;
GetEEInfo->Add((DWORD)0, value);
DEBUG_REC(dmpGetEEInfo((DWORD)0, value));
@@ -4143,34 +4278,19 @@ void MethodContext::recGetEEInfo(CORINFO_EE_INFO *pEEInfoOut)
void MethodContext::dmpGetEEInfo(DWORD key, const Agnostic_CORINFO_EE_INFO& value)
{
printf("GetEEInfo key %u, value icfi{sz-%u ogs-%u ofv-%u ofl-%u ocsp-%u ocsfp-%u oct-%u ora-%u} "
- "otf-%u ogcs-%u odi-%u odft-%u osdic-%u otrp-%u orps-%u ooad-%u srpf-%u osps-%u muono-%u tabi-%u osType-%u osMajor-%u osMinor-%u osBuild-%u",
- key,
- value.inlinedCallFrameInfo.size,
- value.inlinedCallFrameInfo.offsetOfGSCookie,
- value.inlinedCallFrameInfo.offsetOfFrameVptr,
- value.inlinedCallFrameInfo.offsetOfFrameLink,
- value.inlinedCallFrameInfo.offsetOfCallSiteSP,
- value.inlinedCallFrameInfo.offsetOfCalleeSavedFP,
- value.inlinedCallFrameInfo.offsetOfCallTarget,
- value.inlinedCallFrameInfo.offsetOfReturnAddress,
- value.offsetOfThreadFrame,
- value.offsetOfGCState,
- value.offsetOfDelegateInstance,
- value.offsetOfDelegateFirstTarget,
- value.offsetOfSecureDelegateIndirectCell,
- value.offsetOfTransparentProxyRP,
- value.offsetOfRealProxyServer,
- value.offsetOfObjArrayData,
- value.sizeOfReversePInvokeFrame,
- value.osPageSize,
- value.maxUncheckedOffsetForNullObject,
- value.targetAbi,
- value.osType,
- value.osMajor,
- value.osMinor,
- value.osBuild);
-}
-void MethodContext::repGetEEInfo(CORINFO_EE_INFO *pEEInfoOut)
+ "otf-%u ogcs-%u odi-%u odft-%u osdic-%u otrp-%u orps-%u ooad-%u srpf-%u osps-%u muono-%u tabi-%u osType-%u "
+ "osMajor-%u osMinor-%u osBuild-%u",
+ key, value.inlinedCallFrameInfo.size, value.inlinedCallFrameInfo.offsetOfGSCookie,
+ value.inlinedCallFrameInfo.offsetOfFrameVptr, value.inlinedCallFrameInfo.offsetOfFrameLink,
+ value.inlinedCallFrameInfo.offsetOfCallSiteSP, value.inlinedCallFrameInfo.offsetOfCalleeSavedFP,
+ value.inlinedCallFrameInfo.offsetOfCallTarget, value.inlinedCallFrameInfo.offsetOfReturnAddress,
+ value.offsetOfThreadFrame, value.offsetOfGCState, value.offsetOfDelegateInstance,
+ value.offsetOfDelegateFirstTarget, value.offsetOfSecureDelegateIndirectCell,
+ value.offsetOfTransparentProxyRP, value.offsetOfRealProxyServer, value.offsetOfObjArrayData,
+ value.sizeOfReversePInvokeFrame, value.osPageSize, value.maxUncheckedOffsetForNullObject, value.targetAbi,
+ value.osType, value.osMajor, value.osMinor, value.osBuild);
+}
+void MethodContext::repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut)
{
Agnostic_CORINFO_EE_INFO value;
@@ -4179,63 +4299,65 @@ void MethodContext::repGetEEInfo(CORINFO_EE_INFO *pEEInfoOut)
index = GetEEInfo->GetIndex((DWORD)0);
if (index >= 0)
{
- value = GetEEInfo->Get((DWORD)0);
- pEEInfoOut->inlinedCallFrameInfo.size = (unsigned)value.inlinedCallFrameInfo.size;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie = (unsigned)value.inlinedCallFrameInfo.offsetOfGSCookie;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr = (unsigned)value.inlinedCallFrameInfo.offsetOfFrameVptr;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink = (unsigned)value.inlinedCallFrameInfo.offsetOfFrameLink;
+ value = GetEEInfo->Get((DWORD)0);
+ pEEInfoOut->inlinedCallFrameInfo.size = (unsigned)value.inlinedCallFrameInfo.size;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie = (unsigned)value.inlinedCallFrameInfo.offsetOfGSCookie;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr = (unsigned)value.inlinedCallFrameInfo.offsetOfFrameVptr;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink = (unsigned)value.inlinedCallFrameInfo.offsetOfFrameLink;
pEEInfoOut->inlinedCallFrameInfo.offsetOfCallSiteSP = (unsigned)value.inlinedCallFrameInfo.offsetOfCallSiteSP;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfCalleeSavedFP = (unsigned)value.inlinedCallFrameInfo.offsetOfCalleeSavedFP;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfCalleeSavedFP =
+ (unsigned)value.inlinedCallFrameInfo.offsetOfCalleeSavedFP;
pEEInfoOut->inlinedCallFrameInfo.offsetOfCallTarget = (unsigned)value.inlinedCallFrameInfo.offsetOfCallTarget;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfReturnAddress = (unsigned)value.inlinedCallFrameInfo.offsetOfReturnAddress;
- pEEInfoOut->offsetOfThreadFrame = (unsigned)value.offsetOfThreadFrame;
- pEEInfoOut->offsetOfGCState = (unsigned)value.offsetOfGCState;
- pEEInfoOut->offsetOfDelegateInstance = (unsigned)value.offsetOfDelegateInstance;
- pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)value.offsetOfDelegateFirstTarget;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfReturnAddress =
+ (unsigned)value.inlinedCallFrameInfo.offsetOfReturnAddress;
+ pEEInfoOut->offsetOfThreadFrame = (unsigned)value.offsetOfThreadFrame;
+ pEEInfoOut->offsetOfGCState = (unsigned)value.offsetOfGCState;
+ pEEInfoOut->offsetOfDelegateInstance = (unsigned)value.offsetOfDelegateInstance;
+ pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)value.offsetOfDelegateFirstTarget;
pEEInfoOut->offsetOfSecureDelegateIndirectCell = (unsigned)value.offsetOfSecureDelegateIndirectCell;
- pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)value.offsetOfTransparentProxyRP;
- pEEInfoOut->offsetOfRealProxyServer = (unsigned)value.offsetOfRealProxyServer;
- pEEInfoOut->offsetOfObjArrayData = (unsigned)value.offsetOfObjArrayData;
- pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)value.sizeOfReversePInvokeFrame;
- pEEInfoOut->osPageSize = (size_t)value.osPageSize;
- pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)value.maxUncheckedOffsetForNullObject;
- pEEInfoOut->targetAbi = (CORINFO_RUNTIME_ABI)value.targetAbi;
- pEEInfoOut->osType = (CORINFO_OS)value.osType;
- pEEInfoOut->osMajor = (unsigned)value.osMajor;
- pEEInfoOut->osMinor = (unsigned)value.osMinor;
- pEEInfoOut->osBuild = (unsigned)value.osBuild;
+ pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)value.offsetOfTransparentProxyRP;
+ pEEInfoOut->offsetOfRealProxyServer = (unsigned)value.offsetOfRealProxyServer;
+ pEEInfoOut->offsetOfObjArrayData = (unsigned)value.offsetOfObjArrayData;
+ pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)value.sizeOfReversePInvokeFrame;
+ pEEInfoOut->osPageSize = (size_t)value.osPageSize;
+ pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)value.maxUncheckedOffsetForNullObject;
+ pEEInfoOut->targetAbi = (CORINFO_RUNTIME_ABI)value.targetAbi;
+ pEEInfoOut->osType = (CORINFO_OS)value.osType;
+ pEEInfoOut->osMajor = (unsigned)value.osMajor;
+ pEEInfoOut->osMinor = (unsigned)value.osMinor;
+ pEEInfoOut->osBuild = (unsigned)value.osBuild;
DEBUG_REP(dmpGetEEInfo((DWORD)0, value));
}
else
{
- pEEInfoOut->inlinedCallFrameInfo.size = (unsigned)0x40;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie = (unsigned)0;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr = (unsigned)0x8;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink = (unsigned)0x10;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfCallSiteSP = (unsigned)0x28;
+ pEEInfoOut->inlinedCallFrameInfo.size = (unsigned)0x40;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfGSCookie = (unsigned)0;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameVptr = (unsigned)0x8;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfFrameLink = (unsigned)0x10;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfCallSiteSP = (unsigned)0x28;
pEEInfoOut->inlinedCallFrameInfo.offsetOfCalleeSavedFP = (unsigned)0x38;
- pEEInfoOut->inlinedCallFrameInfo.offsetOfCallTarget = (unsigned)0x18;
+ pEEInfoOut->inlinedCallFrameInfo.offsetOfCallTarget = (unsigned)0x18;
pEEInfoOut->inlinedCallFrameInfo.offsetOfReturnAddress = (unsigned)0x30;
- pEEInfoOut->offsetOfThreadFrame = (unsigned)0x10;
- pEEInfoOut->offsetOfGCState = (unsigned)0xc;
- pEEInfoOut->offsetOfDelegateInstance = (unsigned)0x8;
- pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)0x18;
- pEEInfoOut->offsetOfSecureDelegateIndirectCell = (unsigned)0x40;
- pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)0x8;
- pEEInfoOut->offsetOfRealProxyServer = (unsigned)0x18;
- pEEInfoOut->offsetOfObjArrayData = (unsigned)0x18;
- pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)0x8;
- pEEInfoOut->osPageSize = (size_t)0x1000;
- pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32*1024)-1);
- pEEInfoOut->targetAbi = CORINFO_DESKTOP_ABI;
- pEEInfoOut->osType = (CORINFO_OS)0;
- pEEInfoOut->osMajor = (unsigned)0;
- pEEInfoOut->osMinor = (unsigned)0;
- pEEInfoOut->osBuild = (unsigned)0;
+ pEEInfoOut->offsetOfThreadFrame = (unsigned)0x10;
+ pEEInfoOut->offsetOfGCState = (unsigned)0xc;
+ pEEInfoOut->offsetOfDelegateInstance = (unsigned)0x8;
+ pEEInfoOut->offsetOfDelegateFirstTarget = (unsigned)0x18;
+ pEEInfoOut->offsetOfSecureDelegateIndirectCell = (unsigned)0x40;
+ pEEInfoOut->offsetOfTransparentProxyRP = (unsigned)0x8;
+ pEEInfoOut->offsetOfRealProxyServer = (unsigned)0x18;
+ pEEInfoOut->offsetOfObjArrayData = (unsigned)0x18;
+ pEEInfoOut->sizeOfReversePInvokeFrame = (unsigned)0x8;
+ pEEInfoOut->osPageSize = (size_t)0x1000;
+ pEEInfoOut->maxUncheckedOffsetForNullObject = (size_t)((32 * 1024) - 1);
+ pEEInfoOut->targetAbi = CORINFO_DESKTOP_ABI;
+ pEEInfoOut->osType = (CORINFO_OS)0;
+ pEEInfoOut->osMajor = (unsigned)0;
+ pEEInfoOut->osMinor = (unsigned)0;
+ pEEInfoOut->osBuild = (unsigned)0;
}
}
-void MethodContext::recGetGSCookie(GSCookie *pCookieVal, GSCookie **ppCookieVal)
+void MethodContext::recGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal)
{
if (GetGSCookie == nullptr)
GetGSCookie = new LightWeightMap<DWORD, DLDL>();
@@ -4257,7 +4379,7 @@ void MethodContext::dmpGetGSCookie(DWORD key, DLDL value)
{
printf("GetGSCookie key 0, value pCookieVal-%016llX ppCookieVal-%016llX", value.A, value.B);
}
-void MethodContext::repGetGSCookie(GSCookie *pCookieVal, GSCookie **ppCookieVal)
+void MethodContext::repGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal)
{
DLDL value;
@@ -4269,7 +4391,10 @@ void MethodContext::repGetGSCookie(GSCookie *pCookieVal, GSCookie **ppCookieVal)
*ppCookieVal = (GSCookie*)value.B;
}
-void MethodContext::recGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE *pModule, void **ppIndirection, size_t result)
+void MethodContext::recGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls,
+ CORINFO_MODULE_HANDLE* pModule,
+ void** ppIndirection,
+ size_t result)
{
if (GetClassModuleIdForStatics == nullptr)
GetClassModuleIdForStatics = new LightWeightMap<DWORDLONG, Agnostic_GetClassModuleIdForStatics>();
@@ -4284,14 +4409,17 @@ void MethodContext::recGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORI
value.pIndirection = (DWORDLONG)*ppIndirection;
else
value.pIndirection = (DWORDLONG)0;
- value.result = (DWORDLONG)result;
+ value.result = (DWORDLONG)result;
GetClassModuleIdForStatics->Add((DWORDLONG)cls, value);
}
void MethodContext::dmpGetClassModuleIdForStatics(DWORDLONG key, const Agnostic_GetClassModuleIdForStatics& value)
{
- printf("GetClassModuleIdForStatics key cls-%016llX, value mod-%016llX pp-%016llX res-%016llX", key, value.Module, value.pIndirection, value.result);
+ printf("GetClassModuleIdForStatics key cls-%016llX, value mod-%016llX pp-%016llX res-%016llX", key, value.Module,
+ value.pIndirection, value.result);
}
-size_t MethodContext::repGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE *pModule, void **ppIndirection)
+size_t MethodContext::repGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls,
+ CORINFO_MODULE_HANDLE* pModule,
+ void** ppIndirection)
{
Agnostic_GetClassModuleIdForStatics value;
@@ -4305,7 +4433,7 @@ size_t MethodContext::repGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CO
return (size_t)value.result;
}
-void MethodContext::recGetThreadTLSIndex(void **ppIndirection, DWORD result)
+void MethodContext::recGetThreadTLSIndex(void** ppIndirection, DWORD result)
{
if (GetThreadTLSIndex == nullptr)
GetThreadTLSIndex = new LightWeightMap<DWORD, DLD>();
@@ -4316,7 +4444,7 @@ void MethodContext::recGetThreadTLSIndex(void **ppIndirection, DWORD result)
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORD)result;
+ value.B = (DWORD)result;
GetThreadTLSIndex->Add((DWORD)0, value);
}
@@ -4324,7 +4452,7 @@ void MethodContext::dmpGetThreadTLSIndex(DWORD key, DLD value)
{
printf("GetThreadTLSIndex key 0, value ppIndirection-%016llX result-%08X", value.A, value.B);
}
-DWORD MethodContext::repGetThreadTLSIndex(void **ppIndirection)
+DWORD MethodContext::repGetThreadTLSIndex(void** ppIndirection)
{
DLD value;
@@ -4335,7 +4463,7 @@ DWORD MethodContext::repGetThreadTLSIndex(void **ppIndirection)
return (DWORD)value.B;
}
-void MethodContext::recGetInlinedCallFrameVptr(void **ppIndirection, const void * result)
+void MethodContext::recGetInlinedCallFrameVptr(void** ppIndirection, const void* result)
{
if (GetInlinedCallFrameVptr == nullptr)
GetInlinedCallFrameVptr = new LightWeightMap<DWORD, DLDL>();
@@ -4346,7 +4474,7 @@ void MethodContext::recGetInlinedCallFrameVptr(void **ppIndirection, const void
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetInlinedCallFrameVptr->Add((DWORD)0, value);
}
@@ -4354,7 +4482,7 @@ void MethodContext::dmpGetInlinedCallFrameVptr(DWORD key, DLDL value)
{
printf("GetInlinedCallFrameVptr key 0, value ppIndirection-%016llX result-%016llX\n", value.A, value.B);
}
-const void * MethodContext::repGetInlinedCallFrameVptr(void **ppIndirection)
+const void* MethodContext::repGetInlinedCallFrameVptr(void** ppIndirection)
{
DLDL value;
@@ -4362,10 +4490,10 @@ const void * MethodContext::repGetInlinedCallFrameVptr(void **ppIndirection)
if (ppIndirection != nullptr)
*ppIndirection = (void*)value.A;
- return (const void *)value.B;
+ return (const void*)value.B;
}
-void MethodContext::recGetAddrOfCaptureThreadGlobal(void **ppIndirection, LONG * result)
+void MethodContext::recGetAddrOfCaptureThreadGlobal(void** ppIndirection, LONG* result)
{
if (GetAddrOfCaptureThreadGlobal == nullptr)
GetAddrOfCaptureThreadGlobal = new LightWeightMap<DWORD, DLDL>();
@@ -4376,7 +4504,7 @@ void MethodContext::recGetAddrOfCaptureThreadGlobal(void **ppIndirection, LONG *
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetAddrOfCaptureThreadGlobal->Add((DWORD)0, value);
DEBUG_REC(dmpGetAddrOfCaptureThreadGlobal((DWORD)0, value));
@@ -4385,7 +4513,7 @@ void MethodContext::dmpGetAddrOfCaptureThreadGlobal(DWORD key, DLDL value)
{
printf("GetAddrOfCaptureThreadGlobal key %u, value ppi-%016llX res-%016llX", key, value.A, value.B);
}
-LONG * MethodContext::repGetAddrOfCaptureThreadGlobal(void **ppIndirection)
+LONG* MethodContext::repGetAddrOfCaptureThreadGlobal(void** ppIndirection)
{
DLDL value;
@@ -4403,10 +4531,10 @@ LONG * MethodContext::repGetAddrOfCaptureThreadGlobal(void **ppIndirection)
if (ppIndirection != nullptr)
*ppIndirection = (void*)value.A;
DEBUG_REP(dmpGetAddrOfCaptureThreadGlobal((DWORD)0, value));
- return (LONG *)value.B;
+ return (LONG*)value.B;
}
-void MethodContext::recGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppIndirection, unsigned result)
+void MethodContext::recGetClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection, unsigned result)
{
if (GetClassDomainID == nullptr)
GetClassDomainID = new LightWeightMap<DWORDLONG, DLD>();
@@ -4417,7 +4545,7 @@ void MethodContext::recGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppIndir
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORD)result;
+ value.B = (DWORD)result;
GetClassDomainID->Add((DWORDLONG)cls, value);
DEBUG_REC(dmpGetClassDomainID((DWORDLONG)cls, value));
@@ -4426,12 +4554,13 @@ void MethodContext::dmpGetClassDomainID(DWORDLONG key, DLD value)
{
printf("GetClassDomainID key cls-%016llX, value pp-%016llX res-%u", key, value.A, value.B);
}
-unsigned MethodContext::repGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppIndirection)
+unsigned MethodContext::repGetClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection)
{
DLD value;
AssertCodeMsg(GetClassDomainID != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)cls);
- AssertCodeMsg(GetClassDomainID->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)cls);
+ AssertCodeMsg(GetClassDomainID->GetIndex((DWORDLONG)cls) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)cls);
value = GetClassDomainID->Get((DWORDLONG)cls);
if (ppIndirection != nullptr)
*ppIndirection = (void*)value.A;
@@ -4439,7 +4568,7 @@ unsigned MethodContext::repGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppI
return (unsigned)value.B;
}
-void MethodContext::recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND *result)
+void MethodContext::recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* result)
{
if (GetLocationOfThisType == nullptr)
GetLocationOfThisType = new LightWeightMap<DWORDLONG, Agnostic_CORINFO_LOOKUP_KIND>();
@@ -4447,7 +4576,7 @@ void MethodContext::recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORI
Agnostic_CORINFO_LOOKUP_KIND value;
value.needsRuntimeLookup = (DWORD)result->needsRuntimeLookup;
- value.runtimeLookupKind = (DWORD)result->runtimeLookupKind;
+ value.runtimeLookupKind = (DWORD)result->runtimeLookupKind;
value.runtimeLookupFlags = (WORD)result->runtimeLookupFlags;
// We don't store result->runtimeLookupArgs, which is opaque data. Ok?
@@ -4455,82 +4584,87 @@ void MethodContext::recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORI
}
void MethodContext::dmpGetLocationOfThisType(DWORDLONG key, const Agnostic_CORINFO_LOOKUP_KIND& value)
{
- printf("GetLocationOfThisType key ftn-%016llX, value nrl-%u rlk-%u", key, value.needsRuntimeLookup, value.runtimeLookupKind);
+ printf("GetLocationOfThisType key ftn-%016llX, value nrl-%u rlk-%u", key, value.needsRuntimeLookup,
+ value.runtimeLookupKind);
}
CORINFO_LOOKUP_KIND MethodContext::repGetLocationOfThisType(CORINFO_METHOD_HANDLE context)
{
Agnostic_CORINFO_LOOKUP_KIND value1;
- CORINFO_LOOKUP_KIND value2;
+ CORINFO_LOOKUP_KIND value2;
value1 = GetLocationOfThisType->Get((DWORDLONG)context);
value2.needsRuntimeLookup = value1.needsRuntimeLookup != 0;
- value2.runtimeLookupKind = (CORINFO_RUNTIME_LOOKUP_KIND)value1.runtimeLookupKind;
+ value2.runtimeLookupKind = (CORINFO_RUNTIME_LOOKUP_KIND)value1.runtimeLookupKind;
value2.runtimeLookupFlags = (WORD)value1.runtimeLookupFlags;
- value2.runtimeLookupArgs = nullptr; // We don't store this opaque data. Ok?
+ value2.runtimeLookupArgs = nullptr; // We don't store this opaque data. Ok?
return value2;
}
-void MethodContext::recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs *pCtorData, CORINFO_METHOD_HANDLE result)
+void MethodContext::recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
+ CORINFO_CLASS_HANDLE clsHnd,
+ CORINFO_METHOD_HANDLE targetMethodHnd,
+ DelegateCtorArgs* pCtorData,
+ CORINFO_METHOD_HANDLE result)
{
if (GetDelegateCtor == nullptr)
GetDelegateCtor = new LightWeightMap<Agnostic_GetDelegateCtorIn, Agnostic_GetDelegateCtorOut>();
Agnostic_GetDelegateCtorIn key;
- ZeroMemory(&key, sizeof(Agnostic_GetDelegateCtorIn)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetDelegateCtorIn)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_GetDelegateCtorOut value;
- key.methHnd = (DWORDLONG)methHnd;
- key.clsHnd = (DWORDLONG)clsHnd;
+ key.methHnd = (DWORDLONG)methHnd;
+ key.clsHnd = (DWORDLONG)clsHnd;
key.targetMethodHnd = (DWORDLONG)targetMethodHnd;
value.CtorData.pMethod = (DWORDLONG)pCtorData->pMethod;
- value.CtorData.pArg3 = (DWORDLONG)pCtorData->pArg3;
- value.CtorData.pArg4 = (DWORDLONG)pCtorData->pArg4;
- value.CtorData.pArg5 = (DWORDLONG)pCtorData->pArg5;
- value.result = (DWORDLONG)result;
+ value.CtorData.pArg3 = (DWORDLONG)pCtorData->pArg3;
+ value.CtorData.pArg4 = (DWORDLONG)pCtorData->pArg4;
+ value.CtorData.pArg5 = (DWORDLONG)pCtorData->pArg5;
+ value.result = (DWORDLONG)result;
GetDelegateCtor->Add(key, value);
DEBUG_REC(dmpGetDelegateCtor(key, value));
}
void MethodContext::dmpGetDelegateCtor(const Agnostic_GetDelegateCtorIn& key, const Agnostic_GetDelegateCtorOut& value)
{
- printf("GetDelegateCtor key ftn-%016llX cls-%016llX tftn-%016llX, value pm-%016llX a3-%016llX a4-%016llX a5-%016llX res-%016llX",
- key.methHnd,
- key.clsHnd,
- key.targetMethodHnd,
- value.CtorData.pMethod,
- value.CtorData.pArg3,
- value.CtorData.pArg4,
- value.CtorData.pArg5,
- value.result);
+ printf("GetDelegateCtor key ftn-%016llX cls-%016llX tftn-%016llX, value pm-%016llX a3-%016llX a4-%016llX "
+ "a5-%016llX res-%016llX",
+ key.methHnd, key.clsHnd, key.targetMethodHnd, value.CtorData.pMethod, value.CtorData.pArg3,
+ value.CtorData.pArg4, value.CtorData.pArg5, value.result);
}
-CORINFO_METHOD_HANDLE MethodContext::repGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs *pCtorData)
+CORINFO_METHOD_HANDLE MethodContext::repGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
+ CORINFO_CLASS_HANDLE clsHnd,
+ CORINFO_METHOD_HANDLE targetMethodHnd,
+ DelegateCtorArgs* pCtorData)
{
Agnostic_GetDelegateCtorIn key;
- ZeroMemory(&key, sizeof(Agnostic_GetDelegateCtorIn)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetDelegateCtorIn)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
Agnostic_GetDelegateCtorOut value;
- key.methHnd = (DWORDLONG)methHnd;
- key.clsHnd = (DWORDLONG)clsHnd;
+ key.methHnd = (DWORDLONG)methHnd;
+ key.clsHnd = (DWORDLONG)clsHnd;
key.targetMethodHnd = (DWORDLONG)targetMethodHnd;
- AssertCodeMsg(GetDelegateCtor != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)key.methHnd);
- AssertCodeMsg(GetDelegateCtor->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.methHnd);
+ AssertCodeMsg(GetDelegateCtor != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)key.methHnd);
+ AssertCodeMsg(GetDelegateCtor->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)key.methHnd);
value = GetDelegateCtor->Get(key);
pCtorData->pMethod = (void*)value.CtorData.pMethod;
- pCtorData->pArg3 = (void*)value.CtorData.pArg3;
- pCtorData->pArg4 = (void*)value.CtorData.pArg4;
- pCtorData->pArg5 = (void*)value.CtorData.pArg5;
+ pCtorData->pArg3 = (void*)value.CtorData.pArg3;
+ pCtorData->pArg4 = (void*)value.CtorData.pArg4;
+ pCtorData->pArg5 = (void*)value.CtorData.pArg5;
DEBUG_REP(dmpGetDelegateCtor(key, value));
return (CORINFO_METHOD_HANDLE)value.result;
}
-void MethodContext::recGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult)
+void MethodContext::recGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult)
{
if (GetFunctionFixedEntryPoint == nullptr)
GetFunctionFixedEntryPoint = new LightWeightMap<DWORDLONG, Agnostic_CORINFO_CONST_LOOKUP>();
@@ -4538,7 +4672,7 @@ void MethodContext::recGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, COR
Agnostic_CORINFO_CONST_LOOKUP value;
value.accessType = (DWORD)pResult->accessType;
- value.handle = (DWORDLONG)pResult->handle;
+ value.handle = (DWORDLONG)pResult->handle;
GetFunctionFixedEntryPoint->Add((DWORDLONG)ftn, value);
}
@@ -4546,14 +4680,14 @@ void MethodContext::dmpGetFunctionFixedEntryPoint(DWORDLONG key, const Agnostic_
{
printf("GetFunctionFixedEntryPoint key ftn-%016llX, value at-%u han-%016llX", key, value.accessType, value.handle);
}
-void MethodContext::repGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult)
+void MethodContext::repGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult)
{
Agnostic_CORINFO_CONST_LOOKUP value;
value = GetFunctionFixedEntryPoint->Get((DWORDLONG)ftn);
pResult->accessType = (InfoAccessType)value.accessType;
- pResult->handle = (CORINFO_GENERIC_HANDLE)value.handle;
+ pResult->handle = (CORINFO_GENERIC_HANDLE)value.handle;
}
void MethodContext::recGetFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num, CORINFO_FIELD_HANDLE result)
@@ -4562,7 +4696,8 @@ void MethodContext::recGetFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num, COR
GetFieldInClass = new LightWeightMap<DLD, DWORDLONG>();
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
+ 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)clsHnd;
key.B = (DWORD)num;
@@ -4577,26 +4712,31 @@ void MethodContext::dmpGetFieldInClass(DLD key, DWORDLONG value)
CORINFO_FIELD_HANDLE MethodContext::repGetFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num)
{
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
+ 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)clsHnd;
key.B = (DWORD)num;
- AssertCodeMsg((GetFieldInClass != nullptr) && (GetFieldInClass->GetIndex(key) != -1),
- EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.A);
+ AssertCodeMsg((GetFieldInClass != nullptr) && (GetFieldInClass->GetIndex(key) != -1), EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)key.A);
CORINFO_FIELD_HANDLE temp = (CORINFO_FIELD_HANDLE)GetFieldInClass->Get(key);
DEBUG_REP(dmpGetFieldInClass(key, (DWORDLONG)temp));
return temp;
}
-void MethodContext::recGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HANDLE *structType, CORINFO_CLASS_HANDLE memberParent, CorInfoType result)
+void MethodContext::recGetFieldType(CORINFO_FIELD_HANDLE field,
+ CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE memberParent,
+ CorInfoType result)
{
if (GetFieldType == nullptr)
GetFieldType = new LightWeightMap<DLDL, DLD>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
DLD value;
key.A = (DWORDLONG)field;
@@ -4610,12 +4750,16 @@ void MethodContext::recGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HA
}
void MethodContext::dmpGetFieldType(DLDL key, DLD value)
{
- printf("GetFieldType key fld-%016llX cls-%016llX, value ch-%016llX cit-%u(%s)", key.A, key.B, value.A, value.B, toString((CorInfoType)value.B));
+ printf("GetFieldType key fld-%016llX cls-%016llX, value ch-%016llX cit-%u(%s)", key.A, key.B, value.A, value.B,
+ toString((CorInfoType)value.B));
}
-CorInfoType MethodContext::repGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HANDLE *structType, CORINFO_CLASS_HANDLE memberParent)
+CorInfoType MethodContext::repGetFieldType(CORINFO_FIELD_HANDLE field,
+ CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE memberParent)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
DLD value;
key.A = (DWORDLONG)field;
@@ -4625,7 +4769,6 @@ CorInfoType MethodContext::repGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_C
AssertCodeMsg(GetFieldType->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.A);
value = GetFieldType->Get(key);
-
if (structType != nullptr)
*structType = (CORINFO_CLASS_HANDLE)value.A;
@@ -4633,7 +4776,7 @@ CorInfoType MethodContext::repGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_C
return (CorInfoType)value.B;
}
-void MethodContext::recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **moduleName, const char* result)
+void MethodContext::recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char** moduleName, const char* result)
{
if (GetFieldName == nullptr)
GetFieldName = new LightWeightMap<DWORDLONG, DD>();
@@ -4641,12 +4784,12 @@ void MethodContext::recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **modul
DD value;
if (result != nullptr)
- value.A = GetFieldName->AddBuffer((unsigned char *)result, (DWORD)strlen(result) + 1);
+ value.A = GetFieldName->AddBuffer((unsigned char*)result, (DWORD)strlen(result) + 1);
else
value.A = (DWORD)-1;
- if (moduleName != nullptr) //protect strlen
- value.B = (DWORD)GetFieldName->AddBuffer((unsigned char *)*moduleName, (DWORD)strlen(*moduleName) + 1);
+ if (moduleName != nullptr) // protect strlen
+ value.B = (DWORD)GetFieldName->AddBuffer((unsigned char*)*moduleName, (DWORD)strlen(*moduleName) + 1);
else
value.B = (DWORD)-1;
@@ -4654,12 +4797,12 @@ void MethodContext::recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **modul
}
void MethodContext::dmpGetFieldName(DWORDLONG key, DD value)
{
- unsigned char *fieldName = (unsigned char *)GetFieldName->GetBuffer(value.A);
- unsigned char *moduleName = (unsigned char *)GetFieldName->GetBuffer(value.B);
+ unsigned char* fieldName = (unsigned char*)GetFieldName->GetBuffer(value.A);
+ unsigned char* moduleName = (unsigned char*)GetFieldName->GetBuffer(value.B);
printf("GetFieldName key - ftn-%016llX, value fld-'%s', mod-'%s'", key, fieldName, moduleName);
GetFieldName->Unlock();
}
-const char* MethodContext::repGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **moduleName)
+const char* MethodContext::repGetFieldName(CORINFO_FIELD_HANDLE ftn, const char** moduleName)
{
DD value;
if (GetFieldName == nullptr)
@@ -4670,8 +4813,8 @@ const char* MethodContext::repGetFieldName(CORINFO_FIELD_HANDLE ftn, const char
}
value = GetFieldName->Get((DWORDLONG)ftn);
if (moduleName != nullptr)
- *moduleName = (const char *)GetFieldName->GetBuffer(value.B);
- return (const char *)GetFieldName->GetBuffer(value.A);
+ *moduleName = (const char*)GetFieldName->GetBuffer(value.B);
+ return (const char*)GetFieldName->GetBuffer(value.A);
}
void MethodContext::recCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls, BOOL result)
@@ -4690,13 +4833,16 @@ BOOL MethodContext::repCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE c
return (BOOL)CanInlineTypeCheckWithObjectVTable->Get((DWORDLONG)cls);
}
-void MethodContext::recSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method, BOOL result)
+void MethodContext::recSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent,
+ CORINFO_METHOD_HANDLE method,
+ BOOL result)
{
if (SatisfiesMethodConstraints == nullptr)
SatisfiesMethodConstraints = new LightWeightMap<DLDL, DWORD>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)parent;
key.B = (DWORDLONG)method;
@@ -4710,7 +4856,8 @@ void MethodContext::dmpSatisfiesMethodConstraints(DLDL key, DWORD value)
BOOL MethodContext::repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)parent;
key.B = (DWORDLONG)method;
@@ -4719,8 +4866,9 @@ BOOL MethodContext::repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, C
return value;
}
-void MethodContext::recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method, BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraint)
+void MethodContext::recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
+ BOOL* pfHasCircularClassConstraints,
+ BOOL* pfHasCircularMethodConstraint)
{
if (InitConstraintsForVerification == nullptr)
InitConstraintsForVerification = new LightWeightMap<DWORDLONG, DD>();
@@ -4736,8 +4884,9 @@ void MethodContext::dmpInitConstraintsForVerification(DWORDLONG key, DD value)
{
printf("InitConstraintsForVerification key ftn-%016llX, value circ-%u cirm-%u", key, value.A, value.B);
}
-void MethodContext::repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method, BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraint)
+void MethodContext::repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
+ BOOL* pfHasCircularClassConstraints,
+ BOOL* pfHasCircularMethodConstraint)
{
DD value;
@@ -4753,7 +4902,8 @@ void MethodContext::recIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned m
IsValidStringRef = new LightWeightMap<DLD, DWORD>();
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
+ 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;
@@ -4767,7 +4917,8 @@ void MethodContext::dmpIsValidStringRef(DLD key, DWORD value)
BOOL MethodContext::repIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK)
{
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
+ 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;
@@ -4795,7 +4946,8 @@ void MethodContext::dmpGetHelperName(DWORD key, DWORD value)
}
const char* MethodContext::repGetHelperName(CorInfoHelpFunc funcNum)
{
- if (GetHelperName == nullptr) return "Yickish helper name";
+ if (GetHelperName == nullptr)
+ return "Yickish helper name";
int itemIndex = GetHelperName->GetIndex((DWORD)funcNum);
if (itemIndex < 0)
@@ -4810,14 +4962,14 @@ const char* MethodContext::repGetHelperName(CorInfoHelpFunc funcNum)
}
}
-
void MethodContext::recCanCast(CORINFO_CLASS_HANDLE child, CORINFO_CLASS_HANDLE parent, BOOL result)
{
if (CanCast == nullptr)
CanCast = new LightWeightMap<DLDL, DWORD>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)child;
key.B = (DWORDLONG)parent;
@@ -4832,19 +4984,22 @@ void MethodContext::dmpCanCast(DLDL key, DWORD value)
BOOL MethodContext::repCanCast(CORINFO_CLASS_HANDLE child, CORINFO_CLASS_HANDLE parent)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)child;
key.B = (DWORDLONG)parent;
- AssertCodeMsg(CanCast != nullptr, EXCEPTIONCODE_MC, "Didn't find anything %016llX, %016llX in map", (DWORDLONG)child, (DWORDLONG)parent);
- AssertCodeMsg(CanCast->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX, %016llX %u in map", (DWORDLONG)child, (DWORDLONG)parent, CanCast->GetCount());
+ AssertCodeMsg(CanCast != nullptr, EXCEPTIONCODE_MC, "Didn't find anything %016llX, %016llX in map",
+ (DWORDLONG)child, (DWORDLONG)parent);
+ AssertCodeMsg(CanCast->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX, %016llX %u in map",
+ (DWORDLONG)child, (DWORDLONG)parent, CanCast->GetCount());
BOOL value = (BOOL)CanCast->Get(key);
DEBUG_REP(dmpCanCast(key, (DWORD)value));
return value;
}
-void MethodContext::recGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE *clsRet, CorInfoType result)
+void MethodContext::recGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet, CorInfoType result)
{
if (GetChildType == nullptr)
GetChildType = new LightWeightMap<DWORDLONG, DLD>();
@@ -4859,14 +5014,16 @@ void MethodContext::recGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_H
}
void MethodContext::dmpGetChildType(DWORDLONG key, DLD value)
{
- printf("GetChildType key cls-%016llX, value clsr-%016llX cit-%u(%s)", key, value.A, value.B, toString((CorInfoType)value.B));
+ printf("GetChildType key cls-%016llX, value clsr-%016llX cit-%u(%s)", key, value.A, value.B,
+ toString((CorInfoType)value.B));
}
-CorInfoType MethodContext::repGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE *clsRet)
+CorInfoType MethodContext::repGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet)
{
DLD value;
AssertCodeMsg(GetChildType != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)clsHnd);
- AssertCodeMsg(GetChildType->GetIndex((DWORDLONG)clsHnd) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)clsHnd);
+ AssertCodeMsg(GetChildType->GetIndex((DWORDLONG)clsHnd) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)clsHnd);
value = GetChildType->Get((DWORDLONG)clsHnd);
*clsRet = (CORINFO_CLASS_HANDLE)value.A;
@@ -4874,14 +5031,14 @@ CorInfoType MethodContext::repGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_
return (CorInfoType)value.B;
}
-
-void MethodContext::recGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size, void *result)
+void MethodContext::recGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size, void* result)
{
if (GetArrayInitializationData == nullptr)
GetArrayInitializationData = new LightWeightMap<DLD, DWORDLONG>();
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
+ 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)field;
key.B = (DWORD)size;
@@ -4892,19 +5049,20 @@ void MethodContext::dmpGetArrayInitializationData(DLD key, DWORDLONG value)
{
printf("GetArrayInitializationData key field-%016llX size-%08X, value result-%016llX", key.A, key.B, value);
}
-void *MethodContext::repGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size)
+void* MethodContext::repGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size)
{
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
+ 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)field;
key.B = (DWORD)size;
- void *value = (void*)GetArrayInitializationData->Get(key);
+ void* value = (void*)GetArrayInitializationData->Get(key);
return value;
}
-void MethodContext::recFilterException(struct _EXCEPTION_POINTERS *pExceptionPointers, int result)
+void MethodContext::recFilterException(struct _EXCEPTION_POINTERS* pExceptionPointers, int result)
{
if (FilterException == nullptr)
FilterException = new LightWeightMap<DWORD, DWORD>();
@@ -4915,7 +5073,7 @@ void MethodContext::dmpFilterException(DWORD key, DWORD value)
{
printf("FilterException key %u, value %u", key, value);
}
-int MethodContext::repFilterException(struct _EXCEPTION_POINTERS *pExceptionPointers)
+int MethodContext::repFilterException(struct _EXCEPTION_POINTERS* pExceptionPointers)
{
if (FilterException == nullptr)
return EXCEPTION_CONTINUE_SEARCH;
@@ -4926,10 +5084,9 @@ int MethodContext::repFilterException(struct _EXCEPTION_POINTERS *pExceptionPoin
int result = FilterException->Get((DWORD)pExceptionPointers->ExceptionRecord->ExceptionCode);
return result;
}
-
}
-void MethodContext::recHandleException(struct _EXCEPTION_POINTERS *pExceptionPointers)
+void MethodContext::recHandleException(struct _EXCEPTION_POINTERS* pExceptionPointers)
{
if (HandleException == nullptr)
HandleException = new DenseLightWeightMap<DWORD>();
@@ -4941,7 +5098,7 @@ void MethodContext::dmpHandleException(DWORD key, DWORD value)
printf("HandleException key %u, value %u", key, value);
}
-void MethodContext::recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection, void* result)
+void MethodContext::recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result)
{
if (GetAddressOfPInvokeFixup == nullptr)
GetAddressOfPInvokeFixup = new LightWeightMap<DWORDLONG, DLDL>();
@@ -4952,7 +5109,7 @@ void MethodContext::recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, vo
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetAddressOfPInvokeFixup->Add((DWORDLONG)method, value);
}
@@ -4960,17 +5117,17 @@ void MethodContext::dmpGetAddressOfPInvokeFixup(DWORDLONG key, DLDL value)
{
printf("GetAddressOfPInvokeFixup key ftn-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-void* MethodContext::repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection)
+void* MethodContext::repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection)
{
DLDL value;
value = GetAddressOfPInvokeFixup->Get((DWORDLONG)method);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
return (void*)value.B;
}
-void MethodContext::recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup)
+void MethodContext::recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup)
{
if (GetAddressOfPInvokeTarget == nullptr)
GetAddressOfPInvokeTarget = new LightWeightMap<DWORDLONG, DLD>();
@@ -4986,15 +5143,14 @@ void MethodContext::dmpGetAddressOfPInvokeTarget(DWORDLONG key, DLD value)
{
printf("GetAddressOfPInvokeTarget key ftn-%016llX, value addr-%016llX at-%u", key, value.A, value.B);
}
-void MethodContext::repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup)
+void MethodContext::repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup)
{
DLD value = GetAddressOfPInvokeTarget->Get((DWORDLONG)method);
- pLookup->addr = (void *)value.A;
+ pLookup->addr = (void*)value.A;
pLookup->accessType = (InfoAccessType)value.B;
}
-
void MethodContext::recSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls, BOOL result)
{
if (SatisfiesClassConstraints == nullptr)
@@ -5017,7 +5173,7 @@ void MethodContext::recGetMethodHash(CORINFO_METHOD_HANDLE ftn, unsigned result)
GetMethodHash = new LightWeightMap<DWORDLONG, DWORD>();
GetMethodHash->Add((DWORDLONG)ftn, (DWORD)result);
- DEBUG_REC(dmpGetMethodHash((DWORDLONG)ftn, (DWORD) result));
+ DEBUG_REC(dmpGetMethodHash((DWORDLONG)ftn, (DWORD)result));
}
void MethodContext::dmpGetMethodHash(DWORDLONG key, DWORD value)
{
@@ -5027,69 +5183,78 @@ unsigned MethodContext::repGetMethodHash(CORINFO_METHOD_HANDLE ftn)
{
unsigned result = 0x43;
if (GetMethodHash != nullptr)
- if (GetMethodHash->GetIndex((DWORDLONG)ftn) >= 0)
- result = GetMethodHash->Get((DWORDLONG)ftn);
- DEBUG_REP(dmpGetMethodHash((DWORDLONG)ftn, (DWORD) result));
+ if (GetMethodHash->GetIndex((DWORDLONG)ftn) >= 0)
+ result = GetMethodHash->Get((DWORDLONG)ftn);
+ DEBUG_REP(dmpGetMethodHash((DWORDLONG)ftn, (DWORD)result));
return result;
}
-void MethodContext::recCanTailCall(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE declaredCalleeHnd,
- CORINFO_METHOD_HANDLE exactCalleeHnd, bool fIsTailPrefix, bool result)
+void MethodContext::recCanTailCall(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE declaredCalleeHnd,
+ CORINFO_METHOD_HANDLE exactCalleeHnd,
+ bool fIsTailPrefix,
+ bool result)
{
if (CanTailCall == nullptr)
CanTailCall = new LightWeightMap<Agnostic_CanTailCall, DWORD>();
Agnostic_CanTailCall key;
- ZeroMemory(&key, sizeof(Agnostic_CanTailCall)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CanTailCall)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
- key.callerHnd = (DWORDLONG)callerHnd;
+ key.callerHnd = (DWORDLONG)callerHnd;
key.declaredCalleeHnd = (DWORDLONG)declaredCalleeHnd;
- key.exactCalleeHnd = (DWORDLONG)exactCalleeHnd;
- key.fIsTailPrefix = (DWORD)fIsTailPrefix;
+ key.exactCalleeHnd = (DWORDLONG)exactCalleeHnd;
+ key.fIsTailPrefix = (DWORD)fIsTailPrefix;
CanTailCall->Add(key, (DWORD)result);
- DEBUG_REC(dmpCanTailCall(key,(DWORD)result));
+ DEBUG_REC(dmpCanTailCall(key, (DWORD)result));
}
void MethodContext::dmpCanTailCall(const Agnostic_CanTailCall& key, DWORD value)
{
- printf("CanTailCall key clr-%016llX dcle-%016llX ecle-%016llX pfx-%u, value res-%u",
- key.callerHnd,
- key.declaredCalleeHnd,
- key.exactCalleeHnd,
- key.fIsTailPrefix,
- value);
+ printf("CanTailCall key clr-%016llX dcle-%016llX ecle-%016llX pfx-%u, value res-%u", key.callerHnd,
+ key.declaredCalleeHnd, key.exactCalleeHnd, key.fIsTailPrefix, value);
}
-bool MethodContext::repCanTailCall(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE declaredCalleeHnd, CORINFO_METHOD_HANDLE exactCalleeHnd,
- bool fIsTailPrefix)
+bool MethodContext::repCanTailCall(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE declaredCalleeHnd,
+ CORINFO_METHOD_HANDLE exactCalleeHnd,
+ bool fIsTailPrefix)
{
Agnostic_CanTailCall key;
- ZeroMemory(&key, sizeof(Agnostic_CanTailCall)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CanTailCall)); // We use the input structs as a key and use memcmp to compare.. so
+ // we need to zero out padding too
- key.callerHnd = (DWORDLONG)callerHnd;
+ key.callerHnd = (DWORDLONG)callerHnd;
key.declaredCalleeHnd = (DWORDLONG)declaredCalleeHnd;
- key.exactCalleeHnd = (DWORDLONG)exactCalleeHnd;
- key.fIsTailPrefix = (DWORD)fIsTailPrefix;
+ key.exactCalleeHnd = (DWORDLONG)exactCalleeHnd;
+ key.fIsTailPrefix = (DWORD)fIsTailPrefix;
- AssertCodeMsg(CanTailCall != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)key.callerHnd);
+ AssertCodeMsg(CanTailCall != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)key.callerHnd);
AssertCodeMsg(CanTailCall->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.callerHnd);
bool temp = CanTailCall->Get(key) != 0;
- DEBUG_REP(dmpCanTailCall(key,(DWORD)temp));
+ DEBUG_REP(dmpCanTailCall(key, (DWORD)temp));
return temp;
}
-void MethodContext::recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls,
- CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, BOOL *pfIsOpenDelegate, BOOL result)
+void MethodContext::recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls,
+ CORINFO_CLASS_HANDLE methodParentCls,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CLASS_HANDLE delegateCls,
+ BOOL* pfIsOpenDelegate,
+ BOOL result)
{
if (IsCompatibleDelegate == nullptr)
IsCompatibleDelegate = new LightWeightMap<Agnostic_IsCompatibleDelegate, DD>();
Agnostic_IsCompatibleDelegate key;
- ZeroMemory(&key, sizeof(Agnostic_IsCompatibleDelegate)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_IsCompatibleDelegate)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DD value;
- key.objCls = (DWORDLONG)objCls;
+ key.objCls = (DWORDLONG)objCls;
key.methodParentCls = (DWORDLONG)methodParentCls;
- key.method = (DWORDLONG)method;
- key.delegateCls = (DWORDLONG)delegateCls;
+ key.method = (DWORDLONG)method;
+ key.delegateCls = (DWORDLONG)delegateCls;
value.A = (DWORD)*pfIsOpenDelegate;
value.B = (DWORD)result;
@@ -5098,20 +5263,25 @@ void MethodContext::recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO
}
void MethodContext::dmpIsCompatibleDelegate(const Agnostic_IsCompatibleDelegate& key, DD value)
{
- printf("IsCompatibleDelegate key objCls-%016llX methodParentCls-%016llX method-%016llX delegateCls-%016llX, value pfIsOpenDelegate-%08X result-%08X",
- key.objCls, key.methodParentCls, key.method, key.delegateCls, value.A, value.B);
+ printf("IsCompatibleDelegate key objCls-%016llX methodParentCls-%016llX method-%016llX delegateCls-%016llX, value "
+ "pfIsOpenDelegate-%08X result-%08X",
+ key.objCls, key.methodParentCls, key.method, key.delegateCls, value.A, value.B);
}
-BOOL MethodContext::repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls,
- CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, BOOL *pfIsOpenDelegate)
+BOOL MethodContext::repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls,
+ CORINFO_CLASS_HANDLE methodParentCls,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CLASS_HANDLE delegateCls,
+ BOOL* pfIsOpenDelegate)
{
Agnostic_IsCompatibleDelegate key;
- ZeroMemory(&key, sizeof(Agnostic_IsCompatibleDelegate)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_IsCompatibleDelegate)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DD value;
- key.objCls = (DWORDLONG)objCls;
+ key.objCls = (DWORDLONG)objCls;
key.methodParentCls = (DWORDLONG)methodParentCls;
- key.method = (DWORDLONG)method;
- key.delegateCls = (DWORDLONG)delegateCls;
+ key.method = (DWORDLONG)method;
+ key.delegateCls = (DWORDLONG)delegateCls;
value = IsCompatibleDelegate->Get(key);
@@ -5119,7 +5289,9 @@ BOOL MethodContext::repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO
return (BOOL)value.B;
}
-void MethodContext::recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd, BOOL result)
+void MethodContext::recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ BOOL result)
{
if (IsDelegateCreationAllowed == nullptr)
IsDelegateCreationAllowed = new LightWeightMap<DLDL, DWORD>();
@@ -5137,8 +5309,7 @@ void MethodContext::recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHn
}
void MethodContext::dmpIsDelegateCreationAllowed(DLDL key, DWORD value)
{
- printf("IsDelegateCreationAllowed key delegateHnd-%016llX calleeHnd-%016llX result-%08X",
- key.A, key.B, value);
+ printf("IsDelegateCreationAllowed key delegateHnd-%016llX calleeHnd-%016llX result-%08X", key.A, key.B, value);
}
BOOL MethodContext::repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd)
{
@@ -5154,19 +5325,22 @@ BOOL MethodContext::repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHn
return (BOOL)value;
}
-void MethodContext::recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip, CorInfoCanSkipVerificationResult result)
+void MethodContext::recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle,
+ BOOL skip,
+ CorInfoCanSkipVerificationResult result)
{
if (CanSkipMethodVerification == nullptr)
CanSkipMethodVerification = new LightWeightMap<DLD, DWORD>();
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
+ 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)ftnHandle;
key.B = (DWORD)skip;
CanSkipMethodVerification->Add(key, (DWORD)result);
- DEBUG_REC(dmpCanSkipMethodVerification(key,(DWORD)result));
+ DEBUG_REC(dmpCanSkipMethodVerification(key, (DWORD)result));
}
void MethodContext::dmpCanSkipMethodVerification(DLD key, DWORD value)
{
@@ -5175,80 +5349,82 @@ void MethodContext::dmpCanSkipMethodVerification(DLD key, DWORD value)
CorInfoCanSkipVerificationResult MethodContext::repCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip)
{
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
+ 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)ftnHandle;
key.B = (DWORD)skip;
- AssertCodeMsg(CanSkipMethodVerification != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)ftnHandle);
- AssertCodeMsg(CanSkipMethodVerification->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)ftnHandle);
+ AssertCodeMsg(CanSkipMethodVerification != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)ftnHandle);
+ AssertCodeMsg(CanSkipMethodVerification->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)ftnHandle);
CorInfoCanSkipVerificationResult temp = (CorInfoCanSkipVerificationResult)CanSkipMethodVerification->Get(key);
- DEBUG_REP(dmpCanSkipMethodVerification(key,(DWORD)temp));
+ DEBUG_REP(dmpCanSkipMethodVerification(key, (DWORD)temp));
return temp;
}
-void MethodContext::recFindCallSiteSig(CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig)
+void MethodContext::recFindCallSiteSig(CORINFO_MODULE_HANDLE module,
+ unsigned methTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig)
{
if (FindCallSiteSig == nullptr)
FindCallSiteSig = new LightWeightMap<Agnostic_FindCallSiteSig, Agnostic_CORINFO_SIG_INFO>();
Agnostic_FindCallSiteSig key;
- ZeroMemory(&key, sizeof(Agnostic_FindCallSiteSig)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_FindCallSiteSig)); // We use the input structs as a key and use memcmp to compare..
+ // so we need to zero out padding too
Agnostic_CORINFO_SIG_INFO value;
- key.module = (DWORDLONG)module;
+ key.module = (DWORDLONG)module;
key.methTok = (DWORD)methTOK;
key.context = (DWORDLONG)context;
- value.callConv = (DWORD)sig->callConv;
- value.retTypeClass = (DWORDLONG)sig->retTypeClass;
- value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
- value.retType = (DWORD)sig->retType;
- value.flags = (DWORD)sig->flags;
- value.numArgs = (DWORD)sig->numArgs;
- value.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
- value.sigInst_classInst_Index = FindCallSiteSig->AddBuffer((unsigned char*)sig->sigInst.classInst, sig->sigInst.classInstCount * 8); //porting issue
- value.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
- value.sigInst_methInst_Index = FindCallSiteSig->AddBuffer((unsigned char*)sig->sigInst.methInst, sig->sigInst.methInstCount * 8); //porting issue
- value.args = (DWORDLONG)sig->args;
+ value.callConv = (DWORD)sig->callConv;
+ value.retTypeClass = (DWORDLONG)sig->retTypeClass;
+ value.retTypeSigClass = (DWORDLONG)sig->retTypeSigClass;
+ value.retType = (DWORD)sig->retType;
+ value.flags = (DWORD)sig->flags;
+ value.numArgs = (DWORD)sig->numArgs;
+ value.sigInst_classInstCount = (DWORD)sig->sigInst.classInstCount;
+ value.sigInst_classInst_Index = FindCallSiteSig->AddBuffer((unsigned char*)sig->sigInst.classInst,
+ sig->sigInst.classInstCount * 8); // porting issue
+ value.sigInst_methInstCount = (DWORD)sig->sigInst.methInstCount;
+ value.sigInst_methInst_Index = FindCallSiteSig->AddBuffer((unsigned char*)sig->sigInst.methInst,
+ sig->sigInst.methInstCount * 8); // porting issue
+ value.args = (DWORDLONG)sig->args;
value.cbSig = (DWORD)sig->cbSig;
- value.pSig = (DWORD)FindCallSiteSig->AddBuffer((unsigned char *)sig->pSig, sig->cbSig);
+ value.pSig = (DWORD)FindCallSiteSig->AddBuffer((unsigned char*)sig->pSig, sig->cbSig);
value.scope = (DWORDLONG)sig->scope;
value.token = (DWORD)sig->token;
FindCallSiteSig->Add(key, value);
- DEBUG_REC(dmpFindCallSiteSig(key,value));
+ DEBUG_REC(dmpFindCallSiteSig(key, value));
}
void MethodContext::dmpFindCallSiteSig(const Agnostic_FindCallSiteSig& key, const Agnostic_CORINFO_SIG_INFO& value)
{
printf("dmpFindCallSiteSig key module-%016llX methTok-%08X context-%016llX", key.module, key.methTok, key.context);
- printf(", value callConv-%08X retTypeClass-%016llX retTypeSigClass-%016llX retType-%u(%s) flags-%08X numArgs-%08X classInstCount-%08X classInd-%08X "
+ printf(", value callConv-%08X retTypeClass-%016llX retTypeSigClass-%016llX retType-%u(%s) flags-%08X numArgs-%08X "
+ "classInstCount-%08X classInd-%08X "
"methInstCount-%08X methInd-%08X args-%016llX cbSig-%08X pSig-%08X scope-%016llX token-%08X",
- value.callConv,
- value.retTypeClass,
- value.retTypeSigClass,
- value.retType,
- toString((CorInfoType)value.retType),
- value.flags,
- value.numArgs,
- value.sigInst_classInstCount,
- value.sigInst_classInst_Index,
- value.sigInst_methInstCount,
- value.sigInst_methInst_Index,
- value.args,
- value.cbSig,
- value.pSig,
- value.scope,
- value.token);
-}
-void MethodContext::repFindCallSiteSig(CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig)
+ value.callConv, value.retTypeClass, value.retTypeSigClass, value.retType,
+ toString((CorInfoType)value.retType), value.flags, value.numArgs, value.sigInst_classInstCount,
+ value.sigInst_classInst_Index, value.sigInst_methInstCount, value.sigInst_methInst_Index, value.args,
+ value.cbSig, value.pSig, value.scope, value.token);
+}
+void MethodContext::repFindCallSiteSig(CORINFO_MODULE_HANDLE module,
+ unsigned methTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig)
{
Agnostic_FindCallSiteSig key;
- ZeroMemory(&key, sizeof(Agnostic_FindCallSiteSig)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_FindCallSiteSig)); // We use the input structs as a key and use memcmp to compare..
+ // so we need to zero out padding too
Agnostic_CORINFO_SIG_INFO value;
- key.module = (DWORDLONG)module;
+ key.module = (DWORDLONG)module;
key.methTok = (DWORD)methTOK;
key.context = (DWORDLONG)context;
@@ -5256,22 +5432,22 @@ void MethodContext::repFindCallSiteSig(CORINFO_MODULE_HANDLE module, unsigned me
AssertCodeMsg(FindCallSiteSig->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %08X", (DWORD)key.methTok);
value = FindCallSiteSig->Get(key);
- sig->callConv = (CorInfoCallConv)value.callConv;
- sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
- sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
- sig->retType = (CorInfoType)value.retType;
- sig->flags = (unsigned)value.flags;
- sig->numArgs = (unsigned)value.numArgs;
+ sig->callConv = (CorInfoCallConv)value.callConv;
+ sig->retTypeClass = (CORINFO_CLASS_HANDLE)value.retTypeClass;
+ sig->retTypeSigClass = (CORINFO_CLASS_HANDLE)value.retTypeSigClass;
+ sig->retType = (CorInfoType)value.retType;
+ sig->flags = (unsigned)value.flags;
+ sig->numArgs = (unsigned)value.numArgs;
sig->sigInst.classInstCount = (unsigned)value.sigInst_classInstCount;
- sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)FindCallSiteSig->GetBuffer(value.sigInst_classInst_Index);
- sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
- sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)FindCallSiteSig->GetBuffer(value.sigInst_methInst_Index);
- sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
- sig->cbSig = (unsigned int)value.cbSig;
- sig->pSig = (PCCOR_SIGNATURE)FindCallSiteSig->GetBuffer(value.pSig);
- sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
- sig->token = (mdToken)value.token;
- DEBUG_REP(dmpFindCallSiteSig(key,value));
+ sig->sigInst.classInst = (CORINFO_CLASS_HANDLE*)FindCallSiteSig->GetBuffer(value.sigInst_classInst_Index);
+ sig->sigInst.methInstCount = (unsigned)value.sigInst_methInstCount;
+ sig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)FindCallSiteSig->GetBuffer(value.sigInst_methInst_Index);
+ sig->args = (CORINFO_ARG_LIST_HANDLE)value.args;
+ sig->cbSig = (unsigned int)value.cbSig;
+ sig->pSig = (PCCOR_SIGNATURE)FindCallSiteSig->GetBuffer(value.pSig);
+ sig->scope = (CORINFO_MODULE_HANDLE)value.scope;
+ sig->token = (mdToken)value.token;
+ DEBUG_REP(dmpFindCallSiteSig(key, value));
}
void MethodContext::recShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope, BOOL result)
@@ -5287,14 +5463,16 @@ void MethodContext::dmpShouldEnforceCallvirtRestriction(DWORDLONG key, DWORD val
}
BOOL MethodContext::repShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope)
{
- AssertCodeMsg(ShouldEnforceCallvirtRestriction != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)scope);
- AssertCodeMsg(ShouldEnforceCallvirtRestriction->GetIndex((DWORDLONG)scope) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)scope);
+ AssertCodeMsg(ShouldEnforceCallvirtRestriction != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)scope);
+ AssertCodeMsg(ShouldEnforceCallvirtRestriction->GetIndex((DWORDLONG)scope) != -1, EXCEPTIONCODE_MC,
+ "Didn't find %016llX", (DWORDLONG)scope);
BOOL temp = (BOOL)ShouldEnforceCallvirtRestriction->Get((DWORDLONG)scope);
DEBUG_REC(dmpShouldEnforceCallvirtRestriction((DWORDLONG)scope, (DWORD)temp));
return temp;
}
-void MethodContext::recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void **ppIndirection, void* result)
+void MethodContext::recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection, void* result)
{
if (GetMethodSync == nullptr)
GetMethodSync = new LightWeightMap<DWORDLONG, DLDL>();
@@ -5303,7 +5481,7 @@ void MethodContext::recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void **ppIndirec
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetMethodSync->Add((DWORDLONG)ftn, value);
}
@@ -5311,113 +5489,113 @@ void MethodContext::dmpGetMethodSync(DWORDLONG key, DLDL value)
{
printf("GetMethodSync key %016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-void* MethodContext::repGetMethodSync(CORINFO_METHOD_HANDLE ftn, void **ppIndirection)
+void* MethodContext::repGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection)
{
DLDL value;
value = (DLDL)GetMethodSync->Get((DWORDLONG)ftn);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
return (void*)value.B;
}
-void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO *pSig, void **ppIndirection, CORINFO_VARARGS_HANDLE result)
+void MethodContext::recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection, CORINFO_VARARGS_HANDLE result)
{
if (GetVarArgsHandle == nullptr)
GetVarArgsHandle = new LightWeightMap<Agnostic_CORINFO_SIG_INFO, DLDL>();
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DLDL value;
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)pSig->cbSig;
- key.pSig = (DWORD)GetVarArgsHandle->AddBuffer((unsigned char *)pSig->pSig, pSig->cbSig);
- key.scope = (DWORDLONG)pSig->scope;
- key.token = (DWORD)pSig->token;
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)pSig->cbSig;
+ key.pSig = (DWORD)GetVarArgsHandle->AddBuffer((unsigned char*)pSig->pSig, pSig->cbSig);
+ key.scope = (DWORDLONG)pSig->scope;
+ key.token = (DWORD)pSig->token;
if (ppIndirection != nullptr)
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetVarArgsHandle->Add(key, value);
}
void MethodContext::dmpGetVarArgsHandle(const Agnostic_CORINFO_SIG_INFO& key, DLDL value)
{
- printf("GetVarArgsHandle key cbSig-%08X pSig-%08X scope-%016llX token-%08X",
- key.cbSig,
- key.pSig,
- key.scope,
- key.token);
+ printf("GetVarArgsHandle key cbSig-%08X pSig-%08X scope-%016llX token-%08X", key.cbSig, key.pSig, key.scope,
+ key.token);
printf(", value ppIndirection-%016llX result-%016llX", value.A, value.B);
}
-CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO *pSig, void **ppIndirection)
+CORINFO_VARARGS_HANDLE MethodContext::repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection)
{
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DLDL value;
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)pSig->cbSig;
- key.pSig = (DWORD)GetVarArgsHandle->Contains((unsigned char *)pSig->pSig, pSig->cbSig);
- key.scope = (DWORDLONG)pSig->scope;
- key.token = (DWORD)pSig->token;
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)pSig->cbSig;
+ key.pSig = (DWORD)GetVarArgsHandle->Contains((unsigned char*)pSig->pSig, pSig->cbSig);
+ key.scope = (DWORDLONG)pSig->scope;
+ key.token = (DWORD)pSig->token;
value = (DLDL)GetVarArgsHandle->Get(key);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
return (CORINFO_VARARGS_HANDLE)value.B;
}
-void MethodContext::recCanGetVarArgsHandle(CORINFO_SIG_INFO *pSig, bool result)
+void MethodContext::recCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig, bool result)
{
if (CanGetVarArgsHandle == nullptr)
CanGetVarArgsHandle = new LightWeightMap<Agnostic_CORINFO_SIG_INFO, DWORD>();
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)0;
- key.pSig = (DWORD)0;
- key.scope = (DWORDLONG)pSig->scope;
- key.token = (DWORD)pSig->token;
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)0;
+ key.pSig = (DWORD)0;
+ key.scope = (DWORDLONG)pSig->scope;
+ key.token = (DWORD)pSig->token;
CanGetVarArgsHandle->Add(key, (DWORD)result);
DEBUG_REC(dmpCanGetVarArgsHandle(key, (DWORD)result));
@@ -5426,38 +5604,42 @@ void MethodContext::dmpCanGetVarArgsHandle(const Agnostic_CORINFO_SIG_INFO& key,
{
printf("CanGetVarArgsHandle key scope-%016llX token-%08X, value result-%08X", key.scope, key.token, value);
}
-bool MethodContext::repCanGetVarArgsHandle(CORINFO_SIG_INFO *pSig)
+bool MethodContext::repCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig)
{
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)0;
- key.pSig = (DWORD)0;
- key.scope = (DWORDLONG)pSig->scope;
- key.token = (DWORD)pSig->token;
-
- AssertCodeMsg(CanGetVarArgsHandle != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)key.token);
- AssertCodeMsg(CanGetVarArgsHandle->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.token);
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)0;
+ key.pSig = (DWORD)0;
+ key.scope = (DWORDLONG)pSig->scope;
+ key.token = (DWORD)pSig->token;
+
+ AssertCodeMsg(CanGetVarArgsHandle != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX",
+ (DWORDLONG)key.token);
+ AssertCodeMsg(CanGetVarArgsHandle->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)key.token);
bool value = CanGetVarArgsHandle->Get(key) != 0;
DEBUG_REP(dmpCanGetVarArgsHandle(key, (DWORD)value));
return value;
}
-void MethodContext::recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void **ppIndirection, DWORD result)
+void MethodContext::recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection, DWORD result)
{
if (GetFieldThreadLocalStoreID == nullptr)
- GetFieldThreadLocalStoreID = new LightWeightMap<DWORDLONG, DLD>();;
+ GetFieldThreadLocalStoreID = new LightWeightMap<DWORDLONG, DLD>();
+ ;
DLD value;
@@ -5465,25 +5647,29 @@ void MethodContext::recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, vo
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORD)result;
+ value.B = (DWORD)result;
GetFieldThreadLocalStoreID->Add((DWORDLONG)field, value);
}
void MethodContext::dmpGetFieldThreadLocalStoreID(DWORDLONG key, DLD value)
{
- printf("GetFieldThreadLocalStoreID key field-%016llX, value ppIndirection-%016llX result-%08X", key, value.A, value.B);
+ printf("GetFieldThreadLocalStoreID key field-%016llX, value ppIndirection-%016llX result-%08X", key, value.A,
+ value.B);
}
-DWORD MethodContext::repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void **ppIndirection)
+DWORD MethodContext::repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection)
{
DLD value;
value = (DLD)GetFieldThreadLocalStoreID->Get((DWORDLONG)field);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
return (DWORD)value.B;
}
-void MethodContext::recGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd, ULONG *count, ICorJitInfo::ProfileBuffer **profileBuffer,
- ULONG *numRuns, HRESULT result)
+void MethodContext::recGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd,
+ ULONG* count,
+ ICorJitInfo::ProfileBuffer** profileBuffer,
+ ULONG* numRuns,
+ HRESULT result)
{
if (GetBBProfileData == nullptr)
GetBBProfileData = new LightWeightMap<DWORDLONG, Agnostic_GetBBProfileData>();
@@ -5491,16 +5677,18 @@ void MethodContext::recGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd, ULONG *cou
Agnostic_GetBBProfileData value;
value.count = (DWORD)*count;
- value.profileBuffer_index = GetBBProfileData->AddBuffer((unsigned char*)*profileBuffer, sizeof(ICorJitInfo::ProfileBuffer)*(*count));
+ value.profileBuffer_index =
+ GetBBProfileData->AddBuffer((unsigned char*)*profileBuffer, sizeof(ICorJitInfo::ProfileBuffer) * (*count));
value.numRuns = (DWORD)*numRuns;
- value.result = (DWORD)result;
+ value.result = (DWORD)result;
GetBBProfileData->Add((DWORDLONG)ftnHnd, value);
}
void MethodContext::dmpGetBBProfileData(DWORDLONG key, const Agnostic_GetBBProfileData& value)
{
printf("GetBBProfileData key ftn-%016llX, value cnt-%u profileBuf-", key, value.count);
- ICorJitInfo::ProfileBuffer* pBuf = (ICorJitInfo::ProfileBuffer *)GetBBProfileData->GetBuffer(value.profileBuffer_index);
+ ICorJitInfo::ProfileBuffer* pBuf =
+ (ICorJitInfo::ProfileBuffer*)GetBBProfileData->GetBuffer(value.profileBuffer_index);
for (DWORD i = 0; i < value.count; i++, pBuf++)
{
printf("{il-%u,cnt-%u}", pBuf->ILOffset, pBuf->ExecutionCount);
@@ -5508,16 +5696,18 @@ void MethodContext::dmpGetBBProfileData(DWORDLONG key, const Agnostic_GetBBProfi
GetBBProfileData->Unlock();
printf(" numRuns-%u result-%u", value.numRuns, value.result);
}
-HRESULT MethodContext::repGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd, ULONG *count, ICorJitInfo::ProfileBuffer **profileBuffer,
- ULONG *numRuns)
+HRESULT MethodContext::repGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd,
+ ULONG* count,
+ ICorJitInfo::ProfileBuffer** profileBuffer,
+ ULONG* numRuns)
{
Agnostic_GetBBProfileData tempValue;
tempValue = GetBBProfileData->Get((DWORDLONG)ftnHnd);
- *count = (ULONG)tempValue.count;
- *profileBuffer = (ICorJitInfo::ProfileBuffer *)GetBBProfileData->GetBuffer(tempValue.profileBuffer_index);
- *numRuns = (ULONG)tempValue.numRuns;
+ *count = (ULONG)tempValue.count;
+ *profileBuffer = (ICorJitInfo::ProfileBuffer*)GetBBProfileData->GetBuffer(tempValue.profileBuffer_index);
+ *numRuns = (ULONG)tempValue.numRuns;
HRESULT result = (HRESULT)tempValue.result;
return result;
}
@@ -5527,7 +5717,8 @@ void MethodContext::recMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HAN
if (MergeClasses == nullptr)
MergeClasses = new LightWeightMap<DLDL, DWORDLONG>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)cls1;
key.B = (DWORDLONG)cls2;
@@ -5541,41 +5732,43 @@ void MethodContext::dmpMergeClasses(DLDL key, DWORDLONG value)
CORINFO_CLASS_HANDLE MethodContext::repMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
DWORDLONG value;
key.A = (DWORDLONG)cls1;
key.B = (DWORDLONG)cls2;
- AssertCodeMsg(MergeClasses->GetIndex(key) != -1, EXCEPTIONCODE_MC,
- "Didn't find %016llX %016llX", (DWORDLONG)cls1, (DWORDLONG)cls2);
+ AssertCodeMsg(MergeClasses->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX %016llX", (DWORDLONG)cls1,
+ (DWORDLONG)cls2);
value = MergeClasses->Get(key);
return (CORINFO_CLASS_HANDLE)value;
}
-void MethodContext::recGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection, LPVOID result)
+void MethodContext::recGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection, LPVOID result)
{
if (GetCookieForPInvokeCalliSig == nullptr)
GetCookieForPInvokeCalliSig = new LightWeightMap<Agnostic_CORINFO_SIG_INFO, DLDL>();
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DLDL value;
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)szMetaSig->cbSig;
- key.pSig = (DWORD)GetCookieForPInvokeCalliSig->AddBuffer((unsigned char *)szMetaSig->pSig, szMetaSig->cbSig);
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)szMetaSig->cbSig;
+ key.pSig = (DWORD)GetCookieForPInvokeCalliSig->AddBuffer((unsigned char*)szMetaSig->pSig, szMetaSig->cbSig);
key.scope = (DWORDLONG)szMetaSig->scope;
key.token = (DWORD)szMetaSig->token;
@@ -5583,7 +5776,7 @@ void MethodContext::recGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig,
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
GetCookieForPInvokeCalliSig->Add(key, value);
}
@@ -5591,32 +5784,33 @@ void MethodContext::dmpGetCookieForPInvokeCalliSig(const Agnostic_CORINFO_SIG_IN
{
printf("GetCookieForPInvokeCalliSig NYI");
}
-LPVOID MethodContext::repGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection)
+LPVOID MethodContext::repGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection)
{
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
DLDL value;
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)szMetaSig->cbSig;
- key.pSig = (DWORD)GetCookieForPInvokeCalliSig->Contains((unsigned char *)szMetaSig->pSig, szMetaSig->cbSig);
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)szMetaSig->cbSig;
+ key.pSig = (DWORD)GetCookieForPInvokeCalliSig->Contains((unsigned char*)szMetaSig->pSig, szMetaSig->cbSig);
key.scope = (DWORDLONG)szMetaSig->scope;
key.token = (DWORD)szMetaSig->token;
value = (DLDL)GetCookieForPInvokeCalliSig->Get(key);
if (ppIndirection != nullptr)
- *ppIndirection = (void *)value.A;
+ *ppIndirection = (void*)value.A;
return (CORINFO_VARARGS_HANDLE)value.B;
}
@@ -5627,50 +5821,53 @@ void MethodContext::recCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSi
CanGetCookieForPInvokeCalliSig = new LightWeightMap<Agnostic_CORINFO_SIG_INFO, DWORD>();
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)0;
- key.pSig = (DWORD)0;
- key.scope = (DWORDLONG)szMetaSig->scope;
- key.token = (DWORD)szMetaSig->token;
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)0;
+ key.pSig = (DWORD)0;
+ key.scope = (DWORDLONG)szMetaSig->scope;
+ key.token = (DWORD)szMetaSig->token;
CanGetCookieForPInvokeCalliSig->Add(key, (DWORD)result);
}
void MethodContext::dmpCanGetCookieForPInvokeCalliSig(const Agnostic_CORINFO_SIG_INFO& key, DWORD value)
{
- printf("CanGetCookieForPInvokeCalliSig key scope-%016llX token-%08X, value result-%08X", key.scope, key.token, value);
+ printf("CanGetCookieForPInvokeCalliSig key scope-%016llX token-%08X, value result-%08X", key.scope, key.token,
+ value);
}
bool MethodContext::repCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig)
{
Agnostic_CORINFO_SIG_INFO key;
- ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.callConv = (DWORD)0;
- key.retTypeClass = (DWORDLONG)0;
- key.retTypeSigClass = (DWORDLONG)0;
- key.retType = (DWORD)0;
- key.flags = (DWORD)0;
- key.numArgs = (DWORD)0;
- key.sigInst_classInstCount = (DWORD)0;
+ ZeroMemory(&key, sizeof(Agnostic_CORINFO_SIG_INFO)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.callConv = (DWORD)0;
+ key.retTypeClass = (DWORDLONG)0;
+ key.retTypeSigClass = (DWORDLONG)0;
+ key.retType = (DWORD)0;
+ key.flags = (DWORD)0;
+ key.numArgs = (DWORD)0;
+ key.sigInst_classInstCount = (DWORD)0;
key.sigInst_classInst_Index = (DWORD)0;
- key.sigInst_methInstCount = (DWORD)0;
- key.sigInst_methInst_Index = (DWORD)0;
- key.args = (DWORDLONG)0;
- key.cbSig = (DWORD)0;
- key.pSig = (DWORD)0;
- key.scope = (DWORDLONG)szMetaSig->scope;
- key.token = (DWORD)szMetaSig->token;
+ key.sigInst_methInstCount = (DWORD)0;
+ key.sigInst_methInst_Index = (DWORD)0;
+ key.args = (DWORDLONG)0;
+ key.cbSig = (DWORD)0;
+ key.pSig = (DWORD)0;
+ key.scope = (DWORDLONG)szMetaSig->scope;
+ key.token = (DWORD)szMetaSig->token;
DWORD temp = CanGetCookieForPInvokeCalliSig->Get(key);
return temp != 0;
@@ -5682,7 +5879,8 @@ void MethodContext::recCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CL
CanAccessFamily = new LightWeightMap<DLDL, DWORD>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)hCaller;
key.B = (DWORDLONG)hInstanceType;
@@ -5696,7 +5894,8 @@ void MethodContext::dmpCanAccessFamily(DLDL key, DWORD value)
BOOL MethodContext::repCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)hCaller;
key.B = (DWORDLONG)hInstanceType;
@@ -5705,7 +5904,7 @@ BOOL MethodContext::repCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CL
return (BOOL)temp;
}
-void MethodContext::recErrorList(const char *error)
+void MethodContext::recErrorList(const char* error)
{
if (ErrorList == nullptr)
ErrorList = new DenseLightWeightMap<DWORD>();
@@ -5713,7 +5912,7 @@ void MethodContext::recErrorList(const char *error)
DWORD temp = (DWORD)-1;
if (error != nullptr)
- temp = (DWORD)ErrorList->AddBuffer((unsigned char *)error, (DWORD)strlen(error) + 1);
+ temp = (DWORD)ErrorList->AddBuffer((unsigned char*)error, (DWORD)strlen(error) + 1);
ErrorList->Append(temp);
}
@@ -5722,38 +5921,39 @@ void MethodContext::dmpErrorList(DWORD key, DWORD value)
printf("ErrorList NYI");
}
-void MethodContext::recGetProfilingHandle(BOOL *pbHookFunction, void **pProfilerHandle, BOOL *pbIndirectedHandles)
+void MethodContext::recGetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles)
{
if (GetProfilingHandle == nullptr)
GetProfilingHandle = new LightWeightMap<DWORD, Agnostic_GetProfilingHandle>();
Agnostic_GetProfilingHandle value;
- ZeroMemory(&value, sizeof(Agnostic_GetProfilingHandle)); //We use the input structs as a value and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&value, sizeof(Agnostic_GetProfilingHandle)); // We use the input structs as a value and use memcmp to
+ // compare.. so we need to zero out padding too
- value.bHookFunction = (DWORD)*pbHookFunction;
- value.ProfilerHandle = (DWORDLONG)*pProfilerHandle;
+ value.bHookFunction = (DWORD)*pbHookFunction;
+ value.ProfilerHandle = (DWORDLONG)*pProfilerHandle;
value.bIndirectedHandles = (DWORD)*pbIndirectedHandles;
GetProfilingHandle->Add((DWORD)0, value);
DEBUG_REC(dmpGetProfilingHandle(0, value));
}
void MethodContext::dmpGetProfilingHandle(DWORD key, const Agnostic_GetProfilingHandle& value)
{
- printf("GetProfilingHandle key %u, value bHookFtn-%u profHnd-%016llX bIndHnd-%u",
- key, value.bHookFunction, value.ProfilerHandle, value.bIndirectedHandles);
+ printf("GetProfilingHandle key %u, value bHookFtn-%u profHnd-%016llX bIndHnd-%u", key, value.bHookFunction,
+ value.ProfilerHandle, value.bIndirectedHandles);
}
-void MethodContext::repGetProfilingHandle(BOOL *pbHookFunction, void **pProfilerHandle, BOOL *pbIndirectedHandles)
+void MethodContext::repGetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles)
{
Agnostic_GetProfilingHandle value;
value = GetProfilingHandle->Get((DWORD)0);
- *pbHookFunction = (BOOL)value.bHookFunction;
- *pProfilerHandle = (void*)value.ProfilerHandle;
+ *pbHookFunction = (BOOL)value.bHookFunction;
+ *pProfilerHandle = (void*)value.ProfilerHandle;
*pbIndirectedHandles = (BOOL)value.bIndirectedHandles;
DEBUG_REP(dmpGetProfilingHandle(0, value));
}
-void MethodContext::recEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIndirection, CORINFO_FIELD_HANDLE result)
+void MethodContext::recEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection, CORINFO_FIELD_HANDLE result)
{
if (EmbedFieldHandle == nullptr)
EmbedFieldHandle = new LightWeightMap<DWORDLONG, DLDL>();
@@ -5763,7 +5963,7 @@ void MethodContext::recEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIn
value.A = (DWORDLONG)*ppIndirection;
else
value.A = (DWORDLONG)0;
- value.B = (DWORDLONG)result;
+ value.B = (DWORDLONG)result;
EmbedFieldHandle->Add((DWORDLONG)handle, value);
}
@@ -5771,7 +5971,7 @@ void MethodContext::dmpEmbedFieldHandle(DWORDLONG key, DLDL value)
{
printf("EmbedFieldHandle NYI");
}
-CORINFO_FIELD_HANDLE MethodContext::repEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIndirection)
+CORINFO_FIELD_HANDLE MethodContext::repEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection)
{
DLDL value;
@@ -5787,7 +5987,8 @@ void MethodContext::recAreTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLA
AreTypesEquivalent = new LightWeightMap<DLDL, DWORD>();
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)cls1;
key.B = (DWORDLONG)cls2;
@@ -5801,24 +6002,27 @@ void MethodContext::dmpAreTypesEquivalent(DLDL key, DWORD value)
BOOL MethodContext::repAreTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2)
{
DLDL key;
- ZeroMemory(&key, sizeof(DLDL)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero
+ // out padding too
key.A = (DWORDLONG)cls1;
key.B = (DWORDLONG)cls2;
- AssertCodeMsg(AreTypesEquivalent->GetIndex(key) != -1, EXCEPTIONCODE_MC,
- "Didn't find %016llX %016llX", (DWORDLONG)cls1, (DWORDLONG)cls2);
+ AssertCodeMsg(AreTypesEquivalent->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX %016llX",
+ (DWORDLONG)cls1, (DWORDLONG)cls2);
BOOL value = (BOOL)AreTypesEquivalent->Get(key);
return value;
}
-void MethodContext::recFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char * szFQName, size_t FQNameCapacity, size_t result)
+void MethodContext::recFindNameOfToken(
+ CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity, size_t result)
{
if (FindNameOfToken == nullptr)
FindNameOfToken = new LightWeightMap<DLD, DLD>();
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
+ 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
DLD value;
key.A = (DWORDLONG)module;
@@ -5832,18 +6036,22 @@ void MethodContext::recFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken met
}
void MethodContext::dmpFindNameOfToken(DLD key, DLD value)
{
- //practically the name of a token wont be bigger than 4gb...
- unsigned char *buff = new unsigned char[(unsigned int)value.A + 1];
+ // practically the name of a token wont be bigger than 4gb...
+ unsigned char* buff = new unsigned char[(unsigned int)value.A + 1];
ZeroMemory(buff, (unsigned int)value.A + 1);
memcpy(buff, FindNameOfToken->GetBuffer(value.B), (unsigned int)value.A);
FindNameOfToken->Unlock();
printf("FindNameOfToken key mod-%016llX tok-%08X, value '%s'", key.A, key.B, buff);
- delete[]buff;
+ delete[] buff;
}
-size_t MethodContext::repFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char * szFQName, size_t FQNameCapacity)
+size_t MethodContext::repFindNameOfToken(CORINFO_MODULE_HANDLE module,
+ mdToken metaTOK,
+ char* szFQName,
+ size_t FQNameCapacity)
{
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
+ 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
DLD value;
key.A = (DWORDLONG)module;
@@ -5862,12 +6070,16 @@ size_t MethodContext::repFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken m
return (size_t)value.A;
}
-void MethodContext::recGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr, bool result)
+void MethodContext::recGetSystemVAmd64PassStructInRegisterDescriptor(
+ CORINFO_CLASS_HANDLE structHnd,
+ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr,
+ bool result)
{
if (GetSystemVAmd64PassStructInRegisterDescriptor == nullptr)
- GetSystemVAmd64PassStructInRegisterDescriptor = new LightWeightMap<DWORDLONG, Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor>();
+ GetSystemVAmd64PassStructInRegisterDescriptor =
+ new LightWeightMap<DWORDLONG, Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor>();
- DWORDLONG key;
+ DWORDLONG key;
Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor value;
key = (DWORDLONG)structHnd;
@@ -5885,21 +6097,22 @@ void MethodContext::recGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLA
GetSystemVAmd64PassStructInRegisterDescriptor->Add(key, value);
DEBUG_REC(dmpGetSystemVAmd64PassStructInRegisterDescriptor(key, value));
}
-void MethodContext::dmpGetSystemVAmd64PassStructInRegisterDescriptor(DWORDLONG key, const Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor& value)
+void MethodContext::dmpGetSystemVAmd64PassStructInRegisterDescriptor(
+ DWORDLONG key, const Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor& value)
{
- printf("GetSystemVAmd64PassStructInRegisterDescriptor key structHnd-%016llX, value passInReg-%u 8bCount-%u", key, value.passedInRegisters, value.eightByteCount);
+ printf("GetSystemVAmd64PassStructInRegisterDescriptor key structHnd-%016llX, value passInReg-%u 8bCount-%u", key,
+ value.passedInRegisters, value.eightByteCount);
for (int i = 0; i < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS; i++)
{
- printf(" 8bClass[%u]-%u 8bSz[%u]-%u 8bOff[%u]-%u",
- i, value.eightByteClassifications[i],
- i, value.eightByteSizes[i],
- i, value.eightByteOffsets[i]);
+ printf(" 8bClass[%u]-%u 8bSz[%u]-%u 8bOff[%u]-%u", i, value.eightByteClassifications[i], i,
+ value.eightByteSizes[i], i, value.eightByteOffsets[i]);
}
printf(" result %u", value.result);
}
-bool MethodContext::repGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr)
+bool MethodContext::repGetSystemVAmd64PassStructInRegisterDescriptor(
+ CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr)
{
- DWORDLONG key;
+ DWORDLONG key;
Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor value;
key = (DWORDLONG)structHnd;
@@ -5910,16 +6123,17 @@ bool MethodContext::repGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLA
structPassInRegDescPtr->eightByteCount = (unsigned __int8)value.eightByteCount;
for (int i = 0; i < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS; i++)
{
- structPassInRegDescPtr->eightByteClassifications[i] = (SystemVClassificationType)value.eightByteClassifications[i];
- structPassInRegDescPtr->eightByteSizes[i] = (unsigned __int8)value.eightByteSizes[i];
- structPassInRegDescPtr->eightByteOffsets[i] = (unsigned __int8)value.eightByteOffsets[i];
+ structPassInRegDescPtr->eightByteClassifications[i] =
+ (SystemVClassificationType)value.eightByteClassifications[i];
+ structPassInRegDescPtr->eightByteSizes[i] = (unsigned __int8)value.eightByteSizes[i];
+ structPassInRegDescPtr->eightByteOffsets[i] = (unsigned __int8)value.eightByteOffsets[i];
}
DEBUG_REP(dmpGetSystemVAmd64PassStructInRegisterDescriptor(key, value));
return value.result ? true : false;
}
-void MethodContext::recGetRelocTypeHint(void * target, WORD result)
+void MethodContext::recGetRelocTypeHint(void* target, WORD result)
{
if (GetRelocTypeHint == nullptr)
GetRelocTypeHint = new LightWeightMap<DWORDLONG, DWORD>();
@@ -5931,7 +6145,7 @@ void MethodContext::dmpGetRelocTypeHint(DWORDLONG key, DWORD value)
{
printf("GetRelocTypeHint key tgt-%016llX, value hint-%u", key, value);
}
-WORD MethodContext::repGetRelocTypeHint(void * target)
+WORD MethodContext::repGetRelocTypeHint(void* target)
{
if (GetRelocTypeHint == nullptr)
{
@@ -5944,7 +6158,7 @@ WORD MethodContext::repGetRelocTypeHint(void * target)
}
if (GetRelocTypeHint->GetIndex((DWORDLONG)target) == -1)
{
- void *origAddr = cr->repAddressMap((void *)target);
+ void* origAddr = cr->repAddressMap((void*)target);
if (origAddr != (void*)-1 && origAddr != nullptr)
{
if (GetRelocTypeHint->GetIndex((DWORDLONG)origAddr) == -1)
@@ -5961,11 +6175,11 @@ WORD MethodContext::repGetRelocTypeHint(void * target)
}
}
- int index = GetRelocTypeHint->GetIndex((DWORDLONG)target);
+ int index = GetRelocTypeHint->GetIndex((DWORDLONG)target);
WORD retVal = 0;
if (index == -1)
{
- void *subtarget = cr->searchAddressMap(target);
+ void* subtarget = cr->searchAddressMap(target);
int index2 = GetRelocTypeHint->GetIndex((DWORDLONG)subtarget);
if (index2 == -1)
@@ -5980,7 +6194,6 @@ WORD MethodContext::repGetRelocTypeHint(void * target)
retVal = (WORD)GetRelocTypeHint->Get((DWORDLONG)target);
DEBUG_REP(dmpGetRelocTypeHint((DWORDLONG)target, retVal));
return retVal;
-
}
void MethodContext::recIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field, bool result)
@@ -6008,7 +6221,8 @@ void MethodContext::recIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaT
IsValidToken = new LightWeightMap<DLD, DWORD>();
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
+ 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;
IsValidToken->Add(key, (DWORD)result);
@@ -6020,10 +6234,11 @@ void MethodContext::dmpIsValidToken(DLD key, DWORD value)
BOOL MethodContext::repIsValidToken(CORINFO_MODULE_HANDLE module, unsigned metaTOK)
{
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
+ 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;
+ key.A = (DWORDLONG)module;
+ key.B = (DWORD)metaTOK;
BOOL value = (BOOL)IsValidToken->Get(key);
return value;
}
@@ -6052,23 +6267,25 @@ const char* MethodContext::repGetClassName(CORINFO_CLASS_HANDLE cls)
int index = GetClassName->GetIndex((DWORDLONG)cls);
if (index == -1)
return "hackishClassName";
- int offset = GetClassName->Get((DWORDLONG)cls);
- const char* name = (const char*)GetClassName->GetBuffer(offset);
+ int offset = GetClassName->Get((DWORDLONG)cls);
+ const char* name = (const char*)GetClassName->GetBuffer(offset);
DEBUG_REC(dmpGetClassName((DWORDLONG)cls, (DWORD)offset));
return name;
}
-void MethodContext::recAppendClassName(CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly, const WCHAR* result)
+void MethodContext::recAppendClassName(
+ CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly, const WCHAR* result)
{
if (AppendClassName == nullptr)
AppendClassName = new LightWeightMap<Agnostic_AppendClassName, DWORD>();
Agnostic_AppendClassName key;
- ZeroMemory(&key, sizeof(Agnostic_AppendClassName)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
- key.classHandle = (DWORDLONG) cls;
- key.fNamespace = fNamespace;
- key.fFullInst = fFullInst;
- key.fAssembly = fAssembly;
+ ZeroMemory(&key, sizeof(Agnostic_AppendClassName)); // We use the input structs as a key and use memcmp to compare..
+ // so we need to zero out padding too
+ key.classHandle = (DWORDLONG)cls;
+ key.fNamespace = fNamespace;
+ key.fFullInst = fFullInst;
+ key.fAssembly = fAssembly;
DWORD temp = (DWORD)-1;
if (result != nullptr)
@@ -6080,105 +6297,112 @@ void MethodContext::recAppendClassName(CORINFO_CLASS_HANDLE cls, BOOL fNamespace
void MethodContext::dmpAppendClassName(const Agnostic_AppendClassName& key, DWORD value)
{
- printf("AppendClassName key cls-%016llX ns-%u fi-%u as-%u, value %s",
- key.classHandle, key.fNamespace, key.fFullInst, key.fAssembly, AppendClassName->GetBuffer(value));
+ printf("AppendClassName key cls-%016llX ns-%u fi-%u as-%u, value %s", key.classHandle, key.fNamespace,
+ key.fFullInst, key.fAssembly, AppendClassName->GetBuffer(value));
AppendClassName->Unlock();
}
-const WCHAR* MethodContext::repAppendClassName(CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly)
+const WCHAR* MethodContext::repAppendClassName(CORINFO_CLASS_HANDLE cls,
+ BOOL fNamespace,
+ BOOL fFullInst,
+ BOOL fAssembly)
{
if (AppendClassName == nullptr)
return W("hackishClassName");
Agnostic_AppendClassName key;
- ZeroMemory(&key, sizeof(Agnostic_AppendClassName)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
- key.classHandle = (DWORDLONG) cls;
- key.fNamespace = fNamespace;
- key.fFullInst = fFullInst;
- key.fAssembly = fAssembly;
+ ZeroMemory(&key, sizeof(Agnostic_AppendClassName)); // We use the input structs as a key and use memcmp to compare..
+ // so we need to zero out padding too
+ key.classHandle = (DWORDLONG)cls;
+ key.fNamespace = fNamespace;
+ key.fFullInst = fFullInst;
+ key.fAssembly = fAssembly;
int index = AppendClassName->GetIndex(key);
if (index == -1)
return W("hackishClassName");
- int offset = AppendClassName->Get(key);
- const WCHAR* name = (const WCHAR*)AppendClassName->GetBuffer(offset);
+ int offset = AppendClassName->Get(key);
+ const WCHAR* name = (const WCHAR*)AppendClassName->GetBuffer(offset);
DEBUG_REC(dmpAppendClassName(key, (DWORD)offset));
return name;
}
-void MethodContext::recGetTailCallCopyArgsThunk(CORINFO_SIG_INFO *pSig, CorInfoHelperTailCallSpecialHandling flags, void* result)
+void MethodContext::recGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig,
+ CorInfoHelperTailCallSpecialHandling flags,
+ void* result)
{
if (GetTailCallCopyArgsThunk == nullptr)
GetTailCallCopyArgsThunk = new LightWeightMap<Agnostic_GetTailCallCopyArgsThunk, DWORDLONG>();
Agnostic_GetTailCallCopyArgsThunk key;
- ZeroMemory(&key, sizeof(Agnostic_GetTailCallCopyArgsThunk)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
-
- key.Sig.callConv = (DWORD)pSig->callConv;
- key.Sig.retTypeClass = (DWORDLONG)pSig->retTypeClass;
- key.Sig.retTypeSigClass = (DWORDLONG)pSig->retTypeSigClass;
- key.Sig.retType = (DWORD)pSig->retType;
- key.Sig.flags = (DWORD)pSig->flags;
- key.Sig.numArgs = (DWORD)pSig->numArgs;
+ ZeroMemory(&key, sizeof(Agnostic_GetTailCallCopyArgsThunk)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
+
+ key.Sig.callConv = (DWORD)pSig->callConv;
+ key.Sig.retTypeClass = (DWORDLONG)pSig->retTypeClass;
+ key.Sig.retTypeSigClass = (DWORDLONG)pSig->retTypeSigClass;
+ key.Sig.retType = (DWORD)pSig->retType;
+ key.Sig.flags = (DWORD)pSig->flags;
+ key.Sig.numArgs = (DWORD)pSig->numArgs;
key.Sig.sigInst_classInstCount = (DWORD)pSig->sigInst.classInstCount;
- key.Sig.sigInst_classInst_Index = (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char*)pSig->sigInst.classInst, pSig->sigInst.classInstCount * 8); //porting issue
+ key.Sig.sigInst_classInst_Index =
+ (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char*)pSig->sigInst.classInst,
+ pSig->sigInst.classInstCount * 8); // porting issue
key.Sig.sigInst_methInstCount = (DWORD)pSig->sigInst.methInstCount;
- key.Sig.sigInst_methInst_Index = (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char*)pSig->sigInst.methInst, pSig->sigInst.methInstCount * 8); //porting issue
- key.Sig.args = (DWORDLONG)pSig->args;
+ key.Sig.sigInst_methInst_Index =
+ (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char*)pSig->sigInst.methInst,
+ pSig->sigInst.methInstCount * 8); // porting issue
+ key.Sig.args = (DWORDLONG)pSig->args;
key.Sig.cbSig = (DWORD)pSig->cbSig;
- key.Sig.pSig = (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char *)pSig->pSig, pSig->cbSig);
+ key.Sig.pSig = (DWORD)GetTailCallCopyArgsThunk->AddBuffer((unsigned char*)pSig->pSig, pSig->cbSig);
key.Sig.scope = (DWORDLONG)pSig->scope;
key.Sig.token = (DWORD)pSig->token;
- key.flags = (DWORD)flags;
+ key.flags = (DWORD)flags;
GetTailCallCopyArgsThunk->Add(key, (DWORDLONG)result);
DEBUG_REC(dmpGetTailCallCopyArgsThunk(key, (DWORDLONG)result));
}
void MethodContext::dmpGetTailCallCopyArgsThunk(const Agnostic_GetTailCallCopyArgsThunk& key, DWORDLONG value)
{
- printf("GetTailCallCopyArgsThunk key sig{cc-%u rtc-%016llX rts-%016llX rt-%u flg-%08X na-%u cc-%u ci-%u mc-%u mi-%u sig-%u pSig-%u scp-%016llX tok-%08X} flg-%08X",
- key.Sig.callConv,
- key.Sig.retTypeClass,
- key.Sig.retTypeSigClass,
- key.Sig.retType,
- key.Sig.flags,
- key.Sig.numArgs,
- key.Sig.sigInst_classInstCount,
- key.Sig.sigInst_classInst_Index,
- key.Sig.sigInst_methInstCount,
- key.Sig.sigInst_methInst_Index,
- key.Sig.cbSig,
- key.Sig.pSig,
- key.Sig.scope,
- key.Sig.token,
- key.flags);
+ printf("GetTailCallCopyArgsThunk key sig{cc-%u rtc-%016llX rts-%016llX rt-%u flg-%08X na-%u cc-%u ci-%u mc-%u "
+ "mi-%u sig-%u pSig-%u scp-%016llX tok-%08X} flg-%08X",
+ key.Sig.callConv, key.Sig.retTypeClass, key.Sig.retTypeSigClass, key.Sig.retType, key.Sig.flags,
+ key.Sig.numArgs, key.Sig.sigInst_classInstCount, key.Sig.sigInst_classInst_Index,
+ key.Sig.sigInst_methInstCount, key.Sig.sigInst_methInst_Index, key.Sig.cbSig, key.Sig.pSig, key.Sig.scope,
+ key.Sig.token, key.flags);
printf(", value res-%016llX", value);
}
-void* MethodContext::repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO *pSig, CorInfoHelperTailCallSpecialHandling flags)
+void* MethodContext::repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags)
{
Agnostic_GetTailCallCopyArgsThunk key;
- ZeroMemory(&key, sizeof(Agnostic_GetTailCallCopyArgsThunk)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_GetTailCallCopyArgsThunk)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
AssertCodeMsg(GetTailCallCopyArgsThunk != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for ...");
- key.Sig.callConv = (DWORD)pSig->callConv;
- key.Sig.retTypeClass = (DWORDLONG)pSig->retTypeClass;
- key.Sig.retTypeSigClass = (DWORDLONG)pSig->retTypeSigClass;
- key.Sig.retType = (DWORD)pSig->retType;
- key.Sig.flags = (DWORD)pSig->flags;
- key.Sig.numArgs = (DWORD)pSig->numArgs;
+ key.Sig.callConv = (DWORD)pSig->callConv;
+ key.Sig.retTypeClass = (DWORDLONG)pSig->retTypeClass;
+ key.Sig.retTypeSigClass = (DWORDLONG)pSig->retTypeSigClass;
+ key.Sig.retType = (DWORD)pSig->retType;
+ key.Sig.flags = (DWORD)pSig->flags;
+ key.Sig.numArgs = (DWORD)pSig->numArgs;
key.Sig.sigInst_classInstCount = (DWORD)pSig->sigInst.classInstCount;
- key.Sig.sigInst_classInst_Index = (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char*)pSig->sigInst.classInst, pSig->sigInst.classInstCount * 8); //porting issue
+ key.Sig.sigInst_classInst_Index =
+ (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char*)pSig->sigInst.classInst,
+ pSig->sigInst.classInstCount * 8); // porting issue
key.Sig.sigInst_methInstCount = (DWORD)pSig->sigInst.methInstCount;
- key.Sig.sigInst_methInst_Index = (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char*)pSig->sigInst.methInst, pSig->sigInst.methInstCount * 8); //porting issue
- key.Sig.args = (DWORDLONG)pSig->args;
+ key.Sig.sigInst_methInst_Index =
+ (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char*)pSig->sigInst.methInst,
+ pSig->sigInst.methInstCount * 8); // porting issue
+ key.Sig.args = (DWORDLONG)pSig->args;
key.Sig.cbSig = (DWORD)pSig->cbSig;
- key.Sig.pSig = (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char *)pSig->pSig, pSig->cbSig);
+ key.Sig.pSig = (DWORD)GetTailCallCopyArgsThunk->Contains((unsigned char*)pSig->pSig, pSig->cbSig);
key.Sig.scope = (DWORDLONG)pSig->scope;
key.Sig.token = (DWORD)pSig->token;
- key.flags = (DWORD)flags;
+ key.flags = (DWORD)flags;
- AssertCodeMsg(GetTailCallCopyArgsThunk->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)key.Sig.retTypeClass);
- void *result = (void*)GetTailCallCopyArgsThunk->Get(key);
+ AssertCodeMsg(GetTailCallCopyArgsThunk->GetIndex(key) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)key.Sig.retTypeClass);
+ void* result = (void*)GetTailCallCopyArgsThunk->Get(key);
cr->recAddressMap((void*)0x424242, (void*)result, 1);
DEBUG_REP(dmpGetTailCallCopyArgsThunk(key, (DWORDLONG)result));
return result;
@@ -6214,12 +6438,15 @@ void MethodContext::recCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR
CheckMethodModifier = new LightWeightMap<Agnostic_CheckMethodModifier, DWORD>();
Agnostic_CheckMethodModifier key;
- ZeroMemory(&key, sizeof(Agnostic_CheckMethodModifier)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CheckMethodModifier)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
key.hMethod = (DWORDLONG)hMethod;
- //If the input matches something already in the buffer, just re-use that slot.. easier than searching for a soft key on rep.
+ // If the input matches something already in the buffer, just re-use that slot.. easier than searching for a soft
+ // key on rep.
if (modifier != nullptr)
- key.modifier = (DWORD)CheckMethodModifier->AddBuffer((unsigned char*)modifier, (unsigned int)strlen(modifier) + 1);
+ key.modifier =
+ (DWORD)CheckMethodModifier->AddBuffer((unsigned char*)modifier, (unsigned int)strlen(modifier) + 1);
else
key.modifier = (DWORD)-1;
@@ -6230,17 +6457,19 @@ void MethodContext::recCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR
void MethodContext::dmpCheckMethodModifier(const Agnostic_CheckMethodModifier& key, DWORD value)
{
printf("CheckMethodModifier key, ftn-%016llX mod-'%s' opt-%u, value res-%u", key.hMethod,
- (unsigned char *)CheckMethodModifier->GetBuffer(key.modifier), key.fOptional, value);
+ (unsigned char*)CheckMethodModifier->GetBuffer(key.modifier), key.fOptional, value);
CheckMethodModifier->Unlock();
}
BOOL MethodContext::repCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional)
{
Agnostic_CheckMethodModifier key;
- ZeroMemory(&key, sizeof(Agnostic_CheckMethodModifier)); //We use the input structs as a key and use memcmp to compare.. so we need to zero out padding too
+ ZeroMemory(&key, sizeof(Agnostic_CheckMethodModifier)); // We use the input structs as a key and use memcmp to
+ // compare.. so we need to zero out padding too
key.hMethod = (DWORDLONG)hMethod;
if (modifier != nullptr)
- key.modifier = (DWORD)CheckMethodModifier->Contains((unsigned char *)modifier, (unsigned int)strlen(modifier) + 1);
+ key.modifier =
+ (DWORD)CheckMethodModifier->Contains((unsigned char*)modifier, (unsigned int)strlen(modifier) + 1);
else
key.modifier = (DWORD)-1;
@@ -6250,7 +6479,7 @@ BOOL MethodContext::repCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR
return value;
}
-void MethodContext::recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection, void* result)
+void MethodContext::recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result)
{
if (GetPInvokeUnmanagedTarget == nullptr)
GetPInvokeUnmanagedTarget = new LightWeightMap<DWORDLONG, DLDL>();
@@ -6265,13 +6494,13 @@ void MethodContext::dmpGetPInvokeUnmanagedTarget(DWORDLONG key, DLDL value)
{
printf("GetPInvokeUnmanagedTarget key ftn-%016llX, value pp-%016llX res-%016llX", key, value.A, value.B);
}
-void* MethodContext::repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection)
+void* MethodContext::repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection)
{
- DLDL temp = (DLDL)GetPInvokeUnmanagedTarget->Get((DWORDLONG)method);
- *ppIndirection = (void *)temp.A;
+ DLDL temp = (DLDL)GetPInvokeUnmanagedTarget->Get((DWORDLONG)method);
+ *ppIndirection = (void*)temp.A;
DEBUG_REP(dmpGetPInvokeUnmanagedTarget((DWORDLONG)method, temp));
- return (void *)temp.B;
+ return (void*)temp.B;
}
void MethodContext::recGetArrayRank(CORINFO_CLASS_HANDLE cls, unsigned result)
@@ -6305,13 +6534,14 @@ void MethodContext::dmpIsFieldStatic(DWORDLONG key, DWORD value)
bool MethodContext::repIsFieldStatic(CORINFO_FIELD_HANDLE fhld)
{
AssertCodeMsg(IsFieldStatic != nullptr, EXCEPTIONCODE_MC, "Didn't find anything for %016llX", (DWORDLONG)fhld);
- AssertCodeMsg(IsFieldStatic->GetIndex((DWORDLONG)fhld) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", (DWORDLONG)fhld);
+ AssertCodeMsg(IsFieldStatic->GetIndex((DWORDLONG)fhld) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX",
+ (DWORDLONG)fhld);
bool result = (bool)(IsFieldStatic->Get((DWORDLONG)fhld) != 0);
DEBUG_REP(dmpIsFieldStatic((DWORDLONG)fhld, (DWORD)result));
return result;
}
-void MethodContext::recGetIntConfigValue(const wchar_t *name, int defaultValue, int result)
+void MethodContext::recGetIntConfigValue(const wchar_t* name, int defaultValue, int result)
{
if (GetIntConfigValue == nullptr)
GetIntConfigValue = new LightWeightMap<Agnostic_ConfigIntInfo, DWORD>();
@@ -6321,9 +6551,10 @@ void MethodContext::recGetIntConfigValue(const wchar_t *name, int defaultValue,
Agnostic_ConfigIntInfo key;
ZeroMemory(&key, sizeof(Agnostic_ConfigIntInfo));
- DWORD index = (DWORD)GetIntConfigValue->AddBuffer((unsigned char*)name, sizeof(wchar_t) * ((unsigned int)wcslen(name) + 1));
+ DWORD index =
+ (DWORD)GetIntConfigValue->AddBuffer((unsigned char*)name, sizeof(wchar_t) * ((unsigned int)wcslen(name) + 1));
- key.nameIndex = index;
+ key.nameIndex = index;
key.defaultValue = defaultValue;
GetIntConfigValue->Add(key, result);
@@ -6332,13 +6563,12 @@ void MethodContext::recGetIntConfigValue(const wchar_t *name, int defaultValue,
void MethodContext::dmpGetIntConfigValue(const Agnostic_ConfigIntInfo& key, int value)
{
- const wchar_t *name = (const wchar_t*)GetIntConfigValue->GetBuffer(key.nameIndex);
- printf("GetIntConfigValue name %S, default value %d, value %d",
- name, key.defaultValue, value);
+ const wchar_t* name = (const wchar_t*)GetIntConfigValue->GetBuffer(key.nameIndex);
+ printf("GetIntConfigValue name %S, default value %d, value %d", name, key.defaultValue, value);
GetIntConfigValue->Unlock();
}
-int MethodContext::repGetIntConfigValue(const wchar_t *name, int defaultValue)
+int MethodContext::repGetIntConfigValue(const wchar_t* name, int defaultValue)
{
if (GetIntConfigValue == nullptr)
return defaultValue;
@@ -6349,11 +6579,11 @@ int MethodContext::repGetIntConfigValue(const wchar_t *name, int defaultValue)
ZeroMemory(&key, sizeof(Agnostic_ConfigIntInfo));
size_t nameLenInBytes = sizeof(wchar_t) * (wcslen(name) + 1);
- int nameIndex = GetIntConfigValue->Contains((unsigned char *)name, (unsigned int)nameLenInBytes);
- if (nameIndex == -1) // config name not in map
+ int nameIndex = GetIntConfigValue->Contains((unsigned char*)name, (unsigned int)nameLenInBytes);
+ if (nameIndex == -1) // config name not in map
return defaultValue;
- key.nameIndex = (DWORD)nameIndex;
+ key.nameIndex = (DWORD)nameIndex;
key.defaultValue = defaultValue;
DWORD result = GetIntConfigValue->Get(key);
@@ -6361,18 +6591,20 @@ int MethodContext::repGetIntConfigValue(const wchar_t *name, int defaultValue)
return (int)result;
}
-void MethodContext::recGetStringConfigValue(const wchar_t *name, const wchar_t *result)
+void MethodContext::recGetStringConfigValue(const wchar_t* name, const wchar_t* result)
{
if (GetStringConfigValue == nullptr)
GetStringConfigValue = new LightWeightMap<DWORD, DWORD>();
AssertCodeMsg(name != nullptr, EXCEPTIONCODE_MC, "Name can not be nullptr");
- DWORD nameIndex = (DWORD)GetStringConfigValue->AddBuffer((unsigned char*)name, sizeof(wchar_t) * ((unsigned int)wcslen(name) + 1));
+ DWORD nameIndex = (DWORD)GetStringConfigValue->AddBuffer((unsigned char*)name,
+ sizeof(wchar_t) * ((unsigned int)wcslen(name) + 1));
DWORD resultIndex = (DWORD)-1;
if (result != nullptr)
- resultIndex = (DWORD)GetStringConfigValue->AddBuffer((unsigned char*)result, sizeof(wchar_t) * ((unsigned int)wcslen(result) + 1));
+ resultIndex = (DWORD)GetStringConfigValue->AddBuffer((unsigned char*)result,
+ sizeof(wchar_t) * ((unsigned int)wcslen(result) + 1));
GetStringConfigValue->Add(nameIndex, resultIndex);
DEBUG_REC(dmpGetStringConfigValue(nameIndex, resultIndex));
@@ -6380,13 +6612,13 @@ void MethodContext::recGetStringConfigValue(const wchar_t *name, const wchar_t *
void MethodContext::dmpGetStringConfigValue(DWORD nameIndex, DWORD resultIndex)
{
- const wchar_t *name = (const wchar_t*)GetStringConfigValue->GetBuffer(nameIndex);
- const wchar_t *result = (const wchar_t*)GetStringConfigValue->GetBuffer(resultIndex);
+ const wchar_t* name = (const wchar_t*)GetStringConfigValue->GetBuffer(nameIndex);
+ const wchar_t* result = (const wchar_t*)GetStringConfigValue->GetBuffer(resultIndex);
printf("GetStringConfigValue name %S, result %S", name, result);
GetStringConfigValue->Unlock();
}
-const wchar_t *MethodContext::repGetStringConfigValue(const wchar_t *name)
+const wchar_t* MethodContext::repGetStringConfigValue(const wchar_t* name)
{
if (GetStringConfigValue == nullptr)
return nullptr;
@@ -6394,12 +6626,12 @@ const wchar_t *MethodContext::repGetStringConfigValue(const wchar_t *name)
AssertCodeMsg(name != nullptr, EXCEPTIONCODE_MC, "Name can not be nullptr");
size_t nameLenInBytes = sizeof(wchar_t) * (wcslen(name) + 1);
- int nameIndex = GetStringConfigValue->Contains((unsigned char *)name, (unsigned int)nameLenInBytes);
- if (nameIndex == -1) // config name not in map
+ int nameIndex = GetStringConfigValue->Contains((unsigned char*)name, (unsigned int)nameLenInBytes);
+ if (nameIndex == -1) // config name not in map
return nullptr;
- int resultIndex = GetStringConfigValue->Get(nameIndex);
- const wchar_t *value = (const wchar_t *)GetStringConfigValue->GetBuffer(resultIndex);
+ int resultIndex = GetStringConfigValue->Get(nameIndex);
+ const wchar_t* value = (const wchar_t*)GetStringConfigValue->GetBuffer(resultIndex);
DEBUG_REP(dmpGetStringConfigValue(nameIndex, resultIndex));
@@ -6408,70 +6640,70 @@ const wchar_t *MethodContext::repGetStringConfigValue(const wchar_t *name)
struct EnvironmentVariable
{
- char *name;
+ char* name;
DWORD val_index;
};
-int __cdecl compareEnvironmentVariable(const void *arg1, const void *arg2)
+int __cdecl compareEnvironmentVariable(const void* arg1, const void* arg2)
{
- return _stricmp(((EnvironmentVariable *)arg1)->name, ((EnvironmentVariable *)arg2)->name);
+ return _stricmp(((EnvironmentVariable*)arg1)->name, ((EnvironmentVariable*)arg2)->name);
}
-int MethodContext::dumpMethodIdentityInfoToBuffer(char *buff, int len)
+int MethodContext::dumpMethodIdentityInfoToBuffer(char* buff, int len)
{
- char *obuff = buff;
+ char* obuff = buff;
if (len < METHOD_IDENTITY_INFO_SIZE)
return -1;
- //Obtain the Method Info structure for this method
+ // Obtain the Method Info structure for this method
CORINFO_METHOD_INFO info;
- unsigned flags = 0;
+ unsigned flags = 0;
repCompileMethod(&info, &flags);
- //Add the Method Signature
+ // Add the Method Signature
int t = sprintf_s(buff, len, "%s -- ", CallUtils::GetMethodFullName(this, info.ftn, info.args));
buff += t;
len -= t;
- //Add Calling convention information, CorInfoOptions and CorInfoRegionKind
- t = sprintf_s(buff, len, "CallingConvention: %d, CorInfoOptions: %d, CorInfoRegionKind: %d ",
- info.args.callConv, info.options, info.regionKind);
+ // Add Calling convention information, CorInfoOptions and CorInfoRegionKind
+ t = sprintf_s(buff, len, "CallingConvention: %d, CorInfoOptions: %d, CorInfoRegionKind: %d ", info.args.callConv,
+ info.options, info.regionKind);
buff += t;
len -= t;
- //Add COMPLUS_* & dbflag environment variables to method Identity
- //except complus_version and complus_defaultversion
- //since they change the compilation behaviour of JIT
- //we also need to sort them to ensure we don't produce a different
- //hash based on the order of these variables
+ // Add COMPLUS_* & dbflag environment variables to method Identity
+ //except complus_version and complus_defaultversion
+ //since they change the compilation behaviour of JIT
+ //we also need to sort them to ensure we don't produce a different
+ //hash based on the order of these variables
if (Environment != nullptr)
{
Agnostic_Environment val;
- EnvironmentVariable *envValues = new EnvironmentVariable[Environment->GetCount()];
- int envValCount = 0;
+ EnvironmentVariable* envValues = new EnvironmentVariable[Environment->GetCount()];
+ int envValCount = 0;
for (unsigned int i = 0; i < Environment->GetCount(); i++)
{
- val = Environment->Get((DWORD)i);
- char *envVariable = (char *)Environment->GetBuffer(val.name_index);
+ val = Environment->Get((DWORD)i);
+ char* envVariable = (char*)Environment->GetBuffer(val.name_index);
if ((_strnicmp(envVariable, "complus_", 8) == 0 || _strnicmp(envVariable, "dbflag", 6) == 0) &&
(_stricmp(envVariable, "complus_version") != 0) &&
(_stricmp(envVariable, "complus_defaultversion") != 0))
{
- envValues[envValCount].name = envVariable;
+ envValues[envValCount].name = envVariable;
envValues[envValCount++].val_index = val.val_index;
}
}
- //Do a quick sort on envValues if needed
+ // Do a quick sort on envValues if needed
if (envValCount > 1)
qsort(envValues, envValCount, sizeof(EnvironmentVariable), compareEnvironmentVariable);
- //Append these values to the IdentityInfobuffer
+ // Append these values to the IdentityInfobuffer
for (int i = 0; i < envValCount; i++)
{
t = sprintf_s(buff, len, "%s=%s ", _strlwr(envValues[i].name),
- _strlwr((char *)Environment->GetBuffer(envValues[i].val_index)));
+ _strlwr((char*)Environment->GetBuffer(envValues[i].val_index)));
buff += t;
len -= t;
}
@@ -6479,7 +6711,7 @@ int MethodContext::dumpMethodIdentityInfoToBuffer(char *buff, int len)
delete[] envValues;
}
- //Hash the IL Code for this method and append it to the ID info
+ // Hash the IL Code for this method and append it to the ID info
char ilHash[MD5_HASH_BUFFER_SIZE];
dumpMD5HashToBuffer(info.ILCode, info.ILCodeSize, ilHash, MD5_HASH_BUFFER_SIZE);
t = sprintf_s(buff, len, "ILCode Hash: %s", ilHash);
@@ -6488,7 +6720,7 @@ int MethodContext::dumpMethodIdentityInfoToBuffer(char *buff, int len)
return (int)(buff - obuff);
}
-int MethodContext::dumpMethodMD5HashToBuffer(char *buff, int len)
+int MethodContext::dumpMethodMD5HashToBuffer(char* buff, int len)
{
char bufferIdentityInfo[METHOD_IDENTITY_INFO_SIZE];
@@ -6497,17 +6729,17 @@ int MethodContext::dumpMethodMD5HashToBuffer(char *buff, int len)
if (cbLen < 0)
return cbLen;
- cbLen = dumpMD5HashToBuffer((BYTE *)bufferIdentityInfo, cbLen, buff, len);
+ cbLen = dumpMD5HashToBuffer((BYTE*)bufferIdentityInfo, cbLen, buff, len);
return cbLen;
}
-int MethodContext::dumpMD5HashToBuffer(BYTE *pBuffer, int bufLen, char *hash, int hashLen)
+int MethodContext::dumpMD5HashToBuffer(BYTE* pBuffer, int bufLen, char* hash, int hashLen)
{
#ifdef FEATURE_PAL
MD5HASHDATA md5_hashdata;
- MD5 md5_hasher;
+ MD5 md5_hasher;
if (hashLen < MD5_HASH_BUFFER_SIZE)
return -1;
@@ -6522,14 +6754,14 @@ int MethodContext::dumpMD5HashToBuffer(BYTE *pBuffer, int bufLen, char *hash, in
sprintf_s(hash + i * 2, hashLen - i * 2, "%02X", md5_hashdata.rgb[i]);
}
- return MD5_HASH_BUFFER_SIZE; //if we had success we wrote MD5_HASH_BUFFER_SIZE bytes to the buffer
+ return MD5_HASH_BUFFER_SIZE; // if we had success we wrote MD5_HASH_BUFFER_SIZE bytes to the buffer
#else // !FEATURE_PAL
- HCRYPTPROV hProv = NULL; //CryptoProvider
+ HCRYPTPROV hProv = NULL; // CryptoProvider
HCRYPTHASH hHash = NULL;
- BYTE bHash[MD5_HASH_BYTE_SIZE];
- DWORD cbHash = MD5_HASH_BYTE_SIZE;
+ BYTE bHash[MD5_HASH_BYTE_SIZE];
+ DWORD cbHash = MD5_HASH_BYTE_SIZE;
if (hashLen < MD5_HASH_BUFFER_SIZE)
return -1;
@@ -6560,7 +6792,7 @@ int MethodContext::dumpMD5HashToBuffer(BYTE *pBuffer, int bufLen, char *hash, in
if (hProv != NULL)
CryptReleaseContext(hProv, 0);
- return MD5_HASH_BUFFER_SIZE; //if we had success we wrote MD5_HASH_BUFFER_SIZE bytes to the buffer
+ return MD5_HASH_BUFFER_SIZE; // if we had success we wrote MD5_HASH_BUFFER_SIZE bytes to the buffer
OnError:
AssertMsg(false, "Failed to create a hash using the Crypto API (Error %X)", GetLastError());
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
index b2224d91ae..f7c0e164ca 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
@@ -15,10 +15,10 @@
#include "lightweightmap.h"
#include "errorhandling.h"
-#define METHOD_IDENTITY_INFO_SIZE 0x10000 //We assume that the METHOD_IDENTITY_INFO_SIZE will not exceed 64KB
+#define METHOD_IDENTITY_INFO_SIZE 0x10000 // We assume that the METHOD_IDENTITY_INFO_SIZE will not exceed 64KB
-#define MD5_HASH_BYTE_SIZE 16 //MD5 is 128-bit, so we need 16 bytes to store it
-#define MD5_HASH_BUFFER_SIZE 33 //MD5 is 128-bit, so we need 32 chars + 1 char to store null-terminator
+#define MD5_HASH_BYTE_SIZE 16 // MD5 is 128-bit, so we need 16 bytes to store it
+#define MD5_HASH_BUFFER_SIZE 33 // MD5 is 128-bit, so we need 32 chars + 1 char to store null-terminator
class MethodContext
{
@@ -26,46 +26,46 @@ public:
#pragma pack(push, 1)
struct Agnostic_CORINFO_SIG_INFO
{
- DWORD callConv;
+ DWORD callConv;
DWORDLONG retTypeClass;
DWORDLONG retTypeSigClass;
- DWORD retType;
- DWORD flags;
- DWORD numArgs;
- DWORD sigInst_classInstCount;
- DWORD sigInst_classInst_Index;
- DWORD sigInst_methInstCount;
- DWORD sigInst_methInst_Index;
+ DWORD retType;
+ DWORD flags;
+ DWORD numArgs;
+ DWORD sigInst_classInstCount;
+ DWORD sigInst_classInst_Index;
+ DWORD sigInst_methInstCount;
+ DWORD sigInst_methInst_Index;
DWORDLONG args;
- DWORD pSig;
- DWORD cbSig;
+ DWORD pSig;
+ DWORD cbSig;
DWORDLONG scope;
- DWORD token;
+ DWORD token;
};
struct Agnostic_CORINFO_METHOD_INFO
{
- DWORDLONG ftn;
- DWORDLONG scope;
- DWORD ILCode_offset;
- DWORD ILCodeSize;
- DWORD maxStack;
- DWORD EHcount;
- DWORD options;
- DWORD regionKind;
+ DWORDLONG ftn;
+ DWORDLONG scope;
+ DWORD ILCode_offset;
+ DWORD ILCodeSize;
+ DWORD maxStack;
+ DWORD EHcount;
+ DWORD options;
+ DWORD regionKind;
Agnostic_CORINFO_SIG_INFO args;
Agnostic_CORINFO_SIG_INFO locals;
};
struct Agnostic_CompileMethod
{
Agnostic_CORINFO_METHOD_INFO info;
- DWORD flags;
+ DWORD flags;
};
struct Agnostic_InitClass
{
DWORDLONG field;
DWORDLONG method;
DWORDLONG context;
- DWORD speculative;
+ DWORD speculative;
};
struct DLDL
{
@@ -87,35 +87,35 @@ public:
struct DLD
{
DWORDLONG A;
- DWORD B;
+ DWORD B;
};
struct Agnostic_CORINFO_RESOLVED_TOKENin
{
DWORDLONG tokenContext;
DWORDLONG tokenScope;
- DWORD token;
- DWORD tokenType;
+ DWORD token;
+ DWORD tokenType;
};
struct Agnostic_CORINFO_RESOLVED_TOKENout
{
DWORDLONG hClass;
DWORDLONG hMethod;
DWORDLONG hField;
- DWORD pTypeSpec_Index;
- DWORD cbTypeSpec;
- DWORD pMethodSpec_Index;
- DWORD cbMethodSpec;
- DWORD exceptionCode;
+ DWORD pTypeSpec_Index;
+ DWORD cbTypeSpec;
+ DWORD pMethodSpec_Index;
+ DWORD cbMethodSpec;
+ DWORD exceptionCode;
};
struct Agnostic_GetArgType
{
Agnostic_CORINFO_SIG_INFO sig;
- DWORDLONG args;
+ DWORDLONG args;
};
struct Agnostic_GetArgClass
{
Agnostic_CORINFO_SIG_INFO sig;
- DWORDLONG args;
+ DWORDLONG args;
};
struct Agnostic_GetBoundaries
{
@@ -135,8 +135,7 @@ public:
DWORD offsetOfCalleeSavedFP;
DWORD offsetOfCallTarget;
DWORD offsetOfReturnAddress;
- }
- inlinedCallFrameInfo;
+ } inlinedCallFrameInfo;
DWORD offsetOfThreadFrame;
DWORD offsetOfGCState;
DWORD offsetOfDelegateInstance;
@@ -158,48 +157,48 @@ public:
{
DWORDLONG ppIndirection;
DWORDLONG fieldAddress;
- DWORD fieldValue;
+ DWORD fieldValue;
};
struct Agnostic_CORINFO_RESOLVED_TOKEN
{
DWORDLONG tokenContext;
DWORDLONG tokenScope;
- DWORD token;
- DWORD tokenType;
+ DWORD token;
+ DWORD tokenType;
DWORDLONG hClass;
DWORDLONG hMethod;
DWORDLONG hField;
- DWORD typeSpec_Index;
- DWORD cbTypeSpec;
- DWORD methodSpec_Index;
- DWORD cbMethodSpec;
+ DWORD typeSpec_Index;
+ DWORD cbTypeSpec;
+ DWORD methodSpec_Index;
+ DWORD cbMethodSpec;
};
struct Agnostic_GetFieldInfo
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
- DWORDLONG callerHandle;
- DWORD flags;
+ DWORDLONG callerHandle;
+ DWORD flags;
};
struct Agnostic_CORINFO_HELPER_ARG
{
- DWORDLONG constant; //one view of a large union of ptr size
- DWORD argType;
+ DWORDLONG constant; // one view of a large union of ptr size
+ DWORD argType;
};
struct Agnostic_CORINFO_HELPER_DESC
{
- DWORD helperNum;
- DWORD numArgs;
+ DWORD helperNum;
+ DWORD numArgs;
Agnostic_CORINFO_HELPER_ARG args[CORINFO_ACCESS_ALLOWED_MAX_ARGS];
};
struct Agnostic_CORINFO_FIELD_INFO
{
- DWORD fieldAccessor;
- DWORD fieldFlags;
- DWORD helper;
- DWORD offset;
- DWORD fieldType;
- DWORDLONG structType;
- DWORD accessAllowed;
+ DWORD fieldAccessor;
+ DWORD fieldFlags;
+ DWORD helper;
+ DWORD offset;
+ DWORD fieldType;
+ DWORDLONG structType;
+ DWORD accessAllowed;
Agnostic_CORINFO_HELPER_DESC accessCalloutHelper;
};
struct DD
@@ -212,81 +211,83 @@ public:
DWORDLONG callerHnd;
DWORDLONG declaredCalleeHnd;
DWORDLONG exactCalleeHnd;
- WORD fIsTailPrefix;
+ WORD fIsTailPrefix;
};
struct Agnostic_Environment
{
- DWORD name_index;;
+ DWORD name_index;
+ ;
DWORD val_index;
};
struct Agnostic_GetCallInfo
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
Agnostic_CORINFO_RESOLVED_TOKEN ConstrainedResolvedToken;
- DWORDLONG callerHandle;
- DWORD flags;
+ DWORDLONG callerHandle;
+ DWORD flags;
};
struct Agnostic_CORINFO_LOOKUP_KIND
{
DWORD needsRuntimeLookup;
DWORD runtimeLookupKind;
- WORD runtimeLookupFlags;
+ WORD runtimeLookupFlags;
};
struct Agnostic_CORINFO_RUNTIME_LOOKUP
{
DWORDLONG signature;
- DWORD helper;
- DWORD indirections;
- DWORD testForNull;
- DWORD testForFixup;
+ DWORD helper;
+ DWORD indirections;
+ DWORD testForNull;
+ DWORD testForFixup;
DWORDLONG offsets[CORINFO_MAXINDIRECTIONS];
};
struct Agnostic_CORINFO_CONST_LOOKUP
{
- DWORD accessType;
- DWORDLONG handle; // actually a union of two pointer sized things
+ DWORD accessType;
+ DWORDLONG handle; // actually a union of two pointer sized things
};
struct Agnostic_CORINFO_LOOKUP
{
- Agnostic_CORINFO_LOOKUP_KIND lookupKind;
- Agnostic_CORINFO_RUNTIME_LOOKUP runtimeLookup; //This and constLookup actually a union, but with different layouts.. :-| copy the right one based on lookupKinds value
- Agnostic_CORINFO_CONST_LOOKUP constLookup;
+ Agnostic_CORINFO_LOOKUP_KIND lookupKind;
+ Agnostic_CORINFO_RUNTIME_LOOKUP runtimeLookup; // This and constLookup actually a union, but with different
+ // layouts.. :-| copy the right one based on lookupKinds value
+ Agnostic_CORINFO_CONST_LOOKUP constLookup;
};
struct Agnostic_CORINFO_CALL_INFO
{
- DWORDLONG hMethod;
- DWORD methodFlags;
- DWORD classFlags;
- Agnostic_CORINFO_SIG_INFO sig;
- DWORD verMethodFlags;
- Agnostic_CORINFO_SIG_INFO verSig;
- DWORD accessAllowed;
- Agnostic_CORINFO_HELPER_DESC callsiteCalloutHelper;
- DWORD thisTransform;
- DWORD kind;
- DWORD nullInstanceCheck;
- DWORDLONG contextHandle;
- DWORD exactContextNeedsRuntimeLookup;
- Agnostic_CORINFO_LOOKUP stubLookup;//first view of union. others are matching or subordinate
+ DWORDLONG hMethod;
+ DWORD methodFlags;
+ DWORD classFlags;
+ Agnostic_CORINFO_SIG_INFO sig;
+ DWORD verMethodFlags;
+ Agnostic_CORINFO_SIG_INFO verSig;
+ DWORD accessAllowed;
+ Agnostic_CORINFO_HELPER_DESC callsiteCalloutHelper;
+ DWORD thisTransform;
+ DWORD kind;
+ DWORD nullInstanceCheck;
+ DWORDLONG contextHandle;
+ DWORD exactContextNeedsRuntimeLookup;
+ Agnostic_CORINFO_LOOKUP stubLookup; // first view of union. others are matching or subordinate
Agnostic_CORINFO_CONST_LOOKUP instParamLookup;
- DWORD secureDelegateInvoke;
- DWORD exceptionCode;
+ DWORD secureDelegateInvoke;
+ DWORD exceptionCode;
};
struct Agnostic_GetMethodInfo
{
Agnostic_CORINFO_METHOD_INFO info;
- bool result;
- DWORD exceptionCode;
+ bool result;
+ DWORD exceptionCode;
};
struct Agnostic_FindSig
{
DWORDLONG module;
- DWORD sigTOK;
+ DWORD sigTOK;
DWORDLONG context;
};
struct Agnostic_PInvokeMarshalingRequired
{
- DWORDLONG method;
+ DWORDLONG method;
Agnostic_CORINFO_SIG_INFO callSiteSig;
};
struct Agnostic_CORINFO_EH_CLAUSE
@@ -296,7 +297,7 @@ public:
DWORD TryLength;
DWORD HandlerOffset;
DWORD HandlerLength;
- DWORD ClassToken;//first view of a two dword union
+ DWORD ClassToken; // first view of a two dword union
};
struct Agnostic_GetVars
{
@@ -307,12 +308,12 @@ public:
struct Agnostic_CanAccessClassIn
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
- DWORDLONG callerHandle;
+ DWORDLONG callerHandle;
};
struct Agnostic_CanAccessClassOut
{
Agnostic_CORINFO_HELPER_DESC AccessHelper;
- DWORD result;
+ DWORD result;
};
struct Agnostic_AppendClassName
{
@@ -324,20 +325,20 @@ public:
struct Agnostic_CheckMethodModifier
{
DWORDLONG hMethod;
- DWORD modifier;
- DWORD fOptional;
+ DWORD modifier;
+ DWORD fOptional;
};
struct Agnostic_EmbedGenericHandle
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
- DWORD fEmbedParent;
+ DWORD fEmbedParent;
};
struct Agnostic_CORINFO_GENERICHANDLE_RESULT
{
Agnostic_CORINFO_LOOKUP lookup;
- DWORDLONG compileTimeHandle;
- DWORD handleType;
+ DWORDLONG compileTimeHandle;
+ DWORD handleType;
};
struct Agnostic_GetDelegateCtorIn
{
@@ -355,23 +356,23 @@ public:
struct Agnostic_GetDelegateCtorOut
{
Agnostic_DelegateCtorArgs CtorData;
- DWORDLONG result;
+ DWORDLONG result;
};
struct Agnostic_FindCallSiteSig
{
DWORDLONG module;
- DWORD methTok;
+ DWORD methTok;
DWORDLONG context;
};
struct Agnostic_GetNewHelper
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
- DWORDLONG callerHandle;
+ DWORDLONG callerHandle;
};
struct Agnostic_GetCastingHelper
{
Agnostic_CORINFO_RESOLVED_TOKEN ResolvedToken;
- DWORD fThrowing;
+ DWORD fThrowing;
};
struct Agnostic_GetClassModuleIdForStatics
{
@@ -395,25 +396,25 @@ public:
};
struct Agnostic_GetProfilingHandle
{
- DWORD bHookFunction;
+ DWORD bHookFunction;
DWORDLONG ProfilerHandle;
- DWORD bIndirectedHandles;
+ DWORD bIndirectedHandles;
};
struct Agnostic_GetTailCallCopyArgsThunk
{
Agnostic_CORINFO_SIG_INFO Sig;
- DWORD flags;
+ DWORD flags;
};
struct Agnostic_GetArgClass_Value
{
DWORDLONG result;
- DWORD exceptionCode;
+ DWORD exceptionCode;
};
struct Agnostic_GetArgType_Value
{
DWORDLONG vcTypeRet;
- DWORD result;
- DWORD exceptionCode;
+ DWORD result;
+ DWORD exceptionCode;
};
// Agnostic_ConfigIntInfo combines as a single key the name
@@ -428,12 +429,17 @@ public:
// SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR
struct Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor
{
- DWORD passedInRegisters; // Whether the struct is passable/passed (this includes struct returning) in registers.
- DWORD eightByteCount; // Number of eightbytes for this struct.
- DWORD eightByteClassifications[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The eightbytes type classification.
- DWORD eightByteSizes[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The size of the eightbytes (an eightbyte could include padding. This represents the no padding size of the eightbyte).
- DWORD eightByteOffsets[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The start offset of the eightbytes (in bytes).
- DWORD result;
+ DWORD passedInRegisters; // Whether the struct is passable/passed (this includes struct returning) in registers.
+ DWORD eightByteCount; // Number of eightbytes for this struct.
+ DWORD eightByteClassifications[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The eightbytes type
+ // classification.
+ DWORD eightByteSizes[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The size of the eightbytes (an
+ // eightbyte could include padding.
+ // This represents the no padding
+ // size of the eightbyte).
+ DWORD eightByteOffsets[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The start offset of the
+ // eightbytes (in bytes).
+ DWORD result;
};
struct Agnostic_ResolveVirtualMethod
@@ -448,36 +454,35 @@ public:
MethodContext();
private:
-
MethodContext(HANDLE hFile);
- MethodContext(unsigned char *buff, unsigned int totalLen);
+ MethodContext(unsigned char* buff, unsigned int totalLen);
- void MethodInitHelper(unsigned char *buff, unsigned int totalLen);
+ void MethodInitHelper(unsigned char* buff, unsigned int totalLen);
void MethodInitHelperFile(HANDLE hFile);
bool Initialize(int loadedCount, unsigned char* buff, DWORD size);
bool Initialize(int loadedCount, HANDLE hFile);
- int dumpMD5HashToBuffer(BYTE *pBuffer, int bufLen, char *buff, int len);
+ int dumpMD5HashToBuffer(BYTE* pBuffer, int bufLen, char* buff, int len);
public:
-
static bool Initialize(int loadedCount, unsigned char* buff, DWORD size, /* OUT */ MethodContext** ppmc);
static bool Initialize(int loadedCount, HANDLE hFile, /* OUT */ MethodContext** ppmc);
~MethodContext();
void Destroy();
- bool Equal(MethodContext *other);
+ bool Equal(MethodContext* other);
unsigned int saveToFile(HANDLE hFile);
unsigned int calculateFileSize();
unsigned int calculateRawFileSize();
- void dumpToConsole(int mcNumber = -1); // if mcNumber is not -1, display the method context number before the dumped info
- int dumpStatToBuffer(char *buff, int len);
- static int dumpStatTitleToBuffer(char *buff, int len);
+ void dumpToConsole(int mcNumber = -1); // if mcNumber is not -1, display the method context number before the dumped
+ // info
+ int dumpStatToBuffer(char* buff, int len);
+ static int dumpStatTitleToBuffer(char* buff, int len);
int methodSize;
- int dumpMethodIdentityInfoToBuffer(char *buff, int len);
- int dumpMethodMD5HashToBuffer(char *buff, int len);
+ int dumpMethodIdentityInfoToBuffer(char* buff, int len);
+ int dumpMethodMD5HashToBuffer(char* buff, int len);
void recGlobalContext(const MethodContext& other);
@@ -485,12 +490,12 @@ public:
void dmpEnvironment(DWORD key, const Agnostic_Environment& value);
void repEnvironmentSet();
void repEnvironmentUnset();
- int repEnvironmentGetCount();
- int repGetTestID();
+ int repEnvironmentGetCount();
+ int repGetTestID();
- void recCompileMethod(CORINFO_METHOD_INFO *info, unsigned flags);
+ void recCompileMethod(CORINFO_METHOD_INFO* info, unsigned flags);
void dmpCompileMethod(DWORD key, const Agnostic_CompileMethod& value);
- void repCompileMethod(CORINFO_METHOD_INFO *info, unsigned *flags);
+ void repCompileMethod(CORINFO_METHOD_INFO* info, unsigned* flags);
void recGetMethodClass(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CLASS_HANDLE classHandle);
void dmpGetMethodClass(DWORDLONG key, DWORDLONG value);
@@ -504,48 +509,77 @@ public:
void dmpGetMethodAttribs(DWORDLONG key, DWORD value);
DWORD repGetMethodAttribs(CORINFO_METHOD_HANDLE methodHandle);
- void recGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDebugInfo::ILVarInfo **vars, bool *extendOthers);
+ void recGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32* cVars, ICorDebugInfo::ILVarInfo** vars, bool* extendOthers);
void dmpGetVars(DWORDLONG key, const Agnostic_GetVars& value);
- void repGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32 *cVars, ICorDebugInfo::ILVarInfo **vars, bool *extendOthers);
+ void repGetVars(CORINFO_METHOD_HANDLE ftn, ULONG32* cVars, ICorDebugInfo::ILVarInfo** vars, bool* extendOthers);
- void recGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cILOffsets, DWORD **pILOffsets, ICorDebugInfo::BoundaryTypes *implictBoundaries);
+ void recGetBoundaries(CORINFO_METHOD_HANDLE ftn,
+ unsigned int* cILOffsets,
+ DWORD** pILOffsets,
+ ICorDebugInfo::BoundaryTypes* implictBoundaries);
void dmpGetBoundaries(DWORDLONG key, const Agnostic_GetBoundaries& value);
- void repGetBoundaries(CORINFO_METHOD_HANDLE ftn, unsigned int *cILOffsets, DWORD **pILOffsets, ICorDebugInfo::BoundaryTypes *implictBoundaries);
-
- void recInitClass(CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, CORINFO_CONTEXT_HANDLE context, BOOL speculative, CorInfoInitClassResult result);
+ void repGetBoundaries(CORINFO_METHOD_HANDLE ftn,
+ unsigned int* cILOffsets,
+ DWORD** pILOffsets,
+ ICorDebugInfo::BoundaryTypes* implictBoundaries);
+
+ void recInitClass(CORINFO_FIELD_HANDLE field,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CONTEXT_HANDLE context,
+ BOOL speculative,
+ CorInfoInitClassResult result);
void dmpInitClass(const Agnostic_InitClass& key, DWORD value);
- CorInfoInitClassResult repInitClass(CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, CORINFO_CONTEXT_HANDLE context, BOOL speculative);
+ CorInfoInitClassResult repInitClass(CORINFO_FIELD_HANDLE field,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CONTEXT_HANDLE context,
+ BOOL speculative);
- void recGetMethodName(CORINFO_METHOD_HANDLE ftn, char *methodname, const char **moduleName);
+ void recGetMethodName(CORINFO_METHOD_HANDLE ftn, char* methodname, const char** moduleName);
void dmpGetMethodName(DLD key, DD value);
- const char *repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char **moduleName);
+ const char* repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char** moduleName);
- void recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result);
+ void recGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes, DWORD result);
void dmpGetJitFlags(DWORD key, DD value);
- DWORD repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes);
+ DWORD repGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes);
void recGetJitTimeLogFilename(LPCWSTR tempFileName);
void dmpGetJitTimeLogFilename(DWORD key, DWORD value);
LPCWSTR repGetJitTimeLogFilename();
- void recCanInline(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, DWORD *pRestrictions, CorInfoInline response, DWORD exceptionCode);
+ void recCanInline(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ DWORD* pRestrictions,
+ CorInfoInline response,
+ DWORD exceptionCode);
void dmpCanInline(DLDL key, const Agnostic_CanInline& value);
- CorInfoInline repCanInline(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, DWORD* pRestrictions, DWORD *exceptionCode);
+ CorInfoInline repCanInline(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE calleeHnd,
+ DWORD* pRestrictions,
+ DWORD* exceptionCode);
- void recResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, DWORD exceptionCode);
+ void recResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWORD exceptionCode);
void dmpResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const Agnostic_CORINFO_RESOLVED_TOKENout& value);
- void repResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, DWORD *exceptionCode);
-
- void recTryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken, bool success);
- void dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key, const Agnostic_CORINFO_RESOLVED_TOKENout& value);
- bool repTryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken);
-
- void recGetCallInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_RESOLVED_TOKEN *pConstrainedResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO *pResult, DWORD exceptionCode);
+ void repResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, DWORD* exceptionCode);
+
+ void recTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool success);
+ void dmpTryResolveToken(const Agnostic_CORINFO_RESOLVED_TOKENin& key,
+ const Agnostic_CORINFO_RESOLVED_TOKENout& value);
+ bool repTryResolveToken(CORINFO_RESOLVED_TOKEN* pResolvedToken);
+
+ void recGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_CALLINFO_FLAGS flags,
+ CORINFO_CALL_INFO* pResult,
+ DWORD exceptionCode);
void dmpGetCallInfo(const Agnostic_GetCallInfo& key, const Agnostic_CORINFO_CALL_INFO& value);
- void repGetCallInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_RESOLVED_TOKEN *pConstrainedResolvedToken,
- CORINFO_METHOD_HANDLE callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO *pResult, DWORD *exceptionCode);
- void repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CALL_INFO *pResult);
+ void repGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_CALLINFO_FLAGS flags,
+ CORINFO_CALL_INFO* pResult,
+ DWORD* exceptionCode);
+ void repGetCallInfoFromMethodHandle(CORINFO_METHOD_HANDLE methodHandle, CORINFO_CALL_INFO* pResult);
void recGetIntrinsicID(CORINFO_METHOD_HANDLE method, bool* pMustExpand, CorInfoIntrinsics result);
void dmpGetIntrinsicID(DWORDLONG key, DD value);
@@ -593,7 +627,7 @@ public:
void recGetTypeForBox(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE result);
void dmpGetTypeForBox(DWORDLONG key, DWORDLONG value);
- CORINFO_CLASS_HANDLE repGetTypeForBox(CORINFO_CLASS_HANDLE cls);
+ CORINFO_CLASS_HANDLE repGetTypeForBox(CORINFO_CLASS_HANDLE cls);
void recGetBoxHelper(CORINFO_CLASS_HANDLE cls, CorInfoHelpFunc result);
void dmpGetBoxHelper(DWORDLONG key, DWORD value);
@@ -635,187 +669,257 @@ public:
void dmpGetUnBoxHelper(DWORDLONG key, DWORD value);
CorInfoHelpFunc repGetUnBoxHelper(CORINFO_CLASS_HANDLE cls);
- void recGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup, bool result);
+ void recGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_LOOKUP_KIND* pGenericLookupKind,
+ CorInfoHelpFunc id,
+ CORINFO_CONST_LOOKUP* pLookup,
+ bool result);
void dmpGetReadyToRunHelper(DWORDLONG key, DWORD value);
- bool repGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup);
-
- void recGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_LOOKUP* pLookup);
+ bool repGetReadyToRunHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_LOOKUP_KIND* pGenericLookupKind,
+ CorInfoHelpFunc id,
+ CORINFO_CONST_LOOKUP* pLookup);
+
+ void recGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod,
+ CORINFO_CLASS_HANDLE delegateType,
+ CORINFO_LOOKUP* pLookup);
void dmpGetReadyToRunDelegateCtorHelper(DWORDLONG key, DWORD value);
- void repGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_HANDLE delegateType, CORINFO_LOOKUP* pLookup);
+ void repGetReadyToRunDelegateCtorHelper(CORINFO_RESOLVED_TOKEN* pTargetMethod,
+ CORINFO_CLASS_HANDLE delegateType,
+ CORINFO_LOOKUP* pLookup);
- void recGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirection, void *result);
+ void recGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection, void* result);
void dmpGetHelperFtn(DWORD key, DLDL value);
- void* repGetHelperFtn(CorInfoHelpFunc ftnNum, void **ppIndirection);
- bool fndGetHelperFtn(void *functionAddress, CorInfoHelpFunc *pResult);
+ void* repGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection);
+ bool fndGetHelperFtn(void* functionAddress, CorInfoHelpFunc* pResult);
- void recGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection, CORINFO_JUST_MY_CODE_HANDLE result);
+ void recGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method,
+ CORINFO_JUST_MY_CODE_HANDLE** ppIndirection,
+ CORINFO_JUST_MY_CODE_HANDLE result);
void dmpGetJustMyCodeHandle(DWORDLONG key, DLDL value);
- CORINFO_JUST_MY_CODE_HANDLE repGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method, CORINFO_JUST_MY_CODE_HANDLE **ppIndirection);
+ CORINFO_JUST_MY_CODE_HANDLE repGetJustMyCodeHandle(CORINFO_METHOD_HANDLE method,
+ CORINFO_JUST_MY_CODE_HANDLE** ppIndirection);
- void recGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult, CORINFO_ACCESS_FLAGS accessFlags);
+ void recGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn,
+ CORINFO_CONST_LOOKUP* pResult,
+ CORINFO_ACCESS_FLAGS accessFlags);
void dmpGetFunctionEntryPoint(DLD key, DLD value);
- void repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult, CORINFO_ACCESS_FLAGS accessFlags);
- bool fndGetFunctionEntryPoint(DLD value, CORINFO_METHOD_HANDLE *pResult);
+ void repGetFunctionEntryPoint(CORINFO_METHOD_HANDLE ftn,
+ CORINFO_CONST_LOOKUP* pResult,
+ CORINFO_ACCESS_FLAGS accessFlags);
+ bool fndGetFunctionEntryPoint(DLD value, CORINFO_METHOD_HANDLE* pResult);
- void recConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void *ppValue, InfoAccessType result);
+ void recConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void* ppValue, InfoAccessType result);
void dmpConstructStringLiteral(DLD key, DLD value);
- InfoAccessType repConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void **ppValue);
+ InfoAccessType repConstructStringLiteral(CORINFO_MODULE_HANDLE module, mdToken metaTok, void** ppValue);
- void recEmptyStringLiteral(void **ppValue, InfoAccessType result);
+ void recEmptyStringLiteral(void** ppValue, InfoAccessType result);
void dmpEmptyStringLiteral(DWORD key, DLD value);
- InfoAccessType repEmptyStringLiteral(void **ppValue);
+ InfoAccessType repEmptyStringLiteral(void** ppValue);
- void recGetArgType(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE *vcTypeRet, CorInfoTypeWithMod result, DWORD exception);
+ void recGetArgType(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE* vcTypeRet,
+ CorInfoTypeWithMod result,
+ DWORD exception);
void dmpGetArgType(const Agnostic_GetArgType& key, const Agnostic_GetArgType_Value& value);
- CorInfoTypeWithMod repGetArgType(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE *vcTypeRet, DWORD *exception);
+ CorInfoTypeWithMod repGetArgType(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE* vcTypeRet,
+ DWORD* exception);
void recGetArgNext(CORINFO_ARG_LIST_HANDLE args, CORINFO_ARG_LIST_HANDLE result);
void dmpGetArgNext(DWORDLONG key, DWORDLONG value);
CORINFO_ARG_LIST_HANDLE repGetArgNext(CORINFO_ARG_LIST_HANDLE args);
- void recGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO *sig, CORINFO_CLASS_HANDLE memberParent);
+ void recGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_HANDLE memberParent);
void dmpGetMethodSig(DLDL key, const Agnostic_CORINFO_SIG_INFO& value);
- void repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO *sig, CORINFO_CLASS_HANDLE memberParent);
+ void repGetMethodSig(CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_HANDLE memberParent);
- void recGetArgClass(CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_HANDLE args, CORINFO_CLASS_HANDLE result, DWORD exceptionCode);
+ void recGetArgClass(CORINFO_SIG_INFO* sig,
+ CORINFO_ARG_LIST_HANDLE args,
+ CORINFO_CLASS_HANDLE result,
+ DWORD exceptionCode);
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);
+ 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 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);
+ bool repGetMethodInfo(CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO* info, DWORD* exceptionCode);
- void recGetNewHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CorInfoHelpFunc result);
+ void recGetNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CorInfoHelpFunc result);
void dmpGetNewHelper(const Agnostic_GetNewHelper& key, DWORD value);
- CorInfoHelpFunc repGetNewHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle);
-
- void recEmbedGenericHandle(CORINFO_RESOLVED_TOKEN *pResolvedToken, BOOL fEmbedParent, CORINFO_GENERICHANDLE_RESULT *pResult);
- void dmpEmbedGenericHandle(const Agnostic_EmbedGenericHandle& key, const Agnostic_CORINFO_GENERICHANDLE_RESULT& value);
- void repEmbedGenericHandle(CORINFO_RESOLVED_TOKEN *pResolvedToken, BOOL fEmbedParent, CORINFO_GENERICHANDLE_RESULT *pResult);
-
- void recGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE *clause);
+ CorInfoHelpFunc repGetNewHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_HANDLE callerHandle);
+
+ void recEmbedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ BOOL fEmbedParent,
+ CORINFO_GENERICHANDLE_RESULT* pResult);
+ void dmpEmbedGenericHandle(const Agnostic_EmbedGenericHandle& key,
+ const Agnostic_CORINFO_GENERICHANDLE_RESULT& value);
+ void repEmbedGenericHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ BOOL fEmbedParent,
+ CORINFO_GENERICHANDLE_RESULT* pResult);
+
+ void recGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause);
void dmpGetEHinfo(DLD key, const Agnostic_CORINFO_EH_CLAUSE& value);
- void repGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE *clause);
+ void repGetEHinfo(CORINFO_METHOD_HANDLE ftn, unsigned EHnumber, CORINFO_EH_CLAUSE* clause);
- void recGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsigned *offsetOfIndirection, unsigned* offsetAfterIndirection);
+ void recGetMethodVTableOffset(CORINFO_METHOD_HANDLE method,
+ unsigned* offsetOfIndirection,
+ unsigned* offsetAfterIndirection);
void dmpGetMethodVTableOffset(DWORDLONG key, DD value);
- void repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method, unsigned *offsetOfIndirection, unsigned* offsetAfterIndirection);
-
- void recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
- CORINFO_CONTEXT_HANDLE ownerType, CORINFO_METHOD_HANDLE result);
+ void repGetMethodVTableOffset(CORINFO_METHOD_HANDLE method,
+ unsigned* offsetOfIndirection,
+ unsigned* offsetAfterIndirection);
+
+ void recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod,
+ CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType,
+ CORINFO_METHOD_HANDLE result);
void dmpResolveVirtualMethod(const Agnostic_ResolveVirtualMethod& key, DWORDLONG value);
- CORINFO_METHOD_HANDLE repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, CORINFO_CLASS_HANDLE implClass,
- CORINFO_CONTEXT_HANDLE ownerType);
+ CORINFO_METHOD_HANDLE repResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod,
+ CORINFO_CLASS_HANDLE implClass,
+ CORINFO_CONTEXT_HANDLE ownerType);
- void recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_CLASS_HANDLE result);
+ void recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CLASS_HANDLE result);
void dmpGetTokenTypeAsHandle(const Agnostic_CORINFO_RESOLVED_TOKEN& key, DWORDLONG value);
- CORINFO_CLASS_HANDLE repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN * pResolvedToken);
+ CORINFO_CLASS_HANDLE repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken);
- void recGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_ACCESS_FLAGS flags,
- CORINFO_FIELD_INFO *pResult);
+ void recGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_ACCESS_FLAGS flags,
+ CORINFO_FIELD_INFO* pResult);
void dmpGetFieldInfo(const Agnostic_GetFieldInfo& key, const Agnostic_CORINFO_FIELD_INFO& value);
- void repGetFieldInfo(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle, CORINFO_ACCESS_FLAGS flags,
- CORINFO_FIELD_INFO *pResult);
+ void repGetFieldInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_ACCESS_FLAGS flags,
+ CORINFO_FIELD_INFO* pResult);
- void recEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void **ppIndirection, CORINFO_METHOD_HANDLE result);
+ void recEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection, CORINFO_METHOD_HANDLE result);
void dmpEmbedMethodHandle(DWORDLONG key, DLDL value);
- CORINFO_METHOD_HANDLE repEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void **ppIndirection);
+ CORINFO_METHOD_HANDLE repEmbedMethodHandle(CORINFO_METHOD_HANDLE handle, void** ppIndirection);
- void recGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndirection, void *result, CorInfoType cit);
+ void recGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection, void* result, CorInfoType cit);
void dmpGetFieldAddress(DWORDLONG key, const Agnostic_GetFieldAddress& value);
- void* repGetFieldAddress(CORINFO_FIELD_HANDLE field, void **ppIndirection);
+ void* repGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndirection);
- void recGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE *gcPtrs, unsigned len, unsigned result);
+ void recGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE* gcPtrs, unsigned len, unsigned result);
void dmpGetClassGClayout(DWORDLONG key, const Agnostic_GetClassGClayout& value);
- unsigned repGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE *gcPtrs);
+ unsigned repGetClassGClayout(CORINFO_CLASS_HANDLE cls, BYTE* gcPtrs);
void recGetClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint, unsigned result);
void dmpGetClassAlignmentRequirement(DLD key, DWORD value);
unsigned repGetClassAlignmentRequirement(CORINFO_CLASS_HANDLE cls, BOOL fDoubleAlignHint);
- void recCanAccessClass(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_HELPER_DESC *pAccessHelper, CorInfoIsAccessAllowedResult result);
+ void recCanAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_HELPER_DESC* pAccessHelper,
+ CorInfoIsAccessAllowedResult result);
void dmpCanAccessClass(const Agnostic_CanAccessClassIn& key, const Agnostic_CanAccessClassOut& value);
- CorInfoIsAccessAllowedResult repCanAccessClass(CORINFO_RESOLVED_TOKEN *pResolvedToken, CORINFO_METHOD_HANDLE callerHandle,
- CORINFO_HELPER_DESC *pAccessHelper);
+ CorInfoIsAccessAllowedResult repCanAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_METHOD_HANDLE callerHandle,
+ CORINFO_HELPER_DESC* pAccessHelper);
- void recGetCastingHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, bool fThrowing, CorInfoHelpFunc result);
+ void recGetCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing, CorInfoHelpFunc result);
void dmpGetCastingHelper(const Agnostic_GetCastingHelper& key, DWORD value);
- CorInfoHelpFunc repGetCastingHelper(CORINFO_RESOLVED_TOKEN *pResolvedToken, bool fThrowing);
+ CorInfoHelpFunc repGetCastingHelper(CORINFO_RESOLVED_TOKEN* pResolvedToken, bool fThrowing);
- void recEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void **ppIndirection, CORINFO_MODULE_HANDLE result);
+ void recEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection, CORINFO_MODULE_HANDLE result);
void dmpEmbedModuleHandle(DWORDLONG key, DLDL value);
- CORINFO_MODULE_HANDLE repEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void **ppIndirection);
+ CORINFO_MODULE_HANDLE repEmbedModuleHandle(CORINFO_MODULE_HANDLE handle, void** ppIndirection);
- void recEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void **ppIndirection, CORINFO_CLASS_HANDLE result);
+ void recEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection, CORINFO_CLASS_HANDLE result);
void dmpEmbedClassHandle(DWORDLONG key, DLDL value);
- CORINFO_CLASS_HANDLE repEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void **ppIndirection);
+ CORINFO_CLASS_HANDLE repEmbedClassHandle(CORINFO_CLASS_HANDLE handle, void** ppIndirection);
void recPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig, BOOL result);
void dmpPInvokeMarshalingRequired(const Agnostic_PInvokeMarshalingRequired& key, DWORD value);
BOOL repPInvokeMarshalingRequired(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* callSiteSig);
- void recFindSig(CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig);
+ void recFindSig(CORINFO_MODULE_HANDLE module,
+ unsigned sigTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig);
void dmpFindSig(const Agnostic_FindSig& key, const Agnostic_CORINFO_SIG_INFO& value);
- void repFindSig(CORINFO_MODULE_HANDLE module, unsigned sigTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig);
+ void repFindSig(CORINFO_MODULE_HANDLE module,
+ unsigned sigTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig);
- void recGetEEInfo(CORINFO_EE_INFO *pEEInfoOut);
+ void recGetEEInfo(CORINFO_EE_INFO* pEEInfoOut);
void dmpGetEEInfo(DWORD key, const Agnostic_CORINFO_EE_INFO& value);
- void repGetEEInfo(CORINFO_EE_INFO *pEEInfoOut);
+ void repGetEEInfo(CORINFO_EE_INFO* pEEInfoOut);
- void recGetGSCookie(GSCookie *pCookieVal, GSCookie **ppCookieVal);
+ void recGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal);
void dmpGetGSCookie(DWORD key, DLDL value);
- void repGetGSCookie(GSCookie *pCookieVal, GSCookie **ppCookieVal);
+ void repGetGSCookie(GSCookie* pCookieVal, GSCookie** ppCookieVal);
- void recGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE *pModule, void **ppIndirection, size_t result);
+ void recGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls,
+ CORINFO_MODULE_HANDLE* pModule,
+ void** ppIndirection,
+ size_t result);
void dmpGetClassModuleIdForStatics(DWORDLONG key, const Agnostic_GetClassModuleIdForStatics& value);
- size_t repGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls, CORINFO_MODULE_HANDLE *pModule, void **ppIndirection);
+ size_t repGetClassModuleIdForStatics(CORINFO_CLASS_HANDLE cls,
+ CORINFO_MODULE_HANDLE* pModule,
+ void** ppIndirection);
- void recGetThreadTLSIndex(void **ppIndirection, DWORD result);
+ void recGetThreadTLSIndex(void** ppIndirection, DWORD result);
void dmpGetThreadTLSIndex(DWORD key, DLD value);
- DWORD repGetThreadTLSIndex(void **ppIndirection);
+ DWORD repGetThreadTLSIndex(void** ppIndirection);
- void recGetInlinedCallFrameVptr(void **ppIndirection, const void * result);
+ void recGetInlinedCallFrameVptr(void** ppIndirection, const void* result);
void dmpGetInlinedCallFrameVptr(DWORD key, DLDL value);
- const void * repGetInlinedCallFrameVptr(void **ppIndirection);
+ const void* repGetInlinedCallFrameVptr(void** ppIndirection);
- void recGetAddrOfCaptureThreadGlobal(void **ppIndirection, LONG * result);
+ void recGetAddrOfCaptureThreadGlobal(void** ppIndirection, LONG* result);
void dmpGetAddrOfCaptureThreadGlobal(DWORD key, DLDL value);
- LONG * repGetAddrOfCaptureThreadGlobal(void **ppIndirection);
+ LONG* repGetAddrOfCaptureThreadGlobal(void** ppIndirection);
- void recGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppIndirection, unsigned result);
+ void recGetClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection, unsigned result);
void dmpGetClassDomainID(DWORDLONG key, DLD value);
- unsigned repGetClassDomainID(CORINFO_CLASS_HANDLE cls, void **ppIndirection);
+ unsigned repGetClassDomainID(CORINFO_CLASS_HANDLE cls, void** ppIndirection);
- void recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND *result);
+ void recGetLocationOfThisType(CORINFO_METHOD_HANDLE context, CORINFO_LOOKUP_KIND* result);
void dmpGetLocationOfThisType(DWORDLONG key, const Agnostic_CORINFO_LOOKUP_KIND& value);
CORINFO_LOOKUP_KIND repGetLocationOfThisType(CORINFO_METHOD_HANDLE context);
- void recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs *pCtorData, CORINFO_METHOD_HANDLE result);
+ void recGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
+ CORINFO_CLASS_HANDLE clsHnd,
+ CORINFO_METHOD_HANDLE targetMethodHnd,
+ DelegateCtorArgs* pCtorData,
+ CORINFO_METHOD_HANDLE result);
void dmpGetDelegateCtor(const Agnostic_GetDelegateCtorIn& key, const Agnostic_GetDelegateCtorOut& value);
- CORINFO_METHOD_HANDLE repGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, CORINFO_CLASS_HANDLE clsHnd,
- CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs *pCtorData);
+ CORINFO_METHOD_HANDLE repGetDelegateCtor(CORINFO_METHOD_HANDLE methHnd,
+ CORINFO_CLASS_HANDLE clsHnd,
+ CORINFO_METHOD_HANDLE targetMethodHnd,
+ DelegateCtorArgs* pCtorData);
- void recGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult);
+ void recGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult);
void dmpGetFunctionFixedEntryPoint(DWORDLONG key, const Agnostic_CORINFO_CONST_LOOKUP& value);
- void repGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP *pResult);
+ void repGetFunctionFixedEntryPoint(CORINFO_METHOD_HANDLE ftn, CORINFO_CONST_LOOKUP* pResult);
void recGetFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num, CORINFO_FIELD_HANDLE result);
void dmpGetFieldInClass(DLD key, DWORDLONG value);
CORINFO_FIELD_HANDLE repGetFieldInClass(CORINFO_CLASS_HANDLE clsHnd, INT num);
- void recGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HANDLE *structType, CORINFO_CLASS_HANDLE memberParent, CorInfoType result);
+ void recGetFieldType(CORINFO_FIELD_HANDLE field,
+ CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE memberParent,
+ CorInfoType result);
void dmpGetFieldType(DLDL key, DLD value);
- CorInfoType repGetFieldType(CORINFO_FIELD_HANDLE field, CORINFO_CLASS_HANDLE *structType, CORINFO_CLASS_HANDLE memberParent);
+ CorInfoType repGetFieldType(CORINFO_FIELD_HANDLE field,
+ CORINFO_CLASS_HANDLE* structType,
+ CORINFO_CLASS_HANDLE memberParent);
- void recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **moduleName, const char* result);
+ void recGetFieldName(CORINFO_FIELD_HANDLE ftn, const char** moduleName, const char* result);
void dmpGetFieldName(DWORDLONG key, DD value);
- const char* repGetFieldName(CORINFO_FIELD_HANDLE ftn, const char **moduleName);
+ const char* repGetFieldName(CORINFO_FIELD_HANDLE ftn, const char** moduleName);
void recCanInlineTypeCheckWithObjectVTable(CORINFO_CLASS_HANDLE cls, BOOL result);
void dmpCanInlineTypeCheckWithObjectVTable(DWORDLONG key, DWORD value);
@@ -825,11 +929,13 @@ public:
void dmpSatisfiesMethodConstraints(DLDL key, DWORD value);
BOOL repSatisfiesMethodConstraints(CORINFO_CLASS_HANDLE parent, CORINFO_METHOD_HANDLE method);
- void recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method, BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraint);
+ void recInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
+ BOOL* pfHasCircularClassConstraints,
+ BOOL* pfHasCircularMethodConstraint);
void dmpInitConstraintsForVerification(DWORDLONG key, DD value);
- void repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method, BOOL *pfHasCircularClassConstraints,
- BOOL *pfHasCircularMethodConstraint);
+ void repInitConstraintsForVerification(CORINFO_METHOD_HANDLE method,
+ BOOL* pfHasCircularClassConstraints,
+ BOOL* pfHasCircularMethodConstraint);
void recIsValidStringRef(CORINFO_MODULE_HANDLE module, unsigned metaTOK, BOOL result);
void dmpIsValidStringRef(DLD key, DWORD value);
@@ -843,28 +949,28 @@ public:
void dmpCanCast(DLDL key, DWORD value);
BOOL repCanCast(CORINFO_CLASS_HANDLE child, CORINFO_CLASS_HANDLE parent);
- void recGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE *clsRet, CorInfoType result);
+ void recGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet, CorInfoType result);
void dmpGetChildType(DWORDLONG key, DLD value);
- CorInfoType repGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE *clsRet);
+ CorInfoType repGetChildType(CORINFO_CLASS_HANDLE clsHnd, CORINFO_CLASS_HANDLE* clsRet);
- void recGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size, void *result);
+ void recGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size, void* result);
void dmpGetArrayInitializationData(DLD key, DWORDLONG value);
- void *repGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size);
+ void* repGetArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size);
- void recFilterException(struct _EXCEPTION_POINTERS *pExceptionPointers, int result);
+ void recFilterException(struct _EXCEPTION_POINTERS* pExceptionPointers, int result);
void dmpFilterException(DWORD key, DWORD value);
- int repFilterException(struct _EXCEPTION_POINTERS *pExceptionPointers);
+ int repFilterException(struct _EXCEPTION_POINTERS* pExceptionPointers);
- void recHandleException(struct _EXCEPTION_POINTERS *pExceptionPointers);
+ void recHandleException(struct _EXCEPTION_POINTERS* pExceptionPointers);
void dmpHandleException(DWORD key, DWORD value);
- void recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection, void* result);
+ void recGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result);
void dmpGetAddressOfPInvokeFixup(DWORDLONG key, DLDL value);
- void* repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void **ppIndirection);
+ void* repGetAddressOfPInvokeFixup(CORINFO_METHOD_HANDLE method, void** ppIndirection);
- void recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup);
+ void recGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup);
void dmpGetAddressOfPInvokeTarget(DWORDLONG key, DLD value);
- void repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP *pLookup);
+ void repGetAddressOfPInvokeTarget(CORINFO_METHOD_HANDLE method, CORINFO_CONST_LOOKUP* pLookup);
void recSatisfiesClassConstraints(CORINFO_CLASS_HANDLE cls, BOOL result);
void dmpSatisfiesClassConstraints(DWORDLONG key, DWORD value);
@@ -874,63 +980,88 @@ public:
void dmpGetMethodHash(DWORDLONG key, DWORD value);
unsigned repGetMethodHash(CORINFO_METHOD_HANDLE ftn);
- void recCanTailCall(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE declaredCalleeHnd, CORINFO_METHOD_HANDLE exactCalleeHnd,
- bool fIsTailPrefix, bool result);
+ void recCanTailCall(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE declaredCalleeHnd,
+ CORINFO_METHOD_HANDLE exactCalleeHnd,
+ bool fIsTailPrefix,
+ bool result);
void dmpCanTailCall(const Agnostic_CanTailCall& key, DWORD value);
- bool repCanTailCall(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE declaredCalleeHnd, CORINFO_METHOD_HANDLE exactCalleeHnd,
- bool fIsTailPrefix);
-
- void recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls,
- CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, BOOL *pfIsOpenDelegate, BOOL result);
+ bool repCanTailCall(CORINFO_METHOD_HANDLE callerHnd,
+ CORINFO_METHOD_HANDLE declaredCalleeHnd,
+ CORINFO_METHOD_HANDLE exactCalleeHnd,
+ bool fIsTailPrefix);
+
+ void recIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls,
+ CORINFO_CLASS_HANDLE methodParentCls,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CLASS_HANDLE delegateCls,
+ BOOL* pfIsOpenDelegate,
+ BOOL result);
void dmpIsCompatibleDelegate(const Agnostic_IsCompatibleDelegate& key, DD value);
- BOOL repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls, CORINFO_CLASS_HANDLE methodParentCls,
- CORINFO_METHOD_HANDLE method, CORINFO_CLASS_HANDLE delegateCls, BOOL *pfIsOpenDelegate);
+ BOOL repIsCompatibleDelegate(CORINFO_CLASS_HANDLE objCls,
+ CORINFO_CLASS_HANDLE methodParentCls,
+ CORINFO_METHOD_HANDLE method,
+ CORINFO_CLASS_HANDLE delegateCls,
+ BOOL* pfIsOpenDelegate);
void recIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd, BOOL result);
void dmpIsDelegateCreationAllowed(DLDL key, DWORD value);
BOOL repIsDelegateCreationAllowed(CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeHnd);
- void recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip, CorInfoCanSkipVerificationResult result);
+ void recCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle,
+ BOOL skip,
+ CorInfoCanSkipVerificationResult result);
void dmpCanSkipMethodVerification(DLD key, DWORD value);
CorInfoCanSkipVerificationResult repCanSkipMethodVerification(CORINFO_METHOD_HANDLE ftnHandle, BOOL skip);
- void recFindCallSiteSig(CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig);
+ void recFindCallSiteSig(CORINFO_MODULE_HANDLE module,
+ unsigned methTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig);
void dmpFindCallSiteSig(const Agnostic_FindCallSiteSig& key, const Agnostic_CORINFO_SIG_INFO& value);
- void repFindCallSiteSig(CORINFO_MODULE_HANDLE module, unsigned methTOK, CORINFO_CONTEXT_HANDLE context, CORINFO_SIG_INFO *sig);
+ void repFindCallSiteSig(CORINFO_MODULE_HANDLE module,
+ unsigned methTOK,
+ CORINFO_CONTEXT_HANDLE context,
+ CORINFO_SIG_INFO* sig);
void recShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope, BOOL result);
void dmpShouldEnforceCallvirtRestriction(DWORDLONG key, DWORD value);
BOOL repShouldEnforceCallvirtRestriction(CORINFO_MODULE_HANDLE scope);
- void recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void **ppIndirection, void* result);
+ void recGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection, void* result);
void dmpGetMethodSync(DWORDLONG key, DLDL value);
- void* repGetMethodSync(CORINFO_METHOD_HANDLE ftn, void **ppIndirection);
+ void* repGetMethodSync(CORINFO_METHOD_HANDLE ftn, void** ppIndirection);
- void recGetVarArgsHandle(CORINFO_SIG_INFO *pSig, void **ppIndirection, CORINFO_VARARGS_HANDLE result);
+ void recGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection, CORINFO_VARARGS_HANDLE result);
void dmpGetVarArgsHandle(const Agnostic_CORINFO_SIG_INFO& key, DLDL value);
- CORINFO_VARARGS_HANDLE repGetVarArgsHandle(CORINFO_SIG_INFO *pSig, void **ppIndirection);
+ CORINFO_VARARGS_HANDLE repGetVarArgsHandle(CORINFO_SIG_INFO* pSig, void** ppIndirection);
- void recCanGetVarArgsHandle(CORINFO_SIG_INFO *pSig, bool result);
+ void recCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig, bool result);
void dmpCanGetVarArgsHandle(const Agnostic_CORINFO_SIG_INFO& key, DWORD value);
- bool repCanGetVarArgsHandle(CORINFO_SIG_INFO *pSig);
+ bool repCanGetVarArgsHandle(CORINFO_SIG_INFO* pSig);
- void recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void **ppIndirection, DWORD result);
+ void recGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection, DWORD result);
void dmpGetFieldThreadLocalStoreID(DWORDLONG key, DLD value);
- DWORD repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void **ppIndirection);
+ DWORD repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection);
- void recGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd, ULONG *count, ICorJitInfo::ProfileBuffer **profileBuffer,
- ULONG *numRuns, HRESULT result);
+ void recGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd,
+ ULONG* count,
+ ICorJitInfo::ProfileBuffer** profileBuffer,
+ ULONG* numRuns,
+ HRESULT result);
void dmpGetBBProfileData(DWORDLONG key, const Agnostic_GetBBProfileData& value);
- HRESULT repGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd, ULONG *count, ICorJitInfo::ProfileBuffer **profileBuffer,
- ULONG *numRuns);
+ HRESULT repGetBBProfileData(CORINFO_METHOD_HANDLE ftnHnd,
+ ULONG* count,
+ ICorJitInfo::ProfileBuffer** profileBuffer,
+ ULONG* numRuns);
void recMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, CORINFO_CLASS_HANDLE result);
void dmpMergeClasses(DLDL key, DWORDLONG value);
CORINFO_CLASS_HANDLE repMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2);
- void recGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection, LPVOID result);
+ void recGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection, LPVOID result);
void dmpGetCookieForPInvokeCalliSig(const Agnostic_CORINFO_SIG_INFO& key, DLDL value);
- LPVOID repGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void ** ppIndirection);
+ LPVOID repGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, void** ppIndirection);
void recCanGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig, bool result);
void dmpCanGetCookieForPInvokeCalliSig(const Agnostic_CORINFO_SIG_INFO& key, DWORD value);
@@ -940,32 +1071,38 @@ public:
void dmpCanAccessFamily(DLDL key, DWORD value);
BOOL repCanAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType);
- void recErrorList(const char *error);
+ void recErrorList(const char* error);
void dmpErrorList(DWORD key, DWORD value);
- void recGetProfilingHandle(BOOL *pbHookFunction, void **pProfilerHandle, BOOL *pbIndirectedHandles);
+ void recGetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles);
void dmpGetProfilingHandle(DWORD key, const Agnostic_GetProfilingHandle& value);
- void repGetProfilingHandle(BOOL *pbHookFunction, void **pProfilerHandle, BOOL *pbIndirectedHandles);
+ void repGetProfilingHandle(BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles);
- void recEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIndirection, CORINFO_FIELD_HANDLE result);
+ void recEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection, CORINFO_FIELD_HANDLE result);
void dmpEmbedFieldHandle(DWORDLONG key, DLDL value);
- CORINFO_FIELD_HANDLE repEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void **ppIndirection);
+ CORINFO_FIELD_HANDLE repEmbedFieldHandle(CORINFO_FIELD_HANDLE handle, void** ppIndirection);
void recAreTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, BOOL result);
void dmpAreTypesEquivalent(DLDL key, DWORD value);
BOOL repAreTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2);
- void recFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char * szFQName, size_t FQNameCapacity, size_t result);
+ void recFindNameOfToken(
+ CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity, size_t result);
void dmpFindNameOfToken(DLD key, DLD value);
- size_t repFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char * szFQName, size_t FQNameCapacity);
-
- void recGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr, bool result);
- void dmpGetSystemVAmd64PassStructInRegisterDescriptor(DWORDLONG key, const Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor& value);
- bool repGetSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr);
-
- void recGetRelocTypeHint(void * target, WORD result);
+ size_t repFindNameOfToken(CORINFO_MODULE_HANDLE module, mdToken metaTOK, char* szFQName, size_t FQNameCapacity);
+
+ void recGetSystemVAmd64PassStructInRegisterDescriptor(
+ CORINFO_CLASS_HANDLE structHnd,
+ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr,
+ bool result);
+ void dmpGetSystemVAmd64PassStructInRegisterDescriptor(
+ DWORDLONG key, const Agnostic_GetSystemVAmd64PassStructInRegisterDescriptor& value);
+ bool repGetSystemVAmd64PassStructInRegisterDescriptor(
+ CORINFO_CLASS_HANDLE structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr);
+
+ void recGetRelocTypeHint(void* target, WORD result);
void dmpGetRelocTypeHint(DWORDLONG key, DWORD value);
- WORD repGetRelocTypeHint(void * target);
+ WORD repGetRelocTypeHint(void* target);
void recIsWriteBarrierHelperRequired(CORINFO_FIELD_HANDLE field, bool result);
void dmpIsWriteBarrierHelperRequired(DWORDLONG key, DWORD value);
@@ -979,13 +1116,14 @@ public:
void dmpGetClassName(DWORDLONG key, DWORD value);
const char* repGetClassName(CORINFO_CLASS_HANDLE cls);
- void recAppendClassName(CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly, const WCHAR* result);
+ void recAppendClassName(
+ CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly, const WCHAR* result);
void dmpAppendClassName(const Agnostic_AppendClassName& key, DWORD value);
const WCHAR* repAppendClassName(CORINFO_CLASS_HANDLE cls, BOOL fNamespace, BOOL fFullInst, BOOL fAssembly);
- void recGetTailCallCopyArgsThunk(CORINFO_SIG_INFO *pSig, CorInfoHelperTailCallSpecialHandling flags, void* result);
+ void recGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags, void* result);
void dmpGetTailCallCopyArgsThunk(const Agnostic_GetTailCallCopyArgsThunk& key, DWORDLONG value);
- void* repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO *pSig, CorInfoHelperTailCallSpecialHandling flags);
+ void* repGetTailCallCopyArgsThunk(CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags);
void recGetMethodDefFromMethod(CORINFO_METHOD_HANDLE hMethod, mdMethodDef result);
void dmpGetMethodDefFromMethod(DWORDLONG key, DWORD value);
@@ -995,9 +1133,9 @@ public:
void dmpCheckMethodModifier(const Agnostic_CheckMethodModifier& key, DWORD value);
BOOL repCheckMethodModifier(CORINFO_METHOD_HANDLE hMethod, LPCSTR modifier, BOOL fOptional);
- void recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection, void* result);
+ void recGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection, void* result);
void dmpGetPInvokeUnmanagedTarget(DWORDLONG key, DLDL value);
- void* repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void **ppIndirection);
+ void* repGetPInvokeUnmanagedTarget(CORINFO_METHOD_HANDLE method, void** ppIndirection);
void recGetArrayRank(CORINFO_CLASS_HANDLE cls, unsigned result);
void dmpGetArrayRank(DWORDLONG key, DWORD value);
@@ -1007,192 +1145,189 @@ public:
void dmpIsFieldStatic(DWORDLONG key, DWORD value);
bool repIsFieldStatic(CORINFO_FIELD_HANDLE fhld);
- void recGetIntConfigValue(const wchar_t *name, int defaultValue, int result);
+ void recGetIntConfigValue(const wchar_t* name, int defaultValue, int result);
void dmpGetIntConfigValue(const Agnostic_ConfigIntInfo& key, int value);
- int repGetIntConfigValue(const wchar_t *name, int defaultValue);
+ int repGetIntConfigValue(const wchar_t* name, int defaultValue);
- void recGetStringConfigValue(const wchar_t *name, const wchar_t *result);
+ void recGetStringConfigValue(const wchar_t* name, const wchar_t* result);
void dmpGetStringConfigValue(DWORD nameIndex, DWORD result);
- const wchar_t *repGetStringConfigValue(const wchar_t *name);
+ const wchar_t* repGetStringConfigValue(const wchar_t* name);
- CompileResult *cr;
- CompileResult *originalCR;
- int index;
+ CompileResult* cr;
+ CompileResult* originalCR;
+ int index;
private:
-
- #define LWM(map,key,value) LightWeightMap<key, value>* map;
- #define DENSELWM(map,value) DenseLightWeightMap<value>* map;
- #include "lwmlist.h"
-
+#define LWM(map, key, value) LightWeightMap<key, value>* map;
+#define DENSELWM(map, value) DenseLightWeightMap<value>* map;
+#include "lwmlist.h"
};
-
// ********************* Please keep this up-to-date to ease adding more ***************
// Highest packet number: 160
// *************************************************************************************
enum mcPackets
{
- Packet_AppendClassName = 149, // Added 8/6/2014 - needed for SIMD
- Packet_AreTypesEquivalent = 1,
- Packet_AsCorInfoType = 2,
- Packet_CanAccessClass = 3,
- Packet_CanAccessFamily = 4,
- Packet_CanCast = 5,
- Retired8 = 6,
- Packet_GetLazyStringLiteralHelper = 147, //Added 12/20/2013 - as a replacement for CanEmbedModuleHandleForHelper
- Packet_CanGetCookieForPInvokeCalliSig = 7,
- Packet_CanGetVarArgsHandle = 8,
- Packet_CanInline = 9,
+ Packet_AppendClassName = 149, // Added 8/6/2014 - needed for SIMD
+ Packet_AreTypesEquivalent = 1,
+ Packet_AsCorInfoType = 2,
+ Packet_CanAccessClass = 3,
+ Packet_CanAccessFamily = 4,
+ Packet_CanCast = 5,
+ Retired8 = 6,
+ Packet_GetLazyStringLiteralHelper = 147, // Added 12/20/2013 - as a replacement for CanEmbedModuleHandleForHelper
+ Packet_CanGetCookieForPInvokeCalliSig = 7,
+ Packet_CanGetVarArgsHandle = 8,
+ Packet_CanInline = 9,
Packet_CanInlineTypeCheckWithObjectVTable = 10,
- Packet_CanSkipMethodVerification = 11,
- Packet_CanTailCall = 12,
- Retired4 = 13,
- Packet_CheckMethodModifier = 142, //retired as 13 on 2013/07/04
- Retired3 = 14,
- Retired5 = 141, //retired as 14 on 2013/07/03
- Packet_CompileMethod = 143, //retired as 141 on 2013/07/09
- Packet_ConstructStringLiteral = 15,
- Packet_EmbedClassHandle = 16,
- Packet_EmbedFieldHandle = 17,
- Packet_EmbedGenericHandle = 18,
- Packet_EmbedMethodHandle = 19,
- Packet_EmbedModuleHandle = 20,
- Packet_EmptyStringLiteral = 21,
- Packet_Environment = 136, //Added 4/3/2013
- Packet_ErrorList = 22,
- Packet_FilterException = 134,
- Packet_FindCallSiteSig = 23,
- Retired7 = 24,
- Packet_FindNameOfToken = 145,//Added 7/19/2013 - adjusted members to proper types
- Packet_GetSystemVAmd64PassStructInRegisterDescriptor = 156, //Added 2/17/2016
- Packet_FindSig = 25,
- Packet_GetAddressOfPInvokeFixup = 26,
- Packet_GetAddressOfPInvokeTarget = 153, //Added 2/3/2016
- 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
- Packet_GetArrayInitializationData = 31,
- Packet_GetArrayRank = 32,
- Packet_GetBBProfileData = 33,
- Packet_GetBoundaries = 34,
- Packet_GetBoxHelper = 35,
- Packet_GetBuiltinClass = 36,
- Packet_GetCallInfo = 37,
- Packet_GetCastingHelper = 38,
- Packet_GetChildType = 39,
- Packet_GetClassAlignmentRequirement = 40,
- Packet_GetClassAttribs = 41,
- Packet_GetClassDomainID = 42,
- Packet_GetClassGClayout = 43,
- Packet_GetClassModuleIdForStatics = 44,
- Packet_GetClassName = 45,
- Packet_GetClassNumInstanceFields = 46,
- Packet_GetClassSize = 47,
- Packet_GetIntConfigValue = 151, //Added 2/12/2015
- Packet_GetStringConfigValue = 152, // Added 2/12/2015
- Packet_GetCookieForPInvokeCalliSig = 48,
- Packet_GetDelegateCtor = 49,
- Packet_GetEEInfo = 50,
- Packet_GetEHinfo = 51,
- Packet_GetFieldAddress = 52,
- Packet_GetFieldClass = 53,
- Packet_GetFieldInClass = 54,
- Packet_GetFieldInfo = 55,
- Packet_GetFieldName = 56,
- Packet_GetFieldOffset = 57,
- Packet_GetFieldThreadLocalStoreID = 58,
- Packet_GetFieldType = 59,
- Packet_GetFunctionEntryPoint = 60,
- Packet_GetFunctionFixedEntryPoint = 61,
- Packet_GetGSCookie = 62,
- Packet_GetHelperFtn = 63,
- Packet_GetHelperName = 64,
- Packet_GetInlinedCallFrameVptr = 65,
- Packet_GetIntrinsicID = 66,
- Packet_GetJitFlags = 154, //Added 2/3/2016
- Packet_GetJitTimeLogFilename = 67,
- Packet_GetJustMyCodeHandle = 68,
- Packet_GetLocationOfThisType = 69,
- Packet_GetMethodAttribs = 70,
- Packet_GetMethodClass = 71,
- Packet_GetMethodDefFromMethod = 72,
- Packet_GetMethodHash = 73,
- Packet_GetMethodInfo = 74,
- Packet_GetMethodName = 75,
- Packet_GetMethodSig = 76,
- Packet_GetMethodSync = 77,
- Packet_GetMethodVTableOffset = 78,
- Packet_GetNewArrHelper = 79,
- Packet_GetNewHelper = 80,
- Packet_GetParentType = 81,
- Packet_GetPInvokeUnmanagedTarget = 82,
- Packet_GetProfilingHandle = 83,
- Packet_GetRelocTypeHint = 84,
- Packet_GetSecurityPrologHelper = 85,
- Packet_GetSharedCCtorHelper = 86,
- Packet_GetTailCallCopyArgsThunk = 87,
- Packet_GetThreadTLSIndex = 88,
- Packet_GetTokenTypeAsHandle = 89,
- Packet_GetTypeForBox = 90,
- Packet_GetTypeForPrimitiveValueClass = 91,
- Packet_GetUnBoxHelper = 92,
- Packet_GetReadyToRunHelper = 150, //Added 10/10/2014
- Packet_GetReadyToRunDelegateCtorHelper = 157, //Added 3/30/2016
- Packet_GetUnmanagedCallConv = 94,
- Packet_GetVarArgsHandle = 95,
- Packet_GetVars = 96,
- Packet_HandleException = 135,
- Packet_InitClass = 97,
- Packet_InitConstraintsForVerification = 98,
- Packet_IsCompatibleDelegate = 99,
- Packet_IsDelegateCreationAllowed = 155,
- Packet_IsFieldStatic = 137,//Added 4/9/2013 - needed for 4.5.1
- Packet_IsInSIMDModule = 148,// Added 6/18/2014 - SIMD support
- Packet_IsInstantiationOfVerifiedGeneric = 100,
- Packet_IsSDArray = 101,
+ Packet_CanSkipMethodVerification = 11,
+ Packet_CanTailCall = 12,
+ Retired4 = 13,
+ Packet_CheckMethodModifier = 142, // retired as 13 on 2013/07/04
+ Retired3 = 14,
+ Retired5 = 141, // retired as 14 on 2013/07/03
+ Packet_CompileMethod = 143, // retired as 141 on 2013/07/09
+ Packet_ConstructStringLiteral = 15,
+ Packet_EmbedClassHandle = 16,
+ Packet_EmbedFieldHandle = 17,
+ Packet_EmbedGenericHandle = 18,
+ Packet_EmbedMethodHandle = 19,
+ Packet_EmbedModuleHandle = 20,
+ Packet_EmptyStringLiteral = 21,
+ Packet_Environment = 136, // Added 4/3/2013
+ Packet_ErrorList = 22,
+ Packet_FilterException = 134,
+ Packet_FindCallSiteSig = 23,
+ Retired7 = 24,
+ Packet_FindNameOfToken = 145, // Added 7/19/2013 - adjusted members to proper types
+ Packet_GetSystemVAmd64PassStructInRegisterDescriptor = 156, // Added 2/17/2016
+ Packet_FindSig = 25,
+ Packet_GetAddressOfPInvokeFixup = 26,
+ Packet_GetAddressOfPInvokeTarget = 153, // Added 2/3/2016
+ 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
+ Packet_GetArrayInitializationData = 31,
+ Packet_GetArrayRank = 32,
+ Packet_GetBBProfileData = 33,
+ Packet_GetBoundaries = 34,
+ Packet_GetBoxHelper = 35,
+ Packet_GetBuiltinClass = 36,
+ Packet_GetCallInfo = 37,
+ Packet_GetCastingHelper = 38,
+ Packet_GetChildType = 39,
+ Packet_GetClassAlignmentRequirement = 40,
+ Packet_GetClassAttribs = 41,
+ Packet_GetClassDomainID = 42,
+ Packet_GetClassGClayout = 43,
+ Packet_GetClassModuleIdForStatics = 44,
+ Packet_GetClassName = 45,
+ Packet_GetClassNumInstanceFields = 46,
+ Packet_GetClassSize = 47,
+ Packet_GetIntConfigValue = 151, // Added 2/12/2015
+ Packet_GetStringConfigValue = 152, // Added 2/12/2015
+ Packet_GetCookieForPInvokeCalliSig = 48,
+ Packet_GetDelegateCtor = 49,
+ Packet_GetEEInfo = 50,
+ Packet_GetEHinfo = 51,
+ Packet_GetFieldAddress = 52,
+ Packet_GetFieldClass = 53,
+ Packet_GetFieldInClass = 54,
+ Packet_GetFieldInfo = 55,
+ Packet_GetFieldName = 56,
+ Packet_GetFieldOffset = 57,
+ Packet_GetFieldThreadLocalStoreID = 58,
+ Packet_GetFieldType = 59,
+ Packet_GetFunctionEntryPoint = 60,
+ Packet_GetFunctionFixedEntryPoint = 61,
+ Packet_GetGSCookie = 62,
+ Packet_GetHelperFtn = 63,
+ Packet_GetHelperName = 64,
+ Packet_GetInlinedCallFrameVptr = 65,
+ Packet_GetIntrinsicID = 66,
+ Packet_GetJitFlags = 154, // Added 2/3/2016
+ Packet_GetJitTimeLogFilename = 67,
+ Packet_GetJustMyCodeHandle = 68,
+ Packet_GetLocationOfThisType = 69,
+ Packet_GetMethodAttribs = 70,
+ Packet_GetMethodClass = 71,
+ Packet_GetMethodDefFromMethod = 72,
+ Packet_GetMethodHash = 73,
+ Packet_GetMethodInfo = 74,
+ Packet_GetMethodName = 75,
+ Packet_GetMethodSig = 76,
+ Packet_GetMethodSync = 77,
+ Packet_GetMethodVTableOffset = 78,
+ Packet_GetNewArrHelper = 79,
+ Packet_GetNewHelper = 80,
+ Packet_GetParentType = 81,
+ Packet_GetPInvokeUnmanagedTarget = 82,
+ Packet_GetProfilingHandle = 83,
+ Packet_GetRelocTypeHint = 84,
+ Packet_GetSecurityPrologHelper = 85,
+ Packet_GetSharedCCtorHelper = 86,
+ Packet_GetTailCallCopyArgsThunk = 87,
+ Packet_GetThreadTLSIndex = 88,
+ Packet_GetTokenTypeAsHandle = 89,
+ Packet_GetTypeForBox = 90,
+ Packet_GetTypeForPrimitiveValueClass = 91,
+ Packet_GetUnBoxHelper = 92,
+ Packet_GetReadyToRunHelper = 150, // Added 10/10/2014
+ Packet_GetReadyToRunDelegateCtorHelper = 157, // Added 3/30/2016
+ Packet_GetUnmanagedCallConv = 94,
+ Packet_GetVarArgsHandle = 95,
+ Packet_GetVars = 96,
+ Packet_HandleException = 135,
+ Packet_InitClass = 97,
+ Packet_InitConstraintsForVerification = 98,
+ Packet_IsCompatibleDelegate = 99,
+ Packet_IsDelegateCreationAllowed = 155,
+ Packet_IsFieldStatic = 137, // Added 4/9/2013 - needed for 4.5.1
+ Packet_IsInSIMDModule = 148, // Added 6/18/2014 - SIMD support
+ Packet_IsInstantiationOfVerifiedGeneric = 100,
+ Packet_IsSDArray = 101,
Packet_IsStructRequiringStackAllocRetBuf = 102,
- Packet_IsValidStringRef = 103,
- Retired6 = 104,
- Packet_IsValidToken = 144,//Added 7/19/2013 - adjusted members to proper types
- Packet_IsValueClass = 105,
- Packet_IsWriteBarrierHelperRequired = 106,
- Packet_MergeClasses = 107,
- Packet_PInvokeMarshalingRequired = 108,
- Packet_ResolveToken = 109,
- Packet_ResolveVirtualMethod = 160, // Added 2/13/17
- Packet_TryResolveToken = 158, //Added 4/26/2016
- Packet_SatisfiesClassConstraints = 110,
- Packet_SatisfiesMethodConstraints = 111,
+ Packet_IsValidStringRef = 103,
+ Retired6 = 104,
+ Packet_IsValidToken = 144, // Added 7/19/2013 - adjusted members to proper types
+ Packet_IsValueClass = 105,
+ Packet_IsWriteBarrierHelperRequired = 106,
+ Packet_MergeClasses = 107,
+ Packet_PInvokeMarshalingRequired = 108,
+ Packet_ResolveToken = 109,
+ Packet_ResolveVirtualMethod = 160, // Added 2/13/17
+ Packet_TryResolveToken = 158, // Added 4/26/2016
+ Packet_SatisfiesClassConstraints = 110,
+ Packet_SatisfiesMethodConstraints = 111,
Packet_ShouldEnforceCallvirtRestriction = 112,
- PacketCR_AddressMap = 113,
+ PacketCR_AddressMap = 113,
PacketCR_AllocBBProfileBuffer = 131,
- PacketCR_AllocGCInfo = 114,
- PacketCR_AllocMem = 115,
- PacketCR_AllocUnwindInfo = 132,
- PacketCR_AssertLog = 138, //Added 6/10/2013 - added to nicely support ilgen
- PacketCR_CallLog = 116,
- PacketCR_ClassMustBeLoadedBeforeCodeIsRun = 117,
- PacketCR_CompileMethod = 118,
- PacketCR_MessageLog = 119,
+ PacketCR_AllocGCInfo = 114,
+ PacketCR_AllocMem = 115,
+ PacketCR_AllocUnwindInfo = 132,
+ PacketCR_AssertLog = 138, // Added 6/10/2013 - added to nicely support ilgen
+ PacketCR_CallLog = 116,
+ PacketCR_ClassMustBeLoadedBeforeCodeIsRun = 117,
+ PacketCR_CompileMethod = 118,
+ PacketCR_MessageLog = 119,
PacketCR_MethodMustBeLoadedBeforeCodeIsRun = 120,
- PacketCR_ProcessName = 121,
- PacketCR_RecordRelocation = 122,
- PacketCR_ReportFatalError = 123,
- PacketCR_ReportInliningDecision = 124,
- PacketCR_ReportTailCallDecision = 125,
- PacketCR_ReserveUnwindInfo = 133,
- PacketCR_SetBoundaries = 126,
- PacketCR_SetEHcount = 127,
- PacketCR_SetEHinfo = 128,
- PacketCR_SetMethodAttribs = 129,
- PacketCR_SetVars = 130,
- PacketCR_RecordCallSite = 146, //Added 10/28/2013 - to support indirect calls
+ PacketCR_ProcessName = 121,
+ PacketCR_RecordRelocation = 122,
+ PacketCR_ReportFatalError = 123,
+ PacketCR_ReportInliningDecision = 124,
+ PacketCR_ReportTailCallDecision = 125,
+ PacketCR_ReserveUnwindInfo = 133,
+ PacketCR_SetBoundaries = 126,
+ PacketCR_SetEHcount = 127,
+ PacketCR_SetEHinfo = 128,
+ PacketCR_SetMethodAttribs = 129,
+ PacketCR_SetVars = 130,
+ PacketCR_RecordCallSite = 146, // Added 10/28/2013 - to support indirect calls
};
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.cpp
index 55f8045938..0483ac18b3 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.cpp
@@ -7,10 +7,10 @@
#include "methodcontext.h"
#include "methodcontextiterator.h"
-
bool MethodContextIterator::Initialize(const char* fileName)
{
- m_hFile = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+ m_hFile = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (m_hFile == INVALID_HANDLE_VALUE)
{
LogError("Failed to open file '%s'. GetLastError()=%u", fileName, GetLastError());
@@ -18,7 +18,7 @@ bool MethodContextIterator::Initialize(const char* fileName)
}
LARGE_INTEGER DataTemp;
- if (GetFileSizeEx(m_hFile, &DataTemp)==0)
+ if (GetFileSizeEx(m_hFile, &DataTemp) == 0)
{
LogError("GetFileSizeEx failed. GetLastError()=%u", GetLastError());
CloseHandle(m_hFile);
@@ -53,8 +53,8 @@ bool MethodContextIterator::Destroy()
if (m_index < m_indexCount)
{
- LogWarning("Didn't use all of index count input: %d < %d (i.e., didn't see MC #%d)",
- m_index, m_indexCount, m_indexes[m_index]);
+ LogWarning("Didn't use all of index count input: %d < %d (i.e., didn't see MC #%d)", m_index, m_indexCount,
+ m_indexes[m_index]);
}
delete m_timer;
@@ -95,7 +95,8 @@ bool MethodContextIterator::MoveNext()
if (m_methodContextNumber % 500 == 0)
{
m_timer->Stop();
- LogVerbose("Loaded %d at %d per second", m_methodContextNumber, (int)((double)500 / m_timer->GetSeconds()));
+ LogVerbose("Loaded %d at %d per second", m_methodContextNumber,
+ (int)((double)500 / m_timer->GetSeconds()));
m_timer->Start();
}
}
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.h b/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.h
index d6002ba852..857f268072 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.h
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontextiterator.h
@@ -10,7 +10,6 @@
class MethodContextIterator
{
public:
-
MethodContextIterator(bool progressReport = false)
: m_hFile(INVALID_HANDLE_VALUE)
, m_fileSize(0)
@@ -67,7 +66,7 @@ public:
MethodContext* CurrentTakeOwnership()
{
MethodContext* ret = m_mc;
- m_mc = nullptr;
+ m_mc = nullptr;
return ret;
}
@@ -83,22 +82,21 @@ public:
}
private:
-
- HANDLE m_hFile;
- int64_t m_fileSize;
- int m_methodContextNumber;
- MethodContext* m_mc;
- LARGE_INTEGER m_pos;
+ HANDLE m_hFile;
+ int64_t m_fileSize;
+ int m_methodContextNumber;
+ MethodContext* m_mc;
+ LARGE_INTEGER m_pos;
// If m_indexCount==-1, use all method contexts. Otherwise, m_indexCount is the number of elements in the
// m_indexes array, which contains a sorted set of method context indexes to return. In this case, m_index
// is the index of the current element in m_indexes.
- const int m_indexCount;
- int m_index;
- const int* m_indexes;
+ const int m_indexCount;
+ int m_index;
+ const int* m_indexes;
// Should we log a progress report as we are loading the method contexts?
// The timer is only used when m_progressReport==true.
- bool m_progressReport;
- SimpleTimer* m_timer;
+ bool m_progressReport;
+ SimpleTimer* m_timer;
}; \ No newline at end of file
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp
index 1e375e0d6a..6b40839a63 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp
@@ -16,9 +16,10 @@
#include "runtimedetails.h"
// Just a helper...
-HANDLE MethodContextReader::OpenFile(const char *inputFile, DWORD flags)
+HANDLE MethodContextReader::OpenFile(const char* inputFile, DWORD flags)
{
- HANDLE fileHandle = CreateFileA(inputFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | flags, NULL);
+ HANDLE fileHandle =
+ CreateFileA(inputFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | flags, NULL);
if (fileHandle == INVALID_HANDLE_VALUE)
{
LogError("Failed to open file '%s'. GetLastError()=%u", inputFile, GetLastError());
@@ -26,7 +27,7 @@ HANDLE MethodContextReader::OpenFile(const char *inputFile, DWORD flags)
return fileHandle;
}
-static std::string to_lower(const std::string &input)
+static std::string to_lower(const std::string& input)
{
std::string res = input;
std::transform(input.cbegin(), input.cend(), res.begin(), tolower);
@@ -37,15 +38,16 @@ static std::string to_lower(const std::string &input)
// but only if foo.origSuffix exists.
//
// Note: filename extensions must be lower-case, even on case-sensitive file systems!
-std::string MethodContextReader::CheckForPairedFile(const std::string &fileName, const std::string &origSuffix, const std::string &newSuffix)
+std::string MethodContextReader::CheckForPairedFile(const std::string& fileName,
+ const std::string& origSuffix,
+ const std::string& newSuffix)
{
std::string tmp = to_lower(origSuffix);
// First, check to see if foo.origSuffix exists
size_t suffix_offset = fileName.find_last_of('.');
- if ((SSIZE_T)suffix_offset <= 0
- || (tmp != to_lower(fileName.substr(suffix_offset)))
- || (GetFileAttributesA(fileName.c_str()) == INVALID_FILE_ATTRIBUTES))
+ if ((SSIZE_T)suffix_offset <= 0 || (tmp != to_lower(fileName.substr(suffix_offset))) ||
+ (GetFileAttributesA(fileName.c_str()) == INVALID_FILE_ATTRIBUTES))
return std::string();
// next, check foo.orig.new from foo.orig
@@ -66,8 +68,8 @@ std::string MethodContextReader::CheckForPairedFile(const std::string &fileName,
return std::string();
}
-
-MethodContextReader::MethodContextReader(const char *inputFileName, const int *indexes, int indexCount, char *hash, int offset, int increment)
+MethodContextReader::MethodContextReader(
+ const char* inputFileName, const int* indexes, int indexCount, char* hash, int offset, int increment)
: fileHandle(INVALID_HANDLE_VALUE)
, fileSize(0)
, curMCIndex(0)
@@ -108,10 +110,12 @@ MethodContextReader::MethodContextReader(const char *inputFileName, const int *i
this->tocFile.LoadToc(tocFileName.c_str());
// we'll get here even if we don't have a valid index file
- this->fileHandle = OpenFile(mchFile.c_str(), (this->hasTOC() && this->hasIndex()) ? FILE_ATTRIBUTE_NORMAL : FILE_FLAG_SEQUENTIAL_SCAN);
+ this->fileHandle =
+ OpenFile(mchFile.c_str(),
+ (this->hasTOC() && this->hasIndex()) ? FILE_ATTRIBUTE_NORMAL : FILE_FLAG_SEQUENTIAL_SCAN);
if (this->fileHandle != INVALID_HANDLE_VALUE)
{
- GetFileSizeEx(this->fileHandle, (PLARGE_INTEGER)&this->fileSize);
+ GetFileSizeEx(this->fileHandle, (PLARGE_INTEGER) & this->fileSize);
}
}
@@ -139,14 +143,15 @@ void MethodContextReader::ReleaseLock()
bool MethodContextReader::atEof()
{
__int64 pos = 0;
- SetFilePointerEx(this->fileHandle, *(PLARGE_INTEGER)&pos, (PLARGE_INTEGER)&pos, FILE_CURRENT); // LARGE_INTEGER is a crime against humanity
+ SetFilePointerEx(this->fileHandle, *(PLARGE_INTEGER)&pos, (PLARGE_INTEGER)&pos,
+ FILE_CURRENT); // LARGE_INTEGER is a crime against humanity
return pos == this->fileSize;
}
MethodContextBuffer MethodContextReader::ReadMethodContextNoLock(bool justSkip)
{
- DWORD bytesRead;
- char buff[512];
+ DWORD bytesRead;
+ char buff[512];
unsigned int totalLen = 0;
if (atEof())
{
@@ -159,19 +164,20 @@ MethodContextBuffer MethodContextReader::ReadMethodContextNoLock(bool justSkip)
{
__int64 pos = totalLen + 2;
// Just move the file pointer ahead the correct number of bytes
- AssertMsg(SetFilePointerEx(this->fileHandle, *(PLARGE_INTEGER)&pos, (PLARGE_INTEGER)&pos, FILE_CURRENT) == TRUE, "SetFilePointerEx failed (Error %X)", GetLastError());
+ AssertMsg(SetFilePointerEx(this->fileHandle, *(PLARGE_INTEGER)&pos, (PLARGE_INTEGER)&pos, FILE_CURRENT) == TRUE,
+ "SetFilePointerEx failed (Error %X)", GetLastError());
- //Increment curMCIndex as we advanced the file pointer by another MC
+ // Increment curMCIndex as we advanced the file pointer by another MC
++curMCIndex;
return MethodContextBuffer(0);
}
else
{
- unsigned char *buff2 = new unsigned char[totalLen + 2]; //total + End Canary
+ unsigned char* buff2 = new unsigned char[totalLen + 2]; // total + End Canary
Assert(ReadFile(this->fileHandle, buff2, totalLen + 2, &bytesRead, NULL) == TRUE);
- //Increment curMCIndex as we read another MC
+ // Increment curMCIndex as we read another MC
++curMCIndex;
return MethodContextBuffer(buff2, totalLen);
@@ -186,13 +192,14 @@ MethodContextBuffer MethodContextReader::ReadMethodContext(bool acquireLock, boo
return MethodContextBuffer(-1);
}
- struct Param {
+ struct Param
+ {
MethodContextReader* pThis;
- MethodContextBuffer ret;
- bool justSkip;
+ MethodContextBuffer ret;
+ bool justSkip;
} param;
- param.pThis = this;
- param.ret = MethodContextBuffer(-2);
+ param.pThis = this;
+ param.ret = MethodContextBuffer(-2);
param.justSkip = justSkip;
PAL_TRY(Param*, pParam, &param)
@@ -214,8 +221,8 @@ MethodContextBuffer MethodContextReader::GetNextMethodContext()
{
struct Param : FilterSuperPMIExceptionsParam_CaptureException
{
- MethodContextReader* pThis;
- MethodContextBuffer mcb;
+ MethodContextReader* pThis;
+ MethodContextBuffer mcb;
} param;
param.pThis = this;
@@ -235,34 +242,34 @@ MethodContextBuffer MethodContextReader::GetNextMethodContext()
MethodContextBuffer MethodContextReader::GetNextMethodContextHelper()
{
- //If we have an offset/increment combo
+ // If we have an offset/increment combo
if (this->Offset > 0 && this->Increment > 0)
return GetNextMethodContextFromOffsetIncrement();
- //If we have an index
+ // If we have an index
if (this->hasIndex())
{
if (this->curIndexPos < this->IndexCount)
{
- //If we are not done with all of them
+ // If we are not done with all of them
return GetNextMethodContextFromIndexes();
}
- else //We are done with all of them, return
+ else // We are done with all of them, return
return MethodContextBuffer();
}
- //If we have a hash
+ // If we have a hash
if (this->Hash != nullptr)
return GetNextMethodContextFromHash();
- //If we don't have any of these options return all MCs one by one
+ // If we don't have any of these options return all MCs one by one
return this->ReadMethodContext(true);
}
// Read a method context buffer from the ContextCollection using Indexes
MethodContextBuffer MethodContextReader::GetNextMethodContextFromIndexes()
{
- //Assert if we don't have an Index or we are done with all the indexes
+ // Assert if we don't have an Index or we are done with all the indexes
Assert(this->hasIndex() && this->curIndexPos < this->IndexCount);
if (this->hasTOC())
@@ -291,29 +298,29 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromIndexes()
// Read a method context buffer from the ContextCollection using Hash
MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
{
- //Assert if we don't have a valid hash
+ // Assert if we don't have a valid hash
Assert(this->Hash != nullptr);
if (this->hasTOC())
{
- //We have a TOC so lets go through the TOCElements
- //one-by-one till we find a matching hash
+ // We have a TOC so lets go through the TOCElements
+ //one-by-one till we find a matching hash
for (; curTOCIndex < (int)this->tocFile.GetTocCount(); curTOCIndex++)
{
if (_strnicmp(this->Hash, this->tocFile.GetElementPtr(curTOCIndex)->Hash, MD5_HASH_BUFFER_SIZE) == 0)
{
- //We found a match, return this specific method
+ // We found a match, return this specific method
return this->GetSpecificMethodContext(this->tocFile.GetElementPtr(curTOCIndex++)->Number);
}
}
- //No more matches in the TOC for our hash value
+ // No more matches in the TOC for our hash value
return MethodContextBuffer();
}
else
{
// Keep reading all MCs until we hit a match
- //or we reach the end or hit an error
+ //or we reach the end or hit an error
while (true)
{
// Read a method context
@@ -324,12 +331,12 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
char mcHash[MD5_HASH_BUFFER_SIZE];
- //Create a temporary copy of mcb.buff plus ending 2-byte canary
- //this will get freed up by MethodContext constructor
- unsigned char *buff = new unsigned char[mcb.size + 2];
+ // Create a temporary copy of mcb.buff plus ending 2-byte canary
+ //this will get freed up by MethodContext constructor
+ unsigned char* buff = new unsigned char[mcb.size + 2];
memcpy(buff, mcb.buff, mcb.size + 2);
- MethodContext *mc;
+ MethodContext* mc;
if (!MethodContext::Initialize(-1, buff, mcb.size, &mc))
return MethodContextBuffer(-1);
@@ -339,13 +346,13 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
if (_strnicmp(this->Hash, mcHash, MD5_HASH_BUFFER_SIZE) == 0)
{
- //We found a match, return this specific method
+ // We found a match, return this specific method
return mcb;
}
}
}
- //We should never get here under normal conditions
+ // We should never get here under normal conditions
AssertMsg(true, "Unexpected condition hit while reading input file.");
return MethodContextBuffer(-1);
}
@@ -353,17 +360,17 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
// Read a method context buffer from the ContextCollection using offset/increment
MethodContextBuffer MethodContextReader::GetNextMethodContextFromOffsetIncrement()
{
- //Assert if we don't have a valid increment/offset combo
+ // Assert if we don't have a valid increment/offset combo
Assert(this->Offset > 0 && this->Increment > 0);
int methodNumber = this->curMCIndex > 0 ? this->curMCIndex + this->Increment : this->Offset;
if (this->hasTOC())
{
- //Check if we are within the TOC
+ // Check if we are within the TOC
if ((int)this->tocFile.GetTocCount() >= methodNumber)
{
- //We have a TOC so we can request a specific method context
+ // We have a TOC so we can request a specific method context
return this->GetSpecificMethodContext(methodNumber);
}
else
@@ -374,7 +381,7 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromOffsetIncrement
// Keep skipping MCs until we get to the one we need to return
while (this->curMCIndex + 1 < methodNumber)
{
- //skip over a method
+ // skip over a method
MethodContextBuffer mcb = this->ReadMethodContext(true, true);
if (mcb.allDone() || mcb.Error())
return mcb;
@@ -421,10 +428,10 @@ __int64 MethodContextReader::GetOffset(unsigned int methodNumber)
if (!this->hasTOC())
return -2;
size_t high = this->tocFile.GetTocCount() - 1;
- size_t low = 0;
+ size_t low = 0;
while (low <= high)
{
- size_t pos = (high + low) / 2;
+ size_t pos = (high + low) / 2;
unsigned int num = this->tocFile.GetElementPtr(pos)->Number;
if (num == methodNumber)
return this->tocFile.GetElementPtr(pos)->Offset;
@@ -454,8 +461,8 @@ MethodContextBuffer MethodContextReader::GetSpecificMethodContext(unsigned int m
// ReadMethodContext will release the lock, but we already acquired it
MethodContextBuffer mcb = this->ReadMethodContext(false);
- //The curMCIndex value updated by ReadMethodContext() is incorrect
- //since we are repositioning the file pointer we need to update it
+ // The curMCIndex value updated by ReadMethodContext() is incorrect
+ //since we are repositioning the file pointer we need to update it
curMCIndex = methodNumber;
return mcb;
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h b/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h
index 0068fa231f..e9ee451115 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.h
@@ -17,16 +17,29 @@ struct MethodContextBuffer
{
private:
static const int Completed = 0x1234abcd;
+
public:
- unsigned char *buff;
- DWORD size;
+ unsigned char* buff;
+ DWORD size;
- MethodContextBuffer() : buff(nullptr), size(Completed) {}
- MethodContextBuffer(DWORD error) : buff(nullptr), size(error) {}
- MethodContextBuffer(unsigned char *b, DWORD e) : buff(b), size(e) {}
+ MethodContextBuffer() : buff(nullptr), size(Completed)
+ {
+ }
+ MethodContextBuffer(DWORD error) : buff(nullptr), size(error)
+ {
+ }
+ MethodContextBuffer(unsigned char* b, DWORD e) : buff(b), size(e)
+ {
+ }
- bool allDone() { return size == Completed && buff == nullptr; }
- bool Error() { return size != 0 && size != Completed && buff == nullptr; }
+ bool allDone()
+ {
+ return size == Completed && buff == nullptr;
+ }
+ bool Error()
+ {
+ return size != 0 && size != Completed && buff == nullptr;
+ }
};
// The pack(4) directive is so that each entry is 12 bytes, intead of 16
@@ -35,7 +48,6 @@ public:
class MethodContextReader
{
private:
-
// The MC/MCH file
HANDLE fileHandle;
@@ -47,23 +59,23 @@ private:
// The synchronization mutex
HANDLE mutex;
- bool AcquireLock();
- void ReleaseLock();
+ bool AcquireLock();
+ void ReleaseLock();
TOCFile tocFile;
// Method ranges to process
// If you have an index file, these things get processed
// much faster, now
- const int *Indexes;
- int IndexCount;
- int curIndexPos;
+ const int* Indexes;
+ int IndexCount;
+ int curIndexPos;
// Method hash to process
// If you have an index file, these things get processed
// much faster, now
- char *Hash;
- int curTOCIndex;
+ char* Hash;
+ int curTOCIndex;
// Offset/increment if running in parallel mode
// If you have an index file, these things get processed
@@ -76,7 +88,7 @@ private:
__int64 GetOffset(unsigned int methodNumber);
// Just a helper...
- static HANDLE OpenFile(const char *inputFile, DWORD flags = FILE_ATTRIBUTE_NORMAL);
+ static HANDLE OpenFile(const char* inputFile, DWORD flags = FILE_ATTRIBUTE_NORMAL);
MethodContextBuffer ReadMethodContextNoLock(bool justSkip = false);
MethodContextBuffer ReadMethodContext(bool acquireLock, bool justSkip = false);
@@ -89,7 +101,9 @@ private:
// Looks for a file named foo.origSuffix.newSuffix or foo.newSuffix
// but only if foo.origSuffix exists
- static std::string CheckForPairedFile(const std::string &fileName, const std::string &origSuffix, const std::string &newSuffix);
+ static std::string CheckForPairedFile(const std::string& fileName,
+ const std::string& origSuffix,
+ const std::string& newSuffix);
// are we're at the end of the file...
bool atEof();
@@ -101,18 +115,22 @@ private:
bool hasIndex();
public:
-
- MethodContextReader(const char *inputFileName, const int *indexes = nullptr, int indexCount = -1, char *hash = nullptr, int offset = -1, int increment = -1);
+ MethodContextReader(const char* inputFileName,
+ const int* indexes = nullptr,
+ int indexCount = -1,
+ char* hash = nullptr,
+ int offset = -1,
+ int increment = -1);
~MethodContextReader();
// Read a method context buffer from the ContextCollection
// (either a hive [single] or an index)
MethodContextBuffer GetNextMethodContext();
// No C++ exceptions, so the constructor has to always succeed...
- bool isValid();
+ bool isValid();
double PercentComplete();
- //Returns the index of the last MethodContext read by GetNextMethodContext
+ // Returns the index of the last MethodContext read by GetNextMethodContext
inline int GetMethodContextIndex()
{
return curMCIndex;
diff --git a/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h b/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h
index 4704881082..f6c177cd04 100644
--- a/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h
+++ b/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h
@@ -8,7 +8,7 @@
//----------------------------------------------------------
#ifndef REGDEF
-#error Must define REGDEF macro before including this file
+#error Must define REGDEF macro before including this file
#endif
/*
@@ -16,104 +16,104 @@ REGDEF(msdisID, name)
*/
// 32 bit general purpose registers
-REGDEF(DISX86::REGA::regaEax, "eax")
-REGDEF(DISX86::REGA::regaEcx, "ecx")
-REGDEF(DISX86::REGA::regaEdx, "edx")
-REGDEF(DISX86::REGA::regaEbx, "ebx")
-REGDEF(DISX86::REGA::regaEsp, "esp")
-REGDEF(DISX86::REGA::regaEbp, "ebp")
-REGDEF(DISX86::REGA::regaEsi, "esi")
-REGDEF(DISX86::REGA::regaEdi, "edi")
-REGDEF(DISX86::REGA::regaR8d, "r8d")
-REGDEF(DISX86::REGA::regaR9d, "r9d")
-REGDEF(DISX86::REGA::regaR10d, "r10d")
-REGDEF(DISX86::REGA::regaR11d, "r11d")
-REGDEF(DISX86::REGA::regaR12d, "r12d")
-REGDEF(DISX86::REGA::regaR13d, "r13d")
-REGDEF(DISX86::REGA::regaR14d, "r14d")
-REGDEF(DISX86::REGA::regaR15d, "r15d")
+REGDEF(DISX86::REGA::regaEax, "eax")
+REGDEF(DISX86::REGA::regaEcx, "ecx")
+REGDEF(DISX86::REGA::regaEdx, "edx")
+REGDEF(DISX86::REGA::regaEbx, "ebx")
+REGDEF(DISX86::REGA::regaEsp, "esp")
+REGDEF(DISX86::REGA::regaEbp, "ebp")
+REGDEF(DISX86::REGA::regaEsi, "esi")
+REGDEF(DISX86::REGA::regaEdi, "edi")
+REGDEF(DISX86::REGA::regaR8d, "r8d")
+REGDEF(DISX86::REGA::regaR9d, "r9d")
+REGDEF(DISX86::REGA::regaR10d, "r10d")
+REGDEF(DISX86::REGA::regaR11d, "r11d")
+REGDEF(DISX86::REGA::regaR12d, "r12d")
+REGDEF(DISX86::REGA::regaR13d, "r13d")
+REGDEF(DISX86::REGA::regaR14d, "r14d")
+REGDEF(DISX86::REGA::regaR15d, "r15d")
// 64 bit general purpose registers
-REGDEF(DISX86::REGA::regaRax, "rax")
-REGDEF(DISX86::REGA::regaRcx, "rcx")
-REGDEF(DISX86::REGA::regaRdx, "rdx")
-REGDEF(DISX86::REGA::regaRbx, "rbx")
-REGDEF(DISX86::REGA::regaRsp, "rsp")
-REGDEF(DISX86::REGA::regaRbp, "rbp")
-REGDEF(DISX86::REGA::regaRsi, "rsi")
-REGDEF(DISX86::REGA::regaRdi, "rdi")
-REGDEF(DISX86::REGA::regaR8, "r8")
-REGDEF(DISX86::REGA::regaR9, "r9")
-REGDEF(DISX86::REGA::regaR10, "r10")
-REGDEF(DISX86::REGA::regaR11, "r11")
-REGDEF(DISX86::REGA::regaR12, "r12")
-REGDEF(DISX86::REGA::regaR13, "r13")
-REGDEF(DISX86::REGA::regaR14, "r14")
-REGDEF(DISX86::REGA::regaR15, "r15")
+REGDEF(DISX86::REGA::regaRax, "rax")
+REGDEF(DISX86::REGA::regaRcx, "rcx")
+REGDEF(DISX86::REGA::regaRdx, "rdx")
+REGDEF(DISX86::REGA::regaRbx, "rbx")
+REGDEF(DISX86::REGA::regaRsp, "rsp")
+REGDEF(DISX86::REGA::regaRbp, "rbp")
+REGDEF(DISX86::REGA::regaRsi, "rsi")
+REGDEF(DISX86::REGA::regaRdi, "rdi")
+REGDEF(DISX86::REGA::regaR8, "r8")
+REGDEF(DISX86::REGA::regaR9, "r9")
+REGDEF(DISX86::REGA::regaR10, "r10")
+REGDEF(DISX86::REGA::regaR11, "r11")
+REGDEF(DISX86::REGA::regaR12, "r12")
+REGDEF(DISX86::REGA::regaR13, "r13")
+REGDEF(DISX86::REGA::regaR14, "r14")
+REGDEF(DISX86::REGA::regaR15, "r15")
// 16 bit general purpose registers
-REGDEF(DISX86::REGA::regaAx, "ax")
-REGDEF(DISX86::REGA::regaCx, "cx")
-REGDEF(DISX86::REGA::regaDx, "dx")
-REGDEF(DISX86::REGA::regaBx, "bx")
-REGDEF(DISX86::REGA::regaSp, "sp")
-REGDEF(DISX86::REGA::regaBp, "bp")
-REGDEF(DISX86::REGA::regaSi, "si")
-REGDEF(DISX86::REGA::regaDi, "di")
-REGDEF(DISX86::REGA::regaR8w, "r8w")
-REGDEF(DISX86::REGA::regaR9w, "r9w")
-REGDEF(DISX86::REGA::regaR10w, "r10w")
-REGDEF(DISX86::REGA::regaR11w, "r11w")
-REGDEF(DISX86::REGA::regaR12w, "r12w")
-REGDEF(DISX86::REGA::regaR13w, "r13w")
-REGDEF(DISX86::REGA::regaR14w, "r14w")
-REGDEF(DISX86::REGA::regaR15w, "r15w")
+REGDEF(DISX86::REGA::regaAx, "ax")
+REGDEF(DISX86::REGA::regaCx, "cx")
+REGDEF(DISX86::REGA::regaDx, "dx")
+REGDEF(DISX86::REGA::regaBx, "bx")
+REGDEF(DISX86::REGA::regaSp, "sp")
+REGDEF(DISX86::REGA::regaBp, "bp")
+REGDEF(DISX86::REGA::regaSi, "si")
+REGDEF(DISX86::REGA::regaDi, "di")
+REGDEF(DISX86::REGA::regaR8w, "r8w")
+REGDEF(DISX86::REGA::regaR9w, "r9w")
+REGDEF(DISX86::REGA::regaR10w, "r10w")
+REGDEF(DISX86::REGA::regaR11w, "r11w")
+REGDEF(DISX86::REGA::regaR12w, "r12w")
+REGDEF(DISX86::REGA::regaR13w, "r13w")
+REGDEF(DISX86::REGA::regaR14w, "r14w")
+REGDEF(DISX86::REGA::regaR15w, "r15w")
// 8 bit general purpose registers
-REGDEF(DISX86::REGA::regaAl, "al")
-REGDEF(DISX86::REGA::regaCl, "cl")
-REGDEF(DISX86::REGA::regaDl, "dl")
-REGDEF(DISX86::REGA::regaBl, "bl")
-REGDEF(DISX86::REGA::regaSpl, "spl")
-REGDEF(DISX86::REGA::regaBpl, "bpl")
-REGDEF(DISX86::REGA::regaSil, "sil")
-REGDEF(DISX86::REGA::regaDil, "dil")
-REGDEF(DISX86::REGA::regaR8b, "r8b")
-REGDEF(DISX86::REGA::regaR9b, "r9b")
-REGDEF(DISX86::REGA::regaR10b, "r10b")
-REGDEF(DISX86::REGA::regaR11b, "r11b")
-REGDEF(DISX86::REGA::regaR12b, "r12b")
-REGDEF(DISX86::REGA::regaR13b, "r13b")
-REGDEF(DISX86::REGA::regaR14b, "r14b")
-REGDEF(DISX86::REGA::regaR15b, "r15b")
+REGDEF(DISX86::REGA::regaAl, "al")
+REGDEF(DISX86::REGA::regaCl, "cl")
+REGDEF(DISX86::REGA::regaDl, "dl")
+REGDEF(DISX86::REGA::regaBl, "bl")
+REGDEF(DISX86::REGA::regaSpl, "spl")
+REGDEF(DISX86::REGA::regaBpl, "bpl")
+REGDEF(DISX86::REGA::regaSil, "sil")
+REGDEF(DISX86::REGA::regaDil, "dil")
+REGDEF(DISX86::REGA::regaR8b, "r8b")
+REGDEF(DISX86::REGA::regaR9b, "r9b")
+REGDEF(DISX86::REGA::regaR10b, "r10b")
+REGDEF(DISX86::REGA::regaR11b, "r11b")
+REGDEF(DISX86::REGA::regaR12b, "r12b")
+REGDEF(DISX86::REGA::regaR13b, "r13b")
+REGDEF(DISX86::REGA::regaR14b, "r14b")
+REGDEF(DISX86::REGA::regaR15b, "r15b")
// 8 bit general purpose registers
-REGDEF(DISX86::REGA::regaAh, "ah")
-REGDEF(DISX86::REGA::regaCh, "ch")
-REGDEF(DISX86::REGA::regaDh, "dh")
-REGDEF(DISX86::REGA::regaBh, "bh")
+REGDEF(DISX86::REGA::regaAh, "ah")
+REGDEF(DISX86::REGA::regaCh, "ch")
+REGDEF(DISX86::REGA::regaDh, "dh")
+REGDEF(DISX86::REGA::regaBh, "bh")
// x87 floating point stack
-REGDEF(DISX86::REGA::regaSt0, "st0")
-REGDEF(DISX86::REGA::regaSt1, "st1")
-REGDEF(DISX86::REGA::regaSt2, "st2")
-REGDEF(DISX86::REGA::regaSt3, "st3")
-REGDEF(DISX86::REGA::regaSt4, "st4")
-REGDEF(DISX86::REGA::regaSt5, "st5")
-REGDEF(DISX86::REGA::regaSt6, "st6")
-REGDEF(DISX86::REGA::regaSt7, "st7")
+REGDEF(DISX86::REGA::regaSt0, "st0")
+REGDEF(DISX86::REGA::regaSt1, "st1")
+REGDEF(DISX86::REGA::regaSt2, "st2")
+REGDEF(DISX86::REGA::regaSt3, "st3")
+REGDEF(DISX86::REGA::regaSt4, "st4")
+REGDEF(DISX86::REGA::regaSt5, "st5")
+REGDEF(DISX86::REGA::regaSt6, "st6")
+REGDEF(DISX86::REGA::regaSt7, "st7")
// XMM registers
-REGDEF(DISX86::REGA::regaXmm0, "xmm0")
-REGDEF(DISX86::REGA::regaXmm1, "xmm1")
-REGDEF(DISX86::REGA::regaXmm2, "xmm2")
-REGDEF(DISX86::REGA::regaXmm3, "xmm3")
-REGDEF(DISX86::REGA::regaXmm4, "xmm4")
-REGDEF(DISX86::REGA::regaXmm5, "xmm5")
-REGDEF(DISX86::REGA::regaXmm6, "xmm6")
-REGDEF(DISX86::REGA::regaXmm7, "xmm7")
-REGDEF(DISX86::REGA::regaXmm8, "xmm8")
-REGDEF(DISX86::REGA::regaXmm9, "xmm9")
+REGDEF(DISX86::REGA::regaXmm0, "xmm0")
+REGDEF(DISX86::REGA::regaXmm1, "xmm1")
+REGDEF(DISX86::REGA::regaXmm2, "xmm2")
+REGDEF(DISX86::REGA::regaXmm3, "xmm3")
+REGDEF(DISX86::REGA::regaXmm4, "xmm4")
+REGDEF(DISX86::REGA::regaXmm5, "xmm5")
+REGDEF(DISX86::REGA::regaXmm6, "xmm6")
+REGDEF(DISX86::REGA::regaXmm7, "xmm7")
+REGDEF(DISX86::REGA::regaXmm8, "xmm8")
+REGDEF(DISX86::REGA::regaXmm9, "xmm9")
REGDEF(DISX86::REGA::regaXmm10, "xmm10")
REGDEF(DISX86::REGA::regaXmm11, "xmm11")
REGDEF(DISX86::REGA::regaXmm12, "xmm12")
diff --git a/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h b/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h
index 4677299e3a..019c2d1841 100644
--- a/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h
+++ b/src/ToolBox/superpmi/superpmi-shared/runtimedetails.h
@@ -9,7 +9,7 @@
#ifndef _RuntimeDetails
#define _RuntimeDetails
-//Our little collection of enough of the CLR data to get the JIT up and working...
+// Our little collection of enough of the CLR data to get the JIT up and working...
#define FEATURE_CLRSQM
#if !defined(_TARGET_AMD64_) && !defined(_TARGET_X86_) && !defined(_TARGET_ARM64_) && !defined(_TARGET_ARM_)
@@ -20,13 +20,13 @@
#endif
#endif // _TARGET_* not previously defined
-#define __EXCEPTION_RECORD_CLR //trick out clrntexception.h to not include another exception record....
+#define __EXCEPTION_RECORD_CLR // trick out clrntexception.h to not include another exception record....
#include <mscoree.h>
#include <corjit.h>
#include <utilcode.h>
-///Turn back on direct access to a few OS level things...
+/// Turn back on direct access to a few OS level things...
#undef HeapCreate
#undef HeapAlloc
#undef HeapFree
@@ -35,9 +35,9 @@
#undef TlsGetValue
#undef TlsSetValue
-//Jit Exports
-typedef ICorJitCompiler* (__stdcall *PgetJit)();
-typedef void (__stdcall *PjitStartup)(ICorJitHost* host);
-typedef void (__stdcall *PsxsJitStartup)(CoreClrCallbacks const & cccallbacks);
+// Jit Exports
+typedef ICorJitCompiler*(__stdcall* PgetJit)();
+typedef void(__stdcall* PjitStartup)(ICorJitHost* host);
+typedef void(__stdcall* PsxsJitStartup)(CoreClrCallbacks const& cccallbacks);
#endif
diff --git a/src/ToolBox/superpmi/superpmi-shared/simpletimer.cpp b/src/ToolBox/superpmi/superpmi-shared/simpletimer.cpp
index e9c76339bc..6fa1f8ea89 100644
--- a/src/ToolBox/superpmi/superpmi-shared/simpletimer.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/simpletimer.cpp
@@ -10,10 +10,10 @@
SimpleTimer::SimpleTimer()
{
start.QuadPart = 0;
- stop.QuadPart = 0;
+ stop.QuadPart = 0;
BOOL retVal = ::QueryPerformanceFrequency(&proc_freq);
- if(retVal == FALSE)
+ if (retVal == FALSE)
{
LogDebug("SimpleTimer::SimpleTimer unable to QPF. error was 0x%08x", ::GetLastError());
::__debugbreak();
@@ -27,7 +27,7 @@ SimpleTimer::~SimpleTimer()
void SimpleTimer::Start()
{
BOOL retVal = ::QueryPerformanceCounter(&start);
- if(retVal == FALSE)
+ if (retVal == FALSE)
{
LogDebug("SimpleTimer::Start unable to QPC. error was 0x%08x", ::GetLastError());
::__debugbreak();
@@ -37,7 +37,7 @@ void SimpleTimer::Start()
void SimpleTimer::Stop()
{
BOOL retVal = ::QueryPerformanceCounter(&stop);
- if(retVal == FALSE)
+ if (retVal == FALSE)
{
LogDebug("SimpleTimer::Stop unable to QPC. error was 0x%08x", ::GetLastError());
::__debugbreak();
@@ -46,11 +46,10 @@ void SimpleTimer::Stop()
double SimpleTimer::GetMilliseconds()
{
- return GetSeconds()*1000.0;
+ return GetSeconds() * 1000.0;
}
double SimpleTimer::GetSeconds()
{
return ((stop.QuadPart - start.QuadPart) / (double)proc_freq.QuadPart);
}
-
diff --git a/src/ToolBox/superpmi/superpmi-shared/simpletimer.h b/src/ToolBox/superpmi/superpmi-shared/simpletimer.h
index b5edd7c65e..5ada33c991 100644
--- a/src/ToolBox/superpmi/superpmi-shared/simpletimer.h
+++ b/src/ToolBox/superpmi/superpmi-shared/simpletimer.h
@@ -12,8 +12,8 @@ public:
SimpleTimer();
~SimpleTimer();
- void Start();
- void Stop();
+ void Start();
+ void Stop();
double GetMilliseconds();
double GetSeconds();
diff --git a/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp b/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
index e99e6f4ae2..8f609847f7 100644
--- a/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
@@ -21,7 +21,7 @@ void DebugBreakorAV(int val)
__debugbreak();
if (breakOnDebugBreakorAV)
__debugbreak();
- }
+ }
int exception_code = EXCEPTIONCODE_DebugBreakorAV + val;
// assert((EXCEPTIONCODE_DebugBreakorAV <= exception_code) && (exception_code < EXCEPTIONCODE_DebugBreakorAV_MAX))
@@ -37,13 +37,13 @@ char* GetEnvironmentVariableWithDefaultA(const char* envVarName, const char* def
if (dwRetVal != 0)
{
retString = new char[dwRetVal];
- dwRetVal = ::GetEnvironmentVariableA(envVarName, retString, dwRetVal);
+ dwRetVal = ::GetEnvironmentVariableA(envVarName, retString, dwRetVal);
}
else
{
if (defaultValue != nullptr)
{
- dwRetVal = (DWORD)strlen(defaultValue) + 1; // add one for null terminator
+ dwRetVal = (DWORD)strlen(defaultValue) + 1; // add one for null terminator
retString = new char[dwRetVal];
memcpy_s(retString, dwRetVal, defaultValue, dwRetVal);
}
@@ -61,13 +61,13 @@ WCHAR* GetEnvironmentVariableWithDefaultW(const WCHAR* envVarName, const WCHAR*
if (dwRetVal != 0)
{
retString = new WCHAR[dwRetVal];
- dwRetVal = ::GetEnvironmentVariableW(envVarName, retString, dwRetVal);
+ dwRetVal = ::GetEnvironmentVariableW(envVarName, retString, dwRetVal);
}
else
{
if (defaultValue != nullptr)
{
- dwRetVal = (DWORD)wcslen(defaultValue) + 1; // add one for null terminator
+ dwRetVal = (DWORD)wcslen(defaultValue) + 1; // add one for null terminator
retString = new WCHAR[dwRetVal];
memcpy_s(retString, dwRetVal * sizeof(WCHAR), defaultValue, dwRetVal * sizeof(WCHAR));
}
@@ -80,7 +80,7 @@ WCHAR* GetEnvironmentVariableWithDefaultW(const WCHAR* envVarName, const WCHAR*
// For some reason, the PAL doesn't have GetCommandLineA(). So write it.
LPSTR GetCommandLineA()
{
- LPSTR pCmdLine = nullptr;
+ LPSTR pCmdLine = nullptr;
LPWSTR pwCmdLine = GetCommandLineW();
if (pwCmdLine != nullptr)
diff --git a/src/ToolBox/superpmi/superpmi-shared/spmiutil.h b/src/ToolBox/superpmi/superpmi-shared/spmiutil.h
index 6c8db3948a..7565122839 100644
--- a/src/ToolBox/superpmi/superpmi-shared/spmiutil.h
+++ b/src/ToolBox/superpmi/superpmi-shared/spmiutil.h
@@ -12,7 +12,7 @@
extern bool breakOnDebugBreakorAV;
-extern void DebugBreakorAV(int val); //Global(ish) error handler
+extern void DebugBreakorAV(int val); // Global(ish) error handler
extern char* GetEnvironmentVariableWithDefaultA(const char* envVarName, const char* defaultValue = nullptr);
diff --git a/src/ToolBox/superpmi/superpmi-shared/standardpch.h b/src/ToolBox/superpmi/superpmi-shared/standardpch.h
index 4164244085..f1ad24898d 100644
--- a/src/ToolBox/superpmi/superpmi-shared/standardpch.h
+++ b/src/ToolBox/superpmi/superpmi-shared/standardpch.h
@@ -23,7 +23,7 @@
#endif // INTERNAL_BUILD
#ifdef _MSC_VER
-#pragma warning(disable: 4996) // The compiler encountered a deprecated declaration.
+#pragma warning(disable : 4996) // The compiler encountered a deprecated declaration.
// On Windows, we build against PAL macros that convert to Windows SEH. But we don't want all the
// Contract stuff that normally gets pulled it. Defining JIT_BUILD prevents this, just as it does
@@ -32,7 +32,8 @@
// Defining this prevents:
// error C2338 : / RTCc rejects conformant code, so it isn't supported by the C++ Standard Library.
-// Either remove this compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have received this warning.
+// Either remove this compiler option, or define _ALLOW_RTCc_IN_STL to acknowledge that you have received this
+// warning.
#ifndef _ALLOW_RTCc_IN_STL
#define _ALLOW_RTCc_IN_STL
#endif
@@ -90,9 +91,9 @@
#ifndef W
#ifdef PLATFORM_UNIX
-#define W(str) u##str
+#define W(str) u##str
#else // PLATFORM_UNIX
-#define W(str) L##str
+#define W(str) L##str
#endif // PLATFORM_UNIX
#endif // !W
diff --git a/src/ToolBox/superpmi/superpmi-shared/tocfile.cpp b/src/ToolBox/superpmi/superpmi-shared/tocfile.cpp
index c91ca89c93..f0979fc5c3 100644
--- a/src/ToolBox/superpmi/superpmi-shared/tocfile.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/tocfile.cpp
@@ -12,9 +12,10 @@
#include "logging.h"
// Tries to load a Table of Contents
-void TOCFile::LoadToc(const char *inputFileName, bool validate)
+void TOCFile::LoadToc(const char* inputFileName, bool validate)
{
- HANDLE hIndex = CreateFileA(inputFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+ HANDLE hIndex = CreateFileA(inputFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (hIndex == INVALID_HANDLE_VALUE)
{
LogError("Failed to open file '%s'. GetLastError()=%u", inputFileName, GetLastError());
@@ -23,9 +24,8 @@ void TOCFile::LoadToc(const char *inputFileName, bool validate)
// Now read the index file
LARGE_INTEGER val; // I'm abusing LARGE_INTEGER here...
- DWORD read;
- if (!ReadFile(hIndex, &val, sizeof(val), &read, nullptr) ||
- (val.u.LowPart != *(DWORD *)("INDX")))
+ DWORD read;
+ if (!ReadFile(hIndex, &val, sizeof(val), &read, nullptr) || (val.u.LowPart != *(DWORD*)("INDX")))
{
CloseHandle(hIndex);
LogWarning("The index file %s is invalid: it seems to be missing the starting sentinel/length", inputFileName);
@@ -46,8 +46,7 @@ void TOCFile::LoadToc(const char *inputFileName, bool validate)
}
// Get the last 4 byte token (more abuse of LARGE_INTEGER)
- if (!ReadFile(hIndex, &val.u.HighPart, sizeof(DWORD), &read, nullptr) ||
- (read != sizeof(DWORD)) ||
+ if (!ReadFile(hIndex, &val.u.HighPart, sizeof(DWORD), &read, nullptr) || (read != sizeof(DWORD)) ||
(val.u.LowPart != val.u.HighPart))
{
CloseHandle(hIndex);
diff --git a/src/ToolBox/superpmi/superpmi-shared/tocfile.h b/src/ToolBox/superpmi/superpmi-shared/tocfile.h
index a0e7bde146..7bafc39140 100644
--- a/src/ToolBox/superpmi/superpmi-shared/tocfile.h
+++ b/src/ToolBox/superpmi/superpmi-shared/tocfile.h
@@ -16,16 +16,14 @@ class TOCElement
{
public:
__int64 Offset;
- int Number;
- char Hash[MD5_HASH_BUFFER_SIZE];
+ int Number;
+ char Hash[MD5_HASH_BUFFER_SIZE];
TOCElement()
{
}
- TOCElement(int number, __int64 offset)
- : Offset(offset)
- , Number(number)
+ TOCElement(int number, __int64 offset) : Offset(offset), Number(number)
{
}
};
@@ -33,15 +31,11 @@ public:
class TOCFile
{
private:
-
TOCElement* m_tocArray;
size_t m_tocCount;
public:
-
- TOCFile()
- : m_tocArray(nullptr)
- , m_tocCount(0)
+ TOCFile() : m_tocArray(nullptr), m_tocCount(0)
{
}
@@ -57,7 +51,7 @@ public:
m_tocCount = 0;
}
- void LoadToc(const char *inputFileName, bool validate = true);
+ void LoadToc(const char* inputFileName, bool validate = true);
size_t GetTocCount()
{
diff --git a/src/ToolBox/superpmi/superpmi-shared/typeutils.cpp b/src/ToolBox/superpmi/superpmi-shared/typeutils.cpp
index 0b2eee6b4a..9b3ad4c88a 100644
--- a/src/ToolBox/superpmi/superpmi-shared/typeutils.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/typeutils.cpp
@@ -13,78 +13,78 @@
// Returns a string representation of the given CorInfoType. The naming scheme is based on JITtype2varType
// in src/jit/ee_il_dll.hpp.
-const char *TypeUtils::GetCorInfoTypeName(CorInfoType type)
+const char* TypeUtils::GetCorInfoTypeName(CorInfoType type)
{
switch (type)
{
- case CORINFO_TYPE_VOID:
- return "void";
+ case CORINFO_TYPE_VOID:
+ return "void";
- case CORINFO_TYPE_BOOL:
- return "bool";
+ case CORINFO_TYPE_BOOL:
+ return "bool";
- case CORINFO_TYPE_CHAR:
- return "char";
+ case CORINFO_TYPE_CHAR:
+ return "char";
- case CORINFO_TYPE_BYTE:
- return "byte";
+ case CORINFO_TYPE_BYTE:
+ return "byte";
- case CORINFO_TYPE_UBYTE:
- return "ubyte";
+ case CORINFO_TYPE_UBYTE:
+ return "ubyte";
- case CORINFO_TYPE_SHORT:
- return "short";
+ case CORINFO_TYPE_SHORT:
+ return "short";
- case CORINFO_TYPE_USHORT:
- return "ushort";
+ case CORINFO_TYPE_USHORT:
+ return "ushort";
- case CORINFO_TYPE_INT:
- return "int";
+ case CORINFO_TYPE_INT:
+ return "int";
- case CORINFO_TYPE_UINT:
- return "uint";
+ case CORINFO_TYPE_UINT:
+ return "uint";
- case CORINFO_TYPE_LONG:
- return "long";
+ case CORINFO_TYPE_LONG:
+ return "long";
- case CORINFO_TYPE_ULONG:
- return "ulong";
+ case CORINFO_TYPE_ULONG:
+ return "ulong";
- case CORINFO_TYPE_FLOAT:
- return "float";
+ case CORINFO_TYPE_FLOAT:
+ return "float";
- case CORINFO_TYPE_DOUBLE:
- return "double";
+ case CORINFO_TYPE_DOUBLE:
+ return "double";
- case CORINFO_TYPE_BYREF:
- return "byref";
+ case CORINFO_TYPE_BYREF:
+ return "byref";
- case CORINFO_TYPE_VALUECLASS:
- case CORINFO_TYPE_REFANY:
- return "struct";
+ case CORINFO_TYPE_VALUECLASS:
+ case CORINFO_TYPE_REFANY:
+ return "struct";
- case CORINFO_TYPE_STRING:
- case CORINFO_TYPE_CLASS:
- case CORINFO_TYPE_VAR:
- return "ref";
+ case CORINFO_TYPE_STRING:
+ case CORINFO_TYPE_CLASS:
+ case CORINFO_TYPE_VAR:
+ return "ref";
- case CORINFO_TYPE_NATIVEINT:
- case CORINFO_TYPE_NATIVEUINT:
- // Emulates the JIT's concept of TYP_I_IMPL
+ case CORINFO_TYPE_NATIVEINT:
+ case CORINFO_TYPE_NATIVEUINT:
+// Emulates the JIT's concept of TYP_I_IMPL
#if defined(_TARGET_AMD64_) // TODO: should be _TARGET_64BIT_
- return "long";
+ return "long";
#else
- return "int";
+ return "int";
#endif
- case CORINFO_TYPE_PTR:
- // The JIT just treats this as a TYP_I_IMPL because this isn't a GC root,
- // but we don't care about GC-ness: we care about pointer-sized.
- return "ptr";
+ case CORINFO_TYPE_PTR:
+ // The JIT just treats this as a TYP_I_IMPL because this isn't a GC root,
+ // but we don't care about GC-ness: we care about pointer-sized.
+ return "ptr";
- default:
- LogException(EXCEPTIONCODE_TYPEUTILS, "Unknown type passed into GetCorInfoTypeName (0x%x)", type);
- return "UNKNOWN";
+ default:
+ LogException(EXCEPTIONCODE_TYPEUTILS, "Unknown type passed into GetCorInfoTypeName (0x%x)", type);
+ return "UNKNOWN";
}
}
@@ -95,8 +95,8 @@ bool TypeUtils::IsFloatingPoint(CorInfoType type)
bool TypeUtils::IsPointer(CorInfoType type)
{
- return (type == CORINFO_TYPE_STRING || type == CORINFO_TYPE_PTR ||
- type == CORINFO_TYPE_BYREF || type == CORINFO_TYPE_CLASS);
+ return (type == CORINFO_TYPE_STRING || type == CORINFO_TYPE_PTR || type == CORINFO_TYPE_BYREF ||
+ type == CORINFO_TYPE_CLASS);
}
bool TypeUtils::IsValueClass(CorInfoType type)
@@ -106,11 +106,11 @@ bool TypeUtils::IsValueClass(CorInfoType type)
// Determines if a value class, represented by the given class handle, is required to be passed
// by reference (i.e. it cannot be stuffed as-is into a register or stack slot).
-bool TypeUtils::ValueClassRequiresByref(MethodContext *mc, CORINFO_CLASS_HANDLE clsHnd)
+bool TypeUtils::ValueClassRequiresByref(MethodContext* mc, CORINFO_CLASS_HANDLE clsHnd)
{
#if defined(_TARGET_AMD64_)
size_t size = mc->repGetClassSize(clsHnd);
- return ((size > sizeof(void *)) || ((size & (size - 1)) != 0));
+ return ((size > sizeof(void*)) || ((size & (size - 1)) != 0));
#else
LogException(EXCEPTIONCODE_TYPEUTILS, "unsupported architecture", "");
return false;
@@ -129,7 +129,7 @@ size_t TypeUtils::SizeOfCorInfoType(CorInfoType type)
case CORINFO_TYPE_BOOL:
return sizeof(BYTE);
- case CORINFO_TYPE_CHAR: // 2 bytes for Unicode
+ case CORINFO_TYPE_CHAR: // 2 bytes for Unicode
case CORINFO_TYPE_SHORT:
case CORINFO_TYPE_USHORT:
return sizeof(WORD);
@@ -150,14 +150,14 @@ size_t TypeUtils::SizeOfCorInfoType(CorInfoType type)
case CORINFO_TYPE_PTR:
case CORINFO_TYPE_BYREF:
case CORINFO_TYPE_CLASS:
- return sizeof(void *);
+ return sizeof(void*);
// This should be obtained via repGetClassSize
case CORINFO_TYPE_VALUECLASS:
case CORINFO_TYPE_REFANY:
LogException(EXCEPTIONCODE_TYPEUTILS,
"SizeOfCorInfoType does not support value types; use repGetClassSize instead (type: 0x%x)",
- type);
+ type);
return 0;
case CORINFO_TYPE_UNDEF:
diff --git a/src/ToolBox/superpmi/superpmi-shared/typeutils.h b/src/ToolBox/superpmi/superpmi-shared/typeutils.h
index 31cb478020..c511618b74 100644
--- a/src/ToolBox/superpmi/superpmi-shared/typeutils.h
+++ b/src/ToolBox/superpmi/superpmi-shared/typeutils.h
@@ -14,11 +14,11 @@
class TypeUtils
{
public:
- static const char *GetCorInfoTypeName(CorInfoType type);
+ static const char* GetCorInfoTypeName(CorInfoType type);
static bool IsFloatingPoint(CorInfoType type);
static bool IsPointer(CorInfoType type);
static bool IsValueClass(CorInfoType type);
- static bool ValueClassRequiresByref(MethodContext *mc, CORINFO_CLASS_HANDLE clsHnd);
+ static bool ValueClassRequiresByref(MethodContext* mc, CORINFO_CLASS_HANDLE clsHnd);
static size_t SizeOfCorInfoType(CorInfoType type);
};