Skip to content

Commit d680a13

Browse files
committed
Always return jit_entry even if NULL
We can just always return the jit_entry since it will be initialized to NULL. There is no reason to specifically return NULL if yjit / rjit are disabled
1 parent b74077c commit d680a13

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

vm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,9 @@ jit_compile(rb_execution_context_t *ec)
435435
const rb_iseq_t *iseq = ec->cfp->iseq;
436436
struct rb_iseq_constant_body *body = ISEQ_BODY(iseq);
437437
bool yjit_enabled = rb_yjit_enabled_p;
438-
if (!(yjit_enabled || rb_rjit_call_p)) {
439-
return NULL;
440-
}
441438

442439
// Increment the ISEQ's call counter and trigger JIT compilation if not compiled
443-
if (body->jit_entry == NULL) {
440+
if (body->jit_entry == NULL && (yjit_enabled || rb_rjit_call_p)) {
444441
body->jit_entry_calls++;
445442
if (yjit_enabled) {
446443
if (rb_yjit_threshold_hit(iseq, body->jit_entry_calls)) {

0 commit comments

Comments
 (0)