From 79cd2ae9093343bd8da9507f055146446d2cba7a Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 30 Jan 2024 01:21:17 -0800 Subject: [PATCH] JIT: don't ask for all write barrer helpers for AOT (#97677) Fixes an issue introduced by #97535. AOT hosts don't support all the possible write barriers and blow things up if the JIT asks for ones they don't support. Also add back the initial semicolon to the metrics line --- src/coreclr/jit/codegencommon.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index 0537b050219a5..44de5c336ad51 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -1701,7 +1701,9 @@ void CodeGen::genGenerateCode(void** codePtr, uint32_t* nativeSizeOfCode) DoPhase(this, PHASE_EMIT_GCEH, &CodeGen::genEmitUnwindDebugGCandEH); #ifdef DEBUG - if (genWriteBarrierUsed && JitConfig.EnableExtraSuperPmiQueries()) + // For R2R/NAOT not all these helpers are implemented. So don't ask for them. + // + if (genWriteBarrierUsed && JitConfig.EnableExtraSuperPmiQueries() && !compiler->opts.IsReadyToRun()) { void* ignored; for (int i = CORINFO_HELP_ASSIGN_REF; i <= CORINFO_HELP_ASSIGN_STRUCT; i++) @@ -2036,7 +2038,7 @@ void CodeGen::genEmitMachineCode() printf("\n"); } - printf("Total bytes of code %d, prolog size %d, PerfScore %.2f, instruction count %d, allocated bytes for " + printf("; Total bytes of code %d, prolog size %d, PerfScore %.2f, instruction count %d, allocated bytes for " "code %d", codeSize, prologSize, compiler->info.compPerfScore, instrCount, GetEmitter()->emitTotalHotCodeSize + GetEmitter()->emitTotalColdCodeSize);