Hook zjit_init
This commit is contained in:
parent
f0954d1b2b
commit
8d5d5b34cf
Notes:
git
2025-04-18 13:49:51 +00:00
12
ruby.c
12
ruby.c
@ -1797,6 +1797,13 @@ ruby_opt_init(ruby_cmdline_options_t *opt)
|
||||
#if USE_YJIT
|
||||
rb_yjit_init(opt->yjit);
|
||||
#endif
|
||||
#if USE_ZJIT
|
||||
if (opt->zjit) {
|
||||
fprintf(stderr, "test test\n");
|
||||
extern void rb_zjit_init();
|
||||
rb_zjit_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Call yjit_hook.rb after rb_yjit_init() to use `RubyVM::YJIT.enabled?`
|
||||
void Init_builtin_yjit_hook();
|
||||
@ -2331,6 +2338,11 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
||||
opt->yjit = !rb_yjit_option_disable(); // set opt->yjit for Init_ruby_description() and calling rb_yjit_init()
|
||||
}
|
||||
#endif
|
||||
#if USE_ZJIT
|
||||
if (FEATURE_SET_P(opt->features, zjit)) {
|
||||
opt->zjit = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
ruby_mn_threads_params();
|
||||
Init_ruby_description(opt);
|
||||
|
@ -4,12 +4,13 @@ mod cruby;
|
||||
mod stats;
|
||||
mod ir;
|
||||
|
||||
extern "C" fn zjit_init() {
|
||||
println!("zjit_init");
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rb_zjit_init() {
|
||||
println!("zjit init");
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rb_zjit_parse_option() -> bool {
|
||||
println!("parsing zjit");
|
||||
println!("parsing zjit options");
|
||||
false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user