diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index f5499e530..e2d9dd122 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -20,6 +20,12 @@ Log_SetChannel(CPU::CodeCache); +// Enable dumping of recompiled block code size statistics. +// #define DUMP_CODE_SIZE_STATS 1 + +// Enable profiling of JIT blocks. +// #define ENABLE_RECOMPILER_PROFILING 1 + #ifdef ENABLE_RECOMPILER #include "cpu_recompiler_code_generator.h" #endif @@ -1479,7 +1485,7 @@ bool CPU::CodeCache::CompileBlock(Block* block) return false; } -#ifdef _DEBUG +#ifdef DUMP_CODE_SIZE_STATS const u32 host_instructions = GetHostInstructionCount(host_code, host_code_size); s_total_instructions_compiled += block->size; s_total_host_instructions_emitted += host_instructions; @@ -1490,11 +1496,6 @@ bool CPU::CodeCache::CompileBlock(Block* block) s_code_buffer.GetFarUsedPct(), static_cast(host_instructions) / static_cast(block->size), static_cast(s_total_host_instructions_emitted) / static_cast(s_total_instructions_compiled)); -#else - Log_ProfileFmt("0x{:08X}: {}/{}b for {}b ({} inst), blowup: {:.2f}x, cache: {:.2f}%/{:.2f}%", block->pc, - host_code_size, host_far_code_size, block->size * 4, block->size, - static_cast(host_code_size) / static_cast(block->size * 4), s_code_buffer.GetUsedPct(), - s_code_buffer.GetFarUsedPct()); #endif #if 0 diff --git a/src/core/cpu_code_cache_private.h b/src/core/cpu_code_cache_private.h index 2d10d5aa3..81991ef77 100644 --- a/src/core/cpu_code_cache_private.h +++ b/src/core/cpu_code_cache_private.h @@ -234,11 +234,6 @@ void LogCurrentState(); #define ENABLE_HOST_DISASSEMBLY 1 #endif -#if false -// Enable profiling of JIT blocks. -#define ENABLE_RECOMPILER_PROFILING 1 -#endif - JitCodeBuffer& GetCodeBuffer(); const void* GetInterpretUncachedBlockFunction();