| Age | Commit message (Collapse) | Author |
|
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
|
|
ZJIT: Add stack support for CCalls
|
|
|
|
This is good for protoboeuf and other binary parsing
|
|
|
|
|
|
Inspired by 42ba82424d908c290a4a34ced8853f0a403b734b, I looked for other
occurrences of "the the".
|
|
|
|
* ZJIT: Fix disasm tests on release build
* Rename string() to hexdump()
|
|
|
|
|
|
|
|
Save a couple instructions to load a small negative constant into a
register. In fact MOVN is speced to alias as `mov` in the official
disassembly.
|
|
|
|
|
|
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.
|
|
Tweak for Condition to build when `cfg!(target = "x86_64")`.
|
|
|
|
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
|
|
(https://github.com/Shopify/zjit/pull/72)
* 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
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
|