Add --zjit option

This commit is contained in:
Takashi Kokubun 2025-02-06 10:27:39 -05:00
parent 43234138d6
commit d993307d4c
Notes: git 2025-04-18 13:50:00 +00:00
2 changed files with 9 additions and 1 deletions

View File

@ -39,6 +39,7 @@ typedef struct ruby_cmdline_options {
#if USE_YJIT
unsigned int yjit: 1;
#endif
unsigned int zjit: 1;
} ruby_cmdline_options_t;
struct ruby_opt_message {

9
ruby.c
View File

@ -106,6 +106,8 @@ void rb_warning_category_update(unsigned int mask, unsigned int bits);
X(frozen_string_literal) \
SEP \
X(yjit) \
SEP \
X(zjit) \
/* END OF FEATURES */
#define EACH_DEBUG_FEATURES(X, SEP) \
X(frozen_string_literal) \
@ -342,9 +344,10 @@ usage(const char *name, int help, int highlight, int columns)
#if USE_YJIT
M("--yjit", "", "Enable in-process JIT compiler."),
#endif
M("--zjit", "", "Enable in-process JIT compiler."),
M("-h", "", "Print this help message; use --help for longer message."),
};
STATIC_ASSERT(usage_msg_size, numberof(usage_msg) < 25);
STATIC_ASSERT(usage_msg_size, numberof(usage_msg) < 26);
static const struct ruby_opt_message help_msg[] = {
M("--backtrace-limit=num", "", "Set backtrace limit."),
@ -1450,6 +1453,10 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char **
" You may need to install rustc to build Ruby with YJIT.");
#endif
}
else if (is_option_with_optarg("zjit", '-', true, false, false)) {
FEATURE_SET(opt->features, FEATURE_BIT(yjit));
// TODO
}
else if (strcmp("yydebug", s) == 0) {
if (envopt) goto noenvopt_long;
opt->dump |= DUMP_BIT(yydebug);