Exit reason breakdown for opt_aref
This commit is contained in:
parent
c04e5188d5
commit
db53decad6
1
yjit.rb
1
yjit.rb
@ -63,6 +63,7 @@ module YJIT
|
||||
print_counters(counters, prefix: 'oswb_', prompt: 'opt_send_without_block exit reasons: ')
|
||||
print_counters(counters, prefix: 'leave_', prompt: 'leave exit reasons: ')
|
||||
print_counters(counters, prefix: 'getivar_', prompt: 'getinstancevariable exit reasons:')
|
||||
print_counters(counters, prefix: 'oaref_', prompt: 'opt_aref exit reasons: ')
|
||||
end
|
||||
|
||||
def print_counters(counters, prefix:, prompt:)
|
||||
|
@ -924,6 +924,7 @@ gen_opt_aref(jitstate_t* jit, ctx_t* ctx)
|
||||
|
||||
// Only JIT one arg calls like `ary[6]`
|
||||
if (argc != 1) {
|
||||
GEN_COUNTER_INC(cb, oaref_argc_not_one);
|
||||
return YJIT_CANT_COMPILE;
|
||||
}
|
||||
|
||||
@ -933,6 +934,7 @@ gen_opt_aref(jitstate_t* jit, ctx_t* ctx)
|
||||
// (including arrays) don't use the inline cache, so if the inline cache
|
||||
// has an entry, then this must be used by some other type.
|
||||
if (cme) {
|
||||
GEN_COUNTER_INC(cb, oaref_filled_cc);
|
||||
return YJIT_CANT_COMPILE;
|
||||
}
|
||||
|
||||
@ -962,12 +964,12 @@ gen_opt_aref(jitstate_t* jit, ctx_t* ctx)
|
||||
mov(cb, REG1, mem_opnd(64, REG0, offsetof(struct RBasic, klass)));
|
||||
mov(cb, REG0, const_ptr_opnd((void *)rb_cArray));
|
||||
cmp(cb, REG0, REG1);
|
||||
jne_ptr(cb, side_exit);
|
||||
jne_ptr(cb, COUNTED_EXIT(side_exit, oaref_not_array));
|
||||
|
||||
// Bail if idx is not a FIXNUM
|
||||
mov(cb, REG1, idx_opnd);
|
||||
test(cb, REG1, imm_opnd(RUBY_FIXNUM_FLAG));
|
||||
jz_ptr(cb, side_exit);
|
||||
jz_ptr(cb, COUNTED_EXIT(side_exit, oaref_arg_not_fixnum));
|
||||
|
||||
// Save YJIT registers
|
||||
yjit_save_regs(cb);
|
||||
|
@ -51,6 +51,11 @@ YJIT_DECLARE_COUNTERS(
|
||||
getivar_idx_out_of_range,
|
||||
getivar_undef,
|
||||
|
||||
oaref_filled_cc,
|
||||
oaref_argc_not_one,
|
||||
oaref_not_array,
|
||||
oaref_arg_not_fixnum,
|
||||
|
||||
// Member with known name for iterating over counters
|
||||
last_member
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user