summaryrefslogtreecommitdiff
path: root/ruby.c
AgeCommit message (Collapse)Author
2024-02-28[PRISM] Factor in CLI options for prismKevin Newton
2024-02-20Update warning flags before dumpNobuyoshi Nakada
2024-02-16[PRISM] Make prism compiler warning experimentalKevin Newton
2024-02-16Abort when streaming code from stdin with PrismNobuyoshi Nakada
Do not read STDIN as a String instance.
2024-02-16Use ID without cache and fix conversion of offsetNobuyoshi Nakada
2024-02-16Extract `process_options_global_setup`Nobuyoshi Nakada
2024-02-16Extract functions depending on `--parser` optionNobuyoshi Nakada
2024-02-16Extract `show_help` functionNobuyoshi Nakada
2024-02-16Dispose AST before exit by yydebugNobuyoshi Nakada
2024-02-15Do not include a backtick in error messages and backtracesYusuke Endoh
[Feature #16495]
2024-02-14[PRISM] Correctly hook up line numbers for evalKevin Newton
2024-02-12Enable redefinition check for rbinc methodsNobuyoshi Nakada
2024-02-08[PRISM] Run opt init before parsingKevin Newton
2024-02-08[PRISM] Support the DATA constantKevin Newton
2024-01-31Raise errors for dumping prism parse treeKevin Newton
2024-01-31[PRISM] Mirror iseq APIsKevin Newton
Before this commit, we were mixing a lot of concerns with the prism compile between RubyVM::InstructionSequence and the general entry points to the prism parser/compiler. This commit makes all of the various prism-related APIs mirror their corresponding APIs in the existing parser/compiler. This means we now have the correct frame naming, and it's much easier to follow where the logic actually flows. Furthermore this consolidates a lot of the prism initialization, making it easier to see where we could potentially be raising errors.
2024-01-22[Prism] path and script name are not the sameMatt Valentine-House
When loading Ruby from a file, or parsing using RubyVM::InstructionSequence.
2024-01-22Make prism respect dump_without_optKevin Newton
2024-01-17Fix off-by-one error of argcNobuyoshi Nakada
Fix ruby/ruby#9562
2024-01-13Fix possible out-of-bounds accessNobuyoshi Nakada
2023-12-21RJIT: Add --rjit-trace to allow TracePoint during JITTakashi Kokubun
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 <ufuk@paralaus.com>
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 <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
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 <jean.boussier+github@shopify.com> * Shorten help string to appease test * Address bug found by Kokubun. Reorder logic. --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com>
2023-09-25[Feature #19790] Rename BUGREPORT_PATH as CRASH_REPORTNobuyoshi Nakada
2023-09-25Honor the same option given laterNobuyoshi Nakada