ZJIT: Make lir::Opnd::const_ptr take any pointer to save on casts

This commit is contained in:
Alan Wu 2025-07-05 01:55:38 +09:00
parent 7a7f128d0d
commit 3922a14a22
2 changed files with 4 additions and 4 deletions

View file

@ -416,7 +416,7 @@ fn gen_get_constant_path(asm: &mut Assembler, ic: *const iseq_inline_constant_ca
// Save PC since the call can allocate an IC
gen_save_pc(asm, state);
asm_ccall!(asm, rb_vm_opt_getconstant_path, EC, CFP, Opnd::const_ptr(ic as *const u8))
asm_ccall!(asm, rb_vm_opt_getconstant_path, EC, CFP, Opnd::const_ptr(ic))
}
fn gen_invokebuiltin(asm: &mut Assembler, state: &FrameState, bf: &rb_builtin_function, args: Vec<Opnd>) -> Option<lir::Opnd> {
@ -988,7 +988,7 @@ fn gen_save_pc(asm: &mut Assembler, state: &FrameState) {
let next_pc: *const VALUE = unsafe { state.pc.offset(insn_len(opcode) as isize) };
asm_comment!(asm, "save PC to CFP");
asm.mov(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_PC), Opnd::const_ptr(next_pc as *const u8));
asm.mov(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_PC), Opnd::const_ptr(next_pc));
}
/// Save the current SP on the CFP