Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for DUMP_GC_TABLES defined in Release #79835

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ void Compiler::compInit(ArenaAllocator* pAlloc,
verbose = compIsForInlining() ? impInlineInfo->InlinerCompiler->verbose : false;
#endif

#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS || DUMP_GC_TABLES
// Initialize the method name and related info, as it is used early in determining whether to
// apply stress modes, and which ones to apply.
// Note that even allocating memory can invoke the stress mechanism, so ensure that both
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9659,7 +9659,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bool hasCircularClassConstraints;
bool hasCircularMethodConstraints;

#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS
#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_FLOWGRAPHS || DUMP_GC_TABLES

const char* compMethodName;
const char* compClassName;
Expand Down
15 changes: 15 additions & 0 deletions src/coreclr/jit/gcencode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3567,7 +3567,12 @@ size_t GCInfo::gcInfoBlockHdrDump(const BYTE* table, InfoHdr* header, unsigned*
{
GCDump gcDump(GCINFO_VERSION);

#ifdef DEBUG
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
#else
gcDump.gcPrintf = printf;
#endif

printf("Method info block:\n");

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

GCDump gcDump(GCINFO_VERSION);

#ifdef DEBUG
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
#else
gcDump.gcPrintf = printf;
#endif

return gcDump.DumpGCTable(table, header, methodSize, verifyGCTables);
}
Expand All @@ -3593,7 +3603,12 @@ size_t GCInfo::gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned
void GCInfo::gcFindPtrsInFrame(const void* infoBlock, const void* codeBlock, unsigned offs)
{
GCDump gcDump(GCINFO_VERSION);

#ifdef DEBUG
gcDump.gcPrintf = gcDump_logf; // use my printf (which logs to VM)
#else
gcDump.gcPrintf = printf;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using jitstdout for release because of speed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling gcDump_logf to build when DEBUG is not defined but DUMP_GC_TABLES is defined seemed like more work, and possibly not necessary to achieve the goal, so I went for a simpler build fix.

#endif

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