YJIT: add defer_empty_count stat

Count how often we defer from a block that is empty
This commit is contained in:
Maxime Chevalier-Boisvert 2023-02-27 16:38:40 -05:00 коммит произвёл Maxime Chevalier-Boisvert
Родитель 9ddd73060b
Коммит de66b60f33
3 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -269,6 +269,7 @@ module RubyVM::YJIT
$stderr.puts "compiled_branch_count: " + format_number(13, stats[:compiled_branch_count]) $stderr.puts "compiled_branch_count: " + format_number(13, stats[:compiled_branch_count])
$stderr.puts "block_next_count: " + format_number(13, stats[:block_next_count]) $stderr.puts "block_next_count: " + format_number(13, stats[:block_next_count])
$stderr.puts "defer_count: " + format_number(13, stats[:defer_count]) $stderr.puts "defer_count: " + format_number(13, stats[:defer_count])
$stderr.puts "defer_empty_count: " + format_number(13, stats[:defer_empty_count])
$stderr.puts "freed_iseq_count: " + format_number(13, stats[:freed_iseq_count]) $stderr.puts "freed_iseq_count: " + format_number(13, stats[:freed_iseq_count])
$stderr.puts "invalidation_count: " + format_number(13, stats[:invalidation_count]) $stderr.puts "invalidation_count: " + format_number(13, stats[:invalidation_count])
$stderr.puts "constant_state_bumps: " + format_number(13, stats[:constant_state_bumps]) $stderr.puts "constant_state_bumps: " + format_number(13, stats[:constant_state_bumps])

Просмотреть файл

@ -2244,6 +2244,11 @@ pub fn defer_compilation(
} }
asm.mark_branch_end(&branch_rc); asm.mark_branch_end(&branch_rc);
// If the block we're deferring from is empty
if jit.get_block().borrow().get_blockid().idx == jit.get_insn_idx() {
incr_counter!(defer_empty_count);
}
incr_counter!(defer_count); incr_counter!(defer_count);
} }

Просмотреть файл

@ -310,6 +310,7 @@ make_counters! {
compilation_failure, compilation_failure,
block_next_count, block_next_count,
defer_count, defer_count,
defer_empty_count,
freed_iseq_count, freed_iseq_count,
exit_from_branch_stub, exit_from_branch_stub,