Skip to content

Commit ff08a52

Browse files
committed
ZJIT: Skip defined? codegen on x86_64 for now
1 parent bef3983 commit ff08a52

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

zjit/src/codegen.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,20 @@ fn gen_defined(jit: &JITState, asm: &mut Assembler, op_type: usize, obj: VALUE,
456456
}
457457
}
458458
_ => {
459-
// Save the PC and SP because the callee may allocate or call #respond_to?
460-
gen_prepare_non_leaf_call(jit, asm, state)?;
459+
// Skip on x86_64 due to index out of bounds on live ranges
460+
// May be related to https://github.com/Shopify/ruby/issues/646
461+
if cfg!(target_arch = "x86_64") {
462+
None
463+
} else {
464+
// Save the PC and SP because the callee may allocate or call #respond_to?
465+
gen_prepare_non_leaf_call(jit, asm, state)?;
461466

462-
// Call vm_defined(ec, reg_cfp, op_type, obj, v)
463-
let def_result = asm.ccall(rb_vm_defined as *const u8, vec![EC, CFP, op_type.into(), obj.into(), tested_value]);
467+
// Call vm_defined(ec, reg_cfp, op_type, obj, v)
468+
let def_result = asm.ccall(rb_vm_defined as *const u8, vec![EC, CFP, op_type.into(), obj.into(), tested_value]);
464469

465-
asm.test(def_result, Opnd::UImm(255));
466-
Some(asm.csel_nz(pushval.into(), Qnil.into()))
470+
asm.test(def_result, Opnd::UImm(255));
471+
Some(asm.csel_nz(pushval.into(), Qnil.into()))
472+
}
467473
}
468474
}
469475
}

0 commit comments

Comments
 (0)