Skip to content

Commit

Permalink
Skip calling jit_exec on Wasm
Browse files Browse the repository at this point in the history
We often break Wasm build when we modify how jit_exec works. I'm
planning to modify it again soon.

We actually don't support running Ruby JIT on Wasm, so it doesn't seem
worth the maintenance effort.
  • Loading branch information
k0kubun committed Aug 4, 2023
1 parent 8d7861e commit e80752f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions vm.c
Expand Up @@ -2336,9 +2336,7 @@ vm_exec_bottom_main(void *context)
struct rb_vm_exec_context *ctx = (struct rb_vm_exec_context *)context;

ctx->state = TAG_NONE;
if (UNDEF_P(ctx->result = jit_exec(ctx->ec))) {
ctx->result = vm_exec_core(ctx->ec);
}
ctx->result = vm_exec_core(ctx->ec);
vm_exec_enter_vm_loop(ctx->ec, ctx, ctx->tag, true);
}

Expand Down

1 comment on commit e80752f

@nobu
Copy link
Member

@nobu nobu commented on e80752f Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a warning.

../src/vm.c:425:21: warning: unused function 'jit_exec' [-Wunused-function]
static inline VALUE jit_exec(rb_execution_context_t *ec) { return Qundef; }
                    ^

On Wasm, RJIT and YJIT will never be enabled and jit_exec() has been defined to return Qundef always to optimize out previously.

Please sign in to comment.