YJIT: Count all opt_getconstant_path exit reasons (#8187)

This commit is contained in:
Takashi Kokubun 2023-08-09 06:54:24 -07:00 committed by GitHub
parent 5eef3ce21f
commit 6acfc50bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-08-09 13:54:45 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
3 changed files with 7 additions and 3 deletions

View File

@ -262,7 +262,7 @@ module RubyVM::YJIT
print_counters(stats, out: out, prefix: 'opt_aref_', prompt: 'opt_aref exit reasons: ')
print_counters(stats, out: out, prefix: 'opt_aref_with_', prompt: 'opt_aref_with exit reasons: ')
print_counters(stats, out: out, prefix: 'expandarray_', prompt: 'expandarray exit reasons: ')
print_counters(stats, out: out, prefix: 'opt_getinlinecache_', prompt: 'opt_getinlinecache exit reasons: ')
print_counters(stats, out: out, prefix: 'opt_getconstant_path_', prompt: 'opt_getconstant_path exit reasons: ')
print_counters(stats, out: out, prefix: 'invalidate_', prompt: 'invalidation reasons: ')
# Number of failed compiler invocations

View File

@ -7864,6 +7864,7 @@ fn gen_opt_getconstant_path(
if ice.is_null() {
// In this case, leave a block that unconditionally side exits
// for the interpreter to invalidate.
gen_counter_incr(asm, Counter::opt_getconstant_path_no_ic_entry);
return None;
}
@ -7884,7 +7885,7 @@ fn gen_opt_getconstant_path(
// Check the result. SysV only specifies one byte for _Bool return values,
// so it's important we only check one bit to ignore the higher bits in the register.
asm.test(ret_val, 1.into());
asm.jz(Target::side_exit(Counter::opt_getinlinecache_miss));
asm.jz(Target::side_exit(Counter::opt_getconstant_path_ic_miss));
let inline_cache = asm.load(Opnd::const_ptr(ic as *const u8));
@ -7906,6 +7907,7 @@ fn gen_opt_getconstant_path(
} else {
// Optimize for single ractor mode.
if !assume_single_ractor_mode(jit, asm, ocb) {
gen_counter_incr(asm, Counter::opt_getconstant_path_multi_ractor);
return None;
}

View File

@ -353,7 +353,9 @@ make_counters! {
opt_case_dispatch_megamorphic,
opt_getinlinecache_miss,
opt_getconstant_path_ic_miss,
opt_getconstant_path_no_ic_entry,
opt_getconstant_path_multi_ractor,
expandarray_splat,
expandarray_postarg,