Skip to content

Commit eaefdd2

Browse files
committed
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 7c146b9 commit eaefdd2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎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));
@@ -1294,7 +1294,6 @@ pub fn gen_single_block(
12941294
let mut asm = Assembler::new(jit.num_locals());
12951295
asm.ctx = ctx;
12961296

1297-
#[cfg(feature = "disasm")]
12981297
if get_option_ref!(dump_disasm).is_some() {
12991298
let blockid_idx = blockid.idx;
13001299
let chain_depth = if asm.ctx.get_chain_depth() > 0 { format!("(chain_depth: {})", asm.ctx.get_chain_depth()) } else { "".to_string() };
@@ -9049,7 +9048,6 @@ fn gen_send_general(
90499048
let recv_opnd: YARVOpnd = recv.into();
90509049

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

90559053
// Gather some statistics about sends

0 commit comments

Comments
 (0)