diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-07-13 15:14:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 18:14:43 -0400 |
commit | d814722fb8299c4baace3e76447a55a3d5478e3a (patch) | |
tree | 9a2c1ad1a2eec7f7df26ca4deef4a52cddb3750f /yjit/src/stats.rs | |
parent | e850181acf0e68a162c75d47b7a0951ab7d878b1 (diff) | |
download | ruby-d814722fb8299c4baace3e76447a55a3d5478e3a.tar.gz |
YJIT: Make ratio_in_yjit always available (#8064)
Diffstat (limited to 'yjit/src/stats.rs')
-rw-r--r-- | yjit/src/stats.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index 7f1a4e3d9f..216c7bddc8 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -369,7 +369,6 @@ make_counters! { binding_allocations, binding_set, - vm_insns_count, compiled_iseq_entry, compiled_iseq_count, compiled_blockid_count, @@ -507,7 +506,6 @@ fn rb_yjit_gen_stats_dict(context: bool) -> VALUE { let hash = unsafe { rb_hash_new() }; - // CodeBlock stats unsafe { // Get the inline and outlined code blocks let cb = CodegenGlobals::get_inline_cb(); @@ -547,6 +545,9 @@ fn rb_yjit_gen_stats_dict(context: bool) -> VALUE { hash_aset_usize!(hash, "live_context_count", live_context_count); hash_aset_usize!(hash, "live_context_size", live_context_count * context_size); } + + // VM instructions count + hash_aset_usize!(hash, "vm_insns_count", rb_vm_insns_count as usize); } // If we're not generating stats, the hash is done @@ -566,13 +567,6 @@ fn rb_yjit_gen_stats_dict(context: bool) -> VALUE { let counter_ptr = get_counter_ptr(counter_name); let counter_val = *counter_ptr; - #[cfg(not(feature = "stats"))] - if counter_name == &"vm_insns_count" { - // If the stats feature is disabled, we don't have vm_insns_count - // so we are going to exclude the key - continue; - } - // Put counter into hash let key = rust_str_to_sym(counter_name); let value = VALUE::fixnum_from_usize(counter_val as usize); @@ -750,12 +744,6 @@ pub extern "C" fn rb_yjit_reset_stats_bang(_ec: EcPtr, _ruby_self: VALUE) -> VAL return Qnil; } -/// Increment the number of instructions executed by the interpreter -#[no_mangle] -pub extern "C" fn rb_yjit_collect_vm_usage_insn() { - incr_counter!(vm_insns_count); -} - #[no_mangle] pub extern "C" fn rb_yjit_collect_binding_alloc() { incr_counter!(binding_allocations); |