[pull] master from ruby:master#370
Merged
pull[bot] merged 5 commits intoturkdevops:masterfrom Oct 17, 2025
Merged
Conversation
We have a lot of patchpoint exits on some applications and this helps pin down why.
Now methods on singleton classes (for example, `new`) get split up into
`String*#new`, `Array*#new`, ... (where the `*` indicates a singleton
class) instead of all looking like `Class#new`.
before:
```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (59.8% of total 10,506,888):
String#<<: 987,752 ( 9.4%)
Kernel#is_a?: 755,223 ( 7.2%)
Hash#[]=: 700,802 ( 6.7%)
Regexp#match?: 400,129 ( 3.8%)
String#empty?: 353,775 ( 3.4%)
String#start_with?: 334,961 ( 3.2%)
Hash#key?: 331,080 ( 3.2%)
ObjectSpace::WeakKeyMap#[]: 238,978 ( 2.3%)
TrueClass#===: 235,771 ( 2.2%)
FalseClass#===: 231,144 ( 2.2%)
Array#include?: 213,362 ( 2.0%)
Kernel#respond_to?: 198,730 ( 1.9%)
Kernel#dup: 178,920 ( 1.7%)
Kernel#block_given?: 178,767 ( 1.7%)
BasicObject#!=: 170,602 ( 1.6%)
Class#new: 168,079 ( 1.6%)
Kernel#kind_of?: 165,600 ( 1.6%)
String#==: 158,036 ( 1.5%)
Module#clock_gettime: 144,992 ( 1.4%)
NilClass#===: 137,833 ( 1.3%)
```
after:
```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (59.8% of total 10,506,906):
String#<<: 987,752 ( 9.4%)
Kernel#is_a?: 755,237 ( 7.2%)
Hash#[]=: 700,802 ( 6.7%)
Regexp#match?: 400,129 ( 3.8%)
String#empty?: 353,775 ( 3.4%)
String#start_with?: 334,961 ( 3.2%)
Hash#key?: 331,080 ( 3.2%)
ObjectSpace::WeakKeyMap#[]: 238,978 ( 2.3%)
TrueClass#===: 235,771 ( 2.2%)
FalseClass#===: 231,144 ( 2.2%)
Array#include?: 213,362 ( 2.0%)
Kernel#respond_to?: 198,730 ( 1.9%)
Kernel#dup: 178,920 ( 1.7%)
Kernel#block_given?: 178,767 ( 1.7%)
BasicObject#!=: 170,602 ( 1.6%)
String*#new: 166,696 ( 1.6%)
Kernel#kind_of?: 165,600 ( 1.6%)
String#==: 158,039 ( 1.5%)
Process*#clock_gettime: 144,992 ( 1.4%)
NilClass#===: 137,833 ( 1.3%)
```
This counts methods that can be folded away to nothing *in addition* to the already-counted `CCall`.
remove_class_from_subclasses calls st_insert, which mallocs. Malloc is not
allowed in GC. This commit replaces the st_insert with an st_update since
we know that ns_id exists in the st_table.
The following script reproduces the crash:
require "tempfile"
Tempfile.create do |file|
ns = Namespace.new
ns.require(file)
end
…e fetcher The remote fetcher only works with certain schemes (`http`, `https`, `s3`, and `file`). It's possible for other schemes to show up in this code and it can cause bugs. Before this patch, doing `gem install path:///hello` would result in an infinite loop because this function would do `send "fetch_path"`, calling itself forever. Now we see an exception. I think we should validate gem names earlier, but it's really best practice to restrict the possible strings passed to `send`. ruby/rubygems@54e2781b73
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 : )