-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
ruby/ruby
#15219Description
We should have RubyVM::ZJIT.enable that allows a Ruby process that started with JIT disabled to lazily enable ZJIT. It allows to skip wasting the code region for boot time-only code, also avoiding unnecessary compilation overhead on warmup.
The patch should look similar to RubyVM::YJIT.enable ruby#8705. The PR already took care of the cont.c changes needed for any JIT, so you shouldn't need to touch the file this time.
- You need to update
zjit/src/state.rsa little to make sure boot-time initialization is called at boot even if ZJIT is disabled.cruby_methods::init()should be called at boot, not atRubyVM::ZJIT.enable.cmes could have been re-defined after boot.
- Add
RubyVM::ZJIT.enableto zjit.rb.- Use
Primitiveto call a Rust function like yjit.rb does. It should do the currentrb_zjit_init()but without (1). - Similarly to
ruby_set_yjit_description, you need to defineruby_set_zjit_descriptionin version.c. The Rust function should call it too.
- Use
Metadata
Metadata
Assignees
Labels
No labels