<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/src/state.rs, branch v4.0.2</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 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: 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: add support for lazy `RubyVM::ZJIT.enable`</title>
<updated>2025-11-18T16:35:09+00:00</updated>
<author>
<name>Godfrey Chan</name>
<email>godfreykfc@gmail.com</email>
</author>
<published>2025-11-17T16:15:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f84bbb423836d9d0d018b8ab71ecceb5868fd5be'/>
<id>f84bbb423836d9d0d018b8ab71ecceb5868fd5be</id>
<content type='text'>
This implements Shopify#854:

- Splits boot-time and enable-time initialization,
  tracks progress with `InitializationState` enum

- Introduces `RubyVM::ZJIT.enable` Ruby method for
  enabling the JIT lazily, if not already enabled

- Introduces `--zjit-disable` flag, which can be
  used alongside the other `--zjit-*` flags but
  prevents enabling the JIT at boot time

- Adds ZJIT infra to support JIT hooks, but this
  is not currently exercised (Shopify/ruby#667)

Left for future enhancements:

- Support kwargs for overriding the CLI flags in
  `RubyVM::ZJIT.enable`

Closes Shopify#854
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements Shopify#854:

- Splits boot-time and enable-time initialization,
  tracks progress with `InitializationState` enum

- Introduces `RubyVM::ZJIT.enable` Ruby method for
  enabling the JIT lazily, if not already enabled

- Introduces `--zjit-disable` flag, which can be
  used alongside the other `--zjit-*` flags but
  prevents enabling the JIT at boot time

- Adds ZJIT infra to support JIT hooks, but this
  is not currently exercised (Shopify/ruby#667)

Left for future enhancements:

- Support kwargs for overriding the CLI flags in
  `RubyVM::ZJIT.enable`

Closes Shopify#854
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Use a shared trampoline across all ISEQs (#15042)</title>
<updated>2025-11-05T00:09:13+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-11-05T00:09:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bd3b44cb0a341878abe0edf65d01b1a48c93f088'/>
<id>bd3b44cb0a341878abe0edf65d01b1a48c93f088</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 trace exit counter (#14831)</title>
<updated>2025-10-15T09:56:31+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-10-15T09:56:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bb4526b9b1c25f2e6435802321137d0d33216b76'/>
<id>bb4526b9b1c25f2e6435802321137d0d33216b76</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Get stats for which C functions are not annotated</title>
<updated>2025-10-09T17:09:27+00:00</updated>
<author>
<name>Max Bernstein</name>
<email>ruby@bernsteinbear.com</email>
</author>
<published>2025-10-09T08:38:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6a25a8b1e28cc5c1b28fc12717a0fade4da23a7c'/>
<id>6a25a8b1e28cc5c1b28fc12717a0fade4da23a7c</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 HIR for calling Cfunc with frame (#14661)</title>
<updated>2025-10-03T22:12:19+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan.lo@shopify.com</email>
</author>
<published>2025-10-03T22:12:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8337de95bc6f89c20cf16ac98aaef8e86c9a4992'/>
<id>8337de95bc6f89c20cf16ac98aaef8e86c9a4992</id>
<content type='text'>
* ZJIT: Add HIR for CCallWithFrame

* ZJIT: Update stats to count not inlined cfunc calls

* ZJIT: Stops optimizing SendWithoutBlock when TracePoint is activated

* ZJIT: Fallback to SendWithoutBlock when CCallWithFrame has too many args

* ZJIT: Rename cfun -&gt; cfunc</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ZJIT: Add HIR for CCallWithFrame

* ZJIT: Update stats to count not inlined cfunc calls

* ZJIT: Stops optimizing SendWithoutBlock when TracePoint is activated

* ZJIT: Fallback to SendWithoutBlock when CCallWithFrame has too many args

* ZJIT: Rename cfun -&gt; cfunc</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Enable sample rate for side exit tracing (#14696)</title>
<updated>2025-10-02T15:57:43+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-10-02T15:57:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=81f253577a77a934bfa02a33d80ca2a7c6af9a04'/>
<id>81f253577a77a934bfa02a33d80ca2a7c6af9a04</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Decouple stats and side exit tracing (#14688)</title>
<updated>2025-09-30T20:51:56+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-09-30T20:51:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=df2d1d5ad386c51ad9750282917ecacf2b343598'/>
<id>df2d1d5ad386c51ad9750282917ecacf2b343598</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 --zjit-trace-exits (#14640)</title>
<updated>2025-09-30T15:55:33+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-09-30T15:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f1c30cd50e464880e44da670d3ad8ebe00fc899'/>
<id>2f1c30cd50e464880e44da670d3ad8ebe00fc899</id>
<content type='text'>
Add side exit tracing functionality for ZJIT</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add side exit tracing functionality for ZJIT</pre>
</div>
</content>
</entry>
</feed>
