Add changes to emitMaxStackDepth and fgPtrArgCntMax to JitDump (#10130)
authorBruce Forstall <brucefo@microsoft.com>
Tue, 14 Mar 2017 00:42:39 +0000 (17:42 -0700)
committerGitHub <noreply@github.com>
Tue, 14 Mar 2017 00:42:39 +0000 (17:42 -0700)
It is useful to see when these are changing.

src/jit/codegencommon.cpp
src/jit/codegenlegacy.cpp
src/jit/emit.cpp
src/jit/emitxarch.cpp
src/jit/morph.cpp

index 35b92bc..90a9149 100644 (file)
@@ -7550,6 +7550,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed)
     //
     if (compiler->fgPtrArgCntMax < 1)
     {
+        JITDUMP("Upping fgPtrArgCntMax from %d to 1\n", compiler->fgPtrArgCntMax);
         compiler->fgPtrArgCntMax = 1;
     }
 #elif defined(_TARGET_ARM_)
@@ -7709,6 +7710,7 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper /*= CORINFO_HELP_PROF_FC
     //
     if (compiler->fgPtrArgCntMax < 1)
     {
+        JITDUMP("Upping fgPtrArgCntMax from %d to 1\n", compiler->fgPtrArgCntMax);
         compiler->fgPtrArgCntMax = 1;
     }
 
index 9f4b130..ff6c14b 100644 (file)
@@ -5195,6 +5195,7 @@ void CodeGen::genCodeForTreeLeaf_GT_JMP(GenTreePtr tree)
         //
         if (compiler->fgPtrArgCntMax < 1)
         {
+            JITDUMP("Upping fgPtrArgCntMax from %d to 1\n", compiler->fgPtrArgCntMax);
             compiler->fgPtrArgCntMax = 1;
         }
 
@@ -18507,6 +18508,7 @@ regMaskTP CodeGen::genCodeForCall(GenTreeCall* call, bool valUsed)
         //
         if (compiler->fgPtrArgCntMax < 1)
         {
+            JITDUMP("Upping fgPtrArgCntMax from %d to 1\n", compiler->fgPtrArgCntMax);
             compiler->fgPtrArgCntMax = 1;
         }
 
index 12ca9f5..6d08b52 100644 (file)
@@ -4419,7 +4419,10 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
 #if EMIT_TRACK_STACK_DEPTH
     /* Convert max. stack depth from # of bytes to # of entries */
 
-    emitMaxStackDepth /= sizeof(int);
+    unsigned maxStackDepthIn4ByteElements = emitMaxStackDepth / sizeof(int);
+    JITDUMP("Converting emitMaxStackDepth from bytes (%d) to elements (%d)\n", emitMaxStackDepth,
+            maxStackDepthIn4ByteElements);
+    emitMaxStackDepth = maxStackDepthIn4ByteElements;
 
     /* Should we use the simple stack */
 
index 7d3b615..9a2fd1e 100644 (file)
@@ -742,7 +742,10 @@ void emitter::emitMarkStackLvl(unsigned stackLevel)
     emitCurStackLvl = emitCurIG->igStkLvl = stackLevel;
 
     if (emitMaxStackDepth < emitCurStackLvl)
+    {
+        JITDUMP("Upping emitMaxStackDepth from %d to %d\n", emitMaxStackDepth, emitCurStackLvl);
         emitMaxStackDepth = emitCurStackLvl;
+    }
 }
 #endif
 
@@ -5137,7 +5140,10 @@ void emitter::emitAdjustStackDepthPushPop(instruction ins)
         emitCurStackLvl += emitCntStackDepth;
 
         if (emitMaxStackDepth < emitCurStackLvl)
+        {
+            JITDUMP("Upping emitMaxStackDepth from %d to %d\n", emitMaxStackDepth, emitCurStackLvl);
             emitMaxStackDepth = emitCurStackLvl;
+        }
     }
     else if (ins == INS_pop)
     {
@@ -5173,7 +5179,10 @@ void emitter::emitAdjustStackDepth(instruction ins, ssize_t val)
         emitCurStackLvl = newStackLvl.Value();
 
         if (emitMaxStackDepth < emitCurStackLvl)
+        {
+            JITDUMP("Upping emitMaxStackDepth from %d to %d\n", emitMaxStackDepth, emitCurStackLvl);
             emitMaxStackDepth = emitCurStackLvl;
+        }
     }
     else if (ins == INS_add)
     {
index 6051b56..96edb3b 100644 (file)
@@ -4328,6 +4328,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
 
     if (fgPtrArgCntMax < fgPtrArgCntCur)
     {
+        JITDUMP("Upping fgPtrArgCntMax from %d to %d\n", fgPtrArgCntMax, fgPtrArgCntCur);
         fgPtrArgCntMax = fgPtrArgCntCur;
     }
 
@@ -14572,7 +14573,10 @@ GenTreePtr Compiler::fgMorphToEmulatedFP(GenTreePtr tree)
         tree = fgMorphIntoHelperCall(tree, helper, args);
 
         if (fgPtrArgCntMax < fgPtrArgCntCur)
+        {
+            JITDUMP("Upping fgPtrArgCntMax from %d to %d\n", fgPtrArgCntMax, fgPtrArgCntCur);
             fgPtrArgCntMax = fgPtrArgCntCur;
+        }
 
         fgPtrArgCntCur -= argc;
         return tree;