diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2020-09-28 07:03:28 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:24 -0400 |
commit | e8c914c2502f6049ebc5bd93e8db0c62dd14400e (patch) | |
tree | c9f8f324366e0a44eba7f89aac117306f83c2e72 /ruby.c | |
parent | f3c961f273d3fa305c9ebea57e5d1ff96f241e19 (diff) |
Implement the --disable-ujit command line option
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -59,6 +59,7 @@ #include "internal/process.h" #include "internal/variable.h" #include "mjit.h" +#include "ujit_compile.h" #include "ruby/encoding.h" #include "ruby/thread.h" #include "ruby/util.h" @@ -103,6 +104,8 @@ void rb_warning_category_update(unsigned int mask, unsigned int bits); X(frozen_string_literal) \ SEP \ X(jit) \ + SEP \ + X(ujit) /* END OF FEATURES */ #define EACH_DEBUG_FEATURES(X, SEP) \ X(frozen_string_literal) \ @@ -229,6 +232,7 @@ cmdline_options_init(ruby_cmdline_options_t *opt) #ifdef MJIT_FORCE_ENABLE /* to use with: ./configure cppflags="-DMJIT_FORCE_ENABLE" */ opt->features.set |= FEATURE_BIT(jit); #endif + opt->features.set |= FEATURE_BIT(ujit); return opt; } @@ -327,6 +331,7 @@ usage(const char *name, int help, int highlight, int columns) M("rubyopt", "", "RUBYOPT environment variable (default: enabled)"), M("frozen-string-literal", "", "freeze all string literals (default: disabled)"), M("jit", "", "JIT compiler (default: disabled)"), + M("ujit", "", "in-process JIT compiler (default: enabled)"), }; static const struct message warn_categories[] = { M("deprecated", "", "deprecated features"), @@ -1435,6 +1440,9 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt) rb_warn("MJIT support is disabled."); #endif } + else if (strncmp("ujit", s, 4) == 0) { + FEATURE_SET(opt->features, FEATURE_BIT(jit)); + } else if (strcmp("yydebug", s) == 0) { if (envopt) goto noenvopt_long; opt->dump |= DUMP_BIT(yydebug); @@ -1861,6 +1869,8 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) /* Using TMP_RUBY_PREFIX created by ruby_init_loadpath(). */ mjit_init(&opt->mjit); #endif + if (opt->features.set & FEATURE_BIT(ujit)) + rb_ujit_init(); Init_ruby_description(); Init_enc(); |