Prefer UINT32 over DWORD in the IBC BlockCount API's
authorBrian Sullivan <briansul@microsoft.com>
Wed, 8 May 2019 18:08:09 +0000 (11:08 -0700)
committerBrian Sullivan <briansul@microsoft.com>
Wed, 8 May 2019 18:08:09 +0000 (11:08 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/e0256bf9c0ba9255a4a955876ff99704b5c1636c

16 files changed:
src/coreclr/src/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp
src/coreclr/src/inc/corbbtprof.h
src/coreclr/src/inc/corjit.h
src/coreclr/src/jit/ICorJitInfo_API_wrapper.hpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/vm/ceeload.cpp
src/coreclr/src/vm/jitinterface.cpp
src/coreclr/src/vm/jitinterface.h
src/coreclr/src/zap/zapinfo.cpp
src/coreclr/src/zap/zapinfo.h

index 52526fa..61d70a2 100644 (file)
@@ -1019,22 +1019,22 @@ void reportFatalError(CorJitResult result);
 /*
 struct BlockCounts  // Also defined here: code:CORBBTPROF_BLOCK_DATA
 {
-    ULONG ILOffset;
-    ULONG ExecutionCount;
+    UINT32 ILOffset;
+    UINT32 ExecutionCount;
 };
 */
 
 // allocate a basic block profile buffer where execution counts will be stored
 // for jitted basic blocks.
-HRESULT allocMethodBlockCounts(DWORD           count, // The number of basic blocks that we have
+HRESULT allocMethodBlockCounts(UINT32          count, // The number of basic blocks that we have
                                BlockCounts**   pBlockCounts);
 
 // get profile information to be used for optimizing the current method.  The format
 // of the buffer is the same as the format the JIT passes to allocMethodBlockCounts.
 HRESULT getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd,
-                             DWORD*            pCount, // The number of basic blocks that we have
+                             UINT32 *          pCount, // The number of basic blocks that we have
                              BlockCounts**     pBlockCounts,
-                             DWORD*            pNumRuns);
+                             UINT32 *          pNumRuns);
 
 // Associates a native call site, identified by its offset in the native code stream, with
 // the signature information and method handle the JIT used to lay out the call site. If
index a832cae..96e95d1 100644 (file)
@@ -5238,9 +5238,9 @@ DWORD MethodContext::repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, v
 }
 
 void MethodContext::recGetMethodBlockCounts(CORINFO_METHOD_HANDLE        ftnHnd,
-                                            DWORD*                       pCount,
+                                            UINT32 *                     pCount,
                                             ICorJitInfo::BlockCounts**   pBlockCounts,
-                                            DWORD*                       pNumRuns,
+                                            UINT32 *                     pNumRuns,
                                             HRESULT                      result)
 {
     if (GetMethodBlockCounts == nullptr)
@@ -5269,17 +5269,17 @@ void MethodContext::dmpGetMethodBlockCounts(DWORDLONG key, const Agnostic_GetMet
     printf(" numRuns-%u result-%u", value.numRuns, value.result);
 }
 HRESULT MethodContext::repGetMethodBlockCounts(CORINFO_METHOD_HANDLE        ftnHnd,
-                                               DWORD*                       pCount,
+                                               UINT32 *                     pCount,
                                                ICorJitInfo::BlockCounts**   pBlockCounts,
-                                               DWORD*                       pNumRuns)
+                                               UINT32 *                     pNumRuns)
 {
     Agnostic_GetMethodBlockCounts tempValue;
 
     tempValue = GetMethodBlockCounts->Get((DWORDLONG)ftnHnd);
 
-    *pCount        = (ULONG)tempValue.count;
+    *pCount        = (UINT32)tempValue.count;
     *pBlockCounts  = (ICorJitInfo::BlockCounts*)GetMethodBlockCounts->GetBuffer(tempValue.pBlockCounts_index);
-    *pNumRuns      = (ULONG)tempValue.numRuns;
+    *pNumRuns      = (UINT32)tempValue.numRuns;
     HRESULT result = (HRESULT)tempValue.result;
     return result;
 }
index d69ed71..c28a3f7 100644 (file)
@@ -1190,15 +1190,15 @@ public:
     DWORD repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection);
 
     void recGetMethodBlockCounts(CORINFO_METHOD_HANDLE        ftnHnd,
-                             DWORD*                       pCount,
-                             ICorJitInfo::BlockCounts**   pBlockCounts,
-                             DWORD*                       pNumRuns,
-                             HRESULT                      result);
+                                 UINT32 *                     pCount,
+                                 ICorJitInfo::BlockCounts**   pBlockCounts,
+                                 UINT32 *                     pNumRuns,
+                                 HRESULT                      result);
     void dmpGetMethodBlockCounts(DWORDLONG key, const Agnostic_GetMethodBlockCounts& value);
     HRESULT repGetMethodBlockCounts(CORINFO_METHOD_HANDLE        ftnHnd,
-                                DWORD*                       pCount,
-                                ICorJitInfo::BlockCounts**   pBlockCounts,
-                                DWORD*                       pNumRuns);
+                                    UINT32 *                     pCount,
+                                    ICorJitInfo::BlockCounts**   pBlockCounts,
+                                    UINT32 *                     pNumRuns);
 
     void recMergeClasses(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2, CORINFO_CLASS_HANDLE result);
     void dmpMergeClasses(DLDL key, DWORDLONG value);
index 794bb3a..0d41b10 100644 (file)
@@ -2117,7 +2117,7 @@ void interceptor_ICJI::reportFatalError(CorJitResult result)
 
 // allocate a basic block profile buffer where execution counts will be stored
 // for jitted basic blocks.
-HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The number of basic blocks that we have
+HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32          count, // The number of basic blocks that we have
                                                  BlockCounts**   pBlockCounts)
 {
     mc->cr->AddCall("allocMethodBlockCounts");
@@ -2129,9 +2129,9 @@ HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The n
 // get profile information to be used for optimizing the current method.  The format
 // of the buffer is the same as the format the JIT passes to allocMethodBlockCounts.
 HRESULT interceptor_ICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd,
-                                               DWORD*                pCount, // The number of basic blocks that we have
+                                               UINT32 *              pCount, // The number of basic blocks that we have
                                                BlockCounts**         pBlockCounts,
-                                               DWORD*                pNumRuns)
+                                               UINT32 *              pNumRuns)
 {
     mc->cr->AddCall("getMethodBlockCounts");
     HRESULT temp = original_ICorJitInfo->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns);
index 94f4385..587aeec 100644 (file)
@@ -1673,14 +1673,14 @@ void interceptor_ICJI::reportFatalError(CorJitResult result)
 /*
 struct BlockCounts  // Also defined here: code:CORBBTPROF_BLOCK_DATA
 {
-    ULONG ILOffset;
-    ULONG ExecutionCount;
+    UINT32 ILOffset;
+    UINT32 ExecutionCount;
 };
 */
 
 // allocate a basic block profile buffer where execution counts will be stored
 // for jitted basic blocks.
-HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The number of basic blocks that we have
+HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32          count, // The number of basic blocks that we have
                                                  BlockCounts**   pBlockCounts)
 {
     mcs->AddCall("allocMethodBlockCounts");
@@ -1690,9 +1690,9 @@ HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The n
 // get profile information to be used for optimizing the current method.  The format
 // of the buffer is the same as the format the JIT passes to allocMethodBlockCounts.
 HRESULT interceptor_ICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd,
-                                               DWORD*                pCount, // The number of basic blocks that we have
+                                               UINT32 *              pCount, // The number of basic blocks that we have
                                                BlockCounts**         pBlockCounts,
-                                               DWORD*                pNumRuns)
+                                               UINT32 *              pNumRuns)
 {
     mcs->AddCall("getMethodBlockCounts");
     return original_ICorJitInfo->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns);
index 95cc39e..e33d9e6 100644 (file)
@@ -1497,7 +1497,7 @@ void interceptor_ICJI::reportFatalError(CorJitResult result)
 
 // allocate a basic block profile buffer where execution counts will be stored
 // for jitted basic blocks.
-HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The number of basic blocks that we have
+HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32          count, // The number of basic blocks that we have
                                                  BlockCounts**   pBlockCounts)
 {
     return original_ICorJitInfo->allocMethodBlockCounts(count, pBlockCounts);
@@ -1506,9 +1506,9 @@ HRESULT interceptor_ICJI::allocMethodBlockCounts(DWORD           count, // The n
 // get profile information to be used for optimizing the current method.  The format
 // of the buffer is the same as the format the JIT passes to allocMethodBlockCounts.
 HRESULT interceptor_ICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd,
-                                               DWORD*                pCount, // The number of basic blocks that we have
+                                               UINT32 *              pCount, // The number of basic blocks that we have
                                                BlockCounts**         pBlockCounts,
-                                               DWORD*                pNumRuns)
+                                               UINT32 *              pNumRuns)
 {
     return original_ICorJitInfo->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns);
 }
index 168c51a..2ced2d8 100644 (file)
@@ -1810,7 +1810,7 @@ void MyICJI::reportFatalError(CorJitResult result)
 
 // allocate a basic block profile buffer where execution counts will be stored
 // for jitted basic blocks.
-HRESULT MyICJI::allocMethodBlockCounts(DWORD           count, // The number of basic blocks that we have
+HRESULT MyICJI::allocMethodBlockCounts(UINT32          count, // The number of basic blocks that we have
                                        BlockCounts**   pBlockCounts)
 {
     jitInstance->mc->cr->AddCall("allocMethodBlockCounts");
@@ -1820,9 +1820,9 @@ HRESULT MyICJI::allocMethodBlockCounts(DWORD           count, // The number of b
 // get profile information to be used for optimizing the current method.  The format
 // of the buffer is the same as the format the JIT passes to allocMethodBlockCounts.
 HRESULT MyICJI::getMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd,
-                                     DWORD*                pCount, // The number of basic blocks that we have
+                                     UINT32 *              pCount, // The number of basic blocks that we have
                                      BlockCounts**         pBlockCounts,
-                                     DWORD*                pNumRuns)
+                                     UINT32 *              pNumRuns)
 {
     jitInstance->mc->cr->AddCall("getMethodBlockCounts");
     return jitInstance->mc->repGetMethodBlockCounts(ftnHnd, pCount, pBlockCounts, pNumRuns);
index 0cbf626..f7258c1 100644 (file)
@@ -404,8 +404,8 @@ struct CORBBTPROF_METHOD_BLOCK_COUNTS_SECTION_HEADER
 
 struct CORBBTPROF_BLOCK_DATA    // This struct is also defined by:  ICorJitInfo.BlockCounts
 {
-    DWORD                          ILOffset;
-    DWORD                          ExecutionCount;
+    UINT32                         ILOffset;
+    UINT32                         ExecutionCount;
 };
 
 struct CORBBTPROF_METHOD_DETAIL_HEADER
index f14fb34..20ff2b3 100644 (file)
@@ -391,14 +391,14 @@ public:
 
     struct BlockCounts  // Also defined by:  CORBBTPROF_BLOCK_DATA
     {
-        ULONG ILOffset;
-        ULONG ExecutionCount;
+        UINT32 ILOffset;
+        UINT32 ExecutionCount;
     };
 
     // allocate a basic block profile buffer where execution counts will be stored
     // for jitted basic blocks.
     virtual HRESULT allocMethodBlockCounts (
-            DWORD                 count,           // The number of basic blocks that we have
+            UINT32                count,           // The number of basic blocks that we have
             BlockCounts **        pBlockCounts     // pointer to array of <ILOffset, ExecutionCount> tuples
             ) = 0;
 
@@ -406,9 +406,9 @@ public:
     // of the buffer is the same as the format the JIT passes to allocBBProfileBuffer.
     virtual HRESULT getMethodBlockCounts(
             CORINFO_METHOD_HANDLE ftnHnd,
-            DWORD *               pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
+            UINT32 *              pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
             BlockCounts **        pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-            DWORD *               pNumRuns         // pointer to the total number of profile scenarios run
+            UINT32 *              pNumRuns         // pointer to the total number of profile scenarios run
             ) = 0;
 
     // Associates a native call site, identified by its offset in the native code stream, with
index 75bd020..496fdba 100644 (file)
@@ -1591,7 +1591,7 @@ void WrapICorJitInfo::reportFatalError(CorJitResult result)
 }
 
 HRESULT WrapICorJitInfo::allocMethodBlockCounts(
-        DWORD count,
+        UINT32 count,
         BlockCounts **pBlockCounts)
 {
     API_ENTER(allocMethodBlockCounts);
@@ -1602,9 +1602,9 @@ HRESULT WrapICorJitInfo::allocMethodBlockCounts(
 
 HRESULT WrapICorJitInfo::getMethodBlockCounts(
         CORINFO_METHOD_HANDLE ftnHnd,
-        DWORD *pCount,
+        UINT32 *pCount,
         BlockCounts **pBlockCounts,
-        DWORD *numRuns)
+        UINT32 *numRuns)
 {
     API_ENTER(getMethodBlockCounts);
     HRESULT temp = wrapHnd->getMethodBlockCounts(ftnHnd, pCount, pBlockCounts, numRuns);
index 3cc1350..bf71502 100644 (file)
@@ -5325,8 +5325,8 @@ protected:
 
     bool                      fgProfileData_ILSizeMismatch;
     ICorJitInfo::BlockCounts* fgBlockCounts;
-    DWORD                     fgBlockCountsCount;
-    DWORD                     fgNumProfileRuns;
+    UINT32                    fgBlockCountsCount;
+    UINT32                    fgNumProfileRuns;
 
     unsigned fgStressBBProf()
     {
index ca5975f..78b9e68 100644 (file)
@@ -11923,7 +11923,7 @@ static void ProfileDataAllocateMethodBlockCounts(ProfileEmitter * pEmitter, CORC
         }
         
         // Reset all of the basic block counts to zero
-        for (DWORD i=0; (i <  pInfo->method.cBlock); i++ )
+        for (UINT32 i=0; (i <  pInfo->method.cBlock); i++ )
         {
             //
             // If methodWasExecuted is false then every block's ExecutionCount should also be zero
index 4d0c7da..60369a9 100644 (file)
@@ -11914,7 +11914,7 @@ void* CEEJitInfo::getMethodSync(CORINFO_METHOD_HANDLE ftnHnd,
 
 /*********************************************************************/
 HRESULT CEEJitInfo::allocMethodBlockCounts (
-    DWORD                         count,           // count of <ILOffset, ExecutionCount> tuples
+    UINT32                        count,           // count of <ILOffset, ExecutionCount> tuples
     ICorJitInfo::BlockCounts **   pBlockCounts     // pointer to array of <ILOffset, ExecutionCount> tuples
     )
 {
@@ -11963,9 +11963,9 @@ HRESULT CEEJitInfo::allocMethodBlockCounts (
 // to use profile info in codegen for non zapped images.
 HRESULT CEEJitInfo::getMethodBlockCounts (
     CORINFO_METHOD_HANDLE         ftnHnd,
-    DWORD *                       pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
+    UINT32 *                      pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
     ICorJitInfo::BlockCounts **   pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-    DWORD *                       pNumRuns
+    UINT32 *                      pNumRuns
     )
 {
     LIMITED_METHOD_CONTRACT;
@@ -13988,7 +13988,7 @@ void* CEEInfo::getMethodSync(CORINFO_METHOD_HANDLE ftnHnd,
 }
 
 HRESULT CEEInfo::allocMethodBlockCounts (
-        DWORD                 count,           // the count of <ILOffset, ExecutionCount> tuples
+        UINT32                count,           // the count of <ILOffset, ExecutionCount> tuples
         BlockCounts **        pBlockCounts     // pointer to array of <ILOffset, ExecutionCount> tuples
         )
 {
@@ -13998,9 +13998,9 @@ HRESULT CEEInfo::allocMethodBlockCounts (
 
 HRESULT CEEInfo::getMethodBlockCounts(
         CORINFO_METHOD_HANDLE ftnHnd,
-        DWORD *               pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
+        UINT32 *              pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
         BlockCounts **        pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-        DWORD *               pNumRuns
+        UINT32 *              pNumRuns
         )
 {
     LIMITED_METHOD_CONTRACT;
index 02ea15b..11b0b7f 100644 (file)
@@ -1089,15 +1089,15 @@ public:
                             CORINFO_METHOD_HANDLE methodHnd);
 
     HRESULT allocMethodBlockCounts (
-            DWORD                 count,           // the count of <ILOffset, ExecutionCount> tuples
+            UINT32                count,           // the count of <ILOffset, ExecutionCount> tuples
             BlockCounts **        pBlockCounts     // pointer to array of <ILOffset, ExecutionCount> tuples
             );
 
     HRESULT getMethodBlockCounts(
             CORINFO_METHOD_HANDLE ftnHnd,
-            DWORD *               pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
+            UINT32 *              pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
             BlockCounts **        pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-            DWORD *               pNumRuns
+            UINT32 *              pNumRuns
             );
 
     void recordCallSite(
@@ -1296,15 +1296,15 @@ public:
 
 
     HRESULT allocMethodBlockCounts (
-        DWORD                         count,         // the count of <ILOffset, ExecutionCount> tuples
+        UINT32                        count,         // the count of <ILOffset, ExecutionCount> tuples
         ICorJitInfo::BlockCounts **   pBlockCounts   // pointer to array of <ILOffset, ExecutionCount> tuples
     );
 
     HRESULT getMethodBlockCounts(
         CORINFO_METHOD_HANDLE         ftnHnd,
-        DWORD *               pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
-        BlockCounts **        pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-        DWORD *               pNumRuns
+        UINT32 *                      pCount,        // pointer to the count of <ILOffset, ExecutionCount> tuples
+        BlockCounts **                pBlockCounts,  // pointer to array of <ILOffset, ExecutionCount> tuples
+        UINT32 *                      pNumRuns
     );
 
     void recordCallSite(
index d487b1e..6d66a56 100644 (file)
@@ -877,7 +877,7 @@ bool ZapInfo::runWithErrorTrap(void (*function)(void*), void* param)
 }
 
 HRESULT ZapInfo::allocMethodBlockCounts (
-    DWORD                         count,           // the count of <ILOffset, ExecutionCount> tuples
+    UINT32                        count,           // the count of <ILOffset, ExecutionCount> tuples
     ICorJitInfo::BlockCounts **   pBlockCounts     // pointer to array of <ILOffset, ExecutionCount> tuples
     )
 {
@@ -937,9 +937,9 @@ HRESULT ZapInfo::allocMethodBlockCounts (
 
 HRESULT ZapInfo::getMethodBlockCounts (
     CORINFO_METHOD_HANDLE ftnHnd,
-    DWORD *               pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
+    UINT32 *              pCount,          // pointer to the count of <ILOffset, ExecutionCount> tuples
     BlockCounts **        pBlockCounts,    // pointer to array of <ILOffset, ExecutionCount> tuples
-    DWORD *               pNumRuns
+    UINT32 *              pNumRuns
     )
 {
     _ASSERTE(pBlockCounts != nullptr);
@@ -4026,7 +4026,7 @@ template<> void LoadTable<CORINFO_METHOD_HANDLE>::EmitLoadFixups(CORINFO_METHOD_
 BOOL ZapInfo::CurrentMethodHasProfileData()
 {
     WRAPPER_NO_CONTRACT;
-    DWORD size;
+    UINT32 size;
     ICorJitInfo::BlockCounts * pBlockCounts;
     return SUCCEEDED(getMethodBlockCounts(m_currentMethodHandle, &size, &pBlockCounts, NULL));
 }
index 435c89a..112bf0d 100644 (file)
@@ -308,14 +308,14 @@ public:
     void reportFatalError(CorJitResult result);
 
     HRESULT allocMethodBlockCounts (
-            DWORD count,
+            UINT32 count,
             ICorJitInfo::BlockCounts ** pBlockCounts);
 
     HRESULT getMethodBlockCounts (
             CORINFO_METHOD_HANDLE ftnHnd,
-            DWORD * pCount,
+            UINT32 * pCount,
             ICorJitInfo::BlockCounts ** pBlockCounts,
-            DWORD * pNumRuns);
+            UINT32 * pNumRuns);
 
     DWORD getJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes);