aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-12-01 00:56:27 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2019-12-01 00:58:47 -0800
commita19d625e667024fe27dcee04dd748e914bc24762 (patch)
tree5ca8c6cec0d19cb54e8c2643d8736216bb6fd2e2 /ruby.c
parentbdc62dfc8ecffd27dd5ad6756cce88eac5c993f5 (diff)
downloadruby-a19d625e667024fe27dcee04dd748e914bc24762.tar.gz
Allow specifying arbitrary MJIT flags by --jit-debug
This is a secret feature for me. It's only for testing and any behavior with this flag override is unsupported. I needed this because I sometimes want to add debug options but do not want to disable optimizations, for using Linux perf.
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index 6edc5c474d..69963e390b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -298,7 +298,7 @@ usage(const char *name, int help)
};
static const struct message mjit_options[] = {
M("--jit-warnings", "", "Enable printing JIT warnings"),
- M("--jit-debug", "", "Enable JIT debugging (very slow)"),
+ M("--jit-debug", "", "Enable JIT debugging (very slow), or add cflags if specified"),
M("--jit-wait", "", "Wait until JIT compilation is finished everytime (for testing)"),
M("--jit-save-temps", "", "Save JIT temporary files in $TMP or /tmp (for testing)"),
M("--jit-verbose=num", "", "Print JIT logs of level num or less to stderr (default: 0)"),
@@ -969,6 +969,9 @@ setup_mjit_options(const char *s, struct mjit_options *mjit_opt)
else if (strcmp(s, "-warnings") == 0) {
mjit_opt->warnings = 1;
}
+ else if (strncmp(s, "-debug=", 7) == 0) {
+ mjit_opt->debug_flags = strdup(s + 7);
+ }
else if (strcmp(s, "-debug") == 0) {
mjit_opt->debug = 1;
}