Skip to content

Commit 279fb04

Browse files
Fix build for DUMP_GC_TABLES defined in Release (#79835)
* Fix build for DUMP_GC_TABLES defined in Release * Formatting
1 parent 53bdf40 commit 279fb04

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/coreclr/jit/compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ void Compiler::compInit(ArenaAllocator* pAlloc,
17781778
verbose = compIsForInlining() ? impInlineInfo->InlinerCompiler->verbose : false;
17791779
#endif
17801780

1781-
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS
1781+
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS || DUMP_GC_TABLES
17821782
// Initialize the method name and related info, as it is used early in determining whether to
17831783
// apply stress modes, and which ones to apply.
17841784
// Note that even allocating memory can invoke the stress mechanism, so ensure that both

src/coreclr/jit/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9659,7 +9659,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
96599659
bool hasCircularClassConstraints;
96609660
bool hasCircularMethodConstraints;
96619661

9662-
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS
9662+
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS || DUMP_GC_TABLES
96639663

96649664
const char* compMethodName;
96659665
const char* compClassName;

src/coreclr/jit/gcencode.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3567,7 +3567,12 @@ size_t GCInfo::gcInfoBlockHdrDump(const BYTE* table, InfoHdr* header, unsigned*
35673567
{
35683568
GCDump gcDump(GCINFO_VERSION);
35693569

3570+
#ifdef DEBUG
35703571
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
3572+
#else
3573+
gcDump.gcPrintf = printf;
3574+
#endif
3575+
35713576
printf("Method info block:\n");
35723577

35733578
return gcDump.DumpInfoHdr(table, header, methodSize, verifyGCTables);
@@ -3580,7 +3585,12 @@ size_t GCInfo::gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned
35803585
printf("Pointer table:\n");
35813586

35823587
GCDump gcDump(GCINFO_VERSION);
3588+
3589+
#ifdef DEBUG
35833590
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
3591+
#else
3592+
gcDump.gcPrintf = printf;
3593+
#endif
35843594

35853595
return gcDump.DumpGCTable(table, header, methodSize, verifyGCTables);
35863596
}
@@ -3593,7 +3603,12 @@ size_t GCInfo::gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned
35933603
void GCInfo::gcFindPtrsInFrame(const void* infoBlock, const void* codeBlock, unsigned offs)
35943604
{
35953605
GCDump gcDump(GCINFO_VERSION);
3606+
3607+
#ifdef DEBUG
35963608
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
3609+
#else
3610+
gcDump.gcPrintf = printf;
3611+
#endif
35973612

35983613
gcDump.DumpPtrsInFrame((PTR_CBYTE)infoBlock, (const BYTE*)codeBlock, offs, verifyGCTables);
35993614
}

0 commit comments

Comments
 (0)