diff options
author | Takashi Kokubun <[email protected]> | 2023-01-11 11:12:15 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-01-11 11:12:15 -0800 |
commit | 36420068725e5b4b86b3481fa1f82b249a60d928 (patch) | |
tree | f4ebd6892926575e67e4824d45cfa39bcbd2aadf | |
parent | ad5ab0c3eac0dea0503086a9166238483b510db6 (diff) |
YJIT: Add a few asm comments (#7105)
* YJIT: Add a few asm comments
* YJIT: Clarify exiting insns
* YJIT: Fix cargo test
Notes
Notes:
Merged-By: k0kubun <[email protected]>
-rw-r--r-- | yjit/src/codegen.rs | 9 | ||||
-rw-r--r-- | yjit/src/core.rs | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 3dbc589466..b4c6d7c941 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -387,7 +387,11 @@ fn gen_code_for_exit_from_stub(ocb: &mut OutlinedCb) -> CodePtr { /// Generate an exit to return to the interpreter fn gen_exit(exit_pc: *mut VALUE, ctx: &Context, asm: &mut Assembler) { - asm.comment("exit to interpreter"); + #[cfg(all(feature = "disasm", not(test)))] + { + let opcode = unsafe { rb_vm_insn_addr2opcode((*exit_pc).as_ptr()) }; + asm.comment(&format!("exit to interpreter on {}", insn_name(opcode as usize))); + } // Generate the code to exit to the interpreters // Write the adjusted SP back into the CFP @@ -769,7 +773,7 @@ pub fn gen_single_block( gen_counter_incr!(asm, exec_instruction); // Add a comment for the name of the YARV instruction - asm.comment(&insn_name(opcode)); + asm.comment(&format!("Insn: {}", insn_name(opcode))); // If requested, dump instructions for debugging if get_option!(dump_insns) { @@ -4776,6 +4780,7 @@ fn gen_return_branch( match shape { BranchShape::Next0 | BranchShape::Next1 => unreachable!(), BranchShape::Default => { + asm.comment("update cfp->jit_return"); asm.mov(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_JIT_RETURN), Opnd::const_ptr(target0.raw_ptr())); } } diff --git a/yjit/src/core.rs b/yjit/src/core.rs index 71c9ae5a9e..9a796bcb87 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -2126,6 +2126,7 @@ pub fn defer_compilation( set_branch_target(0, blockid, &next_ctx, &branch_rc, &mut branch, ocb); // Call the branch generation function + asm.comment("defer_compilation"); asm.mark_branch_start(&branch_rc); if let Some(dst_addr) = branch.get_target_address(0) { gen_jump_branch(asm, dst_addr, None, BranchShape::Default); |