96662 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
a797561e25
Update Typed Data dump on debuggers [ci skip] 2026-01-16 16:47:34 +09:00
Nobuyoshi Nakada
f7d3f675fe
Win32: refine handing of missing-baseruby failure
`exit` in `cmd.exe` ignores non-option, non-digits argument, and exits with the current %ERRORLEVEL%.
2026-01-16 11:12:32 +09:00
Nobuyoshi Nakada
8c39d8d343
Win32: fix baseruby at reconfig
Get rid of the built `ruby.exe` in the current directory.
2026-01-16 11:08:53 +09:00
Nobuyoshi Nakada
81420d6e13
Win32: split -basic-vars- step 2026-01-16 11:01:27 +09:00
Peter Zhu
5d2fd5088d Fix duplicate static assert names in imemo.h 2026-01-15 17:57:27 -05:00
Peter Zhu
f7ae32ed3b Pin ID symbols
Symbols with a corresponding ID should be pinned because they can be used
by things that don't support compaction.
2026-01-15 17:57:27 -05:00
Peter Zhu
6e480e6714 Allow symbols to move in compaction 2026-01-15 17:57:27 -05:00
Earlopain
c34c7def5a [ruby/prism] Fix locations for invalid syntax when using expect1_opening
Followup to https://github.com/ruby/prism/pull/3827

It sets the start to the opening but it should instead just
continue on as usual.
Fixes https://github.com/ruby/prism/issues/3851

Notice how the AST actually contains "123" in both the body and end keyword.

https://github.com/ruby/prism/commit/8f69c5af08
2026-01-15 21:15:34 +00:00
Earlopain
15939e3c30 [ruby/prism] Make irb work with the ripper shim
This is everything that `irb` uses. It works in their test-suite, but there are 20 failures when using the shim that I haven't looked into at all.

`parse` is not used by `irb`. `scan` is, and it's basically `parse` but also including errors. `irb` doesn't seem to care about the errors, so I didn't implement that.

https://github.com/ruby/prism/commit/2c5826b39f
2026-01-15 21:03:55 +00:00
nozomemein
ce390f1995 ZJIT: Remove redundant unboxing 2026-01-15 09:00:53 -08:00
nozomemein
844f072ce1 ZJIT: Inline ArrayAref 2026-01-15 09:00:53 -08:00
nozomemein
256c806a1d ZJIT: Write the result of UnboxFixnum HIR as type spec so that we can make use of it later (e.g. fold_constants for ArrayAref) 2026-01-15 09:00:53 -08:00
nozomemein
065db7cf61 ZJIT: Rename ArrayArefFixnum -> ArrayAref 2026-01-15 09:00:53 -08:00
Nobuyoshi Nakada
11edc286d8
Make Array#map and Array#select more tolerant
Only when YJIT is enabled, the redefinition of `Array#<<` affects
these methods.
2026-01-15 20:32:20 +09:00
Hiroshi SHIBATA
6afac93c5c Restore irb to warning target
Users should add `irb` to their Gemfile.
`Gem::BUNDLED_GEMS.force_activate 'irb'` is workaround for short term.
2026-01-15 17:20:34 +09:00
Daisuke Aritomo
ca9c61800b Suppress bundled gem warning on `binding.irb'
This patch silences the "this won't work in the next version of Ruby"
warning displayed when irb is autoloaded via `binding.irb`.

    main.rb:1: warning: irb used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
    You can add irb to your Gemfile or gemspec to fix this error.
    /.../irb.rb:9: warning: reline used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
    You can add reline to your Gemfile or gemspec to fix this error.

    From: main.rb @ line 1 :

     => 1: binding.irb

    /.../input-method.rb:284: warning: rdoc used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
    You can add rdoc to your Gemfile or gemspec to fix this error.

This warning is incorrect and misleading: users should not need to
include irb (and its dependencies) to their Gemfiles to use
`binding.irb`, even in future versions of Ruby. It is agreed that the
runtime takes care of that.
2026-01-15 17:20:34 +09:00
Hiroshi SHIBATA
2d79cc9bfc Added example for bundle/inline 2026-01-15 16:16:16 +09:00
Daisuke Aritomo
a28c856183 Add comments 2026-01-15 16:16:16 +09:00
Daisuke Aritomo
270c7fcec1 Fake BUNDLE_GEMFILE and BUNDLE_LOCKFILE to let checks pass
Bundler::Runtime#setup requires a real existing lockfile (see
Bundler::SharedHelpers#default_lockfile).
2026-01-15 16:16:16 +09:00
Daisuke Aritomo
943b085949 [Bug #21723] Let binding.irb properly load irb by fixing force_activate()
This patch fixes a problem where `binding.irb` (= force_activate('irb'))
fails under `bundle exec` when the Gemfile does not contain `irb` and
does contain a gem which is (1) not installed in GEM_HOME (2) sourced
using `path:`/`git:`.

The original approach constructing a temporary definition fails since
it does not set the equalivent of `path:`/`git:`.

Always reconstructing a definition from a Gemfile and applying lockfile
constraints should be a more robust approach.

[Bug #21723]
2026-01-15 16:16:16 +09:00
git
de17b84a3d Update bundled gems list as of 2026-01-15 2026-01-15 06:55:51 +00:00
Nobuyoshi Nakada
886202bac8
Count assertions in child processes
Fix up GH-15785.
2026-01-15 12:30:29 +09:00
OKURA Masafumi
189bb64af8 [ci-skip] Shorter example for Module#instance_method
The previous example code was too complex and includes extra logics
that's not relevant to its main usage: `bind`.
The new example code focuses on `bind_call` so that readers can
understand how it works more easily.
2026-01-15 11:36:18 +09:00
Lars Kanis
806031d2ce Windows: Remove workaround for LLVM windres
It was introduced as part of the Arm64-on-Windows patch:
  https://github.com/ruby/ruby/pull/8995

But a few days later it was fixed on the LLVM side for llvm-18 and backported to MSYS2:
  https://github.com/msys2/MINGW-packages/pull/19157#issuecomment-1825285063

Now this code is only unnecessary complexity.
2026-01-15 11:14:54 +09:00
Kevin Menard
4a21b83693
ZJIT: Optimize common invokesuper cases (#15816)
* ZJIT: Profile `invokesuper` instructions

* ZJIT: Introduce the `InvokeSuperDirect` HIR instruction

The new instruction is an optimized version of `InvokeSuper` when we know the `super` target is an ISEQ.

* ZJIT: Expand definition of unspecializable to more complex cases

* ZJIT: Ensure `invokesuper` optimization works when the inheritance hierarchy is modified

* ZJIT: Simplify `invokesuper` specialization to most common case

Looking at ruby-bench, most `super` calls don't pass a block, which means we can use the already optimized `SendWithoutBlockDirect`.

* ZJIT: Track `super` method entries directly to avoid GC issues

Because the method entry isn't typed as a `VALUE`, we set up barriers on its `VALUE` fields. But, that was insufficient as the method entry itself could be collected in certain cases, resulting in dangling objects. Now we track the method entry as a `VALUE` and can more naturally mark it and its children.

* ZJIT: Optimize `super` calls with simple argument forms

* ZJIT: Report the reason why we can't optimize an `invokesuper` instance

* ZJIT: Revise send fallback reasons for `super` calls

* ZJIT: Assert `super` calls are `FCALL` and don't need visibily checks
2026-01-14 19:10:06 -05:00
Alan Wu
cdb2b0eed5 YJIT: A64: In CPopAll, pop into the register before using MSR
Or else we put garbage into the flags.
2026-01-14 17:19:52 -05:00
Alan Wu
9f3225d0c5 YJIT: Properly preserve register mapping in cpush_all() and cpop_all()
Previously, cpop_all() did not in fact restore the register mapping
state since it was effectively doing a no-op
`self.ctx.set_reg_mapping(self.ctx.get_reg_mapping())`. This desync in
bookkeeping led to issues with the --yjit-dump-insns option because
print_str() used to use cpush_all() and cpop_all().
2026-01-14 17:19:52 -05:00
Alan Wu
9930468479 YJIT: Fix --yjit-dump-insns by removing {cpush,cpop}_all() in printers
cpush_all() and cpop_all() in theory enabled these `print_*` utilities
to work in more spots, but with automatically spilling in asm.ccall(),
the benefits are now limited. They also have a bug at the moment. Stop
using them to dodge the bug.
2026-01-14 17:19:52 -05:00
Alan Wu
ac22989066 YJIT: Add crashing test for --yjit-dump-insns
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2026-01-14 17:19:52 -05:00
Peter Zhu
068713964a [DOC] Add docs for WeakMap#inspect 2026-01-14 17:08:40 -05:00
Max Bernstein
b21edc1323
ZJIT: Add assume_no_singleton_classes to avoid invalidation loops (#15871)
Make sure we check if we have seen a singleton for this class before assuming we have not. Port the API from YJIT.
2026-01-14 21:58:10 +00:00
Jeff Zhang
1ca066059f
ZJIT: Add Type::has_value method (#15867)
Resolves TODO added in #15863 (See https://github.com/ruby/ruby/pull/15863#discussion_r2687769112)

Adds a method `Type::has_value` for comparing value specialized types with a `Const`.
2026-01-14 13:37:14 -05:00
Nobuyoshi Nakada
b8566faca5
[ruby/json] Remove trailing spaces [ci skip]
https://github.com/ruby/json/commit/15eb40dbdf
2026-01-14 21:30:19 +09:00
Scott Myron
a650c90fab [ruby/json] initialize search.chunk_end to silence a warning about it being potentially uninitialized
https://github.com/ruby/json/commit/73818b80c8
2026-01-14 07:59:32 +00:00
Scott Myron
24ad90d3e0 [ruby/json] use a conditional to select SIMD implementation rather than pointer
https://github.com/ruby/json/commit/86a5cce405
2026-01-14 07:59:32 +00:00
git
875dce2f59 Update bundled gems list as of 2026-01-13 2026-01-14 06:55:49 +00:00
Hiroshi SHIBATA
323ad363ca
Switch filename of release and publish workflows 2026-01-14 15:22:04 +09:00
Hiroshi SHIBATA
ab522c8876
Stop to sync tsort changes 2026-01-14 14:47:06 +09:00
Hiroshi SHIBATA
3aa4aed0cb
Skip Onigumo to check latest version 2026-01-14 14:44:14 +09:00
Nobuyoshi Nakada
49ce12d2ef
Silence building rubyspec-capiext [ci skip] 2026-01-14 13:55:35 +09:00
Chris Hasiński
6e61496531
Pre-allocate IO.select result arrays based on input size (#15850)
io.c: pre-allocate IO.select result arrays based on input size

The ternary (rp?rb_ary_new():rb_ary_new2(0)) became pointless after
commit a51f30c671 (Variable Width Allocation, Mar 2022) made both
rb_ary_new() and rb_ary_new2(0) equivalent.

Instead of just removing the dead code, improve on the original intent
by pre-allocating based on the actual input array size. This avoids
reallocations when many FDs are ready.

Benchmark (100 ready FDs): ~8% improvement (5.59 -> 5.11 us/op)
2026-01-14 14:41:00 +13:00
Jeff Zhang
65a4845780
ZJIT: Constant-fold LoadField/GuardBitEquals from known-frozen object
Resolves https://github.com/Shopify/ruby/issues/915

When we have `LoadField` with a `Shape` return type, we can fold it similar to the object case.
`GuardBitEquals` can be removed when the argument is `Const` and the values are equal.

The behaviors for loading instances variables from frozen/dynamic objects are already covered in existing tests so no new tests were added.
2026-01-13 20:06:01 -05:00
Takashi Kokubun
4f8478f50c misc/.vscode/settings.json: Fix rust-analyzer warnings 2026-01-13 15:27:45 -08:00
Peter Zhu
9f8505f06c [ruby/mmtk] Implement object movement support for finalizer table
https://github.com/ruby/mmtk/commit/e5e2c1c347
2026-01-13 22:59:22 +00:00
Max Bernstein
6f38d3de7f
ZJIT: Only print bold text in TTY (#15864)
This is really irritating when piping to a file or pager.
2026-01-13 20:47:26 +00:00
Randy Stauner
1a0b356d40 Add pushtoarray insn to fix segfault with forwarding + splat
Example insns diff for `def x = [3]; def a(...) = b(*x, 2, 3, ...)`

     == disasm: #<ISeq:a@-e:1 (1,13)-(1,42)>
     local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
     [ 1] "..."@0
     0000 putself                                                          (   1)[Ca]
     0000 putself
     0000 opt_send_without_block                 <calldata!mid:x, argc:0, FCALL|VCALL|ARGS_SIMPLE>
     0000 splatarray                             true
     0000 putobject                              2
     0000 putobject                              3
    +0000 pushtoarray                            2
     0000 getlocal_WC_0                          "..."@0
     0000 sendforward                            <calldata!mid:b, argc:1, ARGS_SPLAT|ARGS_SPLAT_MUT|FCALL|FORWARDING>, nil
     0000 leave                                  [Re]

This matches the insns produced by parse.y
2026-01-13 11:18:19 -08:00
tkling
9db0a8c7db [DOC] zjit: small typo fix
prerequists -> prerequisites
2026-01-13 10:36:15 -05:00
Jun Aruga
6a0a3d605b [ruby/openssl] Fix test_digest.rb in FIPS.
https://github.com/ruby/openssl/commit/27a9a92309
2026-01-13 15:22:09 +00:00
Edouard CHIN
b722d37f21 [ruby/rubygems] Add a missing "require 'etc'" statement:
- Ref https://github.com/ruby/rubygems/pull/9171#discussion_r2658056892
- Referencing the constant Etc may raise a `NameError` depending on
  whether other Rubygems/Bundler codepath have evaluated a prior
  "require 'etc'". This can be reproduced with this Gemfile:

  ```ruby
  source "https://rubygems.org"

  gem 'prism', github: "ruby/prism"
  ```

https://github.com/ruby/rubygems/commit/5d435e6863
2026-01-13 11:12:00 +00:00
eileencodes
b7dbdfe23a [ruby/rubygems] Refactor atomic file write
This refactoring is based off the changes in
test/rubygems/test_gem_remote_fetcher.rb. It no longer uses tempfile as
a result.

https://github.com/ruby/rubygems/commit/be6fd6550b
2026-01-13 07:12:47 +00:00