diff --git a/vm.c b/vm.c index 87e6e9fecd..e7604bb258 100644 --- a/vm.c +++ b/vm.c @@ -435,12 +435,9 @@ jit_compile(rb_execution_context_t *ec) const rb_iseq_t *iseq = ec->cfp->iseq; struct rb_iseq_constant_body *body = ISEQ_BODY(iseq); bool yjit_enabled = rb_yjit_enabled_p; - if (!(yjit_enabled || rb_rjit_call_p)) { - return NULL; - } // Increment the ISEQ's call counter and trigger JIT compilation if not compiled - if (body->jit_entry == NULL) { + if (body->jit_entry == NULL && (yjit_enabled || rb_rjit_call_p)) { body->jit_entry_calls++; if (yjit_enabled) { if (rb_yjit_threshold_hit(iseq, body->jit_entry_calls)) {