Don't enable YJIT by default. More tests on both Ubuntu and MacOS.

Add RUBY_YJIT_ENABLE env var and YJIT_FORCE_ENABLE compile-time constant.
Rename YJIT_STATS to RUBY_YJIT_STATS.
This commit is contained in:
Noah Gibbs 2021-10-01 13:45:02 +01:00 committed by Alan Wu
parent 7c08538aa3
commit 21e58acef3
6 changed files with 163 additions and 72 deletions

7
ruby.c
View file

@ -234,9 +234,14 @@ cmdline_options_init(ruby_cmdline_options_t *opt)
opt->features.set = DEFAULT_FEATURES;
#ifdef MJIT_FORCE_ENABLE /* to use with: ./configure cppflags="-DMJIT_FORCE_ENABLE" */
opt->features.set |= FEATURE_BIT(jit);
#else
#elif defined(YJIT_FORCE_ENABLE)
opt->features.set |= FEATURE_BIT(yjit);
#endif
if(getenv("RUBY_YJIT_ENABLE")) {
opt->features.set |= FEATURE_BIT(yjit);
}
return opt;
}