<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/src/stats.rs, branch v4.0.4</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>ZJIT: Check method visibility when optimizing sends (#15501)</title>
<updated>2025-12-11T21:12:00+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-12-11T21:12:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=64062792c61d13d1eca9f637db3ed7da12a61154'/>
<id>64062792c61d13d1eca9f637db3ed7da12a61154</id>
<content type='text'>
Fix https://github.com/Shopify/ruby/issues/874</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix https://github.com/Shopify/ruby/issues/874</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Re-compile ISEQs invalidated by PatchPoint (#15459)</title>
<updated>2025-12-11T00:07:39+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-12-11T00:07:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c7d56e90d381f0bf115a5c76cbef9df6ae19f4c9'/>
<id>c7d56e90d381f0bf115a5c76cbef9df6ae19f4c9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Use inline format args (#15482)</title>
<updated>2025-12-10T20:30:04+00:00</updated>
<author>
<name>Alex Rocha</name>
<email>9896751+alexcrocha@users.noreply.github.com</email>
</author>
<published>2025-12-10T20:30:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3640cfe5e0f3ed30f90ae622ef92e6c154213a09'/>
<id>3640cfe5e0f3ed30f90ae622ef92e6c154213a09</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Handle caller_kwarg in direct send when all keyword params are required</title>
<updated>2025-12-09T15:19:38+00:00</updated>
<author>
<name>Randy Stauner</name>
<email>randy@r4s6.net</email>
</author>
<published>2025-11-14T21:50:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c42f4d80eabc6b9b4117253a2ba2ee0b9526f253'/>
<id>c42f4d80eabc6b9b4117253a2ba2ee0b9526f253</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Add codegen for FixnumDiv (#15452)</title>
<updated>2025-12-09T12:41:09+00:00</updated>
<author>
<name>Abrar Habib</name>
<email>86024593+dddictionary@users.noreply.github.com</email>
</author>
<published>2025-12-09T12:41:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=edca81a1bb72a9dc54a37766d2c80790dec13884'/>
<id>edca81a1bb72a9dc54a37766d2c80790dec13884</id>
<content type='text'>
Fixes https://github.com/Shopify/ruby/issues/902

This pull request adds code generation for dividing fixnums.
Testing confirms the normal case, flooring, and side-exiting on division by zero.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/Shopify/ruby/issues/902

This pull request adds code generation for dividing fixnums.
Testing confirms the normal case, flooring, and side-exiting on division by zero.</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Optimize setivar with shape transition (#15375)</title>
<updated>2025-12-04T02:27:56+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-12-04T02:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0af85a1fe291856d6b3d2b3bb68e6edb8cb44b4f'/>
<id>0af85a1fe291856d6b3d2b3bb68e6edb8cb44b4f</id>
<content type='text'>
Since we do a decent job of pre-sizing objects, don't handle the case where we would need to re-size an object. Also don't handle too-complex shapes.

lobsters stats before:

```
Top-20 calls to C functions from JIT code (79.4% of total 90,051,140):
                             rb_vm_opt_send_without_block: 19,762,433 (21.9%)
                                rb_vm_setinstancevariable:  7,698,314 ( 8.5%)
                                             rb_hash_aref:  6,767,461 ( 7.5%)
                                          rb_vm_env_write:  5,373,080 ( 6.0%)
                                               rb_vm_send:  5,049,229 ( 5.6%)
                                rb_vm_getinstancevariable:  4,535,259 ( 5.0%)
                                        rb_obj_is_kind_of:  3,746,306 ( 4.2%)
                           rb_ivar_get_at_no_ractor_check:  3,745,237 ( 4.2%)
                                        rb_vm_invokesuper:  3,037,467 ( 3.4%)
                                             rb_ary_entry:  2,351,983 ( 2.6%)
                               rb_vm_opt_getconstant_path:  1,344,740 ( 1.5%)
                                        rb_vm_invokeblock:  1,184,474 ( 1.3%)
                                                 Hash#[]=:  1,064,288 ( 1.2%)
                                       rb_gc_writebarrier:  1,006,972 ( 1.1%)
                                rb_ec_ary_new_from_values:    902,687 ( 1.0%)
                                                    fetch:    898,667 ( 1.0%)
                                        rb_str_buf_append:    833,787 ( 0.9%)
                               rb_class_allocate_instance:    822,024 ( 0.9%)
                                               Hash#fetch:    699,580 ( 0.8%)
                                                    _bi20:    682,068 ( 0.8%)
Top-4 setivar fallback reasons (100.0% of total 7,732,326):
  shape_transition: 6,032,109 (78.0%)
   not_monomorphic: 1,469,300 (19.0%)
      not_t_object:   172,636 ( 2.2%)
       too_complex:    58,281 ( 0.8%)
```

lobsters stats after:

```
Top-20 calls to C functions from JIT code (79.0% of total 88,322,656):
                             rb_vm_opt_send_without_block: 19,777,880 (22.4%)
                                             rb_hash_aref:  6,771,589 ( 7.7%)
                                          rb_vm_env_write:  5,372,789 ( 6.1%)
                                       rb_gc_writebarrier:  5,195,527 ( 5.9%)
                                               rb_vm_send:  5,049,145 ( 5.7%)
                                rb_vm_getinstancevariable:  4,538,485 ( 5.1%)
                                        rb_obj_is_kind_of:  3,746,241 ( 4.2%)
                           rb_ivar_get_at_no_ractor_check:  3,745,172 ( 4.2%)
                                        rb_vm_invokesuper:  3,037,157 ( 3.4%)
                                             rb_ary_entry:  2,351,968 ( 2.7%)
                                rb_vm_setinstancevariable:  1,703,337 ( 1.9%)
                               rb_vm_opt_getconstant_path:  1,344,730 ( 1.5%)
                                        rb_vm_invokeblock:  1,184,290 ( 1.3%)
                                                 Hash#[]=:  1,061,868 ( 1.2%)
                                rb_ec_ary_new_from_values:    902,666 ( 1.0%)
                                                    fetch:    898,666 ( 1.0%)
                                        rb_str_buf_append:    833,784 ( 0.9%)
                               rb_class_allocate_instance:    821,778 ( 0.9%)
                                               Hash#fetch:    755,913 ( 0.9%)
Top-4 setivar fallback reasons (100.0% of total 1,703,337):
            not_monomorphic: 1,472,405 (86.4%)
               not_t_object:   172,629 (10.1%)
                too_complex:    58,281 ( 3.4%)
  new_shape_needs_extension:        22 ( 0.0%)
```

I also noticed that primitive printing in HIR was broken so I fixed that.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we do a decent job of pre-sizing objects, don't handle the case where we would need to re-size an object. Also don't handle too-complex shapes.

lobsters stats before:

```
Top-20 calls to C functions from JIT code (79.4% of total 90,051,140):
                             rb_vm_opt_send_without_block: 19,762,433 (21.9%)
                                rb_vm_setinstancevariable:  7,698,314 ( 8.5%)
                                             rb_hash_aref:  6,767,461 ( 7.5%)
                                          rb_vm_env_write:  5,373,080 ( 6.0%)
                                               rb_vm_send:  5,049,229 ( 5.6%)
                                rb_vm_getinstancevariable:  4,535,259 ( 5.0%)
                                        rb_obj_is_kind_of:  3,746,306 ( 4.2%)
                           rb_ivar_get_at_no_ractor_check:  3,745,237 ( 4.2%)
                                        rb_vm_invokesuper:  3,037,467 ( 3.4%)
                                             rb_ary_entry:  2,351,983 ( 2.6%)
                               rb_vm_opt_getconstant_path:  1,344,740 ( 1.5%)
                                        rb_vm_invokeblock:  1,184,474 ( 1.3%)
                                                 Hash#[]=:  1,064,288 ( 1.2%)
                                       rb_gc_writebarrier:  1,006,972 ( 1.1%)
                                rb_ec_ary_new_from_values:    902,687 ( 1.0%)
                                                    fetch:    898,667 ( 1.0%)
                                        rb_str_buf_append:    833,787 ( 0.9%)
                               rb_class_allocate_instance:    822,024 ( 0.9%)
                                               Hash#fetch:    699,580 ( 0.8%)
                                                    _bi20:    682,068 ( 0.8%)
Top-4 setivar fallback reasons (100.0% of total 7,732,326):
  shape_transition: 6,032,109 (78.0%)
   not_monomorphic: 1,469,300 (19.0%)
      not_t_object:   172,636 ( 2.2%)
       too_complex:    58,281 ( 0.8%)
```

lobsters stats after:

```
Top-20 calls to C functions from JIT code (79.0% of total 88,322,656):
                             rb_vm_opt_send_without_block: 19,777,880 (22.4%)
                                             rb_hash_aref:  6,771,589 ( 7.7%)
                                          rb_vm_env_write:  5,372,789 ( 6.1%)
                                       rb_gc_writebarrier:  5,195,527 ( 5.9%)
                                               rb_vm_send:  5,049,145 ( 5.7%)
                                rb_vm_getinstancevariable:  4,538,485 ( 5.1%)
                                        rb_obj_is_kind_of:  3,746,241 ( 4.2%)
                           rb_ivar_get_at_no_ractor_check:  3,745,172 ( 4.2%)
                                        rb_vm_invokesuper:  3,037,157 ( 3.4%)
                                             rb_ary_entry:  2,351,968 ( 2.7%)
                                rb_vm_setinstancevariable:  1,703,337 ( 1.9%)
                               rb_vm_opt_getconstant_path:  1,344,730 ( 1.5%)
                                        rb_vm_invokeblock:  1,184,290 ( 1.3%)
                                                 Hash#[]=:  1,061,868 ( 1.2%)
                                rb_ec_ary_new_from_values:    902,666 ( 1.0%)
                                                    fetch:    898,666 ( 1.0%)
                                        rb_str_buf_append:    833,784 ( 0.9%)
                               rb_class_allocate_instance:    821,778 ( 0.9%)
                                               Hash#fetch:    755,913 ( 0.9%)
Top-4 setivar fallback reasons (100.0% of total 1,703,337):
            not_monomorphic: 1,472,405 (86.4%)
               not_t_object:   172,629 (10.1%)
                too_complex:    58,281 ( 3.4%)
  new_shape_needs_extension:        22 ( 0.0%)
```

I also noticed that primitive printing in HIR was broken so I fixed that.

Co-authored-by: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Count fallback reasons for set/get/definedivar (#15324)</title>
<updated>2025-11-26T23:36:00+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-26T23:36:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=db94a79da432bcdb9d48517733f11ccf03c7cd5d'/>
<id>db94a79da432bcdb9d48517733f11ccf03c7cd5d</id>
<content type='text'>
lobsters:

```
Top-4 setivar fallback reasons (100.0% of total 7,789,008):
  shape_transition: 6,074,085 (78.0%)
   not_monomorphic: 1,484,013 (19.1%)
      not_t_object:   172,629 ( 2.2%)
       too_complex:    58,281 ( 0.7%)
Top-3 getivar fallback reasons (100.0% of total 9,348,832):
     not_t_object: 4,658,833 (49.8%)
  not_monomorphic: 4,542,316 (48.6%)
      too_complex:   147,683 ( 1.6%)
Top-3 definedivar fallback reasons (100.0% of total 366,383):
  not_monomorphic: 361,389 (98.6%)
      too_complex:   3,062 ( 0.8%)
     not_t_object:   1,932 ( 0.5%)
```

railsbench:

```
Top-3 setivar fallback reasons (100.0% of total 15,119,057):
  shape_transition: 13,760,763 (91.0%)
   not_monomorphic:    982,368 ( 6.5%)
      not_t_object:    375,926 ( 2.5%)
Top-2 getivar fallback reasons (100.0% of total 14,438,747):
     not_t_object: 7,643,870 (52.9%)
  not_monomorphic: 6,794,877 (47.1%)
Top-2 definedivar fallback reasons (100.0% of total 209,613):
  not_monomorphic: 209,526 (100.0%)
     not_t_object:      87 ( 0.0%)
```

shipit:

```
Top-3 setivar fallback reasons (100.0% of total 14,516,254):
  shape_transition: 8,613,512 (59.3%)
   not_monomorphic: 5,761,398 (39.7%)
      not_t_object:   141,344 ( 1.0%)
Top-2 getivar fallback reasons (100.0% of total 21,016,444):
  not_monomorphic: 11,313,482 (53.8%)
     not_t_object:  9,702,962 (46.2%)
Top-2 definedivar fallback reasons (100.0% of total 290,382):
  not_monomorphic: 287,755 (99.1%)
     not_t_object:   2,627 ( 0.9%)
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lobsters:

```
Top-4 setivar fallback reasons (100.0% of total 7,789,008):
  shape_transition: 6,074,085 (78.0%)
   not_monomorphic: 1,484,013 (19.1%)
      not_t_object:   172,629 ( 2.2%)
       too_complex:    58,281 ( 0.7%)
Top-3 getivar fallback reasons (100.0% of total 9,348,832):
     not_t_object: 4,658,833 (49.8%)
  not_monomorphic: 4,542,316 (48.6%)
      too_complex:   147,683 ( 1.6%)
Top-3 definedivar fallback reasons (100.0% of total 366,383):
  not_monomorphic: 361,389 (98.6%)
      too_complex:   3,062 ( 0.8%)
     not_t_object:   1,932 ( 0.5%)
```

railsbench:

```
Top-3 setivar fallback reasons (100.0% of total 15,119,057):
  shape_transition: 13,760,763 (91.0%)
   not_monomorphic:    982,368 ( 6.5%)
      not_t_object:    375,926 ( 2.5%)
Top-2 getivar fallback reasons (100.0% of total 14,438,747):
     not_t_object: 7,643,870 (52.9%)
  not_monomorphic: 6,794,877 (47.1%)
Top-2 definedivar fallback reasons (100.0% of total 209,613):
  not_monomorphic: 209,526 (100.0%)
     not_t_object:      87 ( 0.0%)
```

shipit:

```
Top-3 setivar fallback reasons (100.0% of total 14,516,254):
  shape_transition: 8,613,512 (59.3%)
   not_monomorphic: 5,761,398 (39.7%)
      not_t_object:   141,344 ( 1.0%)
Top-2 getivar fallback reasons (100.0% of total 21,016,444):
  not_monomorphic: 11,313,482 (53.8%)
     not_t_object:  9,702,962 (46.2%)
Top-2 definedivar fallback reasons (100.0% of total 290,382):
  not_monomorphic: 287,755 (99.1%)
     not_t_object:   2,627 ( 0.9%)
```</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Inline Integer#&lt;&lt; for constant rhs (#15258)</title>
<updated>2025-11-21T16:57:26+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-21T16:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e0bb3fb1cda2238d0c98afcdec2fe282c29994aa'/>
<id>e0bb3fb1cda2238d0c98afcdec2fe282c29994aa</id>
<content type='text'>
This is good for protoboeuf and other binary parsing</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is good for protoboeuf and other binary parsing</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Count all calls to C functions from generated code (#15240)</title>
<updated>2025-11-19T20:58:24+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-19T20:58:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4a1af72a13d41dcc38af7d69ea1f44856265d43f'/>
<id>4a1af72a13d41dcc38af7d69ea1f44856265d43f</id>
<content type='text'>
lobsters:

```
Top-20 calls to C functions from JIT code (79.9% of total 97,004,883):
                             rb_vm_opt_send_without_block: 19,874,212 (20.5%)
                                rb_vm_setinstancevariable:  9,774,841 (10.1%)
                                              rb_ivar_get:  9,358,866 ( 9.6%)
                                             rb_hash_aref:  6,828,948 ( 7.0%)
                                               rb_vm_send:  6,441,551 ( 6.6%)
                                          rb_vm_env_write:  5,375,989 ( 5.5%)
                                        rb_vm_invokesuper:  3,037,836 ( 3.1%)
                                               Module#===:  2,562,446 ( 2.6%)
                                             rb_ary_entry:  2,354,546 ( 2.4%)
                                             Kernel#is_a?:  1,424,092 ( 1.5%)
                               rb_vm_opt_getconstant_path:  1,344,923 ( 1.4%)
                                           Thread.current:  1,300,822 ( 1.3%)
                                     rb_zjit_defined_ivar:  1,222,613 ( 1.3%)
                                        rb_vm_invokeblock:  1,184,555 ( 1.2%)
                                                 Hash#[]=:  1,061,969 ( 1.1%)
                                              rb_ary_push:  1,024,987 ( 1.1%)
                                          rb_ary_new_capa:    904,003 ( 0.9%)
                                        rb_str_buf_append:    833,782 ( 0.9%)
                               rb_class_allocate_instance:    822,626 ( 0.8%)
                                               Hash#fetch:    755,913 ( 0.8%)
```

railsbench:

```
Top-20 calls to C functions from JIT code (74.8% of total 189,170,268):
               rb_vm_opt_send_without_block: 29,870,307 (15.8%)
                  rb_vm_setinstancevariable: 17,631,199 ( 9.3%)
                               rb_hash_aref: 16,928,890 ( 8.9%)
                                rb_ivar_get: 14,441,240 ( 7.6%)
                            rb_vm_env_write: 11,571,001 ( 6.1%)
                                 rb_vm_send: 11,153,457 ( 5.9%)
                          rb_vm_invokesuper:  7,568,267 ( 4.0%)
                                 Module#===:  6,065,923 ( 3.2%)
                                   Hash#[]=:  2,842,990 ( 1.5%)
                               rb_ary_entry:  2,766,125 ( 1.5%)
                                rb_ary_push:  2,722,079 ( 1.4%)
                          rb_vm_invokeblock:  2,594,398 ( 1.4%)
                             Thread.current:  2,560,129 ( 1.4%)
                             rb_str_getbyte:  1,965,627 ( 1.0%)
                               Kernel#is_a?:  1,961,815 ( 1.0%)
                 rb_vm_opt_getconstant_path:  1,863,678 ( 1.0%)
                      rb_hash_new_with_size:  1,796,456 ( 0.9%)
                 rb_class_allocate_instance:  1,785,043 ( 0.9%)
                              String#empty?:  1,713,414 ( 0.9%)
                            rb_ary_new_capa:  1,678,834 ( 0.9%)
```

shipit:

```
Top-20 calls to C functions from JIT code (83.4% of total 182,402,821):
                             rb_vm_opt_send_without_block: 45,753,484 (25.1%)
                                              rb_ivar_get: 21,020,650 (11.5%)
                                rb_vm_setinstancevariable: 17,528,603 ( 9.6%)
                                             rb_hash_aref: 11,892,856 ( 6.5%)
                                               rb_vm_send: 11,723,471 ( 6.4%)
                                          rb_vm_env_write: 10,434,452 ( 5.7%)
                                               Module#===:  4,225,048 ( 2.3%)
                                        rb_vm_invokesuper:  3,705,906 ( 2.0%)
                                           Thread.current:  3,337,603 ( 1.8%)
                                             rb_ary_entry:  3,114,378 ( 1.7%)
                                                 Hash#[]=:  2,509,912 ( 1.4%)
                                             Array#empty?:  2,282,994 ( 1.3%)
                                        rb_vm_invokeblock:  2,210,511 ( 1.2%)
                                               Hash#fetch:  2,017,960 ( 1.1%)
                                                    _bi20:  1,975,147 ( 1.1%)
                                     rb_zjit_defined_ivar:  1,897,127 ( 1.0%)
                               rb_vm_opt_getconstant_path:  1,813,294 ( 1.0%)
                                          rb_ary_new_capa:  1,615,406 ( 0.9%)
                                             Kernel#is_a?:  1,567,854 ( 0.9%)
                               rb_class_allocate_instance:  1,560,035 ( 0.9%)
```

Thanks to @eregon for the idea.

Co-authored-by: Jacob Denbeaux &lt;jacob.denbeaux@shopify.com&gt;
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lobsters:

```
Top-20 calls to C functions from JIT code (79.9% of total 97,004,883):
                             rb_vm_opt_send_without_block: 19,874,212 (20.5%)
                                rb_vm_setinstancevariable:  9,774,841 (10.1%)
                                              rb_ivar_get:  9,358,866 ( 9.6%)
                                             rb_hash_aref:  6,828,948 ( 7.0%)
                                               rb_vm_send:  6,441,551 ( 6.6%)
                                          rb_vm_env_write:  5,375,989 ( 5.5%)
                                        rb_vm_invokesuper:  3,037,836 ( 3.1%)
                                               Module#===:  2,562,446 ( 2.6%)
                                             rb_ary_entry:  2,354,546 ( 2.4%)
                                             Kernel#is_a?:  1,424,092 ( 1.5%)
                               rb_vm_opt_getconstant_path:  1,344,923 ( 1.4%)
                                           Thread.current:  1,300,822 ( 1.3%)
                                     rb_zjit_defined_ivar:  1,222,613 ( 1.3%)
                                        rb_vm_invokeblock:  1,184,555 ( 1.2%)
                                                 Hash#[]=:  1,061,969 ( 1.1%)
                                              rb_ary_push:  1,024,987 ( 1.1%)
                                          rb_ary_new_capa:    904,003 ( 0.9%)
                                        rb_str_buf_append:    833,782 ( 0.9%)
                               rb_class_allocate_instance:    822,626 ( 0.8%)
                                               Hash#fetch:    755,913 ( 0.8%)
```

railsbench:

```
Top-20 calls to C functions from JIT code (74.8% of total 189,170,268):
               rb_vm_opt_send_without_block: 29,870,307 (15.8%)
                  rb_vm_setinstancevariable: 17,631,199 ( 9.3%)
                               rb_hash_aref: 16,928,890 ( 8.9%)
                                rb_ivar_get: 14,441,240 ( 7.6%)
                            rb_vm_env_write: 11,571,001 ( 6.1%)
                                 rb_vm_send: 11,153,457 ( 5.9%)
                          rb_vm_invokesuper:  7,568,267 ( 4.0%)
                                 Module#===:  6,065,923 ( 3.2%)
                                   Hash#[]=:  2,842,990 ( 1.5%)
                               rb_ary_entry:  2,766,125 ( 1.5%)
                                rb_ary_push:  2,722,079 ( 1.4%)
                          rb_vm_invokeblock:  2,594,398 ( 1.4%)
                             Thread.current:  2,560,129 ( 1.4%)
                             rb_str_getbyte:  1,965,627 ( 1.0%)
                               Kernel#is_a?:  1,961,815 ( 1.0%)
                 rb_vm_opt_getconstant_path:  1,863,678 ( 1.0%)
                      rb_hash_new_with_size:  1,796,456 ( 0.9%)
                 rb_class_allocate_instance:  1,785,043 ( 0.9%)
                              String#empty?:  1,713,414 ( 0.9%)
                            rb_ary_new_capa:  1,678,834 ( 0.9%)
```

shipit:

```
Top-20 calls to C functions from JIT code (83.4% of total 182,402,821):
                             rb_vm_opt_send_without_block: 45,753,484 (25.1%)
                                              rb_ivar_get: 21,020,650 (11.5%)
                                rb_vm_setinstancevariable: 17,528,603 ( 9.6%)
                                             rb_hash_aref: 11,892,856 ( 6.5%)
                                               rb_vm_send: 11,723,471 ( 6.4%)
                                          rb_vm_env_write: 10,434,452 ( 5.7%)
                                               Module#===:  4,225,048 ( 2.3%)
                                        rb_vm_invokesuper:  3,705,906 ( 2.0%)
                                           Thread.current:  3,337,603 ( 1.8%)
                                             rb_ary_entry:  3,114,378 ( 1.7%)
                                                 Hash#[]=:  2,509,912 ( 1.4%)
                                             Array#empty?:  2,282,994 ( 1.3%)
                                        rb_vm_invokeblock:  2,210,511 ( 1.2%)
                                               Hash#fetch:  2,017,960 ( 1.1%)
                                                    _bi20:  1,975,147 ( 1.1%)
                                     rb_zjit_defined_ivar:  1,897,127 ( 1.0%)
                               rb_vm_opt_getconstant_path:  1,813,294 ( 1.0%)
                                          rb_ary_new_capa:  1,615,406 ( 0.9%)
                                             Kernel#is_a?:  1,567,854 ( 0.9%)
                               rb_class_allocate_instance:  1,560,035 ( 0.9%)
```

Thanks to @eregon for the idea.

Co-authored-by: Jacob Denbeaux &lt;jacob.denbeaux@shopify.com&gt;
Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Support JIT-to-JIT calls to callees with optional parameters</title>
<updated>2025-11-14T21:35:12+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-11-14T20:20:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89849f3b4a7b4b7f27d5942cdaf25bbe4f99025b'/>
<id>89849f3b4a7b4b7f27d5942cdaf25bbe4f99025b</id>
<content type='text'>
 * Correct JIT entry points for optionals so each optional start with nil
before their initialization routine runs. Establish
`jit_entry_points[filled_opts_num]` gives the appropriate entry point
 * Correct number of HIR block parameters for each JIT entry point
 * Entry points that share the same ISEQ PC get separate entries since
   they start with different state. No more deduplication.
 * Reject post parameters. Was hidden behind check for optionals.
 * Make sure to visit every BB in iseq_to_hir(). Some wasn't visited
   when the initialization routine for an optional terminates the block
   in a `SideExit`. Remove the now impossible `FailedOptionalArguments`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 * Correct JIT entry points for optionals so each optional start with nil
before their initialization routine runs. Establish
`jit_entry_points[filled_opts_num]` gives the appropriate entry point
 * Correct number of HIR block parameters for each JIT entry point
 * Entry points that share the same ISEQ PC get separate entries since
   they start with different state. No more deduplication.
 * Reject post parameters. Was hidden behind check for optionals.
 * Make sure to visit every BB in iseq_to_hir(). Some wasn't visited
   when the initialization routine for an optional terminates the block
   in a `SideExit`. Remove the now impossible `FailedOptionalArguments`.
</pre>
</div>
</content>
</entry>
</feed>
