Skip to content

Commit 9cd1ac4

Browse files
XrXrk0kubun
authored andcommitted
YJIT: Print more disassembly in release builds
These `#[cfg(feature = "disasm")]` were unnecessary and we can provide the information like ruby source location regardless of the availability of capstone.
1 parent c866b90 commit 9cd1ac4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

yjit/src/codegen.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -821,11 +821,11 @@ fn gen_stub_exit(ocb: &mut OutlinedCb) -> Option<CodePtr> {
821821

822822
/// Generate an exit to return to the interpreter
823823
fn gen_exit(exit_pc: *mut VALUE, asm: &mut Assembler) {
824-
#[cfg(all(feature = "disasm", not(test)))]
825-
{
824+
#[cfg(not(test))]
825+
asm_comment!(asm, "exit to interpreter on {}", {
826826
let opcode = unsafe { rb_vm_insn_addr2opcode((*exit_pc).as_ptr()) };
827-
asm_comment!(asm, "exit to interpreter on {}", insn_name(opcode as usize));
828-
}
827+
insn_name(opcode as usize)
828+
});
829829

830830
if asm.ctx.is_return_landing() {
831831
asm.mov(SP, Opnd::mem(64, CFP, RUBY_OFFSET_CFP_SP));
@@ -1292,7 +1292,6 @@ pub fn gen_single_block(
12921292
let mut asm = Assembler::new(jit.num_locals());
12931293
asm.ctx = ctx;
12941294

1295-
#[cfg(feature = "disasm")]
12961295
if get_option_ref!(dump_disasm).is_some() {
12971296
let blockid_idx = blockid.idx;
12981297
let chain_depth = if asm.ctx.get_chain_depth() > 0 { format!("(chain_depth: {})", asm.ctx.get_chain_depth()) } else { "".to_string() };
@@ -9031,7 +9030,6 @@ fn gen_send_general(
90319030
let recv_opnd: YARVOpnd = recv.into();
90329031

90339032
// Log the name of the method we're calling to
9034-
#[cfg(feature = "disasm")]
90359033
asm_comment!(asm, "call to {}", get_method_name(Some(comptime_recv_klass), mid));
90369034

90379035
// Gather some statistics about sends

0 commit comments

Comments
 (0)