<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/bindgen, branch v4.0.3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>ZJIT: Use rb_zjit_writebarrier_check_immediate() instead of rb_gc_writebarrier() in gen_write_barrier()</title>
<updated>2025-12-16T20:00:27+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-12-16T15:31:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5e27581c3b3782f731ada9f83129c5c17a8f8c49'/>
<id>5e27581c3b3782f731ada9f83129c5c17a8f8c49</id>
<content type='text'>
* To avoid calling rb_gc_writebarrier() with an immediate value in gen_write_barrier(),
  and avoid the LIR jump issue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* To avoid calling rb_gc_writebarrier() with an immediate value in gen_write_barrier(),
  and avoid the LIR jump issue.
</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: Avoid binding to `rb_iseq_constant_body`</title>
<updated>2025-12-05T20:49:25+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-12-03T21:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=109ddd291ebc4f07f786e7b4ed277b20e3faaa8a'/>
<id>109ddd291ebc4f07f786e7b4ed277b20e3faaa8a</id>
<content type='text'>
Its definition changes depending on e.g. whether there is YJIT in the
build.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Its definition changes depending on e.g. whether there is YJIT in the
build.
</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: Inline Kernel#class (#15397)</title>
<updated>2025-12-04T01:25:52+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-12-04T01:25:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3efd8c6764a5b324b7d04a12443c2f18dd74181b'/>
<id>3efd8c6764a5b324b7d04a12443c2f18dd74181b</id>
<content type='text'>
We generally know the receiver's class from profile info. I see 600k of these when running lobsters.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We generally know the receiver's class from profile info. I see 600k of these when running lobsters.</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Optimize GetIvar for non-T_OBJECT</title>
<updated>2025-12-02T00:42:14+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-11-25T22:26:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=07ea9a38097c088efd6c2872f2a563dbc69a544a'/>
<id>07ea9a38097c088efd6c2872f2a563dbc69a544a</id>
<content type='text'>
* All Invariant::SingleRactorMode PatchPoint are replaced by
  assume_single_ractor_mode() to fix https://github.com/Shopify/ruby/issues/875
  for SingleRactorMode patchpoints.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* All Invariant::SingleRactorMode PatchPoint are replaced by
  assume_single_ractor_mode() to fix https://github.com/Shopify/ruby/issues/875
  for SingleRactorMode patchpoints.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Specialize String#&lt;&lt; with Fixnum</title>
<updated>2025-12-01T23:19:26+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>ruby@bernsteinbear.com</email>
</author>
<published>2025-11-25T03:24:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8aed31103874524395912fb7ffaee88b5e59a9c3'/>
<id>8aed31103874524395912fb7ffaee88b5e59a9c3</id>
<content type='text'>
Append a codepoint.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Append a codepoint.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Specialize setinstancevariable when ivar is already in shape (#15290)</title>
<updated>2025-11-25T18:50:55+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>rubybugs@bernsteinbear.com</email>
</author>
<published>2025-11-25T18:50:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0eb53053f00458b5b32bb66f63cb7c4c5f402ec8'/>
<id>0eb53053f00458b5b32bb66f63cb7c4c5f402ec8</id>
<content type='text'>
Don't support shape transitions for now.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't support shape transitions for now.</pre>
</div>
</content>
</entry>
<entry>
<title>Name the `iseq-&gt;body-&gt;param` struct and update bindings for JITs</title>
<updated>2025-11-21T00:52:28+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-11-19T21:08:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7a09df45f2619a672eaab763c2e2a0c5199d5daa'/>
<id>7a09df45f2619a672eaab763c2e2a0c5199d5daa</id>
<content type='text'>
This will make reading the parameters nicer for the JITs. Should be
no-op for the C side.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will make reading the parameters nicer for the JITs. Should be
no-op for the C side.
</pre>
</div>
</content>
</entry>
<entry>
<title>Extract `KW_SPECIFIED_BITS_MAX` for JITs (GH-15039)</title>
<updated>2025-11-18T22:32:11+00:00</updated>
<author>
<name>Jacob</name>
<email>jacob.denbeaux@shopify.com</email>
</author>
<published>2025-11-18T22:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f3f3e76882d01d5e0a006ff731b70053997396e8'/>
<id>f3f3e76882d01d5e0a006ff731b70053997396e8</id>
<content type='text'>
Rename to `VM_KW_SPECIFIED_BITS_MAX` now that it's in `vm_core.h`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rename to `VM_KW_SPECIFIED_BITS_MAX` now that it's in `vm_core.h`.</pre>
</div>
</content>
</entry>
</feed>
