Skip to content

[pull] master from ruby:master#877

Merged
pull[bot] merged 14 commits intoturkdevops:masterfrom
ruby:master
Mar 24, 2026
Merged

[pull] master from ruby:master#877
pull[bot] merged 14 commits intoturkdevops:masterfrom
ruby:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Mar 24, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tekknolagi and others added 14 commits March 23, 2026 15:00
The temporary_validate_block_local_definite_assignment check is no
longer needed now that we have a global register allocator.
Closes <#16479>.
It was reported that the duplicate ZJIT symbols among libminiruby and
the ones built into the test binary in zjit-test cause test failures.
This patch removes the duplication, and as such also removes
`--allow-multiple-definition` when on Binutils.
C-defined classes
(ruby/io-console#123)

RDoc does not officially support :stopdoc:/:startdoc: in C files,
and recent RDoc changes cause :stopdoc: to be incorrectly undone
during file processing, making these classes appear as undocumented
in coverage reports.

Switch to :nodoc: which is properly supported in C comments and
correctly marks these internal classes as intentionally undocumented.

ruby/io-console@451630c6ce
Ref: https://bugs.ruby-lang.org/issues/21853

Introduced in Ruby 3.3, will officially be public API in 4.1,
but can be used sooner by checking the existence of RUBY_TYPED_EMBEDDABLE

ruby/json@89fe63069d
This was supposed to go in with #16476 but I didn't realize I never pushed...
When we call `asm.load`, many times we're passing in a VReg, and that
causes extra loads when we lower to machine code.  I'd like to only emit
a load in the case that the operand _isn't_ a VReg.

For example this code:

```ruby
class Foo
  def initialize
    @foo = 123
  end

  def foo
    @foo
  end
end

foo = Foo.new
5.times { foo.foo }
```

Before this patch, the machine code for `LoadField` looks like this:

```
  # Insn: v18 LoadField v17, :_shape_id@0x4
  # Load field id=_shape_id offset=4
  0x121308320: mov x1, x0
  0x121308324: ldur w1, [x1, #4]
```

Now it looks like this:

```
  # Insn: v18 LoadField v17, :_shape_id@0x4
  # Load field id=_shape_id offset=4
  0x12339c320: ldur w1, [x0, #4]
```

We were able to eliminate a reg-reg copy.
The latest RDoc contains ruby/rdoc#1657, which
fixes install-doc failures on some platforms.
* ZJIT: Support nil block parameters

zjit-stats for the ActiveRecord benchmark used to look like this:

```
Top-8 popular complex argument-parameter features not optimized (100.0% of total 2,351,376):
        param_block: 2,157,030 (91.7%)
  param_forwardable:    77,125 ( 3.3%)
         param_rest:    35,052 ( 1.5%)
       param_kwrest:    28,827 ( 1.2%)
       caller_splat:    27,264 ( 1.2%)
    caller_blockarg:    25,309 ( 1.1%)
       caller_kwarg:       476 ( 0.0%)
    caller_kw_splat:       293 ( 0.0%)
```

This is because we weren't handling the case where a callee takes a
block parameter, but the caller doesn't pass one.  For example

```ruby
def test(&blk); blk ? blk.call : 42; end
test
test
```

This patch adds support for `nil` block parameters to bmethod methods as
well as iseq methods.  Now ActiveRecord benchmark stats look like this:

```
Top-7 popular complex argument-parameter features not optimized (100.0% of total 192,204):
  param_forwardable: 74,983 (39.0%)
         param_rest: 35,052 (18.2%)
       param_kwrest: 28,827 (15.0%)
       caller_splat: 27,264 (14.2%)
    caller_blockarg: 25,309 (13.2%)
       caller_kwarg:    476 ( 0.2%)
    caller_kw_splat:    293 ( 0.2%)
```

For posterity: when the callee method is an iseq method, we already
handled the "no block" case by correctly setting BLOCK_HANDLER_NONE in
the environment. When the callee method is a bmethod, we need to
initialize the block to nil as a local

* amend check for complex_arg_pass_param_block instead of deleting

(call to bmethods with a block is rejected elsewhere, but this makes it
so we weaken the check just enough to admit the no block, callee block
param case)

* replace code that directly contradicts comment with an assert

* add snapshot tests

---------

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
@pull pull bot locked and limited conversation to collaborators Mar 24, 2026
@pull pull bot added the ⤵️ pull label Mar 24, 2026
@pull pull bot merged commit 216c5eb into turkdevops:master Mar 24, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants