diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-12-16 06:24:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 06:24:07 -0800 |
commit | 53babf35ef5b643774636550ea23851e2607e076 (patch) | |
tree | a18e660dd7f39718188fb161fd453c6c39097a14 /vm_insnhelper.c | |
parent | bfb374be2342d7822cd37a1b100cb1715f85ca74 (diff) |
Inline getconstant on JIT (#3906)
* Inline getconstant on JIT
* Support USE_MJIT=0
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e8c9719155..57f85b9a31 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -4577,12 +4577,11 @@ vm_opt_newarray_min(rb_num_t num, const VALUE *ptr) #undef id_cmp static int -vm_ic_hit_p(IC ic, const VALUE *reg_ep) +vm_ic_hit_p(const rb_serial_t ic_serial, const rb_cref_t *ic_cref, const VALUE *reg_ep) { - if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE() && - rb_ractor_main_p()) { - return (ic->ic_cref == NULL || // no need to check CREF - ic->ic_cref == vm_get_cref(reg_ep)); + if (ic_serial == GET_GLOBAL_CONSTANT_STATE() && rb_ractor_main_p()) { + return (ic_cref == NULL || // no need to check CREF + ic_cref == vm_get_cref(reg_ep)); } return FALSE; } @@ -4591,9 +4590,11 @@ static void vm_ic_update(IC ic, VALUE val, const VALUE *reg_ep) { VM_ASSERT(ic->value != Qundef); + rb_mjit_before_vm_ic_update(); ic->value = val; ic->ic_serial = GET_GLOBAL_CONSTANT_STATE() - ruby_vm_const_missing_count; ic->ic_cref = vm_get_const_key_cref(reg_ep); + rb_mjit_after_vm_ic_update(); ruby_vm_const_missing_count = 0; } |