summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2025-10-03 15:15:05 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2025-10-03 15:15:06 -0700
commit8eead759c1b2a93c66d80089ad9acf166f37d507 (patch)
tree7b8cc0932b9c32f1023ec3a974aa9e6bee9135a3
parent8337de95bc6f89c20cf16ac98aaef8e86c9a4992 (diff)
ZJIT: Relax the limit of cfunc args by 1
Follow-up on https://github.com/ruby/ruby/pull/14661 Unlike SendWithoutBlockDirect, `args` has every argument given to the C call. So there's no `+ 1` for this HIR.
-rw-r--r--zjit/src/codegen.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs
index 1c1bd2e07f..0c720734da 100644
--- a/zjit/src/codegen.rs
+++ b/zjit/src/codegen.rs
@@ -405,7 +405,8 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
&Insn::GuardBlockParamProxy { level, state } => no_output!(gen_guard_block_param_proxy(jit, asm, level, &function.frame_state(state))),
Insn::PatchPoint { invariant, state } => no_output!(gen_patch_point(jit, asm, invariant, &function.frame_state(*state))),
Insn::CCall { cfunc, args, name: _, return_type: _, elidable: _ } => gen_ccall(asm, *cfunc, opnds!(args)),
- Insn::CCallWithFrame { cd, state, args, .. } if args.len() + 1 > C_ARG_OPNDS.len() => // +1 for self
+ // Give up CCallWithFrame for 7+ args since asm.ccall() doesn't support it.
+ Insn::CCallWithFrame { cd, state, args, .. } if args.len() > C_ARG_OPNDS.len() =>
gen_send_without_block(jit, asm, *cd, &function.frame_state(*state), SendFallbackReason::CCallWithFrameTooManyArgs),
Insn::CCallWithFrame { cfunc, args, cme, state, .. } => gen_ccall_with_frame(jit, asm, *cfunc, opnds!(args), *cme, &function.frame_state(*state)),
Insn::CCallVariadic { cfunc, recv, args, name: _, cme, state } => {