<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/src/backend/lir.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>Revert "ZJIT: Allow ccalls above 7 arguments"</title>
<updated>2025-12-16T19:53:31+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-12-16T19:53:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f3d1557d5c04d7bc0bfa931869fbb35d14592c53'/>
<id>f3d1557d5c04d7bc0bfa931869fbb35d14592c53</id>
<content type='text'>
This reverts commit 2f151e76b5dc578026706b31f054d5caf5374b05.

The SP decrement (push) before the call do not match up with
the pops after the call, so registers were restored incorrectly.

Code from:

    ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e 'p Time.new(1992, 9, 23, 23, 0, 0, :std)'

    str x11, [sp, #-0x10]!
    str x12, [sp, #-0x10]!
    stur x7, [sp]              # last argument
    mov x0, x20
    mov x7, x6
    mov x6, x5
    mov x5, x4
    mov x4, x3
    mov x3, x2
    mov x2, x1
    ldur x1, [x29, #-0x20]
    mov x16, #0xccfc
    movk x16, #0x2e7, lsl #16
    movk x16, #1, lsl #32
    blr x16
    ldr x12, [sp], #0x10       # supposed to match str x12, [sp, #-0x10]!, but got last argument
    ldr x11, [sp], #0x10
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 2f151e76b5dc578026706b31f054d5caf5374b05.

The SP decrement (push) before the call do not match up with
the pops after the call, so registers were restored incorrectly.

Code from:

    ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e 'p Time.new(1992, 9, 23, 23, 0, 0, :std)'

    str x11, [sp, #-0x10]!
    str x12, [sp, #-0x10]!
    stur x7, [sp]              # last argument
    mov x0, x20
    mov x7, x6
    mov x6, x5
    mov x5, x4
    mov x4, x3
    mov x3, x2
    mov x2, x1
    ldur x1, [x29, #-0x20]
    mov x16, #0xccfc
    movk x16, #0x2e7, lsl #16
    movk x16, #1, lsl #32
    blr x16
    ldr x12, [sp], #0x10       # supposed to match str x12, [sp, #-0x10]!, but got last argument
    ldr x11, [sp], #0x10
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Allow ccalls above 7 arguments (#15312)</title>
<updated>2025-12-12T23:29:02+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden@aidenfoxivey.com</email>
</author>
<published>2025-12-12T23:29:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2f151e76b5dc578026706b31f054d5caf5374b05'/>
<id>2f151e76b5dc578026706b31f054d5caf5374b05</id>
<content type='text'>
ZJIT: Add stack support for CCalls</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ZJIT: Add stack support for CCalls</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: Add a specialized instruction iterator to the assembler</title>
<updated>2025-12-03T21:37:40+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2025-11-25T00:16:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b23b05bf2c0f30f2c4ee9bb3030fa58f2cba3a6'/>
<id>2b23b05bf2c0f30f2c4ee9bb3030fa58f2cba3a6</id>
<content type='text'>
This commit adds a specialized instruction iterator to the assembler
with a custom "peek" method.  The reason is that we want to add basic
blocks to LIR.  When we split instructions, we need to add any new
instructions to the correct basic block.  The custom iterator will
maintain the correct basic block inside the assembler, that way when we
push any new instructions they will be appended to the correct place.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds a specialized instruction iterator to the assembler
with a custom "peek" method.  The reason is that we want to add basic
blocks to LIR.  When we split instructions, we need to add any new
instructions to the correct basic block.  The custom iterator will
maintain the correct basic block inside the assembler, that way when we
push any new instructions they will be appended to the correct place.
</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: Deduplicate side exits (#15105)</title>
<updated>2025-11-10T15:30:17+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-11-10T15:30:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b539cd2a33dae904e55fd8f054349b9ff076793a'/>
<id>b539cd2a33dae904e55fd8f054349b9ff076793a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Restore dropped_bytes after temporary OOM (#15069)</title>
<updated>2025-11-06T18:21:18+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-11-06T18:21:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ff6c728acb81e734c3f5a955e82535179a4f6c89'/>
<id>ff6c728acb81e734c3f5a955e82535179a4f6c89</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 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: Implement register spill (#14936)</title>
<updated>2025-11-04T00:49:25+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-11-04T00:49:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9ca940757315e53d1eaddc83071b1b4581f8f578'/>
<id>9ca940757315e53d1eaddc83071b1b4581f8f578</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Let AssemblerPanicHook write into stderr (#15019)</title>
<updated>2025-10-31T19:47:55+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-10-31T19:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ab01fcc5123205cdff6e566c2b686e7ab3ed383f'/>
<id>ab01fcc5123205cdff6e566c2b686e7ab3ed383f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
