@@ -356,13 +356,14 @@ InlineContext::InlineContext(InlineStrategy* strategy)
356356//
357357// Arguments:
358358// indent - indentation level for this node
359+ // verbose - more verbose output if true
359360
360- void InlineContext::Dump (unsigned indent)
361+ void InlineContext::Dump (bool verbose, unsigned indent)
361362{
362363 // Handle fact that siblings are in reverse order.
363364 if (m_Sibling != nullptr )
364365 {
365- m_Sibling->Dump (indent);
366+ m_Sibling->Dump (verbose, indent);
366367 }
367368
368369 // We may not know callee name in some of the failing cases
@@ -391,35 +392,52 @@ void InlineContext::Dump(unsigned indent)
391392 {
392393 // Root method
393394 InlinePolicy* policy = InlinePolicy::GetPolicy (compiler, true );
394- printf (" Inlines into %08X [via %s] %s\n " , calleeToken, policy->GetName (), calleeName);
395+
396+ if (verbose)
397+ {
398+ printf (" \n Inlines into %08X [via %s] %s:\n " , calleeToken, policy->GetName (), calleeName);
399+ }
400+ else
401+ {
402+ printf (" \n Inlines into %s:\n " , calleeName);
403+ }
395404 }
396405 else
397406 {
398407 // Inline attempt.
399408 const char * inlineTarget = InlGetTargetString (m_Observation);
400409 const char * inlineReason = InlGetObservationString (m_Observation);
401- const char * inlineResult = m_Success ? " " : " FAILED: " ;
402- const char * devirtualized = m_Devirtualized ? " devirt " : " " ;
403- const char * guarded = m_Guarded ? " guarded " : " " ;
404- const char * unboxed = m_Unboxed ? " unboxed " : " " ;
410+ const char * inlineResult = m_Success ? " INLINED: " : " FAILED: " ;
411+ const char * devirtualized = m_Devirtualized ? " DEVIRT " : " " ;
412+ const char * guarded = m_Guarded ? " GUARDED " : " " ;
413+ const char * unboxed = m_Unboxed ? " UNBOXED " : " " ;
405414
406- if (m_Offset == BAD_IL_OFFSET )
415+ if (verbose )
407416 {
408- printf (" %*s[%u IL=???? TR=%06u %08X] [%s%s: %s%s%s%s] %s\n " , indent, " " , m_Ordinal, m_TreeID, calleeToken,
409- inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, calleeName);
417+ if (m_Offset == BAD_IL_OFFSET)
418+ {
419+ printf (" %*s[%u IL=???? TR=%06u %08X] [%s%s: %s%s%s%s] %s\n " , indent, " " , m_Ordinal, m_TreeID,
420+ calleeToken, inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed,
421+ calleeName);
422+ }
423+ else
424+ {
425+ printf (" %*s[%u IL=%04d TR=%06u %08X] [%s%s: %s%s%s%s] %s\n " , indent, " " , m_Ordinal,
426+ jitGetILoffs (m_Offset), m_TreeID, calleeToken, inlineResult, inlineTarget, inlineReason, guarded,
427+ devirtualized, unboxed, calleeName);
428+ }
410429 }
411430 else
412431 {
413- IL_OFFSET offset = jitGetILoffs (m_Offset);
414- printf (" %*s[%u IL=%04d TR=%06u %08X] [%s%s: %s%s%s%s] %s\n " , indent, " " , m_Ordinal, offset, m_TreeID,
415- calleeToken, inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, calleeName);
432+ printf (" %*s[%s%s%s%s%s] %s\n " , indent, " " , inlineResult, inlineReason, guarded, devirtualized, unboxed,
433+ calleeName);
416434 }
417435 }
418436
419437 // Recurse to first child
420438 if (m_Child != nullptr )
421439 {
422- m_Child->Dump (indent + 2 );
440+ m_Child->Dump (verbose, indent + 2 );
423441 }
424442}
425443
@@ -763,21 +781,7 @@ void InlineResult::Report()
763781
764782 if ((m_Callee != nullptr ) && (obs != InlineObservation::CALLEE_IS_NOINLINE))
765783 {
766-
767- #ifdef DEBUG
768-
769- const char * obsString = InlGetObservationString (obs);
770-
771- if (VERBOSE)
772- {
773- JITDUMP (" \n INLINER: Marking %s as NOINLINE because of %s\n " , callee, obsString);
774- }
775- else if (m_RootCompiler->fgPrintInlinedMethods )
776- {
777- printf (" Marking %s as NOINLINE because of %s\n " , callee, obsString);
778- }
779-
780- #endif // DEBUG
784+ JITDUMP (" \n INLINER: Marking %s as NOINLINE because of %s\n " , callee, InlGetObservationString (obs));
781785
782786 COMP_HANDLE comp = m_RootCompiler->info .compCompHnd ;
783787 comp->setMethodAttribs (m_Callee, CORINFO_FLG_BAD_INLINEE);
@@ -1361,13 +1365,13 @@ InlineContext* InlineStrategy::NewFailure(Statement* stmt, InlineResult* inlineR
13611365// Dump: dump description of inline behavior
13621366//
13631367// Arguments:
1364- // showBudget - also dump final budget values
1368+ // verbose - print more details such as final budget values and IL offsets
13651369
1366- void InlineStrategy::Dump (bool showBudget )
1370+ void InlineStrategy::Dump (bool verbose )
13671371{
1368- m_RootContext->Dump ();
1372+ m_RootContext->Dump (verbose );
13691373
1370- if (!showBudget )
1374+ if (!verbose )
13711375 {
13721376 return ;
13731377 }
0 commit comments