diff --git a/internal/cmdlineopt.h b/internal/cmdlineopt.h index c12994733e..e156ba10e3 100644 --- a/internal/cmdlineopt.h +++ b/internal/cmdlineopt.h @@ -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 { diff --git a/ruby.c b/ruby.c index 49d6b3d091..9541fce9b8 100644 --- a/ruby.c +++ b/ruby.c @@ -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);