Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YJIT: Tweak asm comments #7743

Merged
merged 1 commit into from Apr 19, 2023
Merged

YJIT: Tweak asm comments #7743

merged 1 commit into from Apr 19, 2023

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Apr 19, 2023

This PR does a couple of asm comment changes:

  • Move ISEQ offset information to each Insn comments
  • Resurrect reg_temps comment at the beginning of each block

Before

  # Block: fib@benchmarks/fib.rb:8 (ISEQ offset: 24, chain_depth: 1)
  # Insn: opt_minus (stack_size: 4)
  # guard arg0 fixnum
  0x1188001bc: tst x10, #1
  0x1188001c0: b.eq #0x1188023dc
  0x1188001c4: nop
  0x1188001c8: subs x11, x10, x14
  0x1188001cc: b.vs #0x11880239c
  0x1188001d0: mov x12, #1
  0x1188001d4: adds x11, x11, x12
  0x1188001d8: mov x10, x11
  # Insn: opt_send_without_block (stack_size: 3)
  # defer_compilation
  0x1188001dc: b #0x11880241c

After

  # Block: fib@benchmarks/fib.rb:8 (chain_depth: 1)
  # reg_temps: 00001110
  # Insn: 0024 opt_minus (stack_size: 4)
  # guard arg0 fixnum
  0x103c401bc: tst x10, #1
  0x103c401c0: b.eq #0x103c423b8
  0x103c401c4: nop
  0x103c401c8: subs x11, x10, x14
  0x103c401cc: b.vs #0x103c42378
  0x103c401d0: mov x12, #1
  0x103c401d4: adds x11, x11, x12
  0x103c401d8: mov x10, x11
  # Insn: 0026 opt_send_without_block (stack_size: 3)
  # defer_compilation
  0x103c401dc: b #0x103c423f8

0024 opt_minus and 0026 opt_send_without_block are easier to understand when you compare it with --dump=insns:

== disasm: #<ISeq:fib@benchmarks/fib.rb:3 (3,0)-(9,3)>
local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] n@0<Arg>
0000 getlocal_WC_0                          n@0                       (   4)[LiCa]
0002 putobject                              2
0004 opt_lt                                 <calldata!mid:<, argc:1, ARGS_SIMPLE>[CcCr]
0006 branchunless                           11
0008 getlocal_WC_0                          n@0                       (   5)[Li]
0010 leave                                  [Re]
0011 putself                                                          (   8)[Li]
0012 getlocal_WC_0                          n@0
0014 putobject_INT2FIX_1_
0015 opt_minus                              <calldata!mid:-, argc:1, ARGS_SIMPLE>[CcCr]
0017 opt_send_without_block                 <calldata!mid:fib, argc:1, FCALL|ARGS_SIMPLE>
0019 putself
0020 getlocal_WC_0                          n@0
0022 putobject                              2
0024 opt_minus                              <calldata!mid:-, argc:1, ARGS_SIMPLE>[CcCr]
0026 opt_send_without_block                 <calldata!mid:fib, argc:1, FCALL|ARGS_SIMPLE>
0028 opt_plus                               <calldata!mid:+, argc:1, ARGS_SIMPLE>[CcCr]
0030 leave                                                            (   9)[Re]

@matzbot matzbot requested a review from a team April 19, 2023 21:07
@maximecb maximecb merged commit 5fc11f3 into ruby:master Apr 19, 2023
98 checks passed
@maximecb maximecb deleted the yjit-comments branch April 19, 2023 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants