diff options
| -rw-r--r-- | zjit.rb | 1 | ||||
| -rw-r--r-- | zjit/src/codegen.rs | 4 | ||||
| -rw-r--r-- | zjit/src/stats.rs | 3 |
3 files changed, 8 insertions, 0 deletions
@@ -56,6 +56,7 @@ class << RubyVM::ZJIT :total_insn_count, :vm_insn_count, :zjit_insn_count, + :zjit_dynamic_dispatch, :ratio_in_zjit, ], buf:, stats:) print_counters_with_prefix(prefix: 'exit_', prompt: 'side exit reasons', buf:, stats:, limit: 20) diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs index 2b71596a17..fd804e5a42 100644 --- a/zjit/src/codegen.rs +++ b/zjit/src/codegen.rs @@ -858,6 +858,10 @@ fn gen_send_without_block( cd: *const rb_call_data, state: &FrameState, ) -> lir::Opnd { + if get_option!(stats) { + gen_incr_counter(asm, Counter::zjit_dynamic_dispatch); + } + // Note that it's incorrect to use this frame state to side exit because // the state might not be on the boundary of an interpreter instruction. // For example, `opt_str_uminus` pushes to the stack and then sends. diff --git a/zjit/src/stats.rs b/zjit/src/stats.rs index c6b1ed29d6..10692d83f5 100644 --- a/zjit/src/stats.rs +++ b/zjit/src/stats.rs @@ -72,6 +72,9 @@ make_counters! { // The number of times YARV instructions are executed on JIT code zjit_insn_count, + // The number of times we do a dynamic dispatch from JIT code + zjit_dynamic_dispatch, + // failed_: Compilation failure reasons failed_iseq_stack_too_large, failed_hir_compile, |
