From d814722fb8299c4baace3e76447a55a3d5478e3a Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 13 Jul 2023 15:14:43 -0700 Subject: YJIT: Make ratio_in_yjit always available (#8064) --- yjit/src/stats.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'yjit/src/stats.rs') 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); -- cgit v1.2.3