format spmi sources. (#14545)
authorSergey Andreenko <seandree@microsoft.com>
Wed, 18 Oct 2017 00:12:24 +0000 (17:12 -0700)
committerGitHub <noreply@github.com>
Wed, 18 Oct 2017 00:12:24 +0000 (17:12 -0700)
format spmi sources.

28 files changed:
src/ToolBox/superpmi/superpmi-shared/coreclrcommoncallbacks.h
src/ToolBox/superpmi/superpmi-shared/errorhandling.h
src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
src/ToolBox/superpmi/superpmi-shared/lwmlist.h
src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
src/ToolBox/superpmi/superpmi-shared/methodcontext.h
src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp
src/ToolBox/superpmi/superpmi-shared/spmirecordhelper.h
src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp
src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.h
src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.h
src/ToolBox/superpmi/superpmi-shim-counter/methodcallsummarizer.cpp
src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.h
src/ToolBox/superpmi/superpmi/commandline.cpp
src/ToolBox/superpmi/superpmi/commandline.h
src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
src/ToolBox/superpmi/superpmi/iexecutionengine.cpp
src/ToolBox/superpmi/superpmi/jitdebugger.cpp
src/ToolBox/superpmi/superpmi/jithost.cpp
src/ToolBox/superpmi/superpmi/jithost.h
src/ToolBox/superpmi/superpmi/jitinstance.cpp
src/ToolBox/superpmi/superpmi/jitinstance.h
src/ToolBox/superpmi/superpmi/neardiffer.cpp
src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp
src/ToolBox/superpmi/superpmi/superpmi.cpp

index 254981c..98c44c5 100644 (file)
@@ -14,7 +14,7 @@ LPVOID STDMETHODCALLTYPE EEHeapAllocInProcessHeap(DWORD dwFlags, SIZE_T dwBytes)
 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
index 8c0cadd..bd4a899 100644 (file)
@@ -11,7 +11,7 @@
 
 #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
index aae6cd8..64a9619 100644 (file)
@@ -15,6 +15,8 @@
 // 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:
 /**********************************************************************************/
 //
index 1bca259..b2f69af 100644 (file)
@@ -71,7 +71,7 @@ LWM(GetClassName, DWORDLONG, DWORD)
 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)
index 4828a47..0ee17c9 100644 (file)
@@ -1029,9 +1029,10 @@ const char* MethodContext::repGetMethodName(CORINFO_METHOD_HANDLE ftn, const cha
     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>();
@@ -1063,15 +1064,18 @@ void MethodContext::recGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftn,
 
 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;
@@ -1092,16 +1096,16 @@ const char* MethodContext::repGetMethodNameFromMetadata(CORINFO_METHOD_HANDLE ft
     }
     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);
         }
     }
@@ -1465,7 +1469,8 @@ void MethodContext::repGetCallInfo(CORINFO_RESOLVED_TOKEN* pResolvedToken,
         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];
     }
@@ -5289,7 +5294,9 @@ BOOL MethodContext::repAreTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLA
     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>();
@@ -5322,7 +5329,9 @@ TypeCompareState MethodContext::repCompareTypesForCast(CORINFO_CLASS_HANDLE from
     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>();
@@ -6075,12 +6084,12 @@ bool MethodContext::wasEnviromentChanged()
         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;
index 9cc8f02..ce62aa1 100644 (file)
@@ -617,9 +617,14 @@ public:
     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);
@@ -876,7 +881,6 @@ public:
     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);
@@ -1251,7 +1255,7 @@ public:
     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;
@@ -1363,7 +1367,7 @@ enum mcPackets
     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,
index 8d1930f..beadcff 100644 (file)
@@ -110,9 +110,8 @@ MethodContextReader::MethodContextReader(
         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);
@@ -308,7 +307,7 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
     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)
@@ -324,7 +323,7 @@ MethodContextBuffer MethodContextReader::GetNextMethodContextFromHash()
     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
@@ -336,7 +335,7 @@ 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
+            // this will get freed up by MethodContext constructor
             unsigned char* buff = new unsigned char[mcb.size + 2];
             memcpy(buff, mcb.buff, mcb.size + 2);
 
@@ -466,7 +465,7 @@ MethodContextBuffer MethodContextReader::GetSpecificMethodContext(unsigned int m
         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;
index c3988f8..40fcd46 100644 (file)
@@ -291,12 +291,12 @@ inline MethodContext::Agnostic_CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::StoreAg
 {
     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];
@@ -307,12 +307,12 @@ inline CORINFO_RUNTIME_LOOKUP SpmiRecordsHelper::RestoreCORINFO_RUNTIME_LOOKUP(
     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];
index 19f9638..13254dc 100644 (file)
@@ -38,7 +38,7 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo*
     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);
index af3e8c9..1c7c0cb 100644 (file)
@@ -76,22 +76,25 @@ bool interceptor_ICJI::getMethodInfo(CORINFO_METHOD_HANDLE ftn, /* IN  */
     param.info  = info;
     param.temp  = false;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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
@@ -122,23 +125,26 @@ CorInfoInline interceptor_ICJI::canInline(CORINFO_METHOD_HANDLE callerHnd,    /*
     param.pRestrictions = pRestrictions;
     param.temp          = INLINE_NEVER;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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
@@ -212,10 +218,10 @@ CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE me
 
 // 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");
@@ -246,9 +252,8 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass(CORINFO_C
     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);
@@ -398,20 +403,23 @@ void interceptor_ICJI::resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN* pResol
     param.pThis          = this;
     param.pResolvedToken = pResolvedToken;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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)
@@ -1107,7 +1115,7 @@ void interceptor_ICJI::getBoundaries(CORINFO_METHOD_HANDLE ftn,        // [IN] m
 // 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.
@@ -1144,7 +1152,7 @@ void interceptor_ICJI::getVars(CORINFO_METHOD_HANDLE      ftn,   // [IN]  method
 // 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
@@ -1221,26 +1229,30 @@ CorInfoTypeWithMod interceptor_ICJI::getArgType(CORINFO_SIG_INFO*       sig,
     param.vcTypeRet = vcTypeRet;
     param.temp      = (CorInfoTypeWithMod)CORINFO_TYPE_UNDEF;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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
@@ -1260,25 +1272,28 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getArgClass(CORINFO_SIG_INFO*       sig,
     param.args  = args;
     param.temp  = 0;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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
@@ -1399,7 +1414,7 @@ const char* interceptor_ICJI::getMethodName(CORINFO_METHOD_HANDLE ftn,       /*
 
 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");
@@ -1683,22 +1698,25 @@ void interceptor_ICJI::getCallInfo(
     param.flags                     = flags;
     param.pResult                   = pResult;
 
-    PAL_TRY(Param*, pOuterParam,
-            &param){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, &param)
+    {
+        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)
index b582866..af2c866 100644 (file)
@@ -20,7 +20,7 @@ private:
 
 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;
 };
index dd047e8..1e7ee24 100644 (file)
@@ -143,10 +143,10 @@ CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE me
 
 // 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");
@@ -171,9 +171,8 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass(CORINFO_C
     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);
index ce269cc..f4c13ee 100644 (file)
@@ -17,7 +17,7 @@ class interceptor_ICJI : public ICorJitInfo
 
 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;
 };
index e22c060..423007a 100644 (file)
@@ -75,7 +75,8 @@ MethodCallSummarizer::MethodCallSummarizer(WCHAR* logPath)
 }
 
 // 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)
 {
index cc384f3..bf3d648 100644 (file)
@@ -132,10 +132,10 @@ CORINFO_MODULE_HANDLE interceptor_ICJI::getMethodModule(CORINFO_METHOD_HANDLE me
 
 // 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);
@@ -157,9 +157,8 @@ CORINFO_CLASS_HANDLE interceptor_ICJI::getDefaultEqualityComparerClass(CORINFO_C
     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);
 }
index 01ccbe6..4d01de9 100644 (file)
@@ -16,7 +16,7 @@ class interceptor_ICJI : public ICorJitInfo
 
 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;
 };
 
index 5394cf2..78af8cb 100644 (file)
@@ -121,11 +121,13 @@ void CommandLine::DumpHelp(const char* program)
     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");
@@ -149,7 +151,7 @@ void CommandLine::DumpHelp(const char* program)
     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];
 
@@ -167,14 +169,14 @@ static bool ParseJitOption(const char* optionString, wchar_t** key, wchar_t **va
     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;
 }
@@ -530,12 +532,11 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o)
             }
             else if (_strnicmp(&argv[i][1], "jit2option", argLen) == 0)
             {
-                i++;                
+                i++;
                 if (!AddJitOption(i, argc, argv, &o->jit2Options, &o->forceJit2Options))
                 {
                     return false;
                 }
-
             }
             else
             {
@@ -545,7 +546,7 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o)
             }
         }
         // 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], '.');
@@ -620,7 +621,11 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o)
 //
 // 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)
     {
@@ -630,7 +635,6 @@ bool CommandLine::AddJitOption(int& currArgument, int argc, char* argv[], LightW
 
     LightWeightMap<DWORD, DWORD>* targetjitOptions = nullptr;
 
-
     if (_strnicmp(argv[currArgument], "force", strlen(argv[currArgument])) == 0)
     {
         if (*pForceJitOptions == nullptr)
@@ -657,8 +661,10 @@ bool CommandLine::AddJitOption(int& currArgument, int argc, char* argv[], LightW
         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;
index cf9d79c..3d6cb88 100644 (file)
@@ -26,9 +26,9 @@ public:
             , 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)
@@ -79,7 +79,11 @@ public:
 
     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);
index e16903b..c53c779 100644 (file)
@@ -163,10 +163,10 @@ CORINFO_MODULE_HANDLE MyICJI::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 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");
@@ -194,9 +194,7 @@ CORINFO_CLASS_HANDLE MyICJI::getDefaultEqualityComparerClass(CORINFO_CLASS_HANDL
     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");
@@ -834,7 +832,8 @@ void* MyICJI::getArrayInitializationData(CORINFO_FIELD_HANDLE field, DWORD size)
 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. */
                                                     )
 {
@@ -1007,7 +1006,7 @@ void MyICJI::getVars(CORINFO_METHOD_HANDLE      ftn,   // [IN]  method of intere
 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");
@@ -1700,8 +1699,8 @@ BOOL MyICJI::logMsg(unsigned level, const char* fmt, va_list args)
 
     //  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;
index 7a39734..8a82406 100644 (file)
@@ -48,9 +48,9 @@ VOID STDMETHODCALLTYPE MyIEE::TLS_AssociateCallback(DWORD slot, PTLS_CALLBACK_FU
 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;
 }
 
index b4b4ede..8003864 100644 (file)
@@ -124,7 +124,7 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, LPCWSTR szKey, LPCWSTR szName, long*
 
 //----------------------------------------------------------------------------
 //
-// GetCurrentModuleFileName - Retrieve the current module's filename 
+// GetCurrentModuleFileName - Retrieve the current module's filename
 //
 // Arguments:
 //    pBuffer - output string buffer
@@ -174,7 +174,7 @@ HRESULT GetCurrentModuleFileName(__out_ecount(*pcchBuffer) LPWSTR pBuffer, __ino
 
 //----------------------------------------------------------------------------
 //
-// IsCurrentModuleFileNameInAutoExclusionList - decide if the current module's filename 
+// IsCurrentModuleFileNameInAutoExclusionList - decide if the current module's filename
 //                                              is in the AutoExclusionList list
 //
 // Arguments:
@@ -347,7 +347,7 @@ HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString,
                                  &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())
                 {
index f92c6f4..1b9b9a3 100644 (file)
@@ -72,7 +72,7 @@ int JitHost::getIntConfigValue(const wchar_t* key, int defaultValue)
     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)
         {
@@ -127,7 +127,8 @@ const wchar_t* JitHost::getStringConfigValue(const wchar_t* key)
 
     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);
 
index 9e31e43..6391fc1 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _JITHOST
 #define _JITHOST
 
-class JitHost final: public ICorJitHost
+class JitHost final : public ICorJitHost
 {
 public:
     JitHost(JitInstance& jitInstance);
index 37cb54d..52f2b90 100644 (file)
 #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)
@@ -58,7 +63,7 @@ HRESULT JitInstance::StartUp(char*          PathToJit,
     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)
     {
@@ -465,7 +470,7 @@ bool JitInstance::resetConfig(MethodContext* firstContext)
 {
     if (pnjitStartup != nullptr)
     {
-        mc = firstContext;
+        mc                   = firstContext;
         ICorJitHost* newHost = new JitHost(*this);
         pnjitStartup(newHost);
         delete static_cast<JitHost*>(jitHost);
index 1172b9c..eeb2ff7 100644 (file)
@@ -44,7 +44,12 @@ public:
     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);
index d31a406..627e43a 100644 (file)
@@ -20,7 +20,7 @@
 
 //
 // 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)
@@ -29,32 +29,36 @@ static void LogFromCoreDisToolsHelper(LogLevel level, const char* msg, va_list a
 }
 
 #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()
@@ -106,7 +110,7 @@ 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);
 }
@@ -265,7 +269,7 @@ struct DiffData
 
 //
 // 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(
@@ -297,7 +301,7 @@ 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;
@@ -329,7 +333,7 @@ bool NearDiffer::compareOffsets(
     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;
     }
 
@@ -339,24 +343,24 @@ bool NearDiffer::compareOffsets(
     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;
@@ -455,12 +459,12 @@ bool NearDiffer::compareCodeSection(MethodContext* mc,
     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;
@@ -507,7 +511,7 @@ bool NearDiffer::compareCodeSection(MethodContext* mc,
             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.");
@@ -604,13 +608,13 @@ bool NearDiffer::compareCodeSection(MethodContext* mc,
                 }
 
                 //
-                // 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]
                 //
index f4c305d..596f1b6 100644 (file)
@@ -282,7 +282,7 @@ Cleanup:
 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;
@@ -334,15 +334,19 @@ void MergeWorkerMCLs(char* mclFilename, char** arrWorkerMCLPath, int workerCount
 //    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);
         }
     }
 }
@@ -432,7 +436,7 @@ int doParallelSuperPMI(CommandLine::Options& o)
         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;
     }
@@ -583,7 +587,7 @@ int doParallelSuperPMI(CommandLine::Options& o)
         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]);
index 89f1d58..b844d58 100644 (file)
@@ -95,8 +95,8 @@ void InvokeNearDiffer(NearDiffer*           nearDiffer,
                      (*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)
@@ -107,8 +107,8 @@ void InvokeNearDiffer(NearDiffer*           nearDiffer,
     {
         SpmiException e(&param.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());
@@ -296,7 +296,8 @@ int __cdecl main(int argc, char* argv[])
 
             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