YJIT: Add a few missing counters for send fallback (#8681)

This commit is contained in:
Takashi Kokubun 2023-10-17 08:36:13 -07:00 коммит произвёл GitHub
Родитель 1f7234c015
Коммит d458b4127f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -295,7 +295,7 @@ module RubyVM::YJIT
out.puts "num_send: " + format_number(13, stats[:num_send])
out.puts "num_send_known_class: " + format_number_pct(13, stats[:num_send_known_class], stats[:num_send])
out.puts "num_send_polymorphic: " + format_number_pct(13, stats[:num_send_polymorphic], stats[:num_send])
out.puts "num_send_megamorphic: " + format_number_pct(13, stats[:num_send_megamorphic], stats[:num_send])
out.puts "num_send_megamorphic: " + format_number_pct(13, stats[:send_megamorphic], stats[:num_send])
out.puts "num_send_dynamic: " + format_number_pct(13, stats[:num_send_dynamic], stats[:num_send])
if stats[:num_send_x86_rel32] != 0 || stats[:num_send_x86_reg] != 0
out.puts "num_send_x86_rel32: " + format_number(13, stats[:num_send_x86_rel32])

Просмотреть файл

@ -6974,7 +6974,7 @@ fn gen_send_general(
}
// If megamorphic, let the caller fallback to dynamic dispatch
if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_DEPTH {
gen_counter_incr(asm, Counter::num_send_megamorphic);
gen_counter_incr(asm, Counter::send_megamorphic);
return None;
}
@ -6993,7 +6993,7 @@ fn gen_send_general(
// Do method lookup
let mut cme = unsafe { rb_callable_method_entry(comptime_recv_klass, mid) };
if cme.is_null() {
// TODO: counter
gen_counter_incr(asm, Counter::send_cme_not_found);
return None;
}
@ -7006,6 +7006,7 @@ fn gen_send_general(
if flags & VM_CALL_FCALL == 0 {
// Can only call private methods with FCALL callsites.
// (at the moment they are callsites without a receiver or an explicit `self` receiver)
gen_counter_incr(asm, Counter::send_private_not_fcall);
return None;
}
}

Просмотреть файл

@ -255,8 +255,11 @@ make_counters! {
send_call_block,
send_call_kwarg,
send_call_multi_ractor,
send_cme_not_found,
send_megamorphic,
send_missing_method,
send_refined_method,
send_private_not_fcall,
send_cfunc_ruby_array_varg,
send_cfunc_argc_mismatch,
send_cfunc_toomany_args,
@ -469,7 +472,6 @@ make_counters! {
num_send,
num_send_known_class,
num_send_megamorphic,
num_send_polymorphic,
num_send_x86_rel32,
num_send_x86_reg,