Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: Avoid undercounting retired_in_yjit #8038

Merged
merged 4 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/yjit/yjit.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ irb(main):001:0> RubyVM::YJIT.runtime_stats
Some of the counters include:

:exec_instruction - how many Ruby bytecode instructions have been executed
:yjit_insns_count - how many Ruby bytecode instruction have been executed in compiled code
:binding_allocations - number of bindings allocated
:binding_set - number of variables set via a binding
:code_gc_count - number of garbage collections of compiled code since process start
Expand Down
2 changes: 1 addition & 1 deletion yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def _print_stats(out: $stderr) # :nodoc:
if stats.key?(:vm_insns_count)
out.puts "vm_insns_count: " + format_number(13, stats[:vm_insns_count])
end
out.puts "yjit_insns_count: " + format_number(13, stats[:exec_instruction])
out.puts "exec_instruction: " + format_number(13, stats[:exec_instruction])
if stats.key?(:ratio_in_yjit)
out.puts "ratio_in_yjit: " + ("%12.1f" % stats[:ratio_in_yjit]) + "%"
end
Expand Down
10 changes: 5 additions & 5 deletions yjit/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,14 @@ pub fn gen_single_block(
verify_ctx(&jit, &asm.ctx);
}

// :count-placement:
// Count bytecode instructions that execute in generated code.
// Note that the increment happens even when the output takes side exit.
gen_counter_incr(&mut asm, Counter::exec_instruction);

// Lookup the codegen function for this instruction
let mut status = None;
if let Some(gen_fn) = get_gen_fn(VALUE(opcode)) {
// :count-placement:
// Count bytecode instructions that execute in generated code.
// Note that the increment happens even when the output takes side exit.
gen_counter_incr(&mut asm, Counter::exec_instruction);

// Add a comment for the name of the YARV instruction
asm.comment(&format!("Insn: {:04} {} (stack_size: {})", insn_idx, insn_name(opcode), asm.ctx.get_stack_size()));

Expand Down