[pull] master from ruby:master#877
Merged
pull[bot] merged 14 commits intoturkdevops:masterfrom Mar 24, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )