format spmi sources.
BOOL STDMETHODCALLTYPE EEHeapFreeInProcessHeap(DWORD dwFlags, LPVOID lpMem);
void* STDMETHODCALLTYPE GetCLRFunction(LPCSTR functionName);
-typedef LPVOID (STDMETHODCALLTYPE *pfnEEHeapAllocInProcessHeap)(DWORD dwFlags, SIZE_T dwBytes);
-typedef BOOL (STDMETHODCALLTYPE *pfnEEHeapFreeInProcessHeap)(DWORD dwFlags, LPVOID lpMem);
+typedef LPVOID(STDMETHODCALLTYPE* pfnEEHeapAllocInProcessHeap)(DWORD dwFlags, SIZE_T dwBytes);
+typedef BOOL(STDMETHODCALLTYPE* pfnEEHeapFreeInProcessHeap)(DWORD dwFlags, LPVOID lpMem);
#endif
#include "logging.h"
-// EXCEPTIONCODE_DebugBreakorAV is just the base exception number; calls to DebugBreakorAV()
+// 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
// interface declaration (with the "virtual" and "= 0" syntax removed). This is to make it easy to compare
// against the interface declaration.
+// clang-format off
+
public:
/**********************************************************************************/
//
LWM(GetClassNumInstanceFields, DWORDLONG, DWORD)
LWM(GetClassSize, DWORDLONG, DWORD)
LWM(GetCookieForPInvokeCalliSig, GetCookieForPInvokeCalliSigValue, DLDL)
-LWM(GetDefaultEqualityComparerClass, DWORDLONG, DWORDLONG)
+LWM(GetDefaultEqualityComparerClass, DWORDLONG, DWORDLONG)
LWM(GetDelegateCtor, Agnostic_GetDelegateCtorIn, Agnostic_GetDelegateCtorOut)
LWM(GetEEInfo, DWORD, Agnostic_CORINFO_EE_INFO)
LWM(GetEHinfo, DLD, Agnostic_CORINFO_EH_CLAUSE)
return result;
}
-
-void MethodContext::recGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
- char* methodName, const char** className, const char **namespaceName)
+void MethodContext::recGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
+ char* methodName,
+ const char** className,
+ const char** namespaceName)
{
if (GetMethodNameFromMetadata == nullptr)
GetMethodNameFromMetadata = new LightWeightMap<DLDD, DDD>();
void MethodContext::dmpGetMethodNameFromMetadata(DLDD key, DDD value)
{
- unsigned char* methodName = (unsigned char*)GetMethodName->GetBuffer(value.A);
- unsigned char* className = (unsigned char*)GetMethodName->GetBuffer(value.B);
+ unsigned char* methodName = (unsigned char*)GetMethodName->GetBuffer(value.A);
+ unsigned char* className = (unsigned char*)GetMethodName->GetBuffer(value.B);
unsigned char* namespaceName = (unsigned char*)GetMethodName->GetBuffer(value.C);
- printf("GetMethodNameFromMetadata key - ftn-%016llX classNonNull-%u namespaceNonNull-%u, value meth-'%s', class-'%s', namespace-'%s'",
- key.A, key.B, key.C, methodName, className, namespaceName);
+ printf("GetMethodNameFromMetadata key - ftn-%016llX classNonNull-%u namespaceNonNull-%u, value meth-'%s', "
+ "class-'%s', namespace-'%s'",
+ key.A, key.B, key.C, methodName, className, namespaceName);
GetMethodNameFromMetadata->Unlock();
}
-const char* MethodContext::repGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, const char** moduleName, const char** namespaceName)
+const char* MethodContext::repGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
+ const char** moduleName,
+ const char** namespaceName)
{
const char* result = nullptr;
DDD value;
}
else
{
- value = GetMethodNameFromMetadata->Get(key);
+ value = GetMethodNameFromMetadata->Get(key);
result = (const char*)GetMethodNameFromMetadata->GetBuffer(value.A);
if (moduleName != nullptr)
- {
+ {
*moduleName = (const char*)GetMethodNameFromMetadata->GetBuffer(value.B);
}
if (namespaceName != nullptr)
- {
+ {
*namespaceName = (const char*)GetMethodNameFromMetadata->GetBuffer(value.C);
}
}
pResult->stubLookup.runtimeLookup.testForNull = value.stubLookup.runtimeLookup.testForNull != 0;
pResult->stubLookup.runtimeLookup.testForFixup = value.stubLookup.runtimeLookup.testForFixup != 0;
pResult->stubLookup.runtimeLookup.indirectFirstOffset = value.stubLookup.runtimeLookup.indirectFirstOffset != 0;
- pResult->stubLookup.runtimeLookup.indirectSecondOffset = value.stubLookup.runtimeLookup.indirectSecondOffset != 0;
+ pResult->stubLookup.runtimeLookup.indirectSecondOffset =
+ value.stubLookup.runtimeLookup.indirectSecondOffset != 0;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
pResult->stubLookup.runtimeLookup.offsets[i] = (SIZE_T)value.stubLookup.runtimeLookup.offsets[i];
}
return value;
}
-void MethodContext::recCompareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass, TypeCompareState result)
+void MethodContext::recCompareTypesForCast(CORINFO_CLASS_HANDLE fromClass,
+ CORINFO_CLASS_HANDLE toClass,
+ TypeCompareState result)
{
if (CompareTypesForCast == nullptr)
CompareTypesForCast = new LightWeightMap<DLDL, DWORD>();
return value;
}
-void MethodContext::recCompareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, TypeCompareState result)
+void MethodContext::recCompareTypesForEquality(CORINFO_CLASS_HANDLE cls1,
+ CORINFO_CLASS_HANDLE cls2,
+ TypeCompareState result)
{
if (CompareTypesForEquality == nullptr)
CompareTypesForEquality = new LightWeightMap<DLDL, DWORD>();
for (unsigned int i = 0; i < Environment->GetCount(); i++)
{
Agnostic_Environment currEnvValue = Environment->Get(i);
- LPCSTR currKey = (LPCSTR)Environment->GetBuffer(currEnvValue.name_index);
- LPCSTR currVal = (LPCSTR)Environment->GetBuffer(currEnvValue.val_index);
+ LPCSTR currKey = (LPCSTR)Environment->GetBuffer(currEnvValue.name_index);
+ LPCSTR currVal = (LPCSTR)Environment->GetBuffer(currEnvValue.val_index);
Agnostic_Environment prevEnvValue = prevEnviroment->Get(i);
- LPCSTR prevKey = (LPCSTR)prevEnviroment->GetBuffer(prevEnvValue.name_index);
- LPCSTR prevVal = (LPCSTR)prevEnviroment->GetBuffer(prevEnvValue.val_index);
+ LPCSTR prevKey = (LPCSTR)prevEnviroment->GetBuffer(prevEnvValue.name_index);
+ LPCSTR prevVal = (LPCSTR)prevEnviroment->GetBuffer(prevEnvValue.val_index);
if (strcmp(currKey, prevKey) != 0 || strcmp(currVal, prevVal) != 0)
{
changed = true;
void dmpGetMethodName(DLD key, DD value);
const char* repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char** moduleName);
- void recGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, char* methodname, const char** moduleName, const char** namespaceName);
+ void recGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
+ char* methodname,
+ const char** moduleName,
+ const char** namespaceName);
void dmpGetMethodNameFromMetadata(DLDD key, DDD value);
- const char* repGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, const char** className, const char** namespaceName);
+ const char* repGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
+ const char** className,
+ const char** namespaceName);
void recGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes, DWORD result);
void dmpGetJitFlags(DWORD key, DD value);
void dmpGetDefaultEqualityComparerClass(DWORDLONG key, DWORDLONG value);
CORINFO_CLASS_HANDLE repGetDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE cls);
-
void recGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CLASS_HANDLE result);
void dmpGetTokenTypeAsHandle(const GetTokenTypeAsHandleValue& key, DWORDLONG value);
CORINFO_CLASS_HANDLE repGetTokenTypeAsHandle(CORINFO_RESOLVED_TOKEN* pResolvedToken);
void dmpGetStringConfigValue(DWORD nameIndex, DWORD result);
const wchar_t* repGetStringConfigValue(const wchar_t* name);
- bool wasEnviromentChanged();
+ bool wasEnviromentChanged();
static DenseLightWeightMap<Agnostic_Environment>* prevEnviroment;
CompileResult* cr;
Packet_GetMethodHash = 73,
Packet_GetMethodInfo = 74,
Packet_GetMethodName = 75,
- Packet_GetMethodNameFromMetadata = 161, // Added 9/6/17
+ Packet_GetMethodNameFromMetadata = 161, // Added 9/6/17
Packet_GetMethodSig = 76,
Packet_GetMethodSync = 77,
Packet_GetMethodVTableOffset = 78,
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);
if (this->hasTOC())
{
// We have a TOC so lets go through the TOCElements
- //one-by-one till we find a matching hash
+ // 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)
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
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
+ // this will get freed up by MethodContext constructor
unsigned char* buff = new unsigned char[mcb.size + 2];
memcpy(buff, mcb.buff, mcb.size + 2);
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
+ // since we are repositioning the file pointer we need to update it
curMCIndex = methodNumber;
return mcb;
{
MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP runtimeLookup;
ZeroMemory(&runtimeLookup, sizeof(runtimeLookup));
- runtimeLookup.signature = (DWORDLONG)pLookup->signature;
- runtimeLookup.helper = (DWORD)pLookup->helper;
- runtimeLookup.indirections = (DWORD)pLookup->indirections;
- runtimeLookup.testForNull = (DWORD)pLookup->testForNull;
- runtimeLookup.testForFixup = (DWORD)pLookup->testForFixup;
- runtimeLookup.indirectFirstOffset = (DWORD)pLookup->indirectFirstOffset;
+ runtimeLookup.signature = (DWORDLONG)pLookup->signature;
+ runtimeLookup.helper = (DWORD)pLookup->helper;
+ runtimeLookup.indirections = (DWORD)pLookup->indirections;
+ runtimeLookup.testForNull = (DWORD)pLookup->testForNull;
+ runtimeLookup.testForFixup = (DWORD)pLookup->testForFixup;
+ runtimeLookup.indirectFirstOffset = (DWORD)pLookup->indirectFirstOffset;
runtimeLookup.indirectSecondOffset = (DWORD)pLookup->indirectSecondOffset;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
runtimeLookup.offsets[i] = (DWORDLONG)pLookup->offsets[i];
MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP& lookup)
{
CORINFO_RUNTIME_LOOKUP runtimeLookup;
- runtimeLookup.signature = (LPVOID)lookup.signature;
- runtimeLookup.helper = (CorInfoHelpFunc)lookup.helper;
- runtimeLookup.indirections = (WORD)lookup.indirections;
- runtimeLookup.testForNull = lookup.testForNull != 0;
- runtimeLookup.testForFixup = lookup.testForFixup != 0;
- runtimeLookup.indirectFirstOffset = lookup.indirectFirstOffset != 0;
+ runtimeLookup.signature = (LPVOID)lookup.signature;
+ runtimeLookup.helper = (CorInfoHelpFunc)lookup.helper;
+ runtimeLookup.indirections = (WORD)lookup.indirections;
+ runtimeLookup.testForNull = lookup.testForNull != 0;
+ runtimeLookup.testForFixup = lookup.testForFixup != 0;
+ runtimeLookup.indirectFirstOffset = lookup.indirectFirstOffset != 0;
runtimeLookup.indirectSecondOffset = lookup.indirectSecondOffset != 0;
for (int i = 0; i < CORINFO_MAXINDIRECTIONS; i++)
runtimeLookup.offsets[i] = (size_t)lookup.offsets[i];
our_ICorJitInfo.mc->recCompileMethod(info, flags);
// force some extra data into our tables..
- //data probably not needed with RyuJIT, but needed in 4.5 and 4.5.1 to help with catching cached values
+ // data probably not needed with RyuJIT, but needed in 4.5 and 4.5.1 to help with catching cached values
our_ICorJitInfo.getBuiltinClass(CLASSID_SYSTEM_OBJECT);
our_ICorJitInfo.getBuiltinClass(CLASSID_TYPED_BYREF);
our_ICorJitInfo.getBuiltinClass(CLASSID_TYPE_HANDLE);
param.info = info;
param.temp = false;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("getMethodInfo");
- pParam->temp = pParam->pThis->original_ICorJitInfo->getMethodInfo(pParam->ftn, pParam->info);
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recGetMethodInfo(ftn, info, param.temp, param.exceptionCode);
-}
-PAL_ENDTRY
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("getMethodInfo");
+ pParam->temp = pParam->pThis->original_ICorJitInfo->getMethodInfo(pParam->ftn, pParam->info);
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recGetMethodInfo(ftn, info, param.temp, param.exceptionCode);
+ }
+ PAL_ENDTRY
-return param.temp;
+ return param.temp;
}
// Decides if you have any limitations for inlining. If everything's OK, it will return
param.pRestrictions = pRestrictions;
param.temp = INLINE_NEVER;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("canInline");
- pParam->temp =
- pParam->pThis->original_ICorJitInfo->canInline(pParam->callerHnd, pParam->calleeHnd, pParam->pRestrictions);
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recCanInline(callerHnd, calleeHnd, pRestrictions, param.temp, param.exceptionCode);
-}
-PAL_ENDTRY
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("canInline");
+ pParam->temp = pParam->pThis->original_ICorJitInfo->canInline(pParam->callerHnd, pParam->calleeHnd,
+ pParam->pRestrictions);
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recCanInline(callerHnd, calleeHnd, pRestrictions, param.temp, param.exceptionCode);
+ }
+ PAL_ENDTRY
-return param.temp;
+ return param.temp;
}
// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all
// This function returns the offset of the specified method in the
// vtable of it's owning class or interface.
-void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
- unsigned* offsetOfIndirection, /* OUT */
- unsigned* offsetAfterIndirection,/* OUT */
- bool* isRelative /* OUT */
+void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
+ unsigned* offsetOfIndirection, /* OUT */
+ unsigned* offsetAfterIndirection, /* OUT */
+ bool* isRelative /* OUT */
)
{
mc->cr->AddCall("getMethodVTableOffset");
return result;
}
-void interceptor_ICJI::expandRawHandleIntrinsic(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_GENERICHANDLE_RESULT * pResult)
+void interceptor_ICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT* pResult)
{
mc->cr->AddCall("expandRawHandleIntrinsic");
original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
param.pThis = this;
param.pResolvedToken = pResolvedToken;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("resolveToken");
- pParam->pThis->original_ICorJitInfo->resolveToken(pParam->pResolvedToken);
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recResolveToken(param.pResolvedToken, param.exceptionCode);
-}
-PAL_ENDTRY
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("resolveToken");
+ pParam->pThis->original_ICorJitInfo->resolveToken(pParam->pResolvedToken);
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recResolveToken(param.pResolvedToken, param.exceptionCode);
+ }
+ PAL_ENDTRY
}
bool interceptor_ICJI::tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResolvedToken)
// 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.
- //Note - Ownership of pMap is transfered with this call. We need to record it before its passed on to the EE.
+// Note - Ownership of pMap is transfered with this call. We need to record it before its passed on to the EE.
void interceptor_ICJI::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.
// Report back to the EE the location of every variable.
// note that the JIT might split lifetimes into different
// locations etc.
- //Note - Ownership of vars is transfered with this call. We need to record it before its passed on to the EE.
+// Note - Ownership of vars is transfered with this call. We need to record it before its passed on to the EE.
void interceptor_ICJI::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
param.vcTypeRet = vcTypeRet;
param.temp = (CorInfoTypeWithMod)CORINFO_TYPE_UNDEF;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("getArgType");
- pParam->temp = pParam->pThis->original_ICorJitInfo->getArgType(pParam->sig, pParam->args, pParam->vcTypeRet);
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("getArgType");
+ pParam->temp =
+ pParam->pThis->original_ICorJitInfo->getArgType(pParam->sig, pParam->args, pParam->vcTypeRet);
#ifdef fatMC
- CORINFO_CLASS_HANDLE temp3 = pParam->pThis->getArgClass(pParam->sig, pParam->args);
+ CORINFO_CLASS_HANDLE temp3 = pParam->pThis->getArgClass(pParam->sig, pParam->args);
#endif
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recGetArgType(sig, args, vcTypeRet, param.temp, param.exceptionCode);
-}
-PAL_ENDTRY
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recGetArgType(sig, args, vcTypeRet, param.temp, param.exceptionCode);
+ }
+ PAL_ENDTRY
-return param.temp;
+ return param.temp;
}
// If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it
param.args = args;
param.temp = 0;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("getArgClass");
- pParam->temp = pParam->pThis->original_ICorJitInfo->getArgClass(pParam->sig, pParam->args);
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recGetArgClass(sig, args, param.temp, param.exceptionCode);
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("getArgClass");
+ pParam->temp = pParam->pThis->original_ICorJitInfo->getArgClass(pParam->sig, pParam->args);
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recGetArgClass(sig, args, param.temp, param.exceptionCode);
- // to build up a fat mc
- getClassName(param.temp);
-}
-PAL_ENDTRY
+ // to build up a fat mc
+ getClassName(param.temp);
+ }
+ PAL_ENDTRY
-return param.temp;
+ return param.temp;
}
// Returns type of HFA for valuetype
const char* interceptor_ICJI::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn, /* IN */
const char** className, /* OUT */
- const char** namespaceName /* OUT */
+ const char** namespaceName /* OUT */
)
{
mc->cr->AddCall("getMethodNameFromMetadata");
param.flags = flags;
param.pResult = pResult;
- PAL_TRY(Param*, pOuterParam,
- ¶m){PAL_TRY(Param*, pParam, pOuterParam){pParam->pThis->mc->cr->AddCall("getCallInfo");
- pParam->pThis->original_ICorJitInfo->getCallInfo(pParam->pResolvedToken, pParam->pConstrainedResolvedToken,
- pParam->callerHandle, pParam->flags, pParam->pResult);
-}
-PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
-{
-}
-PAL_ENDTRY
-}
-PAL_FINALLY
-{
- this->mc->recGetCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult,
- param.exceptionCode);
-}
-PAL_ENDTRY
+ PAL_TRY(Param*, pOuterParam, ¶m)
+ {
+ PAL_TRY(Param*, pParam, pOuterParam)
+ {
+ pParam->pThis->mc->cr->AddCall("getCallInfo");
+ pParam->pThis->original_ICorJitInfo->getCallInfo(pParam->pResolvedToken, pParam->pConstrainedResolvedToken,
+ pParam->callerHandle, pParam->flags, pParam->pResult);
+ }
+ PAL_EXCEPT_FILTER(FilterSuperPMIExceptions_CaptureExceptionAndContinue)
+ {
+ }
+ PAL_ENDTRY
+ }
+ PAL_FINALLY
+ {
+ this->mc->recGetCallInfo(pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult,
+ param.exceptionCode);
+ }
+ PAL_ENDTRY
}
BOOL interceptor_ICJI::canAccessFamily(CORINFO_METHOD_HANDLE hCaller, CORINFO_CLASS_HANDLE hInstanceType)
public:
// Added to help us track the original icji and be able to easily indirect
- //to it. And a simple way to keep one memory manager instance per instance.
+ // to it. And a simple way to keep one memory manager instance per instance.
ICorJitInfo* original_ICorJitInfo;
MethodContext* mc;
};
// This function returns the offset of the specified method in the
// vtable of it's owning class or interface.
-void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
- unsigned* offsetOfIndirection, /* OUT */
- unsigned* offsetAfterIndirection,/* OUT */
- bool* isRelative /* OUT */
+void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
+ unsigned* offsetOfIndirection, /* OUT */
+ unsigned* offsetAfterIndirection, /* OUT */
+ bool* isRelative /* OUT */
)
{
mcs->AddCall("getMethodVTableOffset");
return original_ICorJitInfo->getDefaultEqualityComparerClass(cls);
}
-void interceptor_ICJI::expandRawHandleIntrinsic(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_GENERICHANDLE_RESULT * pResult)
+void interceptor_ICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT* pResult)
{
mcs->AddCall("expandRawHandleIntrinsic");
original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
public:
// Added to help us track the original icji and be able to easily indirect
- //to it. And a simple way to keep one memory manager instance per instance.
+ // to it. And a simple way to keep one memory manager instance per instance.
ICorJitInfo* original_ICorJitInfo;
MethodCallSummarizer* mcs;
};
}
// lots of ways will be faster.. this happens to be decently simple and good enough for the task at hand and nicely
-// sorts the output. in this approach the most commonly added items are at the top of the list... 60% landed in the first
+// sorts the output. in this approach the most commonly added items are at the top of the list... 60% landed in the
+// first
// three slots in short runs
void MethodCallSummarizer::AddCall(const char* name)
{
// This function returns the offset of the specified method in the
// vtable of it's owning class or interface.
-void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
- unsigned* offsetOfIndirection, /* OUT */
- unsigned* offsetAfterIndirection,/* OUT */
- bool* isRelative /* OUT */
+void interceptor_ICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
+ unsigned* offsetOfIndirection, /* OUT */
+ unsigned* offsetAfterIndirection, /* OUT */
+ bool* isRelative /* OUT */
)
{
original_ICorJitInfo->getMethodVTableOffset(method, offsetOfIndirection, offsetAfterIndirection, isRelative);
return original_ICorJitInfo->getDefaultEqualityComparerClass(cls);
}
-void interceptor_ICJI::expandRawHandleIntrinsic(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_GENERICHANDLE_RESULT * pResult)
+void interceptor_ICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken,
+ CORINFO_GENERICHANDLE_RESULT* pResult)
{
return original_ICorJitInfo->expandRawHandleIntrinsic(pResolvedToken, pResult);
}
public:
// Added to help us track the original icji and be able to easily indirect
- //to it. And a simple way to keep one memory manager instance per instance.
+ // to it. And a simple way to keep one memory manager instance per instance.
ICorJitInfo* original_ICorJitInfo;
};
printf("\n");
printf(" -jitoption [force] key=value\n");
printf(" Set the JIT option named \"key\" to \"value\" for JIT 1 if the option was not set.");
- printf(" With optional force flag overwrites the existing value if it was already set. NOTE: do not use a \"COMPlus_\" prefix!\n");
+ printf(" With optional force flag overwrites the existing value if it was already set. NOTE: do not use a "
+ "\"COMPlus_\" prefix!\n");
printf("\n");
printf(" -jit2option [force] key=value\n");
printf(" Set the JIT option named \"key\" to \"value\" for JIT 2 if the option was not set.");
- printf(" With optional force flag overwrites the existing value if it was already set. NOTE: do not use a \"COMPlus_\" prefix!\n");
+ printf(" With optional force flag overwrites the existing value if it was already set. NOTE: do not use a "
+ "\"COMPlus_\" prefix!\n");
printf("\n");
printf("Inputs are case sensitive.\n");
printf("\n");
printf(" ; if there are any failures, record their MC numbers in the file fail.mcl\n");
}
-static bool ParseJitOption(const char* optionString, wchar_t** key, wchar_t **value)
+static bool ParseJitOption(const char* optionString, wchar_t** key, wchar_t** value)
{
char tempKey[1024];
const char* tempVal = &optionString[i + 1];
const unsigned keyLen = i;
- wchar_t* keyBuf = new wchar_t[keyLen + 1];
+ wchar_t* keyBuf = new wchar_t[keyLen + 1];
MultiByteToWideChar(CP_UTF8, 0, tempKey, keyLen + 1, keyBuf, keyLen + 1);
const unsigned valLen = (unsigned)strlen(tempVal);
- wchar_t* valBuf = new wchar_t[valLen + 1];
+ wchar_t* valBuf = new wchar_t[valLen + 1];
MultiByteToWideChar(CP_UTF8, 0, tempVal, valLen + 1, valBuf, valLen + 1);
- *key = keyBuf;
+ *key = keyBuf;
*value = valBuf;
return true;
}
}
else if (_strnicmp(&argv[i][1], "jit2option", argLen) == 0)
{
- i++;
+ i++;
if (!AddJitOption(i, argc, argv, &o->jit2Options, &o->forceJit2Options))
{
return false;
}
-
}
else
{
}
}
// Process an input filename
- //String comparisons on file extensions must be case-insensitive since we run on Windows
+ // String comparisons on file extensions must be case-insensitive since we run on Windows
else
{
char* lastdot = strrchr(argv[i], '.');
//
// Returns:
// False if an error occurred, true if the option was parsed and added.
-bool CommandLine::AddJitOption(int& currArgument, int argc, char* argv[], LightWeightMap<DWORD, DWORD>** pJitOptions, LightWeightMap<DWORD, DWORD>** pForceJitOptions)
+bool CommandLine::AddJitOption(int& currArgument,
+ int argc,
+ char* argv[],
+ LightWeightMap<DWORD, DWORD>** pJitOptions,
+ LightWeightMap<DWORD, DWORD>** pForceJitOptions)
{
if (currArgument >= argc)
{
LightWeightMap<DWORD, DWORD>* targetjitOptions = nullptr;
-
if (_strnicmp(argv[currArgument], "force", strlen(argv[currArgument])) == 0)
{
if (*pForceJitOptions == nullptr)
return false;
}
- DWORD keyIndex = (DWORD)targetjitOptions->AddBuffer((unsigned char*)key, sizeof(wchar_t) * ((unsigned int)wcslen(key) + 1));
- DWORD valueIndex = (DWORD)targetjitOptions->AddBuffer((unsigned char*)value, sizeof(wchar_t) * ((unsigned int)wcslen(value) + 1));
+ DWORD keyIndex =
+ (DWORD)targetjitOptions->AddBuffer((unsigned char*)key, sizeof(wchar_t) * ((unsigned int)wcslen(key) + 1));
+ DWORD valueIndex =
+ (DWORD)targetjitOptions->AddBuffer((unsigned char*)value, sizeof(wchar_t) * ((unsigned int)wcslen(value) + 1));
targetjitOptions->Add(keyIndex, valueIndex);
delete[] key;
, applyDiff(false)
, parallel(false)
#if !defined(USE_MSVCDIS) && defined(USE_COREDISTOOLS)
- , useCoreDisTools(true) // if CoreDisTools is available (but MSVCDIS is not), use it.
+ , useCoreDisTools(true) // if CoreDisTools is available (but MSVCDIS is not), use it.
#else
- , useCoreDisTools(false) // Otherwise, use MSVCDIS if that is available (else no diffs are available).
+ , useCoreDisTools(false) // Otherwise, use MSVCDIS if that is available (else no diffs are available).
#endif
, skipCleanup(false)
, workerCount(-1)
static bool Parse(int argc, char* argv[], /* OUT */ Options* o);
- static bool AddJitOption(int& currArgument, int argc, char* argv[], LightWeightMap<DWORD, DWORD>** pJitOptions, LightWeightMap<DWORD, DWORD>** pForceJitOptions);
+ static bool AddJitOption(int& currArgument,
+ int argc,
+ char* argv[],
+ LightWeightMap<DWORD, DWORD>** pJitOptions,
+ LightWeightMap<DWORD, DWORD>** pForceJitOptions);
private:
static void DumpHelp(const char* program);
// This function returns the offset of the specified method in the
// vtable of it's owning class or interface.
-void MyICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
- unsigned* offsetOfIndirection, /* OUT */
- unsigned* offsetAfterIndirection,/* OUT */
- bool* isRelative /* OUT */
+void MyICJI::getMethodVTableOffset(CORINFO_METHOD_HANDLE method, /* IN */
+ unsigned* offsetOfIndirection, /* OUT */
+ unsigned* offsetAfterIndirection, /* OUT */
+ bool* isRelative /* OUT */
)
{
jitInstance->mc->cr->AddCall("getMethodVTableOffset");
return result;
}
-void MyICJI::expandRawHandleIntrinsic(
- CORINFO_RESOLVED_TOKEN * pResolvedToken,
- CORINFO_GENERICHANDLE_RESULT * pResult)
+void MyICJI::expandRawHandleIntrinsic(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_GENERICHANDLE_RESULT* pResult)
{
jitInstance->mc->cr->AddCall("expandRawHandleIntrinsic");
LogError("Hit unimplemented expandRawHandleIntrinsic");
CorInfoIsAccessAllowedResult MyICJI::canAccessClass(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_METHOD_HANDLE callerHandle,
CORINFO_HELPER_DESC* pAccessHelper /* If canAccessMethod returns
- something other than ALLOWED,
+ something other than
+ ALLOWED,
then this is filled in. */
)
{
void MyICJI::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
+ // jit allocated with allocateArray, EE frees
)
{
jitInstance->mc->cr->AddCall("setVars");
// if(level<=2)
// {
- //jitInstance->mc->cr->recMessageLog(fmt, args);
- //DebugBreakorAV(0x99);
+ // jitInstance->mc->cr->recMessageLog(fmt, args);
+ // DebugBreakorAV(0x99);
//}
jitInstance->mc->cr->recMessageLog(fmt, args);
return 0;
LPVOID* STDMETHODCALLTYPE MyIEE::TLS_GetDataBlock()
{
// We were previously allocating a TlsIndex with
- //the master slot index set to a nullptr
- //so in the new version we just return nullptr
- //and it seems to be working for now
+ // the master slot index set to a nullptr
+ // so in the new version we just return nullptr
+ // and it seems to be working for now
return nullptr;
}
//----------------------------------------------------------------------------
//
-// GetCurrentModuleFileName - Retrieve the current module's filename
+// GetCurrentModuleFileName - Retrieve the current module's filename
//
// Arguments:
// pBuffer - output string buffer
//----------------------------------------------------------------------------
//
-// IsCurrentModuleFileNameInAutoExclusionList - decide if the current module's filename
+// IsCurrentModuleFileNameInAutoExclusionList - decide if the current module's filename
// is in the AutoExclusionList list
//
// Arguments:
&valueSize);
// The OS's behavior is to consider Auto to be FALSE unless the first character is set
- // to 1. They don't take into consideration the following characters. Also if the value
+ // to 1. They don't take into consideration the following characters. Also if the value
// isn't present they assume an Auto value of FALSE.
if ((wzAutoKey[0] == L'1') && !IsCurrentModuleFileNameInAutoExclusionList())
{
if (forceValue != nullptr)
{
wchar_t* endPtr;
- result = static_cast<int>(wcstoul(forceValue, &endPtr, 16));
+ result = static_cast<int>(wcstoul(forceValue, &endPtr, 16));
bool succeeded = (errno != ERANGE) && (endPtr != forceValue);
if (succeeded)
{
const wchar_t* result = nullptr;
- // First check the force options, then mc value. If value is not presented there, probe the JIT options and then the environment.
+ // First check the force options, then mc value. If value is not presented there, probe the JIT options and then the
+ // environment.
result = jitInstance.getForceOption(key);
#ifndef _JITHOST
#define _JITHOST
-class JitHost final: public ICorJitHost
+class JitHost final : public ICorJitHost
{
public:
JitHost(JitInstance& jitInstance);
#include "errorhandling.h"
#include "spmiutil.h"
-JitInstance* JitInstance::InitJit(char* nameOfJit, bool breakOnAssert, SimpleTimer* st1, MethodContext* firstContext, LightWeightMap<DWORD, DWORD>* forceOptions, LightWeightMap<DWORD, DWORD>* options)
+JitInstance* JitInstance::InitJit(char* nameOfJit,
+ bool breakOnAssert,
+ SimpleTimer* st1,
+ MethodContext* firstContext,
+ LightWeightMap<DWORD, DWORD>* forceOptions,
+ LightWeightMap<DWORD, DWORD>* options)
{
JitInstance* jit = new JitInstance();
if (jit == nullptr)
char szTempFileName[MAX_PATH];
// Get an allocator instance
- //Note: we do this to keep cleanup somewhat simple...
+ // Note: we do this to keep cleanup somewhat simple...
ourHeap = ::HeapCreate(0, 0, 0);
if (ourHeap == nullptr)
{
{
if (pnjitStartup != nullptr)
{
- mc = firstContext;
+ mc = firstContext;
ICorJitHost* newHost = new JitHost(*this);
pnjitStartup(newHost);
delete static_cast<JitHost*>(jitHost);
ICorJitCompiler* pJitInstance;
// Allocate and initialize the jit provided
- static JitInstance* InitJit(char* nameOfJit, bool breakOnAssert, SimpleTimer* st1, MethodContext* firstContext, LightWeightMap<DWORD, DWORD>* forceOptions, LightWeightMap<DWORD, DWORD>* options);
+ static JitInstance* InitJit(char* nameOfJit,
+ bool breakOnAssert,
+ SimpleTimer* st1,
+ MethodContext* firstContext,
+ LightWeightMap<DWORD, DWORD>* forceOptions,
+ LightWeightMap<DWORD, DWORD>* options);
HRESULT StartUp(char* PathToJit, bool copyJit, bool breakOnDebugBreakorAV, MethodContext* firstContext);
bool reLoad(MethodContext* firstContext);
//
// Helper functions to print messages from CoreDisTools Library
-// The file/linenumber information is from this helper itself,
+// The file/linenumber information is from this helper itself,
// since we are only linking with the CoreDisTools library.
//
static void LogFromCoreDisToolsHelper(LogLevel level, const char* msg, va_list argList)
}
#define LOGGER(L) \
+ \
static void __cdecl CorDisToolsLog##L(const char* msg, ...) \
-{ \
- va_list argList; \
- va_start(argList, msg); \
- LogFromCoreDisToolsHelper(LOGLEVEL_##L, msg, argList); \
- va_end(argList); \
+ \
+{ \
+ va_list argList; \
+ va_start(argList, msg); \
+ LogFromCoreDisToolsHelper(LOGLEVEL_##L, msg, argList); \
+ va_end(argList); \
+ \
}
LOGGER(VERBOSE)
LOGGER(ERROR)
LOGGER(WARNING)
-const PrintControl CorPrinter = {CorDisToolsLogERROR, CorDisToolsLogWARNING, CorDisToolsLogVERBOSE, CorDisToolsLogVERBOSE};
+const PrintControl CorPrinter = {CorDisToolsLogERROR, CorDisToolsLogWARNING, CorDisToolsLogVERBOSE,
+ CorDisToolsLogVERBOSE};
#endif // USE_COREDISTOOLS
#ifdef USE_COREDISTOOLS
-NewDiffer_t* g_PtrNewDiffer = nullptr;
-FinishDiff_t* g_PtrFinishDiff = nullptr;
+NewDiffer_t* g_PtrNewDiffer = nullptr;
+FinishDiff_t* g_PtrFinishDiff = nullptr;
NearDiffCodeBlocks_t* g_PtrNearDiffCodeBlocks = nullptr;
-DumpDiffBlocks_t* g_PtrDumpDiffBlocks = nullptr;
+DumpDiffBlocks_t* g_PtrDumpDiffBlocks = nullptr;
#endif // USE_COREDISTOOLS
//
// The NearDiff Disassembler initialization.
-//
+//
// Returns true on success, false on failure.
//
bool NearDiffer::InitAsmDiff()
#ifdef USE_COREDISTOOLS
// static
bool __cdecl NearDiffer::CoreDisCompareOffsetsCallback(
- const void* payload, size_t blockOffset, size_t instrLen, uint64_t offset1, uint64_t offset2)
+ const void* payload, size_t blockOffset, size_t instrLen, uint64_t offset1, uint64_t offset2)
{
return compareOffsets(payload, blockOffset, instrLen, offset1, offset2);
}
//
// NearDiff Offset Comparator.
-// Determine whether two syntactically different constants are
+// Determine whether two syntactically different constants are
// semantically equivalent, using certain heuristics.
//
bool NearDiffer::compareOffsets(
(roOffset1a < data->datablockSize1)) // Confirm its an offset that fits inside our RoRegion
return true;
- // This case is written to catch IP-relative offsets to the RO data-section
+ // This case is written to catch IP-relative offsets to the RO data-section
// For example:
//
size_t roOffset1b = ipRelOffset1 - data->originalDataBlock1;
if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1) != (DWORD)-1)
{
// This logging is too noisy, so disable it.
- //LogVerbose("Found VSD callsite, did softer compare than ideal");
+ // LogVerbose("Found VSD callsite, did softer compare than ideal");
return true;
}
if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset1b) != (DWORD)-1)
{
// This logging is too noisy, so disable it.
- //LogVerbose("Found VSD callsite, did softer compare than ideal");
+ // LogVerbose("Found VSD callsite, did softer compare than ideal");
return true;
}
if (data->cr->CallTargetTypes->GetIndex((DWORDLONG)Offset2b) != (DWORD)-1)
{
// This logging is too noisy, so disable it.
- //LogVerbose("Found VSD callsite, did softer compare than ideal");
+ // LogVerbose("Found VSD callsite, did softer compare than ideal");
return true;
}
// Case might be a field address that we handed out to handle inlined values being loaded into
- //a register as an immediate value (and where the address is encoded as an indirect immediate load)
+ // a register as an immediate value (and where the address is encoded as an indirect immediate load)
size_t realTargetAddr = (size_t)data->cr->searchAddressMap((void*)gOffset2);
if (realTargetAddr == gOffset1)
return true;
// Case might be a field address that we handed out to handle inlined values being loaded into
- //a register as an immediate value (and where the address is encoded and loaded by immediate into a register)
+ // a register as an immediate value (and where the address is encoded and loaded by immediate into a register)
realTargetAddr = (size_t)data->cr->searchAddressMap((void*)offset2);
if (realTargetAddr == offset1)
return true;
if (UseCoreDisTools)
{
bool areSame = (*g_PtrNearDiffCodeBlocks)(corAsmDiff, &data, (const uint8_t*)originalBlock1, block1, blocksize1,
- (const uint8_t*)originalBlock2, block2, blocksize2);
+ (const uint8_t*)originalBlock2, block2, blocksize2);
if (!areSame)
{
(*g_PtrDumpDiffBlocks)(corAsmDiff, (const uint8_t*)originalBlock1, block1, blocksize1,
- (const uint8_t*)originalBlock2, block2, blocksize2);
+ (const uint8_t*)originalBlock2, block2, blocksize2);
}
return areSame;
if (haveSeenRet)
{
// This logging is pretty noisy, so disable it.
- //LogVerbose("instruction size of zero after seeing a ret (soft issue?).");
+ // LogVerbose("instruction size of zero after seeing a ret (soft issue?).");
break;
}
LogWarning("instruction size of zero.");
}
//
- // These are special.. we can often reason out exactly why these values
+ // These are special.. we can often reason out exactly why these values
// are different using heuristics.
//
// Why is Instruction size passed as zero?
// Ans: Because the implementation of areOffsetsEquivalent() uses
- // the instruction size to compute absolute offsets in the case of
- // PC-relative addressing, and MSVCDis already reports the
+ // the instruction size to compute absolute offsets in the case of
+ // PC-relative addressing, and MSVCDis already reports the
// absolute offsets! For example:
// 0F 2E 05 67 00 9A FD ucomiss xmm0, dword ptr[FFFFFFFFFD9A006Eh]
//
BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
{
// Since the child SuperPMI.exe processes share the same console
- //We don't need to kill them individually as they also receive the Ctrl-C
+ // We don't need to kill them individually as they also receive the Ctrl-C
closeRequested = true; // set a flag to indicate we need to quit
return TRUE;
// spmiArgs - pointer to the argument string
// optionName - the jitOption name, can include [force] flag.
//
-void addJitOptionArgument(LightWeightMap<DWORD, DWORD>* jitOptions, int &bytesWritten, char * spmiArgs, const char* optionName)
+void addJitOptionArgument(LightWeightMap<DWORD, DWORD>* jitOptions,
+ int& bytesWritten,
+ char* spmiArgs,
+ const char* optionName)
{
if (jitOptions != nullptr)
{
for (unsigned i = 0; i < jitOptions->GetCount(); i++)
{
- wchar_t* key = (wchar_t*)jitOptions->GetBuffer(jitOptions->GetKey(i));
+ wchar_t* key = (wchar_t*)jitOptions->GetBuffer(jitOptions->GetKey(i));
wchar_t* value = (wchar_t*)jitOptions->GetBuffer(jitOptions->GetItem(i));
- bytesWritten += sprintf_s(spmiArgs + bytesWritten, MAX_CMDLINE_SIZE - bytesWritten, " -%s %S=%S", optionName, key, value);
+ bytesWritten += sprintf_s(spmiArgs + bytesWritten, MAX_CMDLINE_SIZE - bytesWritten, " -%s %S=%S",
+ optionName, key, value);
}
}
}
o.workerCount = sysinfo.dwNumberOfProcessors;
// If we ever execute on a machine which has more than MAXIMUM_WAIT_OBJECTS(64) CPU cores
- //we still can't spawn more than the max supported by WaitForMultipleObjects()
+ // we still can't spawn more than the max supported by WaitForMultipleObjects()
if (o.workerCount > MAXIMUM_WAIT_OBJECTS)
o.workerCount = MAXIMUM_WAIT_OBJECTS;
}
int loaded = 0, jitted = 0, failed = 0, diffs = 0;
// Read the stderr files and log them as errors
- //Read the stdout files and parse them for counts and log any MISSING or ISSUE errors
+ // Read the stdout files and parse them for counts and log any MISSING or ISSUE errors
for (int i = 0; i < o.workerCount; i++)
{
ProcessChildStdErr(arrStdErrorPath[i]);
(*pParam->mc)->methodSize);
// This is a difference in ASM outputs from Jit1 & Jit2 and not a playback failure
- //We will add this MC to the diffMCList if one is requested
- //Otherwise this will end up in failingMCList
+ // We will add this MC to the diffMCList if one is requested
+ // Otherwise this will end up in failingMCList
if ((*pParam->o).diffMCLFilename != nullptr)
(*pParam->diffMCL).AddMethodToMCL((*pParam->reader)->GetMethodContextIndex());
else if ((*pParam->o).mclFilename != nullptr)
{
SpmiException e(¶m.exceptionPointers);
- LogError("main method %d of size %d failed to load and compile correctly.",
- (*reader)->GetMethodContextIndex(), (*mc)->methodSize);
+ LogError("main method %d of size %d failed to load and compile correctly.", (*reader)->GetMethodContextIndex(),
+ (*mc)->methodSize);
e.ShowAndDeleteMessage();
if ((*o).mclFilename != nullptr)
(*failingMCL).AddMethodToMCL((*reader)->GetMethodContextIndex());
if (o.nameOfJit2 != nullptr)
{
- jit2 = JitInstance::InitJit(o.nameOfJit2, o.breakOnAssert, &stInitJit, mc, o.forceJit2Options, o.jit2Options);
+ jit2 = JitInstance::InitJit(o.nameOfJit2, o.breakOnAssert, &stInitJit, mc, o.forceJit2Options,
+ o.jit2Options);
if (jit2 == nullptr)
{
// InitJit already printed a failure message