summaryrefslogtreecommitdiff
path: root/doc/yjit/yjit.md
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2026-01-16 22:39:36 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2026-01-19 22:47:36 -0500
commit826dbcfb2be33ffbfbc99554244881e014513d20 (patch)
tree7ecbbb5c30deef2110078bb8c375a9675bc4bd40 /doc/yjit/yjit.md
parentfa910e2bba324f715afad0ca71330fb3b54cfaeb (diff)
ZJIT: A64: Remove nop padding after conditional branchesHEADmaster
Previously, there were a lot of nops after conditional branches. They come from branch to LIR labels: ./miniruby --zjit-call-threshold=1 --zjit-dump-disasm -e 'Object || String' # Insn: v14 CheckInterrupts # RUBY_VM_CHECK_INTS(ec) ldur w2, [x20, #0x20] tst w2, w2 b.ne #0x120900278 nop nop nop nop nop # Insn: v15 Test v11 tst x0, #-5 mov x2, #0 mov x3, #1 csel x2, x2, x3, eq # Insn: v16 IfTrue v15, bb3(v6, v11) tst x2, x2 b.eq #0x120900198 nop nop nop nop nop They gunk up the disassembly and can't be helpful for speed. This commit removes them. I think they were accidentally inherited from certain YJIT branches that require padding for patching. ZJIT doesn't have these requirements. Use a single branch instruction for conditional branches to labels; Jmp already uses a single `B` instruction. This will work for assemblers that generate less than ~260,000 instructions -- plenty. Let the CodeBlock::label_ref() callback return a failure, so we can fail compilation instead of panicking in case we do get large offsets.
Diffstat (limited to 'doc/yjit/yjit.md')
0 files changed, 0 insertions, 0 deletions