YJIT: Add RubyVM::YJIT.enable (#8705)

This commit is contained in:
Takashi Kokubun 2023-10-19 10:54:35 -07:00 committed by GitHub
parent 62e340251b
commit 6beb09c2c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 111 additions and 109 deletions

4
ruby.c
View file

@ -1796,10 +1796,6 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
if (opt->yjit)
rb_yjit_init();
#endif
// rb_threadptr_root_fiber_setup for the initial thread is called before rb_yjit_enabled_p()
// or rjit_enabled becomes true, meaning jit_cont_new is skipped for the initial root fiber.
// Therefore we need to call this again here to set the initial root fiber's jit_cont.
rb_jit_cont_init(); // must be after rjit_enabled = true and rb_yjit_init()
ruby_set_script_name(opt->script_name);
require_libraries(&opt->req_list);