path: root/ruby.c
AgeCommit message (Collapse)Author
2023-11-03[prism] Update to use new options APIsKevin Newton
2023-11-02YJIT: Always define method codegen table at boot (#8807)Takashi Kokubun
2023-10-26Use new prism prettyprint APIsKevin Newton
2023-10-26[PRISM] Change --dump keyword to prism_parsetreeJemma Issroff
2023-10-25[PRISM] Move scope_node itself to CRuby, create prism_compile.hJemma Issroff
2023-10-19YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun
2023-10-17"+MN" in descriptionKoichi Sasada
If `RUBY_MN_THREADS=1` is given, this patch shows `+MN` in `RUBY_DESCRIPTION` like: ``` $ RUBY_MN_THREADS=1 ./miniruby --yjit -v ruby 3.3.0dev (2023-10-17T04:10:14Z master 908f8fffa2) +YJIT +MN [x86_64-linux] ``` Before this patch, a warning is displayed if `$VERBOSE` is given. However it can make troubles with tests (with `$VERBOSE`), do not show any warning with a MN threads configuration.
2023-10-13[PRISM] Add --dump=prism mode (#8643)Jemma Issroff
2023-10-12M:N thread scheduler for RactorsKoichi Sasada
This patch introduce M:N thread scheduler for Ractor system. In general, M:N thread scheduler employs N native threads (OS threads) to manage M user-level threads (Ruby threads in this case). On the Ruby interpreter, 1 native thread is provided for 1 Ractor and all Ruby threads are managed by the native thread. From Ruby 1.9, the interpreter uses 1:1 thread scheduler which means 1 Ruby thread has 1 native thread. M:N scheduler change this strategy. Because of compatibility issue (and stableness issue of the implementation) main Ractor doesn't use M:N scheduler on default. On the other words, threads on the main Ractor will be managed with 1:1 thread scheduler. There are additional settings by environment variables: `RUBY_MN_THREADS=1` enables M:N thread scheduler on the main ractor. Note that non-main ractors use the M:N scheduler without this configuration. With this configuration, single ractor applications run threads on M:1 thread scheduler (green threads, user-level threads). `RUBY_MAX_CPU=n` specifies maximum number of native threads for M:N scheduler (default: 8). This patch will be reverted soon if non-easy issues are found. [Bug #19842]
2023-10-04Use a better variable name for wTakashi Kokubun
2023-10-04Make the function names consistentTakashi Kokubun
2023-10-04YJIT: Move help descriptions to options.rsTakashi Kokubun
2023-10-04Split `show_usage_line` and add `ruby_show_usage_line`Nobuyoshi Nakada
2023-10-04Remove magic numbers from `show_usage_line`Nobuyoshi Nakada
2023-10-03YJIT: add heuristic to avoid compiling cold ISEQs (#8522)Maxime Chevalier-Boisvert
* YJIT: Add counter to measure how often we compile "cold" ISEQs (#535) Fix counter name in DEFAULT_COUNTERS YJIT: add --yjit-cold-threshold, don't compile cold ISEQs YJIT: increase default cold threshold to 200_000 Remove rb_yjit_call_threshold() Remove conflict markers Fix compilation errors Threshold 1 should compile immediately Debug deadlock issue with test_ractor Fix call threshold issue with tests * Revert exception threshold logic. Document option in * (void) for 0 parameter functions in C99 * Rename iseq_entry_cold => cold_iseq_entry * Document --yjit-cold-threshold in ruby.c * Update doc/yjit/ Co-authored-by: Jean byroot Boussier <> * Shorten help string to appease test * Address bug found by Kokubun. Reorder logic. --------- Co-authored-by: Alan Wu <> Co-authored-by: Jean byroot Boussier <>
2023-09-25[Feature #19790] Rename BUGREPORT_PATH as CRASH_REPORTNobuyoshi Nakada
2023-09-25Honor the same option given laterNobuyoshi Nakada
2023-09-25Add `--bugreport-path` optionNobuyoshi Nakada
It has precedence over the environment variable `RUBY_BUGREPORT_PATH`.
2023-09-25Test bug_reportNobuyoshi Nakada
2023-09-18[Bug #19887] RUBYOPT should work without leading `-`Nobuyoshi Nakada
2023-08-30Change heap init environment variable namesPeter Zhu
This commit changes RUBY_GC_HEAP_INIT_SIZE_{40,80,160,320,640}_SLOTS to RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS. This is easier to use because the user does not need to determine the slot sizes (which can vary between 32 and 64 bit systems). They now just use the heap names (`GC.stat_heap.keys`). Notes: Merged:
2023-08-25[Feature #19785] Deprecate RUBY_GC_HEAP_INIT_SLOTSPeter Zhu
This environment variable is replaced by `RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS`, so it doesn't make sense to keep it. Notes: Merged:
2023-08-25Move SCRIPT_LINES__ away from parse.yNobuyoshi Nakada
Notes: Merged:
2023-08-22Call ruby_init_setproctitle before process_optionsJeremy Evans
Fixes [Bug #11269] Notes: Merged:
2023-08-13Fix the precedence of `--backtrace-limit` optionNobuyoshi Nakada
In general, if the same option specifying a single value is given multiple times at the same level, the last one overrides the earlier ones, unless prohibited. Notes: Merged:
2023-08-11Fix range of `--backtrace-limit`Nobuyoshi Nakada
Also an option command line should have precedence over `RUBYOPT`. Notes: Merged:
2023-08-02Fix encoding switches when RUBYOPT is empty or only spacesBenoit Daloze
* Follow-up of dbbc3583ba432c279f07b1fa0afb0a8a9ba50c91 which broke this.
2023-07-16Allow -1 as the value of `--backtrace-limit` optionTom Stuart
-1 is a legitimate backtrace limit — in fact, it’s the default — so it should be possible to provide it with the `--backtrace-limit` option.
2023-07-16Allow `--backtrace-limit` option to appear in RUBYOPTTom Stuart
There’s no reason to prevent RUBYOPT from controlling the backtrace limit. In fact, Matz said [0] he was expecting this to be possible. [0]
2023-07-13Set backtrace length limit at lastNobuyoshi Nakada
Command line options should have higher precedence than the same options in shebang and `RUBYOPT`. Notes: Merged:
2023-07-13Preserve already set options in `moreswitches`Nobuyoshi Nakada
Notes: Merged:
2023-07-13Shrink `ruby_cmdline_options_t` a bitNobuyoshi Nakada
Notes: Merged:
2023-07-05YJIT: Use --yjit-exec-mem-size=128 by default (#8031)Takashi Kokubun
Notes: Merged-By: k0kubun <>
2023-06-12[Feature #19719] Universal Parseryui-knk
Introduce Universal Parser mode for the parser. This commit includes these changes: * Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions are passed via `struct rb_parser_config_struct` when this macro is enabled. * Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu. Notes: Merged:
2023-06-08Split long options from `proc_options`Nobuyoshi Nakada
2023-06-08Split some options from `proc_options`Nobuyoshi Nakada
`-W`, `-e`, `-K`, `-0`, `-E` and `--encoding` options.
2023-06-05Move per sections in help messageNobuyoshi Nakada
Notes: Merged:
2023-06-05Add additional info for `-0` to `--help` messageNobuyoshi Nakada
Notes: Merged:
2023-06-05Fold option lines in help messageNobuyoshi Nakada
Notes: Merged:
2023-06-05[Bug #19685]: Add `-y` and `--yydebug` document to `--help`Yla Aioi
Add -y option information to `--help` Fix a warning on the man page Notes: Merged: Merged-By: nobu <>
2023-05-31Assertion on message length for the `-h` optionNobuyoshi Nakada
2023-05-21Put `rb_fork` back into process.cNobuyoshi Nakada
Now, calling `rb_fork` directly breaks the PID cache and the timer thread, so must use `rb_fork_ruby` or similar instead. Notes: Merged:
2023-05-21Use `rb_fork_ruby` for `--help` pagerNobuyoshi Nakada
Instead of `rb_fork`, to update `current_fork_gen` which has been introduced at 3563e1383fe4ce13168cd3b9f4d5222d69d00061. Otherwise, the forked process attempts to stop the timer thread, but raises an exception because the thread is not alive in the child and dies because already no tag is present at that time. Notes: Merged:
2023-05-10[Bug #19597] Freeze script nameNobuyoshi Nakada
Notes: Merged:
2023-04-14Add RB_WARN_CATEGORY_DEFAULT_BITSJean Boussier
Followup: ac123f167a364c3d7a43eca78d564e41f6dbb91e RB_WARN_CATEGORY_ALL_BITS is exposed in a public header, so it makes sense for it to be updated to contain all valid bits. Instead we introduce RB_WARN_CATEGORY_DEFAULT_BITS to list the categories that are enabled by default. Notes: Merged:
2023-04-13Emit a performance warning when a class reached max variationsJean Boussier
[Feature #19538] This new `peformance` warning category is disabled by default. It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true` Notes: Merged:
2023-04-13YJIT: Add a sampling option to exit tracing (#7693)Adam Hess
Add a sampling option to trace exits Running YJIT with trace exits enabled can make very large metrics files. This allows us to configure a sample rate to make tracing exits possible on larger tests. This also updates the documented YJIT options. Co-authored-by: Alan Wu <> Co-authored-by: John Hawthorn <> Co-authored-by: Maxime Chevalier-Boisvert <> Notes: Merged-By: maximecb <>
2023-04-07[Bug #19584] Register global variable address before assignmentNobuyoshi Nakada
2023-04-04[Feature #19579] Remove !USE_RVARGC code (#7655)Peter Zhu
Remove !USE_RVARGC code [Feature #19579] The Variable Width Allocation feature was turned on by default in Ruby 3.2. Since then, we haven't received bug reports or backports to the non-Variable Width Allocation code paths, so we assume that nobody is using it. We also don't plan on maintaining the non-Variable Width Allocation code, so we are going to remove it. Notes: Merged-By: maximecb <>
2023-03-18RJIT: Prefix rjit_options with rb_Takashi Kokubun