diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-10-17 09:27:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 09:27:59 -0700 |
commit | e7c71c6c9271b0c29f210769159090e17128e740 (patch) | |
tree | 536ec0057e05111955abe0a9cb38389af6c50d08 /ruby.c | |
parent | 07a93b1e378bf2ea356b0561e5e89e60d30fc684 (diff) |
Make mjit_cont sharable with YJIT (#6556)
* Make mjit_cont sharable with YJIT
* Update dependencies
* Update YJIT binding
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -44,6 +44,7 @@ #include "eval_intern.h" #include "internal.h" #include "internal/cmdlineopt.h" +#include "internal/cont.h" #include "internal/error.h" #include "internal/file.h" #include "internal/inits.h" @@ -1618,6 +1619,12 @@ ruby_opt_init(ruby_cmdline_options_t *opt) rb_call_builtin_inits(); ruby_init_prelude(); + // Make sure the saved_ec of the initial thread's root_fiber is scanned by rb_jit_cont_each_ec. + // + // rb_threadptr_root_fiber_setup for the initial thread is called before rb_yjit_enabled_p() + // or mjit_enabled becomes true, meaning jit_cont_new is skipped for the root_fiber. + // Therefore we need to call this again here to set the root_fiber's jit_cont. + rb_fiber_init_jit_cont(GET_EC()->fiber_ptr); #if USE_MJIT // mjit_init is safe only after rb_call_builtin_inits defines RubyVM::MJIT::Compiler if (opt->mjit.on) |