94573 Commits

Author SHA1 Message Date
TaoufikMejri
2f20dc5dc5 [DOC] Improve loop code example documentation 2025-10-19 20:35:57 +09:00
Hiroshi SHIBATA
8edb40f6e8
Change upstream repository of rubygems 2025-10-19 19:18:28 +09:00
Nobuyoshi Nakada
56afc0a0ce [ruby/English] [DOC] Markup variables in the full list as code
https://github.com/ruby/English/commit/5e60c1068a
2025-10-19 00:58:08 +00:00
Nobuyoshi Nakada
4e6d78b8f4 [ruby/English] [DOC] Enclose English in quotes
https://github.com/ruby/English/commit/70b46b58cc
2025-10-19 00:58:07 +00:00
Peter Zhu
ddd1aeaa64 Free loaded_features_index in namespace 2025-10-18 10:40:43 -04:00
Peter Zhu
eb4a6f0cda Fix memory leak of TypedData data in Namespace 2025-10-18 10:40:43 -04:00
Peter Zhu
d7f412e685 Add rb_root_namespace_data_type 2025-10-18 10:40:43 -04:00
Nobuyoshi Nakada
db35784895 [ruby/zlib] Initialize const member
```
  /github/workspace/src/ext/zlib/zlib.c:2608:25: warning: default initialization of an object of type 'struct read_raw_arg' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe]
   2608 |     struct read_raw_arg ra;
        |                         ^
  /github/workspace/src/ext/zlib/zlib.c:2450:14: note: member 'argv' declared 'const' here
   2450 |         const VALUE argv[2]; /* for rb_funcallv */
        |                     ^
```

https://github.com/ruby/zlib/commit/dfa1fcbd37
2025-10-18 03:54:28 +00:00
Peter Zhu
7989a2ff46 Preallocate capacity for id table in rb_singleton_class_clone_and_attach
We know the exact capacity for the constant table created in
rb_singleton_class_clone_and_attach so we can preallocate it.
2025-10-17 20:44:04 -04:00
Burdette Lamar
9b2216954a
[DOC] Tweaks for String#rindex 2025-10-17 20:40:58 -04:00
Aiden Fox Ivey
a0bf6d3498
ZJIT: Add inlining for Kernel#respond_to? (#14873)
lobsters before:

<details>

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (61.1% of total 10,568,718):
                               Kernel#is_a?: 1,030,925 ( 9.8%)
                                  String#<<:   851,954 ( 8.1%)
                                   Hash#[]=:   742,942 ( 7.0%)
                              Regexp#match?:   399,898 ( 3.8%)
                                  Hash#key?:   349,146 ( 3.3%)
                         String#start_with?:   334,963 ( 3.2%)
                         Kernel#respond_to?:   316,528 ( 3.0%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.3%)
                              TrueClass#===:   235,771 ( 2.2%)
                             FalseClass#===:   231,144 ( 2.2%)
                             Array#include?:   211,386 ( 2.0%)
                                 Hash#fetch:   204,702 ( 1.9%)
                        Kernel#block_given?:   181,796 ( 1.7%)
                                 Kernel#dup:   179,341 ( 1.7%)
                             BasicObject#!=:   175,997 ( 1.7%)
                                 String.new:   166,696 ( 1.6%)
                            Kernel#kind_of?:   165,600 ( 1.6%)
                                  String#==:   157,746 ( 1.5%)
                      Process.clock_gettime:   144,992 ( 1.4%)
                                 Array#any?:   138,310 ( 1.3%)
Top-20 not annotated C methods (62.1% of total 10,723,613):
                               Kernel#is_a?: 1,212,816 (11.3%)
                                  String#<<:   851,954 ( 7.9%)
                                   Hash#[]=:   743,121 ( 6.9%)
                              Regexp#match?:   399,898 ( 3.7%)
                                  Hash#key?:   349,146 ( 3.3%)
                         String#start_with?:   334,963 ( 3.1%)
                         Kernel#respond_to?:   316,528 ( 3.0%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.2%)
                              TrueClass#===:   235,771 ( 2.2%)
                             FalseClass#===:   231,144 ( 2.2%)
                             Array#include?:   211,386 ( 2.0%)
                                 Hash#fetch:   204,702 ( 1.9%)
                        Kernel#block_given?:   191,665 ( 1.8%)
                                 Kernel#dup:   179,348 ( 1.7%)
                             BasicObject#!=:   176,181 ( 1.6%)
                                 String.new:   166,696 ( 1.6%)
                            Kernel#kind_of?:   165,634 ( 1.5%)
                                  String#==:   163,678 ( 1.5%)
                      Process.clock_gettime:   144,992 ( 1.4%)
                                 Array#any?:   138,310 ( 1.3%)
Top-2 not optimized method types for send (100.0% of total 72,324):
  cfunc: 48,057 (66.4%)
   iseq: 24,267 (33.6%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,523,699):
       iseq: 2,271,952 (50.2%)
    bmethod:   985,636 (21.8%)
  optimized:   949,704 (21.0%)
      alias:   310,747 ( 6.9%)
       null:     5,106 ( 0.1%)
      cfunc:       554 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,293,340):
             invokesuper: 2,373,561 (55.3%)
             invokeblock:   811,934 (18.9%)
             sendforward:   505,452 (11.8%)
                  opt_eq:   451,756 (10.5%)
                opt_plus:    74,406 ( 1.7%)
               opt_minus:    36,228 ( 0.8%)
  opt_send_without_block:    21,792 ( 0.5%)
                 opt_neq:     7,231 ( 0.2%)
                opt_mult:     6,752 ( 0.2%)
                  opt_or:     3,753 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 25,481,476):
                send_without_block_polymorphic: 9,722,801 (38.2%)
                              send_no_profiles: 5,894,799 (23.1%)
  send_without_block_not_optimized_method_type: 4,523,699 (17.8%)
                     not_optimized_instruction: 4,293,340 (16.8%)
                send_without_block_no_profiles:   948,985 ( 3.7%)
                send_not_optimized_method_type:    72,324 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,134 ( 0.1%)
                      obj_to_string_not_string:     9,765 ( 0.0%)
       send_without_block_direct_too_many_args:       629 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 690,957):
         expandarray: 328,491 (47.5%)
        checkkeyword: 190,694 (27.6%)
    getclassvariable:  59,907 ( 8.7%)
  invokesuperforward:  49,503 ( 7.2%)
       getblockparam:  49,119 ( 7.1%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     952 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      23 ( 0.0%)
Top-3 compile error reasons (100.0% of total 3,718,841):
  register_spill_on_alloc: 3,418,472 (91.9%)
  register_spill_on_ccall:   182,023 ( 4.9%)
        exception_handler:   118,346 ( 3.2%)
Top-17 side exit reasons (100.0% of total 10,861,013):
                        compile_error: 3,718,841 (34.2%)
                   guard_type_failure: 2,638,940 (24.3%)
                  guard_shape_failure: 1,917,541 (17.7%)
                  unhandled_yarv_insn:   690,957 ( 6.4%)
  block_param_proxy_not_iseq_or_ifunc:   535,789 ( 4.9%)
                      unhandled_kwarg:   455,351 ( 4.2%)
                unknown_newarray_send:   314,786 ( 2.9%)
     patchpoint_stable_constant_names:   235,507 ( 2.2%)
                      unhandled_splat:   122,071 ( 1.1%)
        patchpoint_no_singleton_class:   109,668 ( 1.0%)
                   unhandled_hir_insn:    76,397 ( 0.7%)
          patchpoint_method_redefined:    21,598 ( 0.2%)
           block_param_proxy_modified:    19,193 ( 0.2%)
              patchpoint_no_ep_escape:     3,765 ( 0.0%)
               obj_to_string_fallback:       568 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                            interrupt:        19 ( 0.0%)
                             send_count: 68,205,150
                     dynamic_send_count: 25,481,476 (37.4%)
                   optimized_send_count: 42,723,674 (62.6%)
              iseq_optimized_send_count: 18,588,101 (27.3%)
      inline_cfunc_optimized_send_count: 13,566,855 (19.9%)
non_variadic_cfunc_optimized_send_count:  7,904,518 (11.6%)
    variadic_cfunc_optimized_send_count:  2,664,200 ( 3.9%)
dynamic_getivar_count:                        7,366,650
dynamic_setivar_count:                        7,245,122
compiled_iseq_count:                              4,796
failed_iseq_count:                                  447
compile_time:                                     778ms
profile_time:                                       9ms
gc_time:                                           11ms
invalidation_time:                                 77ms
vm_write_pc_count:                           63,636,742
vm_write_sp_count:                           62,292,946
vm_write_locals_count:                       62,292,946
vm_write_stack_count:                        62,292,946
vm_write_to_parent_iseq_local_count:            292,458
vm_read_from_parent_iseq_local_count:         6,600,017
code_region_bytes:                           22,970,368
side_exit_count:                             10,861,013
total_insn_count:                           517,633,620
vm_insn_count:                              162,995,567
zjit_insn_count:                            354,638,053
ratio_in_zjit:                                    68.5%
```

</details>

lobsters after:

<details>

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (61.1% of total 10,239,008):
                               Kernel#is_a?: 1,030,914 (10.1%)
                                  String#<<:   851,954 ( 8.3%)
                                   Hash#[]=:   742,942 ( 7.3%)
                              Regexp#match?:   376,144 ( 3.7%)
                                  Hash#key?:   349,147 ( 3.4%)
                         String#start_with?:   334,963 ( 3.3%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.3%)
                              TrueClass#===:   235,771 ( 2.3%)
                             FalseClass#===:   231,144 ( 2.3%)
                             Array#include?:   211,386 ( 2.1%)
                                 Hash#fetch:   204,702 ( 2.0%)
                        Kernel#block_given?:   181,797 ( 1.8%)
                                 Kernel#dup:   179,341 ( 1.8%)
                             BasicObject#!=:   175,997 ( 1.7%)
                                 String.new:   166,696 ( 1.6%)
                            Kernel#kind_of?:   165,600 ( 1.6%)
                                  String#==:   157,751 ( 1.5%)
                      Process.clock_gettime:   144,992 ( 1.4%)
                                 Array#any?:   138,311 ( 1.4%)
                               Set#include?:   134,362 ( 1.3%)
Top-20 not annotated C methods (62.2% of total 10,372,753):
                               Kernel#is_a?: 1,212,805 (11.7%)
                                  String#<<:   851,954 ( 8.2%)
                                   Hash#[]=:   743,121 ( 7.2%)
                              Regexp#match?:   376,144 ( 3.6%)
                                  Hash#key?:   349,147 ( 3.4%)
                         String#start_with?:   334,963 ( 3.2%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.3%)
                              TrueClass#===:   235,771 ( 2.3%)
                             FalseClass#===:   231,144 ( 2.2%)
                             Array#include?:   211,386 ( 2.0%)
                                 Hash#fetch:   204,702 ( 2.0%)
                        Kernel#block_given?:   191,666 ( 1.8%)
                                 Kernel#dup:   179,348 ( 1.7%)
                             BasicObject#!=:   176,181 ( 1.7%)
                                 String.new:   166,696 ( 1.6%)
                            Kernel#kind_of?:   165,634 ( 1.6%)
                                  String#==:   163,683 ( 1.6%)
                      Process.clock_gettime:   144,992 ( 1.4%)
                                 Array#any?:   138,311 ( 1.3%)
                                Integer#<=>:   135,056 ( 1.3%)
Top-2 not optimized method types for send (100.0% of total 72,324):
  cfunc: 48,057 (66.4%)
   iseq: 24,267 (33.6%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,523,699):
       iseq: 2,271,952 (50.2%)
    bmethod:   985,636 (21.8%)
  optimized:   949,704 (21.0%)
      alias:   310,747 ( 6.9%)
       null:     5,106 ( 0.1%)
      cfunc:       554 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,293,339):
             invokesuper: 2,373,561 (55.3%)
             invokeblock:   811,933 (18.9%)
             sendforward:   505,452 (11.8%)
                  opt_eq:   451,756 (10.5%)
                opt_plus:    74,406 ( 1.7%)
               opt_minus:    36,228 ( 0.8%)
  opt_send_without_block:    21,792 ( 0.5%)
                 opt_neq:     7,231 ( 0.2%)
                opt_mult:     6,752 ( 0.2%)
                  opt_or:     3,753 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 25,457,719):
                send_without_block_polymorphic: 9,699,046 (38.1%)
                              send_no_profiles: 5,894,798 (23.2%)
  send_without_block_not_optimized_method_type: 4,523,699 (17.8%)
                     not_optimized_instruction: 4,293,339 (16.9%)
                send_without_block_no_profiles:   948,985 ( 3.7%)
                send_not_optimized_method_type:    72,324 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,134 ( 0.1%)
                      obj_to_string_not_string:     9,765 ( 0.0%)
       send_without_block_direct_too_many_args:       629 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 690,957):
         expandarray: 328,491 (47.5%)
        checkkeyword: 190,694 (27.6%)
    getclassvariable:  59,907 ( 8.7%)
  invokesuperforward:  49,503 ( 7.2%)
       getblockparam:  49,119 ( 7.1%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     952 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      23 ( 0.0%)
Top-3 compile error reasons (100.0% of total 3,706,981):
  register_spill_on_alloc: 3,406,595 (91.9%)
  register_spill_on_ccall:   182,023 ( 4.9%)
        exception_handler:   118,363 ( 3.2%)
Top-17 side exit reasons (100.0% of total 10,837,266):
                        compile_error: 3,706,981 (34.2%)
                   guard_type_failure: 2,638,921 (24.4%)
                  guard_shape_failure: 1,917,552 (17.7%)
                  unhandled_yarv_insn:   690,957 ( 6.4%)
  block_param_proxy_not_iseq_or_ifunc:   535,789 ( 4.9%)
                      unhandled_kwarg:   455,351 ( 4.2%)
                unknown_newarray_send:   314,786 ( 2.9%)
     patchpoint_stable_constant_names:   223,630 ( 2.1%)
                      unhandled_splat:   122,071 ( 1.1%)
        patchpoint_no_singleton_class:   109,668 ( 1.0%)
                   unhandled_hir_insn:    76,397 ( 0.7%)
          patchpoint_method_redefined:    21,598 ( 0.2%)
           block_param_proxy_modified:    19,193 ( 0.2%)
              patchpoint_no_ep_escape:     3,765 ( 0.0%)
               obj_to_string_fallback:       568 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                            interrupt:        17 ( 0.0%)
                             send_count: 68,157,710
                     dynamic_send_count: 25,457,719 (37.4%)
                   optimized_send_count: 42,699,991 (62.6%)
              iseq_optimized_send_count: 18,588,067 (27.3%)
      inline_cfunc_optimized_send_count: 13,872,916 (20.4%)
non_variadic_cfunc_optimized_send_count:  7,904,566 (11.6%)
    variadic_cfunc_optimized_send_count:  2,334,442 ( 3.4%)
dynamic_getivar_count:                        7,342,896
dynamic_setivar_count:                        7,245,126
compiled_iseq_count:                              4,796
failed_iseq_count:                                  447
compile_time:                                     791ms
profile_time:                                       9ms
gc_time:                                            9ms
invalidation_time:                                 68ms
vm_write_pc_count:                           63,283,243
vm_write_sp_count:                           61,939,447
vm_write_locals_count:                       61,939,447
vm_write_stack_count:                        61,939,447
vm_write_to_parent_iseq_local_count:            292,458
vm_read_from_parent_iseq_local_count:         6,576,263
code_region_bytes:                           22,872,064
side_exit_count:                             10,837,266
total_insn_count:                           517,075,555
vm_insn_count:                              162,674,783
zjit_insn_count:                            354,400,772
ratio_in_zjit:                                    68.5%
```

</details>

---------

Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
2025-10-17 22:37:22 +00:00
Peter Zhu
cb55043383 Set method table owned by iclass in rb_class_duplicate_classext
We duplicate the method table in rb_class_duplicate_classext, so we should
set RCLASSEXT_ICLASS_IS_ORIGIN and unset RCLASSEXT_ICLASS_ORIGIN_SHARED_MTBL
to signal that the iclass owns the method table and it should be freed.
2025-10-17 17:26:00 -04:00
Max Bernstein
1c119f0245 Revert "ZJIT: Mark commonly-edited files as merge=union (#14865)"
This reverts commit 23287c45806cac060ed63e87176d1a87968b9267.

This looks like a mixed bag...
2025-10-17 16:29:03 -04:00
Max Bernstein
23287c4580
ZJIT: Mark commonly-edited files as merge=union (#14865)
This helps the default merge driver make reasonable decisions (and
therefore avoid conflicts) when multiple people are e.g. adding tests
to src/hir.rs at the same time.
2025-10-17 15:48:54 -04:00
Jacob
0594646c0b
ZJIT: Don't push frame for Hash#size (#14871)
`Hash#size` was not in "Top-20 not annotated C methods" on lobsters so our before / after benchmarks are not very helpful for this change.
<details>
<summary>Before</summary>
<br>

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (60.9% of total 10,963,289):
                               Kernel#is_a?: 1,047,725 ( 9.6%)
                                  String#<<:   861,497 ( 7.9%)
                                   Hash#[]=:   740,725 ( 6.8%)
                              Regexp#match?:   398,297 ( 3.6%)
                              String#empty?:   354,809 ( 3.2%)
                                  Hash#key?:   349,173 ( 3.2%)
                         String#start_with?:   337,387 ( 3.1%)
                         Kernel#respond_to?:   321,134 ( 2.9%)
                              TrueClass#===:   239,657 ( 2.2%)
                 ObjectSpace::WeakKeyMap#[]:   238,988 ( 2.2%)
                             FalseClass#===:   234,777 ( 2.1%)
                             Array#include?:   213,229 ( 1.9%)
                        Kernel#block_given?:   181,801 ( 1.7%)
                                 Kernel#dup:   179,349 ( 1.6%)
                            Kernel#kind_of?:   174,710 ( 1.6%)
                             BasicObject#!=:   174,448 ( 1.6%)
                                 String.new:   167,716 ( 1.5%)
                                 Hash#fetch:   160,704 ( 1.5%)
                                  String#==:   158,858 ( 1.4%)
                      Process.clock_gettime:   145,002 ( 1.3%)
Top-20 not annotated C methods (61.8% of total 11,128,431):
                               Kernel#is_a?: 1,226,218 (11.0%)
                                  String#<<:   861,497 ( 7.7%)
                                   Hash#[]=:   740,904 ( 6.7%)
                              Regexp#match?:   398,297 ( 3.6%)
                              String#empty?:   362,047 ( 3.3%)
                                  Hash#key?:   349,173 ( 3.1%)
                         String#start_with?:   337,387 ( 3.0%)
                         Kernel#respond_to?:   321,134 ( 2.9%)
                              TrueClass#===:   239,657 ( 2.2%)
                 ObjectSpace::WeakKeyMap#[]:   238,988 ( 2.1%)
                             FalseClass#===:   234,777 ( 2.1%)
                             Array#include?:   213,229 ( 1.9%)
                        Kernel#block_given?:   191,670 ( 1.7%)
                                 Kernel#dup:   179,356 ( 1.6%)
                            Kernel#kind_of?:   174,745 ( 1.6%)
                             BasicObject#!=:   174,632 ( 1.6%)
                                 String.new:   167,716 ( 1.5%)
                                  String#==:   164,789 ( 1.5%)
                                 Hash#fetch:   160,704 ( 1.4%)
                      Process.clock_gettime:   145,002 ( 1.3%)
Top-2 not optimized method types for send (100.0% of total 62,854):
  cfunc: 47,647 (75.8%)
   iseq: 15,207 (24.2%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,497,956):
       iseq: 2,236,049 (49.7%)
    bmethod:   993,299 (22.1%)
  optimized:   949,781 (21.1%)
      alias:   313,166 ( 7.0%)
       null:     5,106 ( 0.1%)
      cfunc:       555 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,255,830):
             invokesuper: 2,371,027 (55.7%)
             invokeblock:   811,314 (19.1%)
             sendforward:   506,486 (11.9%)
                  opt_eq:   415,294 ( 9.8%)
                opt_plus:    77,090 ( 1.8%)
               opt_minus:    36,228 ( 0.9%)
  opt_send_without_block:    20,297 ( 0.5%)
                 opt_neq:     7,248 ( 0.2%)
                opt_mult:     6,754 ( 0.2%)
                  opt_or:     3,617 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 24,945,472):
                send_without_block_polymorphic: 9,308,731 (37.3%)
                              send_no_profiles: 5,907,934 (23.7%)
  send_without_block_not_optimized_method_type: 4,497,956 (18.0%)
                     not_optimized_instruction: 4,255,830 (17.1%)
                send_without_block_no_profiles:   887,000 ( 3.6%)
                send_not_optimized_method_type:    62,854 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,138 ( 0.1%)
                      obj_to_string_not_string:     9,767 ( 0.0%)
       send_without_block_direct_too_many_args:       262 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 707,558):
         expandarray: 347,142 (49.1%)
        checkkeyword: 190,708 (27.0%)
    getclassvariable:  59,296 ( 8.4%)
       getblockparam:  49,122 ( 6.9%)
  invokesuperforward:  48,163 ( 6.8%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     840 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      19 ( 0.0%)
Top-2 compile error reasons (100.0% of total 3,649,990):
  register_spill_on_alloc: 3,428,507 (93.9%)
  register_spill_on_ccall:   221,483 ( 6.1%)
Top-17 side exit reasons (100.0% of total 10,833,336):
                        compile_error: 3,649,990 (33.7%)
                   guard_type_failure: 2,681,177 (24.7%)
                  guard_shape_failure: 1,897,864 (17.5%)
                  unhandled_yarv_insn:   707,558 ( 6.5%)
  block_param_proxy_not_iseq_or_ifunc:   536,761 ( 5.0%)
                      unhandled_kwarg:   456,394 ( 4.2%)
                unknown_newarray_send:   314,671 ( 2.9%)
     patchpoint_stable_constant_names:   229,825 ( 2.1%)
                      unhandled_splat:   129,577 ( 1.2%)
        patchpoint_no_singleton_class:   108,465 ( 1.0%)
                   unhandled_hir_insn:    76,401 ( 0.7%)
          patchpoint_method_redefined:    20,493 ( 0.2%)
           block_param_proxy_modified:    20,204 ( 0.2%)
              patchpoint_no_ep_escape:     3,765 ( 0.0%)
               obj_to_string_fallback:       156 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                            interrupt:        13 ( 0.0%)
                             send_count: 67,968,616
                     dynamic_send_count: 24,945,472 (36.7%)
                   optimized_send_count: 43,023,144 (63.3%)
              iseq_optimized_send_count: 18,621,234 (27.4%)
      inline_cfunc_optimized_send_count: 13,438,621 (19.8%)
non_variadic_cfunc_optimized_send_count:  8,333,523 (12.3%)
    variadic_cfunc_optimized_send_count:  2,629,766 ( 3.9%)
dynamic_getivar_count:                        7,351,238
dynamic_setivar_count:                        7,267,701
compiled_iseq_count:                              4,772
failed_iseq_count:                                  465
compile_time:                                   7,006ms
profile_time:                                      52ms
gc_time:                                           46ms
invalidation_time:                                123ms
vm_write_pc_count:                           63,668,147
vm_write_sp_count:                           62,343,075
vm_write_locals_count:                       62,343,075
vm_write_stack_count:                        62,343,075
vm_write_to_parent_iseq_local_count:            292,130
vm_read_from_parent_iseq_local_count:         6,623,223
code_region_bytes:                           22,724,608
side_exit_count:                             10,833,336
total_insn_count:                           519,162,657
vm_insn_count:                              164,942,584
zjit_insn_count:                            354,220,073
ratio_in_zjit:                                    68.2%
```

</details>
<details>
<summary>After</summary>
<br>

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (61.1% of total 10,915,774):
                               Kernel#is_a?: 1,027,957 ( 9.4%)
                                  String#<<:   851,954 ( 7.8%)
                                   Hash#[]=:   740,863 ( 6.8%)
                              Regexp#match?:   398,265 ( 3.6%)
                              String#empty?:   353,775 ( 3.2%)
                                  Hash#key?:   349,161 ( 3.2%)
                         String#start_with?:   337,386 ( 3.1%)
                         Kernel#respond_to?:   316,003 ( 2.9%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.2%)
                              TrueClass#===:   235,771 ( 2.2%)
                             FalseClass#===:   231,144 ( 2.1%)
                             Array#include?:   211,340 ( 1.9%)
                                 Hash#fetch:   204,703 ( 1.9%)
                        Kernel#block_given?:   181,791 ( 1.7%)
                                 Kernel#dup:   179,337 ( 1.6%)
                             BasicObject#!=:   174,430 ( 1.6%)
                                 String.new:   166,696 ( 1.5%)
                            Kernel#kind_of?:   165,600 ( 1.5%)
                                  String#==:   154,751 ( 1.4%)
                      Process.clock_gettime:   144,992 ( 1.3%)
Top-20 not annotated C methods (62.0% of total 11,078,184):
                               Kernel#is_a?: 1,209,975 (10.9%)
                                  String#<<:   851,954 ( 7.7%)
                                   Hash#[]=:   741,042 ( 6.7%)
                              Regexp#match?:   398,265 ( 3.6%)
                              String#empty?:   361,013 ( 3.3%)
                                  Hash#key?:   349,161 ( 3.2%)
                         String#start_with?:   337,386 ( 3.0%)
                         Kernel#respond_to?:   316,003 ( 2.9%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 2.2%)
                              TrueClass#===:   235,771 ( 2.1%)
                             FalseClass#===:   231,144 ( 2.1%)
                             Array#include?:   211,340 ( 1.9%)
                                 Hash#fetch:   204,703 ( 1.8%)
                        Kernel#block_given?:   191,660 ( 1.7%)
                                 Kernel#dup:   179,344 ( 1.6%)
                             BasicObject#!=:   174,614 ( 1.6%)
                                 String.new:   166,696 ( 1.5%)
                            Kernel#kind_of?:   165,634 ( 1.5%)
                                  String#==:   160,682 ( 1.5%)
                      Process.clock_gettime:   144,992 ( 1.3%)
Top-2 not optimized method types for send (100.0% of total 71,084):
  cfunc: 47,638 (67.0%)
   iseq: 23,446 (33.0%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,469,252):
       iseq: 2,217,500 (49.6%)
    bmethod:   985,636 (22.1%)
  optimized:   949,705 (21.2%)
      alias:   310,751 ( 7.0%)
       null:     5,106 ( 0.1%)
      cfunc:       554 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,264,988):
             invokesuper: 2,346,307 (55.0%)
             invokeblock:   809,211 (19.0%)
             sendforward:   505,452 (11.9%)
                  opt_eq:   454,244 (10.7%)
                opt_plus:    74,059 ( 1.7%)
               opt_minus:    36,228 ( 0.8%)
  opt_send_without_block:    21,396 ( 0.5%)
                 opt_neq:     7,247 ( 0.2%)
                opt_mult:     6,752 ( 0.2%)
                  opt_or:     3,617 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 25,044,791):
                send_without_block_polymorphic: 9,439,021 (37.7%)
                              send_no_profiles: 5,892,924 (23.5%)
  send_without_block_not_optimized_method_type: 4,469,252 (17.8%)
                     not_optimized_instruction: 4,264,988 (17.0%)
                send_without_block_no_profiles:   882,357 ( 3.5%)
                send_not_optimized_method_type:    71,084 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,136 ( 0.1%)
                      obj_to_string_not_string:     9,767 ( 0.0%)
       send_without_block_direct_too_many_args:       262 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 688,760):
         expandarray: 328,369 (47.7%)
        checkkeyword: 190,697 (27.7%)
    getclassvariable:  59,286 ( 8.6%)
       getblockparam:  49,119 ( 7.1%)
  invokesuperforward:  48,162 ( 7.0%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     840 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      19 ( 0.0%)
Top-2 compile error reasons (100.0% of total 3,642,051):
  register_spill_on_alloc: 3,420,578 (93.9%)
  register_spill_on_ccall:   221,473 ( 6.1%)
Top-17 side exit reasons (100.0% of total 10,740,844):
                        compile_error: 3,642,051 (33.9%)
                   guard_type_failure: 2,624,731 (24.4%)
                  guard_shape_failure: 1,902,123 (17.7%)
                  unhandled_yarv_insn:   688,760 ( 6.4%)
  block_param_proxy_not_iseq_or_ifunc:   534,951 ( 5.0%)
                      unhandled_kwarg:   455,354 ( 4.2%)
                unknown_newarray_send:   314,667 ( 2.9%)
     patchpoint_stable_constant_names:   227,790 ( 2.1%)
                      unhandled_splat:   121,916 ( 1.1%)
        patchpoint_no_singleton_class:   108,465 ( 1.0%)
                   unhandled_hir_insn:    76,397 ( 0.7%)
          patchpoint_method_redefined:    20,487 ( 0.2%)
           block_param_proxy_modified:    19,193 ( 0.2%)
              patchpoint_no_ep_escape:     3,765 ( 0.0%)
               obj_to_string_fallback:       156 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                            interrupt:        16 ( 0.0%)
                             send_count: 67,576,368
                     dynamic_send_count: 25,044,791 (37.1%)
                   optimized_send_count: 42,531,577 (62.9%)
              iseq_optimized_send_count: 18,461,332 (27.3%)
      inline_cfunc_optimized_send_count: 13,154,471 (19.5%)
non_variadic_cfunc_optimized_send_count:  8,243,438 (12.2%)
    variadic_cfunc_optimized_send_count:  2,672,336 ( 4.0%)
dynamic_getivar_count:                        7,322,001
dynamic_setivar_count:                        7,230,445
compiled_iseq_count:                              4,771
failed_iseq_count:                                  466
compile_time:                                   7,134ms
profile_time:                                      52ms
gc_time:                                           46ms
invalidation_time:                                123ms
vm_write_pc_count:                           63,337,758
vm_write_sp_count:                           62,014,782
vm_write_locals_count:                       62,014,782
vm_write_stack_count:                        62,014,782
vm_write_to_parent_iseq_local_count:            292,458
vm_read_from_parent_iseq_local_count:         6,589,698
code_region_bytes:                           22,724,608
side_exit_count:                             10,740,844
total_insn_count:                           515,656,824
vm_insn_count:                              163,676,059
zjit_insn_count:                            351,980,765
ratio_in_zjit:                                    68.3%

```

</details>
2025-10-17 19:33:11 +00:00
Jacob
0e5cb74a00
ZJIT: Don't push frame for String#empty? (#14836)
lobsters before:

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (71.9% of total 15,247,103):
                                    Hash#[]: 4,516,006 (29.6%)
                              Class#current: 1,154,273 ( 7.6%)
                               Kernel#is_a?: 1,027,952 ( 6.7%)
                              Regexp#match?:   398,256 ( 2.6%)
                              String#empty?:   353,775 ( 2.3%)
                                  Hash#key?:   349,154 ( 2.3%)
                                   Hash#[]=:   344,347 ( 2.3%)
                         String#start_with?:   337,386 ( 2.2%)
                         Kernel#respond_to?:   316,003 ( 2.1%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 1.6%)
                              TrueClass#===:   235,771 ( 1.5%)
                             FalseClass#===:   231,144 ( 1.5%)
                             Array#include?:   211,339 ( 1.4%)
                                 Hash#fetch:   204,702 ( 1.3%)
                        Kernel#block_given?:   181,789 ( 1.2%)
         ActiveSupport::OrderedOptions#_get:   181,272 ( 1.2%)
                                 Kernel#dup:   179,336 ( 1.2%)
                             BasicObject#!=:   174,429 ( 1.1%)
                                  Class#new:   168,079 ( 1.1%)
                            Kernel#kind_of?:   165,600 ( 1.1%)
Top-20 not annotated C methods (72.5% of total 15,409,355):
                                    Hash#[]: 4,516,016 (29.3%)
                               Kernel#is_a?: 1,209,970 ( 7.9%)
                              Class#current: 1,154,273 ( 7.5%)
                              Regexp#match?:   398,256 ( 2.6%)
                              String#empty?:   361,013 ( 2.3%)
                                  Hash#key?:   349,154 ( 2.3%)
                                   Hash#[]=:   344,347 ( 2.2%)
                         String#start_with?:   337,386 ( 2.2%)
                         Kernel#respond_to?:   316,003 ( 2.1%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 1.6%)
                              TrueClass#===:   235,771 ( 1.5%)
                             FalseClass#===:   231,144 ( 1.5%)
                             Array#include?:   211,339 ( 1.4%)
                                 Hash#fetch:   204,702 ( 1.3%)
                        Kernel#block_given?:   191,658 ( 1.2%)
         ActiveSupport::OrderedOptions#_get:   181,272 ( 1.2%)
                                 Kernel#dup:   179,343 ( 1.2%)
                             BasicObject#!=:   174,613 ( 1.1%)
                                  Class#new:   168,079 ( 1.1%)
                            Kernel#kind_of?:   165,634 ( 1.1%)
Top-2 not optimized method types for send (100.0% of total 71,083):
  cfunc: 47,637 (67.0%)
   iseq: 23,446 (33.0%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,482,446):
       iseq: 2,227,443 (49.7%)
    bmethod:   985,679 (22.0%)
  optimized:   952,914 (21.3%)
      alias:   310,750 ( 6.9%)
       null:     5,106 ( 0.1%)
      cfunc:       554 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,264,922):
             invokesuper: 2,346,296 (55.0%)
             invokeblock:   809,163 (19.0%)
             sendforward:   505,446 (11.9%)
                  opt_eq:   454,244 (10.7%)
                opt_plus:    74,059 ( 1.7%)
               opt_minus:    36,227 ( 0.8%)
  opt_send_without_block:    21,396 ( 0.5%)
                 opt_neq:     7,247 ( 0.2%)
                opt_mult:     6,752 ( 0.2%)
                  opt_or:     3,617 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 27,366,538):
                send_without_block_polymorphic: 9,222,828 (33.7%)
                              send_no_profiles: 5,892,897 (21.5%)
  send_without_block_not_optimized_method_type: 4,482,446 (16.4%)
                     not_optimized_instruction: 4,264,922 (15.6%)
                send_without_block_no_profiles: 3,407,046 (12.4%)
                send_not_optimized_method_type:    71,083 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,135 ( 0.1%)
                      obj_to_string_not_string:     9,919 ( 0.0%)
       send_without_block_direct_too_many_args:       262 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 688,292):
         expandarray: 328,369 (47.7%)
        checkkeyword: 190,697 (27.7%)
    getclassvariable:  59,286 ( 8.6%)
       getblockparam:  48,651 ( 7.1%)
  invokesuperforward:  48,162 ( 7.0%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     840 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      19 ( 0.0%)
Top-2 compile error reasons (100.0% of total 3,675,808):
  register_spill_on_alloc: 3,459,950 (94.1%)
  register_spill_on_ccall:   215,858 ( 5.9%)
Top-14 side exit reasons (100.0% of total 10,732,532):
                        compile_error: 3,675,808 (34.2%)
                   guard_type_failure: 2,616,693 (24.4%)
                  guard_shape_failure: 1,902,102 (17.7%)
                  unhandled_yarv_insn:   688,292 ( 6.4%)
  block_param_proxy_not_iseq_or_ifunc:   534,943 ( 5.0%)
                      unhandled_kwarg:   421,996 ( 3.9%)
                           patchpoint:   359,831 ( 3.4%)
                unknown_newarray_send:   314,665 ( 2.9%)
                      unhandled_splat:   121,910 ( 1.1%)
                   unhandled_hir_insn:    76,393 ( 0.7%)
           block_param_proxy_modified:    19,193 ( 0.2%)
                            interrupt:       528 ( 0.0%)
               obj_to_string_fallback:       156 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                             send_count: 66,343,482
                     dynamic_send_count: 27,366,538 (41.2%)
                   optimized_send_count: 38,976,944 (58.8%)
              iseq_optimized_send_count: 17,935,768 (27.0%)
      inline_cfunc_optimized_send_count:  5,794,073 ( 8.7%)
non_variadic_cfunc_optimized_send_count: 12,588,582 (19.0%)
    variadic_cfunc_optimized_send_count:  2,658,521 ( 4.0%)
dynamic_getivar_count:                        7,321,990
dynamic_setivar_count:                        7,231,183
compiled_iseq_count:                              4,770
failed_iseq_count:                                  468
compile_time:                                   7,466ms
profile_time:                                      52ms
gc_time:                                           33ms
invalidation_time:                                116ms
vm_write_pc_count:                           64,768,186
vm_write_sp_count:                           63,445,066
vm_write_locals_count:                       63,445,066
vm_write_stack_count:                        63,445,066
vm_write_to_parent_iseq_local_count:            292,445
vm_read_from_parent_iseq_local_count:         6,461,354
code_region_bytes:                           22,446,080
side_exit_count:                             10,732,532
total_insn_count:                           515,600,654
vm_insn_count:                              163,640,874
zjit_insn_count:                            351,959,780
ratio_in_zjit:                                    68.3%
```

lobsters after:

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (72.3% of total 14,893,304):
                                    Hash#[]: 4,515,997 (30.3%)
                              Class#current: 1,154,273 ( 7.8%)
                               Kernel#is_a?: 1,027,957 ( 6.9%)
                              Regexp#match?:   398,259 ( 2.7%)
                                  Hash#key?:   349,149 ( 2.3%)
                                   Hash#[]=:   344,347 ( 2.3%)
                         String#start_with?:   337,386 ( 2.3%)
                         Kernel#respond_to?:   316,003 ( 2.1%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 1.6%)
                              TrueClass#===:   235,771 ( 1.6%)
                             FalseClass#===:   231,144 ( 1.6%)
                             Array#include?:   211,333 ( 1.4%)
                                 Hash#fetch:   204,703 ( 1.4%)
                        Kernel#block_given?:   181,781 ( 1.2%)
         ActiveSupport::OrderedOptions#_get:   181,272 ( 1.2%)
                                 Kernel#dup:   179,337 ( 1.2%)
                             BasicObject#!=:   174,429 ( 1.2%)
                                  Class#new:   168,079 ( 1.1%)
                            Kernel#kind_of?:   165,600 ( 1.1%)
                                  String#==:   154,751 ( 1.0%)
Top-20 not annotated C methods (72.9% of total 15,048,318):
                                    Hash#[]: 4,516,007 (30.0%)
                               Kernel#is_a?: 1,209,975 ( 8.0%)
                              Class#current: 1,154,273 ( 7.7%)
                              Regexp#match?:   398,259 ( 2.6%)
                                  Hash#key?:   349,149 ( 2.3%)
                                   Hash#[]=:   344,347 ( 2.3%)
                         String#start_with?:   337,386 ( 2.2%)
                         Kernel#respond_to?:   316,003 ( 2.1%)
                 ObjectSpace::WeakKeyMap#[]:   238,978 ( 1.6%)
                              TrueClass#===:   235,771 ( 1.6%)
                             FalseClass#===:   231,144 ( 1.5%)
                             Array#include?:   211,333 ( 1.4%)
                                 Hash#fetch:   204,703 ( 1.4%)
                        Kernel#block_given?:   191,650 ( 1.3%)
         ActiveSupport::OrderedOptions#_get:   181,272 ( 1.2%)
                                 Kernel#dup:   179,344 ( 1.2%)
                             BasicObject#!=:   174,613 ( 1.2%)
                                  Class#new:   168,079 ( 1.1%)
                            Kernel#kind_of?:   165,634 ( 1.1%)
                                  String#==:   160,682 ( 1.1%)
Top-2 not optimized method types for send (100.0% of total 71,084):
  cfunc: 47,638 (67.0%)
   iseq: 23,446 (33.0%)
Top-6 not optimized method types for send_without_block (100.0% of total 4,482,444):
       iseq: 2,227,440 (49.7%)
    bmethod:   985,679 (22.0%)
  optimized:   952,916 (21.3%)
      alias:   310,749 ( 6.9%)
       null:     5,106 ( 0.1%)
      cfunc:       554 ( 0.0%)
Top-13 not optimized instructions (100.0% of total 4,264,913):
             invokesuper: 2,346,301 (55.0%)
             invokeblock:   809,153 (19.0%)
             sendforward:   505,445 (11.9%)
                  opt_eq:   454,244 (10.7%)
                opt_plus:    74,056 ( 1.7%)
               opt_minus:    36,227 ( 0.8%)
  opt_send_without_block:    21,396 ( 0.5%)
                 opt_neq:     7,247 ( 0.2%)
                opt_mult:     6,752 ( 0.2%)
                  opt_or:     3,617 ( 0.1%)
                  opt_lt:       348 ( 0.0%)
                  opt_ge:        91 ( 0.0%)
                  opt_gt:        36 ( 0.0%)
Top-9 send fallback reasons (100.0% of total 27,366,491):
                send_without_block_polymorphic: 9,222,820 (33.7%)
                              send_no_profiles: 5,892,885 (21.5%)
  send_without_block_not_optimized_method_type: 4,482,444 (16.4%)
                     not_optimized_instruction: 4,264,913 (15.6%)
                send_without_block_no_profiles: 3,407,030 (12.4%)
                send_not_optimized_method_type:    71,084 ( 0.3%)
       send_without_block_cfunc_array_variadic:    15,134 ( 0.1%)
                      obj_to_string_not_string:     9,919 ( 0.0%)
       send_without_block_direct_too_many_args:       262 ( 0.0%)
Top-9 unhandled YARV insns (100.0% of total 688,291):
         expandarray: 328,368 (47.7%)
        checkkeyword: 190,697 (27.7%)
    getclassvariable:  59,286 ( 8.6%)
       getblockparam:  48,651 ( 7.1%)
  invokesuperforward:  48,162 ( 7.0%)
   opt_duparray_send:  11,978 ( 1.7%)
         getconstant:     840 ( 0.1%)
          checkmatch:     290 ( 0.0%)
                once:      19 ( 0.0%)
Top-2 compile error reasons (100.0% of total 3,675,807):
  register_spill_on_alloc: 3,459,949 (94.1%)
  register_spill_on_ccall:   215,858 ( 5.9%)
Top-14 side exit reasons (100.0% of total 10,732,546):
                        compile_error: 3,675,807 (34.2%)
                   guard_type_failure: 2,616,699 (24.4%)
                  guard_shape_failure: 1,902,100 (17.7%)
                  unhandled_yarv_insn:   688,291 ( 6.4%)
  block_param_proxy_not_iseq_or_ifunc:   534,950 ( 5.0%)
                      unhandled_kwarg:   421,993 ( 3.9%)
                           patchpoint:   359,837 ( 3.4%)
                unknown_newarray_send:   314,667 ( 2.9%)
                      unhandled_splat:   121,913 ( 1.1%)
                   unhandled_hir_insn:    76,393 ( 0.7%)
           block_param_proxy_modified:    19,193 ( 0.2%)
                            interrupt:       525 ( 0.0%)
               obj_to_string_fallback:       156 ( 0.0%)
               guard_type_not_failure:        22 ( 0.0%)
                             send_count: 66,343,388
                     dynamic_send_count: 27,366,491 (41.2%)
                   optimized_send_count: 38,976,897 (58.8%)
              iseq_optimized_send_count: 17,935,730 (27.0%)
      inline_cfunc_optimized_send_count:  6,147,863 ( 9.3%)
non_variadic_cfunc_optimized_send_count: 12,234,780 (18.4%)
    variadic_cfunc_optimized_send_count:  2,658,524 ( 4.0%)
dynamic_getivar_count:                        7,321,987
dynamic_setivar_count:                        7,231,160
compiled_iseq_count:                              4,770
failed_iseq_count:                                  468
compile_time:                                   7,223ms
profile_time:                                      51ms
gc_time:                                           32ms
invalidation_time:                                107ms
vm_write_pc_count:                           64,414,293
vm_write_sp_count:                           63,091,183
vm_write_locals_count:                       63,091,183
vm_write_stack_count:                        63,091,183
vm_write_to_parent_iseq_local_count:            292,443
vm_read_from_parent_iseq_local_count:         6,461,326
code_region_bytes:                           22,446,080
side_exit_count:                             10,732,546
total_insn_count:                           515,600,823
vm_insn_count:                              163,641,263
zjit_insn_count:                            351,959,560
ratio_in_zjit:                                    68.3%
```
2025-10-17 13:26:03 -04:00
Hiroshi SHIBATA
5298e97954
[rubygems/rubygems] Postpone to remove legacy mingw platform
https://github.com/rubygems/rubygems/commit/9b3a5a8ae9
2025-10-17 21:39:13 +09:00
Hiroshi SHIBATA
fb72e188ef
Update repository urls for rubygems and bundler 2025-10-17 21:26:41 +09:00
Nobuyoshi Nakada
837947ac7f Compatibility with test-unit-ruby-core 2025-10-17 18:55:54 +09:00
Jun Aruga
943b5f66f7 CI: Launchable: Fix errors at actions/setup-python on ppc64le/s390x
The following errors happened at the actions/setup-python step.

https://github.com/ruby/ruby/actions/runs/18229870239

> The version '3.x' with architecture 's390x' was not found for Ubuntu 24.04.
> The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

> The version '3.x' with architecture 'ppc64' was not found for Ubuntu 24.04.
> The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

After skipping the actions/setup-python step, the following errors also
happened at the actions/setup-java step.

https://github.com/ruby/ruby/actions/runs/18355975425?pr=14721

> make-ibm (check, ubuntu-24.04-ppc64le)
> Could not find satisfied version for SemVer '17'.

> make-ibm (check, ubuntu-24.04-s390x)
> The process '/usr/bin/bash' failed with exit code 1

> make-ibm (check, ubuntu-24.04-s390x)
> Process completed with exit code 127.

To fix the errors, I started using the Java distribution semeru (IBM Semeru
Runtime Open Edition) on the ppc64le/s390x cases.

You can see the following page for the details of the Java distribution semeru.

https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions
ead9eaa3cf/src/distributions/semeru/installer.ts (L20-L27)
2025-10-17 10:37:15 +01:00
Charlie Savage
5ced99dddb [rubygems/rubygems] :Revamp CmakeBuilder to fix the issues described in #8572. Specifically:
* Correctly pass command line arguments to CMake
* Call CMake twice - once to configure a project and a second time to build (which is the standard way to use CMake). This fixes the previously incorrect assumption that CMake generates a Make file.
* Update the tests to specify a CMake minimum version of 3.26 (which is already two years old). 3.26 is a bit arbritary but it aligns with Rice, and updates from the ancient 3.5 version being used (which CMake generates a warning message saying stop using it!)
* Update the CMake call to use CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DIRECTORY to tell CMake to copy compiled binaries to the a Gem's lib directory.

Note the updated builder took inspiration from the Cargo Builder, meaning you first create an instance of CmakeBuilder versus just calling class methods.

https://github.com/rubygems/rubygems/commit/9e248d4679
2025-10-17 08:24:02 +00:00
Nobuyoshi Nakada
c2860bff88
CI: Try mingw arm64 2025-10-17 15:09:16 +09:00
Nobuyoshi Nakada
87593f2c0f
Disable shorten-64-to-32 warning on IL32LLP64
Disable the shorten-64-to-32 warning for now, because it currently
generates a lot of warnings on platforms where `sizeof(void*)` is
larger than `sizeof(long)`.

TODO: Replace `long` with `ptrdiff_t` or something in the all sources.
2025-10-17 15:09:16 +09:00
Nobuyoshi Nakada
485f079dc5
win32: OBJCOPY is not needed on Windows in favor of def file 2025-10-17 15:09:15 +09:00
Nobuyoshi Nakada
1546362fd1
win32: Prefix clock_getclock and clock_getres
Get rid of conflict with inline versions provided in time.h.
2025-10-17 15:09:15 +09:00
Nobuyoshi Nakada
89961f8581
configure.ac: Update caches for functions defined in win32.c 2025-10-17 15:09:15 +09:00
Nobuyoshi Nakada
3dc620166b
win32: Install the same packages as vcpkg even on msys 2025-10-17 15:09:15 +09:00
Nobuyoshi Nakada
2dc23c1ad8
win32: Fix missing type 2025-10-17 15:08:45 +09:00
Nobuyoshi Nakada
5a23716c4f Skip low precision clocks to measure performances 2025-10-17 14:52:19 +09:00
Nobuyoshi Nakada
b2d4dc9c46 win32: Support more clockid_t
Add `CLOCK_PROCESS_CPUTIME_ID` and `CLOCK_THREAD_CPUTIME_ID`.
2025-10-17 14:52:19 +09:00
ishikawa999
ff6bd7fb4e [ruby/ipaddr] Fix InvalidAddressError message
https://github.com/ruby/ipaddr/commit/c96dbadee3
2025-10-17 05:11:36 +00:00
Hiroshi SHIBATA
9664191e19 Use ruby/setup-ruby v1.265.0 2025-10-17 10:54:32 +09:00
Aaron Patterson
4f51f6243e [rubygems/rubygems] Restrict what schemes are acceptable in the remote 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`.

https://github.com/rubygems/rubygems/commit/54e2781b73
2025-10-16 23:40:04 +00:00
Peter Zhu
9a80258b23 Fix crash when freeing namespaces
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
2025-10-16 17:03:20 -04:00
Max Bernstein
3fa8484600 ZJIT: Add to counters when FnProperties.inline inlining succeeds
This counts methods that can be folded away to nothing *in addition* to
the already-counted `CCall`.
2025-10-16 16:47:49 -04:00
Max Bernstein
9598b4449d ZJIT: Fix singleton class qualified method names in stats
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%)
```
2025-10-16 16:47:49 -04:00
Max Bernstein
037b6e24ea
ZJIT: Break out patchpoint exit reasons (#14858)
We have a lot of patchpoint exits on some applications and this helps
pin down why.
2025-10-16 15:16:47 -04:00
Aiden Fox Ivey
190a3cd475
ZJIT: [DOC] Recommend cargo-binstall for ZJIT tool installation (GH-14859) 2025-10-16 13:35:33 -04:00
Max Bernstein
f925f1ae7b
ZJIT: Inline BasicObject#initialize (#14856)
It just returns nil.
2025-10-16 11:34:07 -04:00
Kevin Newton
68f45a6da7 [ruby/prism] Do not rely on RUBY_VERSION being consistent
https://github.com/ruby/prism/commit/34428946db
2025-10-16 14:38:14 +00:00
Kevin Newton
a8a8f1c20e [ruby/prism] Handle RUBY_VERSION being nil
https://github.com/ruby/prism/commit/dda0dc81df
2025-10-16 14:29:43 +00:00
Kevin Newton
cea3307fe6 [ruby/prism] Do not stub Ruby version
https://github.com/ruby/prism/commit/44c4306247
2025-10-16 14:10:39 +00:00
Kevin Newton
6652d5072f [ruby/prism] Create a new string for the current version error
https://github.com/ruby/prism/commit/ebf4425d49
2025-10-16 14:00:28 +00:00
Kevin Newton
99929d6f2b [ruby/prism] Do not rely on Gem being loaded
https://github.com/ruby/prism/commit/2466940e49
2025-10-16 13:20:44 +00:00
git
ea4c3169c1 Update default gems list at aa2d3cd5133e6a5deb24fa047e5a66 [ci skip] 2025-10-16 12:45:23 +00:00
Kevin Newton
aa2d3cd513 [ruby/prism] Bump to v1.6.0
https://github.com/ruby/prism/commit/b72fcc6183
2025-10-16 12:43:49 +00:00
Earlopain
f5d3b6e626 [ruby/prism] Add support for Prism.parse(foo, version: "current")
The docs currently say to use `Prism.parse(foo, version: RUBY_VERSION)` for this.
By specifying "current" instead, we can have prism raise a more specifc error.

Note: Does not use `ruby_version` from `ruby/version.h` because writing a test for that is not really possible.
`RUBY_VERSION` is nicely stubbable for both the c-ext and FFI backend.

https://github.com/ruby/prism/commit/9c5cd205cf
2025-10-16 12:34:14 +00:00
Max Bernstein
1d95d75c3f
ZJIT: Profile opt_succ and inline Integer#succ for Fixnum (#14846)
This is only really called a lot in the benchmark harness, as far as I
can tell.
2025-10-15 23:40:45 -04:00
Max Bernstein
7a474e1fbd
ZJIT: Inline String#getbyte (#14842) 2025-10-16 02:01:00 +00:00
John Hawthorn
45c016866c Use explicit memory orders in concurrent_set
The atomic load/store operations here should mostly be using
release/acquire semantics. This may lead to better performance than what
we had under the default seq_cst.

On x86 this may make the atomic store of hash faster, as it can avoid
xchg. On ARM the loads may be faster (depending on target CPU for the
compiler).

Reference for comparison of atomic operations
https://godbolt.org/z/6EdaMa5rG
2025-10-15 18:21:52 -07:00