YJIT: Fallback opt_getconstant_path for const_missing (#8623)

* YJIT: Fallback opt_getconstant_path for const_missing

* Fix a comment [ci skip]

* Remove a wrapper function
This commit is contained in:
Takashi Kokubun 2023-10-13 08:52:23 -07:00 committed by GitHub
parent 0bf1749e9f
commit 5808999d30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 42 deletions

View file

@ -260,20 +260,7 @@ opt_getconstant_path
(VALUE val)
// attr bool leaf = false; /* may autoload or raise */
{
const ID *segments = ic->segments;
struct iseq_inline_constant_cache_entry *ice = ic->entry;
if (ice && vm_ic_hit_p(ice, GET_EP())) {
val = ice->value;
VM_ASSERT(val == vm_get_ev_const_chain(ec, segments));
} else {
ruby_vm_constant_cache_misses++;
val = vm_get_ev_const_chain(ec, segments);
vm_ic_track_const_chain(GET_CFP(), ic, segments);
// Because leaf=false, we need to undo the PC increment to get the address to this instruction
// INSN_ATTR(width) == 2
vm_ic_update(GET_ISEQ(), ic, val, GET_EP(), GET_PC() - 2);
}
val = rb_vm_opt_getconstant_path(ec, GET_CFP(), ic);
}
/* Get constant variable id. If klass is Qnil and allow_nil is Qtrue, constants