<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/zjit/src/asm/arm64/opnd.rs, 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>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: Introduce a better LIR printer (#14986)</title>
<updated>2025-10-29T15:17:11+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-10-29T15:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fcd7da15e693206941f388aa260b59fd9301833a'/>
<id>fcd7da15e693206941f388aa260b59fd9301833a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Ensure `clippy` passes and silence unnecessary warnings (#14439)</title>
<updated>2025-09-03T21:45:54+00:00</updated>
<author>
<name>Aiden Fox Ivey</name>
<email>aiden.foxivey@shopify.com</email>
</author>
<published>2025-09-03T21:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a6d397e29c61030f130f8d83e6bfe6d99ebbae91'/>
<id>a6d397e29c61030f130f8d83e6bfe6d99ebbae91</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Keep a frame pointer and use it for memory params</title>
<updated>2025-07-28T19:30:50+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2025-07-26T02:09:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ff428b4dd0c5f0a07abbd8f8520d8d1e4bff8d66'/>
<id>ff428b4dd0c5f0a07abbd8f8520d8d1e4bff8d66</id>
<content type='text'>
Previously, ZJIT miscompiled the following because of native SP
interference.

    def a(n1,n2,n3,n4,n5,n6,n7,n8) = [n8]
    a(0,0,0,0,0,0,0, :ok)

Commented problematic disassembly:

    ; call rb_ary_new_capa
    mov x0, #1
    mov x16, #0x1278
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16
    ; call rb_ary_push
    mov x1, x0
    str x1, [sp, #-0x10]! ; c_push() from alloc_regs()
    mov x0, x1            ; arg0, the array
    ldur x1, [sp]         ; meant to be arg1=n8, but sp just moved!
    mov x16, #0x3968
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16

Since the frame pointer stays constant in the body of the function,
static offsets based on it don't run the risk of being invalidated by SP
movements.

Pass the registers to preserve through Insn::FrameSetup. This allows ARM
to use STP and waste no gaps between EC, SP, and CFP.

x86 now preserves and restores RBP since we use it as the frame pointer.
Since all arches now have a frame pointer, remove offset based SP
movement in the epilogue and restore registers using the frame pointer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, ZJIT miscompiled the following because of native SP
interference.

    def a(n1,n2,n3,n4,n5,n6,n7,n8) = [n8]
    a(0,0,0,0,0,0,0, :ok)

Commented problematic disassembly:

    ; call rb_ary_new_capa
    mov x0, #1
    mov x16, #0x1278
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16
    ; call rb_ary_push
    mov x1, x0
    str x1, [sp, #-0x10]! ; c_push() from alloc_regs()
    mov x0, x1            ; arg0, the array
    ldur x1, [sp]         ; meant to be arg1=n8, but sp just moved!
    mov x16, #0x3968
    movk x16, #0x4bc, lsl #16
    movk x16, #1, lsl #32
    blr x16

Since the frame pointer stays constant in the body of the function,
static offsets based on it don't run the risk of being invalidated by SP
movements.

Pass the registers to preserve through Insn::FrameSetup. This allows ARM
to use STP and waste no gaps between EC, SP, and CFP.

x86 now preserves and restores RBP since we use it as the frame pointer.
Since all arches now have a frame pointer, remove offset based SP
movement in the epilogue and restore registers using the frame pointer.
</pre>
</div>
</content>
</entry>
<entry>
<title>ZJIT: Implement side exits for entry frames (#13469)</title>
<updated>2025-06-04T21:14:40+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-06-04T21:14:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=112c34252d15d94bff87241ade18badc09923b09'/>
<id>112c34252d15d94bff87241ade18badc09923b09</id>
<content type='text'>
Co-authored-by: Max Bernstein &lt;tekknolagi@gmail.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Max Bernstein &lt;tekknolagi@gmail.com&gt;
Co-authored-by: Alan Wu &lt;alansi.xingwu@shopify.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Compile IfFalse, IfTrue, and Jump instructions (https://github.com/Shopify/zjit/pull/72)</title>
<updated>2025-04-18T12:53:00+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-03-21T16:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6ec411add7def0ab97640ebb110bea5e18747e81'/>
<id>6ec411add7def0ab97640ebb110bea5e18747e81</id>
<content type='text'>
* Compile IfFalse instruction

* Add a TODO comment

* Rename *s_len to num_*s

* Run only gen_param() against block.params

* Add a few more tests

* Wrap label indexes with Label

* Compile blocks in reverse post-order

* Simplify a nested test

* s/get_block/block/

* Return a number instead of an iterator

* Clarify the allocator uses disjoint sets of registers

* Use Display for Block and Insn

* Compile IfTrue and Jump

* Avoid resolving Param instructions

* Always compile Insn::Param as basic block arguments

* Remove an obsoleted variable

* Change it back to use find

* Use find for params too

* Use Display more

* Add more tests

* nested if
* if after if
* if elsif else
* loop after loop
* nested loops
* if in loop
* loop in if
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Compile IfFalse instruction

* Add a TODO comment

* Rename *s_len to num_*s

* Run only gen_param() against block.params

* Add a few more tests

* Wrap label indexes with Label

* Compile blocks in reverse post-order

* Simplify a nested test

* s/get_block/block/

* Return a number instead of an iterator

* Clarify the allocator uses disjoint sets of registers

* Use Display for Block and Insn

* Compile IfTrue and Jump

* Avoid resolving Param instructions

* Always compile Insn::Param as basic block arguments

* Remove an obsoleted variable

* Change it back to use find

* Use find for params too

* Use Display more

* Add more tests

* nested if
* if after if
* if elsif else
* loop after loop
* nested loops
* if in loop
* loop in if
</pre>
</div>
</content>
</entry>
<entry>
<title>Add (gutted) asm</title>
<updated>2025-04-18T12:52:56+00:00</updated>
<author>
<name>Maxime Chevalier-Boisvert</name>
<email>maxime.chevalierboisvert@shopify.com</email>
</author>
<published>2025-02-06T17:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5e37317cc51bc8349714ccbd8004ae882f56542d'/>
<id>5e37317cc51bc8349714ccbd8004ae882f56542d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
