summaryrefslogtreecommitdiff
path: root/ruby.c
AgeCommit message (Collapse)Author
2023-12-20Correct free_on_exit env var to free_at_exitHParker
2023-12-19We need to load builtins so that they workAaron Patterson
Before this commit no methods defined in Ruby were being loaded. For example `class` or `tap` methods would not exist. [ruby-core:115793] [Bug #20073]
2023-12-18[PRISM] Fix crash when --parser=prism called with stdinMatt Valentine-House
[Bug #20071] Currently Ruby crashes when the --parser=prism flag is used either with no input, or with input that is being redirected from stdin. So all of the following will crash ruby --parser=prism ruby --parser=prism < test_code.rb cat test_code.rb | ruby --parser=prism This commit checks whether the input is assumed to be from stdin, and then processes that as a file. This will fix the second and third case above, but will cause a slight behavioural changes for the first case - Ruby will treat stdin as an empty file in this case and exit, rather than waiting for data to be piped into stdin.
2023-12-17Adjust styles [ci skip]Nobuyoshi Nakada
2023-12-15update message to clarify compiler, not parserAdam Hess
Co-authored-by: Ufuk Kayserilioglu <[email protected]>
2023-12-15Introduce --parser runtime flagHParker
Introduce runtime flag for specifying the parser, ``` ruby --parser=prism ``` also update the description: ``` $ ruby --parser=prism --version ruby 3.3.0dev (2023-12-08T04:47:14Z add-parser-runtime.. 0616384c9f) +PRISM [x86_64-darwin23] ``` [Bug #20044]
2023-12-13Avoid warning --jit when only YJIT is enabledTakashi Kokubun
2023-12-07Free everything at shutdownAdam Hess
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <[email protected]> Co-authored-by: Peter Zhu <[email protected]>
2023-12-06Revert "allow enabling Prism via flag or env var"HParker
This reverts commit 9b76c7fc89460ed8e9be40e4037c1d68395c0f6d.
2023-12-06Adjust styles [ci skip]Nobuyoshi Nakada
2023-12-05allow enabling Prism via flag or env varHParker
Enable Prism using either --prism ruby --prism test.rb or via env var RUBY_PRISM=1 ruby test.rb
2023-12-04Remove `rb_libruby_selfpath` for MJITNobuyoshi Nakada
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 yjid.md * (void) for 0 parameter functions in C99 * Rename iseq_entry_cold => cold_iseq_entry * Document --yjit-cold-threshold in ruby.c * Update doc/yjit/yjit.md Co-authored-by: Jean byroot Boussier <[email protected]> * Shorten help string to appease test * Address bug found by Kokubun. Reorder logic. --------- Co-authored-by: Alan Wu <[email protected]> Co-authored-by: Jean byroot Boussier <[email protected]>
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: https://github.com/ruby/ruby/pull/8335
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: https://github.com/ruby/ruby/pull/8147
2023-08-25Move SCRIPT_LINES__ away from parse.yNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8289
2023-08-22Call ruby_init_setproctitle before process_optionsJeremy Evans
Fixes [Bug #11269] Notes: Merged: https://github.com/ruby/ruby/pull/8265
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: https://github.com/ruby/ruby/pull/8212
2023-08-11Fix range of `--backtrace-limit`Nobuyoshi Nakada
Also an option command line should have precedence over `RUBYOPT`. Notes: Merged: https://github.com/ruby/ruby/pull/8200
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] https://bugs.ruby-lang.org/issues/8661#note-27
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: https://github.com/ruby/ruby/pull/8068
2023-07-13Preserve already set options in `moreswitches`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8068
2023-07-13Shrink `ruby_cmdline_options_t` a bitNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8068
2023-07-05YJIT: Use --yjit-exec-mem-size=128 by default (#8031)Takashi Kokubun
Notes: Merged-By: k0kubun <[email protected]>
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: https://github.com/ruby/ruby/pull/7927
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: https://github.com/ruby/ruby/pull/7906
2023-06-05Add additional info for `-0` to `--help` messageNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7906