Skip to content

Commit

Permalink
YJIT: add defer_empty_count stat
Browse files Browse the repository at this point in the history
Count how often we defer from a block that is empty
  • Loading branch information
maximecb committed Feb 28, 2023
1 parent 9ddd730 commit de66b60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions yjit.rb
Expand Up @@ -269,6 +269,7 @@ def _print_stats # :nodoc:
$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 "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 "invalidation_count: " + format_number(13, stats[:invalidation_count])
$stderr.puts "constant_state_bumps: " + format_number(13, stats[:constant_state_bumps])
Expand Down
5 changes: 5 additions & 0 deletions yjit/src/core.rs
Expand Up @@ -2244,6 +2244,11 @@ pub fn defer_compilation(
}
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);
}

Expand Down
1 change: 1 addition & 0 deletions yjit/src/stats.rs
Expand Up @@ -310,6 +310,7 @@ make_counters! {
compilation_failure,
block_next_count,
defer_count,
defer_empty_count,
freed_iseq_count,

exit_from_branch_stub,
Expand Down

0 comments on commit de66b60

Please sign in to comment.