99244 Commits

Author SHA1 Message Date
dependabot[bot]
a02496ea0f Bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [github/codeql-action](https://github.com/github/codeql-action) and [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `github/codeql-action` from 4.36.1 to 4.36.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](87557b9c84...8aad20d150)

Updates `taiki-e/install-action` from 2.81.3 to 2.81.5
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](25435dc8dd...4bc351f7f2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.81.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-05 11:23:26 +09:00
Hiroshi SHIBATA
cf90fbfed2 [ruby/rubygems] Reject non-String executables and bindir with a clear error
A non-String executable name or bindir previously raised TypeError from
File.basename or File.join. Guard the type so verify_spec raises
Gem::InstallError instead of aborting with an unexpected exception.

https://github.com/ruby/rubygems/commit/89bf13a11b

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:37 +00:00
Hiroshi SHIBATA
daa3721f02 [ruby/rubygems] Escape executable name when generating the wrapper script
Escape the executable name interpolated into the generated wrapper so a
name containing quotes cannot change the generated Ruby.

https://github.com/ruby/rubygems/commit/9f32631b77

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:37 +00:00
Hiroshi SHIBATA
48d8134e4a [ruby/rubygems] Validate spec.bindir in Gem::Installer#verify_spec
Reject a bindir that resolves outside the gem directory during pre-install
checks.

https://github.com/ruby/rubygems/commit/cd61a78b25

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:37 +00:00
Hiroshi SHIBATA
4e860ec9e8 [ruby/rubygems] Validate spec.executables in Gem::Installer#verify_spec
Reject executables that are not plain basenames during pre-install checks.

https://github.com/ruby/rubygems/commit/92198d209d

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:37 +00:00
Hiroshi SHIBATA
f2fac353c1 [ruby/rubygems] Coerce the post-install message to a String before sanitizing
post_install_message may be a non-String such as an array, so call to_s
before clean_text to avoid raising during install.

https://github.com/ruby/rubygems/commit/95b6bfbd16

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:24 +00:00
Hiroshi SHIBATA
4b4b99deaa [ruby/rubygems] Clarify the C1 comment and strengthen the multibyte test
Reword the comment to explain that the UTF-8 guard avoids splitting
multibyte sequences, and assert preservation with U+0400, whose
continuation byte falls in the C1 byte range.

https://github.com/ruby/rubygems/commit/0db489ff2e

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:23 +00:00
Hiroshi SHIBATA
e8a5722a7f [ruby/rubygems] Clean control characters from the post-install message
Route the post-install message through Gem::Text#clean_text before
printing it so a crafted message cannot emit raw terminal control
sequences.

https://github.com/ruby/rubygems/commit/cc62ee89ab

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:22 +00:00
Hiroshi SHIBATA
13439367d5 [ruby/rubygems] Strip C1 control characters in Gem::Text#clean_text
Match C1 controls (U+0080-U+009F) as codepoints and only for valid UTF-8
text, so multibyte characters are preserved and other encodings are left
unchanged.

https://github.com/ruby/rubygems/commit/c272a8b138

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 01:24:22 +00:00
Peter Zhu
fd10392980 [DOC] Improve docs for ObjectSpace.undefine_finalizer 2026-06-05 09:51:09 +09:00
Hiroshi SHIBATA
c976dffd14
IO::Buffer.map is not shareable across processes on OpenBSD
Restore the OpenBSD exclusion dropped when the windows guard was
replaced with a fork guard in the spec sync. OpenBSD has fork but
MAP_SHARED writes are not reflected through read(2).

https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20260604T223004Z.fail.html.gz

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 09:36:39 +09:00
Nobuyoshi Nakada
2c3723df84 [ruby/zlib] Drop older rubies than 2.7
This library already uses designated initializers, that is a C99
feature.  C99 has been adopted since ruby 2.7.

https://github.com/ruby/zlib/commit/cfa8fb2db4
2026-06-05 00:18:38 +00:00
Jean Boussier
6d5f8aba67 [ruby/json] parser.c: Mark some paths as unreacheable
Generate very sligthly better code (one less instruction...).

Also extract `json_on_duplicate_key` as `NOINLINE`.

https://github.com/ruby/json/commit/500f0eabf3
2026-06-04 14:42:12 +00:00
Kevin Newton
ab2bc7e9e1 [ruby/json] Make the JSON parse loop iterative
As opposed to a recursive loop. We do this by keeping a stack of
frames (very similar to how the stack of values was already
stored). Each frame represents the state of a container. Since
there are only 2 in JSON, it doesn't have to get too complex.

Each frame in the iterative parser now holds an enum describing
its "phase", in order to support suspending parsing.

For performance to be on par with the previous implementation,
we directly jump to the proper handler in most cases.

`JSON_ParserState.stack` was renamed into `.value_stack`,
as with the introduction of the frames stack, the naming became
confusing.

https://github.com/ruby/json/commit/a760d9ae9b

Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
2026-06-04 06:59:14 +00:00
Hiroshi SHIBATA
9f6cb11797 [ruby/rubygems] Assert the Tools section is gone from bundle env
Guards against accidentally reintroducing the removed external tool
version output.

https://github.com/ruby/rubygems/commit/3060a5498a

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 04:44:01 +00:00
Hiroshi SHIBATA
4f3cd707cc [ruby/rubygems] Remove external tool version checks from bundle env
Keeping up with each version manager's invocation convention is not
worth the maintenance cost. chruby in particular is wrapped as a shell
function and cannot be run as `chruby --version` at all, so the line
always reported a missing version.

https://github.com/ruby/rubygems/issues/9528

https://github.com/ruby/rubygems/commit/85cb212067

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 04:44:00 +00:00
dependabot[bot]
cac0c38eea Bump the github-actions group across 1 directory with 3 updates
Bumps the github-actions group with 3 updates in the / directory: [necojackarc/auto-request-review](https://github.com/necojackarc/auto-request-review), [github/codeql-action](https://github.com/github/codeql-action) and [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `necojackarc/auto-request-review` from 5d3060495e58e9cb41f51de50e808d3135d5374e to 035f049cb68460341ab744f19aa9f31aae685e36
- [Release notes](https://github.com/necojackarc/auto-request-review/releases)
- [Commits](5d3060495e...035f049cb6)

Updates `github/codeql-action` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7211b7c807...87557b9c84)

Updates `taiki-e/install-action` from 2.81.1 to 2.81.3
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](e49978b799...25435dc8dd)

---
updated-dependencies:
- dependency-name: necojackarc/auto-request-review
  dependency-version: 035f049cb68460341ab744f19aa9f31aae685e36
  dependency-type: direct:production
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.81.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 12:51:52 +09:00
Peter Zhu
5859196197 [ruby/mmtk] Use rb_gc_obj_needs_cleanup_p
https://github.com/ruby/mmtk/commit/031785b41c
2026-06-04 02:54:35 +00:00
Max Bernstein
c8c6de3c99 ZJIT: Remove Control write effect of HasType
This was likely a bad copy/paste from GuardType; HasType does not affect
control flow at all.
2026-06-03 21:57:43 -04:00
Max Bernstein
b74a5f5ec8 ZJIT: Replace IsNil with existing HasType
No need for a separate opcode.
2026-06-03 21:57:43 -04:00
Hiroshi SHIBATA
97672020e5 Move artipacked suppressions to zizmor config
The inline `# zizmor: ignore[artipacked]` comment is a second trailing
comment on the checkout line, which prevents Dependabot from updating the
version comment. Suppress these findings in .github/zizmor.yml instead so
the pins stay a single comment and Dependabot keeps them in sync.
2026-06-04 10:49:04 +09:00
Hiroshi SHIBATA
a50eaa3dcd Bump actions/checkout to v6.0.3
Dependabot left the version comment as v6.0.2 on the four lines that
carry a trailing `# zizmor: ignore[artipacked]`, since its comment
rewriter only handles a version comment as the last token on the line.
zizmor flagged the resulting hash/comment mismatch. Update every
checkout pin in .github to the v6.0.3 commit and comment at once.
2026-06-04 10:49:04 +09:00
Max Bernstein
1d104ecf97
ZJIT: Skip HeapBasicObject pointer check if known heap object (#17151)
This saves ~115KiB of code on lobsters but mostly it's just a common-sense thing I've been meaning to do for a while.

I have also thought about splitting up `GuardType` into different kinds of guards but I like the HIR uniformity.

Before:

```
ZJIT stats:
code_region_bytes:     15,630,336
zjit_alloc_bytes:      19,423,844
compile_time            1509.19ms
profile_time              22.26ms
gc_time                   19.16ms
invalidation_time          6.28ms
```

After:

```
ZJIT stats:
code_region_bytes:     15,515,648
zjit_alloc_bytes:      19,333,088
compile_time            1535.77ms
profile_time              22.61ms
gc_time                   16.83ms
invalidation_time          6.50ms
```
2026-06-03 20:16:51 -04:00
Peter Zhu
623fa94e9e [DOC] Improve docs for ObjectSpace.memsize_of 2026-06-04 07:55:45 +09:00
John Hawthorn
739ec91d5a Run FREEOBJ hook as separate step 2026-06-03 14:06:14 -07:00
Takashi Kokubun
6da082f6db
ZJIT: Initialize JITFrame on method entry (#17188) 2026-06-03 12:02:46 -07:00
Nozomi Hijikata
f717edca05
ZJIT: Implement Polymorphic DefinedIvar (#16981)
* ZJIT: Implement Polymorphic Definedivar

Closes: https://github.com/Shopify/ruby/issues/980

Build polymorphic shape/type branches for definedivar in HIR. For each profiled T_OBJECT shape, specialize defined?(`@ivar`) to a constant pushval or nil based on the compile-time ivar index check.

DefinedIvar already profiles self on monomorphic shape guard failures for recompilation, so the recompiled HIR can use the collected polymorphic shapes while keeping a generic DefinedIvar fallback for misses and unsupported shapes.


## Benchmark
### lobsters
Summary:
```diff
- dynamic_definedivar_count:   1,294,854 ( 0.7%)
+ dynamic_definedivar_count:     503,058 ( 0.3%)

  ratio_in_zjit:                                     88.4%
```

```
zjit-master: ruby 4.1.0dev (2026-05-23T00:08:49Z master 5855d61ee4) +ZJIT stats +PRISM [arm64-darwin25]
zjit-polymorphic-definedivar: ruby 4.1.0dev (2026-05-23T07:11:22Z zjit-polymorphic-d.. f75a82e7f1) +ZJIT stats +PRISM [arm64-darwin25]
last_commit=ZJIT: Implement Polymorphic Definedivar

--------  ----------------  ---------------------------------  ------------------------------------  ----------------------------------------
bench     zjit-master (ms)  zjit-polymorphic-definedivar (ms)  zjit-polymorphic-definedivar 1st itr  zjit-master/zjit-polymorphic-definedivar
lobsters      529.9 ± 3.6%                       504.2 ± 7.7%                                 1.148                                     1.051
--------  ----------------  ---------------------------------  ------------------------------------  ----------------------------------------
```

Full stats details below:
<details>

<summary>before patch</summary>

```
Top-2 not optimized method types for send (100.0% of total 65,120):
       null: 44,877 (68.9%)
  optimized: 20,243 (31.1%)
Top-3 not optimized method types for send_without_block (100.0% of total 716,678):
        optimized_send: 711,905 (99.3%)
  optimized_block_call:   4,299 ( 0.6%)
                zsuper:     474 ( 0.1%)
Top-1 not optimized method types for super (100.0% of total 3,678):
  attrset: 3,678 (100.0%)
Top-1 instructions with uncategorized fallback reason (100.0% of total 65,868):
  opt_send_without_block: 65,868 (100.0%)
Top-20 send fallback reasons (99.5% of total 22,386,632):
                             invokeblock_not_specialized: 5,946,612 (26.6%)
                            one_or_more_complex_arg_pass: 4,376,419 (19.5%)
                          send_without_block_polymorphic: 3,748,855 (16.7%)
                          send_without_block_no_profiles: 2,830,116 (12.6%)
                          send_without_block_megamorphic: 1,108,467 ( 5.0%)
                             sendforward_not_specialized:   971,957 ( 4.3%)
                                        send_polymorphic:   806,862 ( 3.6%)
  send_without_block_not_optimized_method_type_optimized:   716,204 ( 3.2%)
                                       super_polymorphic:   337,181 ( 1.5%)
                                   too_many_args_for_lir:   333,633 ( 1.5%)
                      send_not_optimized_need_permission:   238,842 ( 1.1%)
        send_without_block_not_optimized_need_permission:   180,946 ( 0.8%)
                                        send_no_profiles:   177,008 ( 0.8%)
                                     argc_param_mismatch:   124,061 ( 0.6%)
                                 super_complex_args_pass:    89,280 ( 0.4%)
                      invokesuperforward_not_specialized:    80,729 ( 0.4%)
                                           uncategorized:    65,868 ( 0.3%)
                          send_not_optimized_method_type:    65,120 ( 0.3%)
                                        super_from_block:    43,185 ( 0.2%)
                                obj_to_string_not_string:    42,731 ( 0.2%)
Top-4 setivar fallback reasons (100.0% of total 4,182,333):
            not_monomorphic: 3,969,254 (94.9%)
               not_t_object:   119,505 ( 2.9%)
                    complex:    93,131 ( 2.2%)
  new_shape_needs_extension:       443 ( 0.0%)
Top-2 getivar fallback reasons (100.0% of total 11,716,846):
  not_monomorphic: 11,537,525 (98.5%)
          complex:    179,321 ( 1.5%)
Top-3 definedivar fallback reasons (100.0% of total 1,294,854):
  not_monomorphic: 1,289,423 (99.6%)
          complex:     5,122 ( 0.4%)
     not_t_object:       309 ( 0.0%)
Top-5 invokeblock handler (100.0% of total 6,968,323):
  monomorphic_ifunc: 4,143,418 (59.5%)
  monomorphic_other: 1,444,525 (20.7%)
   monomorphic_iseq:   865,749 (12.4%)
        polymorphic:   508,677 ( 7.3%)
        megamorphic:     5,954 ( 0.1%)
Top-6 getblockparamproxy handler (100.0% of total 3,321,873):
  polymorphic: 2,370,458 (71.4%)
          nil:   492,185 (14.8%)
         iseq:   242,627 ( 7.3%)
  no_profiles:   168,826 ( 5.1%)
         proc:    40,245 ( 1.2%)
  megamorphic:     7,532 ( 0.2%)
Top-7 popular complex argument-parameter features not optimized (100.0% of total 4,677,994):
    caller_blockarg: 3,092,361 (66.1%)
  param_forwardable:   697,044 (14.9%)
         param_rest:   409,311 ( 8.7%)
       caller_kwarg:   193,462 ( 4.1%)
       param_kwrest:   143,181 ( 3.1%)
    caller_kw_splat:    85,992 ( 1.8%)
       caller_splat:    56,643 ( 1.2%)
Top-3 compile error reasons (100.0% of total 196,397):
                  exception_handler: 192,000 (97.8%)
             native_stack_too_large:   4,342 ( 2.2%)
  validation_mismatched_block_arity:      55 ( 0.0%)
Top-2 unhandled HIR insns (100.0% of total 229,881):
          throw: 194,104 (84.4%)
  invokebuiltin:  35,777 (15.6%)
Top-19 side exit reasons (100.0% of total 8,637,525):
                   guard_type_failure: 7,692,359 (89.1%)
                   unhandled_hir_insn:   229,881 ( 2.7%)
                        compile_error:   196,397 ( 2.3%)
          patchpoint_method_redefined:   118,680 ( 1.4%)
      block_param_proxy_fallback_miss:   112,551 ( 1.3%)
                      no_profile_send:    93,334 ( 1.1%)
            block_param_proxy_not_nil:    75,195 ( 0.9%)
     patchpoint_stable_constant_names:    55,819 ( 0.6%)
        patchpoint_no_singleton_class:    19,352 ( 0.2%)
                  unhandled_block_arg:    14,541 ( 0.2%)
  block_param_proxy_not_iseq_or_ifunc:    13,401 ( 0.2%)
               fixnum_lshift_overflow:    10,165 ( 0.1%)
                   guard_less_failure:     3,120 ( 0.0%)
                  guard_shape_failure:     1,302 ( 0.0%)
             guard_greater_eq_failure:       941 ( 0.0%)
             guard_super_method_entry:       407 ( 0.0%)
                            interrupt:        49 ( 0.0%)
               obj_to_string_fallback:        30 ( 0.0%)
             guard_not_shared_failure:         1 ( 0.0%)
                             send_count: 182,469,185
                     dynamic_send_count:  22,386,632 (12.3%)
                   optimized_send_count: 160,082,553 (87.7%)
                  dynamic_setivar_count:   4,182,333 ( 2.3%)
                  dynamic_getivar_count:  11,716,846 ( 6.4%)
              dynamic_definedivar_count:   1,294,854 ( 0.7%)
              iseq_optimized_send_count:  54,154,353 (29.7%)
      inline_cfunc_optimized_send_count:  74,812,159 (41.0%)
       inline_iseq_optimized_send_count:   6,346,705 ( 3.5%)
non_variadic_cfunc_optimized_send_count:  13,789,249 ( 7.6%)
    variadic_cfunc_optimized_send_count:  10,980,087 ( 6.0%)
compiled_iseq_count:                                  6,166
compiled_side_exit_count:                            80,485
failed_iseq_count:                                        3
compile_time:                                       2,462ms
compile_side_exit_time:                               113ms
compile_side_exit_time_ratio:                          4.6%
compile_hir_time:                                     798ms
compile_hir_build_time:                               238ms
compile_hir_strength_reduce_time:                     322ms
compile_hir_canonicalize_time:                         49ms
compile_hir_fold_constants_time:                       37ms
compile_hir_clean_cfg_time:                            26ms
compile_hir_eliminate_dead_code_time:                  30ms
compile_lir_time:                                   1,525ms
profile_time:                                          39ms
gc_time:                                               33ms
invalidation_time:                                     14ms
vm_write_jit_frame_count:                       137,433,269
vm_write_sp_count:                              137,433,269
vm_write_locals_count:                          131,272,119
vm_write_stack_count:                           131,272,119
vm_write_to_parent_iseq_local_count:                688,492
guard_type_count:                               145,711,992
guard_type_exit_ratio:                                 5.3%
guard_shape_count:                               36,890,099
guard_shape_exit_ratio:                                0.0%
load_field_count:                               210,155,590
store_field_count:                               15,758,742
side_exit_size:                                  13,563,708
code_region_bytes:                               33,505,280
side_exit_size_ratio:                                 40.5%
zjit_alloc_bytes:                                22,783,024
total_mem_bytes:                                 56,288,304
side_exit_count:                                  8,637,525
total_insn_count:                               995,180,861
vm_insn_count:                                  115,515,525
zjit_insn_count:                                879,665,336
ratio_in_zjit:                                        88.4%
```

</details>

<details>

<summary>after patch</summary>

```
Top-2 not optimized method types for send (100.0% of total 65,119):
       null: 44,877 (68.9%)
  optimized: 20,242 (31.1%)
Top-3 not optimized method types for send_without_block (100.0% of total 716,636):
        optimized_send: 711,869 (99.3%)
  optimized_block_call:   4,293 ( 0.6%)
                zsuper:     474 ( 0.1%)
Top-1 not optimized method types for super (100.0% of total 3,676):
  attrset: 3,676 (100.0%)
Top-1 instructions with uncategorized fallback reason (100.0% of total 65,866):
  opt_send_without_block: 65,866 (100.0%)
Top-20 send fallback reasons (99.5% of total 22,409,237):
                             invokeblock_not_specialized: 5,946,405 (26.5%)
                            one_or_more_complex_arg_pass: 4,376,457 (19.5%)
                          send_without_block_polymorphic: 3,775,975 (16.9%)
                          send_without_block_no_profiles: 2,830,029 (12.6%)
                          send_without_block_megamorphic: 1,104,527 ( 4.9%)
                             sendforward_not_specialized:   971,924 ( 4.3%)
                                        send_polymorphic:   806,852 ( 3.6%)
  send_without_block_not_optimized_method_type_optimized:   716,162 ( 3.2%)
                                       super_polymorphic:   337,178 ( 1.5%)
                                   too_many_args_for_lir:   333,625 ( 1.5%)
                      send_not_optimized_need_permission:   238,842 ( 1.1%)
        send_without_block_not_optimized_need_permission:   180,949 ( 0.8%)
                                        send_no_profiles:   176,799 ( 0.8%)
                                     argc_param_mismatch:   124,064 ( 0.6%)
                                 super_complex_args_pass:    89,280 ( 0.4%)
                      invokesuperforward_not_specialized:    80,723 ( 0.4%)
                                           uncategorized:    65,866 ( 0.3%)
                          send_not_optimized_method_type:    65,119 ( 0.3%)
                                        super_from_block:    43,182 ( 0.2%)
                                obj_to_string_not_string:    42,725 ( 0.2%)
Top-4 setivar fallback reasons (100.0% of total 4,182,216):
            not_monomorphic: 3,969,159 (94.9%)
               not_t_object:   119,484 ( 2.9%)
                    complex:    93,131 ( 2.2%)
  new_shape_needs_extension:       442 ( 0.0%)
Top-2 getivar fallback reasons (100.0% of total 11,716,471):
  not_monomorphic: 11,537,150 (98.5%)
          complex:    179,321 ( 1.5%)
Top-3 definedivar fallback reasons (100.0% of total 503,058):
  not_monomorphic: 498,173 (99.0%)
          complex:   4,576 ( 0.9%)
     not_t_object:     309 ( 0.1%)
Top-5 invokeblock handler (100.0% of total 6,968,099):
  monomorphic_ifunc: 4,143,324 (59.5%)
  monomorphic_other: 1,444,457 (20.7%)
   monomorphic_iseq:   865,705 (12.4%)
        polymorphic:   508,659 ( 7.3%)
        megamorphic:     5,954 ( 0.1%)
Top-6 getblockparamproxy handler (100.0% of total 3,321,803):
  polymorphic: 2,370,425 (71.4%)
          nil:   492,172 (14.8%)
         iseq:   242,810 ( 7.3%)
  no_profiles:   168,625 ( 5.1%)
         proc:    40,239 ( 1.2%)
  megamorphic:     7,532 ( 0.2%)
Top-7 popular complex argument-parameter features not optimized (100.0% of total 4,678,011):
    caller_blockarg: 3,092,480 (66.1%)
  param_forwardable:   697,011 (14.9%)
         param_rest:   409,285 ( 8.7%)
       caller_kwarg:   193,450 ( 4.1%)
       param_kwrest:   143,179 ( 3.1%)
    caller_kw_splat:    85,971 ( 1.8%)
       caller_splat:    56,635 ( 1.2%)
Top-3 compile error reasons (100.0% of total 196,386):
                  exception_handler: 191,989 (97.8%)
             native_stack_too_large:   4,342 ( 2.2%)
  validation_mismatched_block_arity:      55 ( 0.0%)
Top-2 unhandled HIR insns (100.0% of total 229,876):
          throw: 194,101 (84.4%)
  invokebuiltin:  35,775 (15.6%)
Top-19 side exit reasons (100.0% of total 8,638,646):
                   guard_type_failure: 7,693,566 (89.1%)
                   unhandled_hir_insn:   229,876 ( 2.7%)
                        compile_error:   196,386 ( 2.3%)
          patchpoint_method_redefined:   118,676 ( 1.4%)
      block_param_proxy_fallback_miss:   112,548 ( 1.3%)
                      no_profile_send:    93,330 ( 1.1%)
            block_param_proxy_not_nil:    75,195 ( 0.9%)
     patchpoint_stable_constant_names:    55,792 ( 0.6%)
        patchpoint_no_singleton_class:    19,326 ( 0.2%)
                  unhandled_block_arg:    14,540 ( 0.2%)
  block_param_proxy_not_iseq_or_ifunc:    13,401 ( 0.2%)
               fixnum_lshift_overflow:    10,165 ( 0.1%)
                   guard_less_failure:     3,119 ( 0.0%)
                  guard_shape_failure:     1,302 ( 0.0%)
             guard_greater_eq_failure:       941 ( 0.0%)
             guard_super_method_entry:       407 ( 0.0%)
                            interrupt:        45 ( 0.0%)
               obj_to_string_fallback:        30 ( 0.0%)
             guard_not_shared_failure:         1 ( 0.0%)
                             send_count: 182,477,537
                     dynamic_send_count:  22,409,237 (12.3%)
                   optimized_send_count: 160,068,300 (87.7%)
                  dynamic_setivar_count:   4,182,216 ( 2.3%)
                  dynamic_getivar_count:  11,716,471 ( 6.4%)
              dynamic_definedivar_count:     503,058 ( 0.3%)
              iseq_optimized_send_count:  54,138,292 (29.7%)
      inline_cfunc_optimized_send_count:  74,815,196 (41.0%)
       inline_iseq_optimized_send_count:   6,346,484 ( 3.5%)
non_variadic_cfunc_optimized_send_count:  13,788,597 ( 7.6%)
    variadic_cfunc_optimized_send_count:  10,979,731 ( 6.0%)
compiled_iseq_count:                                  6,167
compiled_side_exit_count:                            80,471
failed_iseq_count:                                        3
compile_time:                                       2,711ms
compile_side_exit_time:                               125ms
compile_side_exit_time_ratio:                          4.6%
compile_hir_time:                                     870ms
compile_hir_build_time:                               266ms
compile_hir_strength_reduce_time:                     347ms
compile_hir_canonicalize_time:                         52ms
compile_hir_fold_constants_time:                       40ms
compile_hir_clean_cfg_time:                            27ms
compile_hir_eliminate_dead_code_time:                  32ms
compile_lir_time:                                   1,680ms
profile_time:                                          48ms
gc_time:                                               32ms
invalidation_time:                                     15ms
vm_write_jit_frame_count:                       137,425,789
vm_write_sp_count:                              137,425,789
vm_write_locals_count:                          131,264,963
vm_write_stack_count:                           131,264,963
vm_write_to_parent_iseq_local_count:                688,457
guard_type_count:                               146,412,455
guard_type_exit_ratio:                                 5.3%
guard_shape_count:                               36,937,934
guard_shape_exit_ratio:                                0.0%
load_field_count:                               211,394,883
store_field_count:                               15,778,119
side_exit_size:                                  13,563,624
code_region_bytes:                               33,505,280
side_exit_size_ratio:                                 40.5%
zjit_alloc_bytes:                                22,870,223
total_mem_bytes:                                 56,375,503
side_exit_count:                                  8,638,646
total_insn_count:                               995,144,390
vm_insn_count:                                  115,472,694
zjit_insn_count:                                879,671,696
ratio_in_zjit:                                        88.4%
```

</details>

* ZJIT: Add TODO for deduplicating DefinedIvar specialization

* ZJIT: Add more DefinedIvar HIR tests

Cover unsupported receiver profiles and a mixed polymorphic profile with a generic DefinedIvar fallback.

* ZJIT: Add more DefinedIvar polymorphic HIR test

Cover polymorphic definedivar profiles with:
- complex path
- non-T_OBJECT path
2026-06-03 09:42:20 -04:00
git
464e5665a4 [DOC] Update bundled gems list at 71515f8bfdd8da23b59742f39abac3 2026-06-03 08:30:18 +00:00
Jean Boussier
71515f8bfd [ruby/json] Coverage: ignore test/*
https://github.com/ruby/json/commit/52c9d9bdf2
2026-06-03 07:46:17 +00:00
Jean Boussier
8fefa5537c [ruby/json] Integrate with Ruby 4.1 ruby_sized_xfree
Ensure that buffer sizes have been properly tracked when running
in debug mode, and appease the GC slightly when running in release
mode.

Ref: https://bugs.ruby-lang.org/issues/21861

https://github.com/ruby/json/commit/90354007ea
2026-06-03 07:33:28 +00:00
Jean Boussier
695996c976 [ruby/json] parser.c: noinline json_eat_comments
Comments shouldn't be present in performance sensitive
documents, so it's best not to inline it to make space
for more important code.

https://github.com/ruby/json/commit/f7fe86ea69
2026-06-03 06:52:36 +00:00
git
6d39970a85 Update default gems list at 2faad3767c506ad4ee0e22f3141bd8 [ci skip] 2026-06-03 06:31:37 +00:00
Jean Boussier
2faad3767c [ruby/json] Release 2.19.8
https://github.com/ruby/json/commit/5233dd9b85
2026-06-03 06:30:29 +00:00
Peter Zhu
2ff671c93d [DOC] Improve docs for ObjectSpace.internal_class_of 2026-06-03 14:33:09 +09:00
Burdette Lamar
be5be55177
[DOC] New page for "Filename Globbing" (#17173) 2026-06-03 12:39:31 +09:00
Burdette Lamar
b36bf9d98c
[DOC] Adds page "Filename Matching" 2026-06-03 12:39:07 +09:00
Nobuyoshi Nakada
be696c9c24
[Bug #22092] Improve Array#sum when the initial value is a Float 2026-06-03 11:38:38 +09:00
Peter Zhu
1d3e2bd2b8 [DOC] Improve docs for ObjectSpace.reachable_objects_from_root 2026-06-03 09:31:49 +09:00
Burdette Lamar
f0d45e01ee
[DOC] Harmonize find methods (#17150) 2026-06-03 09:31:19 +09:00
Hiroshi SHIBATA
ad8bf0e636 [ruby/rubygems] Assign rubygems_ext_spec to a test shard
The new spec was unassigned, so the shard-based CI jobs would skip it and
spec_helper would warn. Add it to shard_d per the file's guidance.

https://github.com/ruby/rubygems/commit/35a0782cd2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 21:25:30 +00:00
Hiroshi SHIBATA
f956ef766d [ruby/rubygems] Keep the parse_dependency override private and testable
Define SplitCompactIndexEntryOnFirstColon unconditionally so it can be
exercised on any RubyGems, prepending it only when the host RubyGems still
splits compact index entries on every colon. Mark the override private to
preserve the visibility of the original Gem::Resolver::APISet::GemParser
method, and add a spec covering the colon-preserving behavior.

https://github.com/ruby/rubygems/commit/d6af5c724d

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 21:25:29 +00:00
Hiroshi SHIBATA
63ba697b60 [ruby/rubygems] Split compact index entries on the first colon on older RubyGems
Bundler delegates compact index parsing to the host RubyGems'
Gem::Resolver::APISet::GemParser. Before RubyGems 4.0.13 that splits each
entry on every colon, mangling metadata values that contain colons such as
the `created_at` timestamps the cooldown feature reads, so cooldown silently
stops filtering when Bundler runs on an older RubyGems. Shim parse_dependency
to split only on the first colon in that case.

https://github.com/ruby/rubygems/commit/f3a3bda98e

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 21:25:29 +00:00
Daichi Kamiyama
6fa8fcf005
ZJIT: Add codegen tests for fixnum mod (#17182)
Cover the basic case, negative operands, and division by zero.
2026-06-02 17:13:44 -04:00
Max Bernstein
4aa721f791
ZJIT: Fold unnecessary RefineType (#17183)
If it's already the type we're refining, we can delete the RefineType.
2026-06-02 17:13:27 -04:00
Randy Stauner
3b4761cc8e
ZJIT: Add HIR Comment insn (#15166)
Useful for adding comments to HIR/LIR/disasm that are not specific to an instruction.

Possibly most useful for temporarily printing more information
while debugging by keeping the statements interleaved with the HIR.

With a local change like this

    diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
    index bff384fa65..de5b41caa1 100644
    --- a/zjit/src/hir.rs
    +++ b/zjit/src/hir.rs
    @@ -2491,6 +2491,8 @@ fn type_specialize(&mut self) {
                                cme = unsafe { rb_aliased_callable_method_entry(cme) };
                                def_type = unsafe { get_cme_def_type(cme) };
                            }
    +                       eprintln!("WTH");
    +                       hir_comment!(self, block, "HOWDY def_type {:?}", def_type);
                            if def_type == VM_METHOD_TYPE_ISEQ {
                                // TODO(max): Allow non-iseq; cache cme
                                // Only specialize positional-positional calls

The print statement (1) shows up early (anywhere)
whereas the HIR comment (2) is interleaved with the rest of
the HIR so you can easily correlate debug info to the compilation of
whatever function you are observing:

    1.  WTH
        Optimized HIR:
        fn test@test.rb:2:
        bb0():
          EntryPoint interpreter
          v1:BasicObject = LoadSelf
          Jump bb2(v1)
        bb1(v4:BasicObject):
          EntryPoint JIT(0)
          Jump bb2(v4)
        bb2(v6:BasicObject):
          v11:Fixnum[1] = Const Value(1)
    2.    # HOWDY def_type 0
          PatchPoint MethodRedefined(Object@0x10184ed10, foo@0x9c01, cme:0x101967060)

The comments show up in HIR, LIR, and disasm:

    bb2(v6:BasicObject):
      v11:Fixnum[1] = Const Value(1)
      # HOWDY def_type 0
      PatchPoint MethodRedefined(Object@0x1220fed10, foo@0x9c01, cme:0x123717060)

--

    PatchPoint Exit(PatchPoint(NoTracePoint))
    # Insn: v11 Const Value(1)
    # Insn: v18 # HOWDY def_type 0
    # Insn: v19 PatchPoint MethodRedefined(Object@0x103aaed00, foo@0x9c01, cme:0x103bc7080)
    PatchPoint Exit(PatchPoint(MethodRedefined(Object@0x103aaed00, foo@0x9c01, cme:0x103bc7080)))

--

    0x1230bc0f0: nop
    # Insn: v11 Const Value(1)
    # Insn: v18 # HOWDY def_type 0
    # Insn: v19 PatchPoint MethodRedefined(Object@0x103c6ed20, foo@0x9c01, cme:0x103d87070)
    0x1230bc0f4: nop
2026-06-02 20:42:09 +00:00
Max Bernstein
f261909fa9
ZJIT: Upgrade self to HeapBasicObject in normal methods on most classes (#17155)
If the ISEQ we're compiling is a `ISEQ_TYPE_METHOD` and it's defined on a
class that no immediate object's class inherits from (exclude
`BasicObject`, `Object`, `Numeric`, etc), and the allocator is the
default allocator, then we can assume the `self` is heap-allocated.

This lets us skip HeapBasicObject guards for a lot of instance variable
lookups, for example:

```ruby
class C
  def foo = @foo
end
```

Thanks to @jhawthorn for the idea and @tenderlove for convincing me it was reasonable.
2026-06-02 15:53:09 +00:00
Daichi Kamiyama
9feac5d10e
ZJIT: Change return type of FixnumDiv to Integer (#17165)
`FIXNUM_MIN / -1` overflows to a `Bignum` rather than a `Fixnum`, so type it as returning an `Integer` rather than `Fixnum`. Users that expect a `Fixnum` can guard to narrow the result back to `Fixnum`.

Closes: https://github.com/Shopify/ruby/issues/990
2026-06-02 14:09:39 +00:00
Peter Zhu
f916141a2d [DOC] Fix hash style for Struct 2026-06-02 20:12:28 +09:00
Colby Swandale
5e3e2a4047 [ruby/rubygems] Include the missing dependency's version in resolver errors & test and document Bundler-aligned resolver behaviors
https://github.com/ruby/rubygems/commit/3d5dfa91b9
2026-06-02 07:58:15 +00:00
Colby Swandale
f7932a5318 [ruby/rubygems] Prefer the earlier source for same-version dependency ties
When version and platform match across sources, prefer the earlier
source. This formalises existing behaviour and matches Bundler.
Cross-version selection is unchanged.

https://github.com/ruby/rubygems/commit/8f2cd72650
2026-06-02 07:58:15 +00:00