Skip to content

Commit 3e9dd93

Browse files
committed
fix: use leaf calls for NewArray instead of non-leaf calls
1 parent 352c9b6 commit 3e9dd93

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

zjit/src/codegen.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
350350
&Insn::Const { val: Const::CPtr(val) } => gen_const_cptr(val),
351351
&Insn::Const { val: Const::CInt64(val) } => gen_const_long(val),
352352
Insn::Const { .. } => panic!("Unexpected Const in gen_insn: {insn}"),
353-
Insn::NewArray { elements, state } => gen_new_array(jit, asm, opnds!(elements), &function.frame_state(*state)),
353+
Insn::NewArray { elements, state } => gen_new_array(asm, opnds!(elements), &function.frame_state(*state)),
354354
Insn::NewHash { elements, state } => gen_new_hash(jit, asm, opnds!(elements), &function.frame_state(*state)),
355355
Insn::NewRange { low, high, flag, state } => gen_new_range(jit, asm, opnd!(low), opnd!(high), *flag, &function.frame_state(*state)),
356356
Insn::NewRangeFixnum { low, high, flag, state } => gen_new_range_fixnum(asm, opnd!(low), opnd!(high), *flag, &function.frame_state(*state)),
@@ -1405,12 +1405,11 @@ fn gen_array_dup(
14051405

14061406
/// Compile a new array instruction
14071407
fn gen_new_array(
1408-
jit: &JITState,
14091408
asm: &mut Assembler,
14101409
elements: Vec<Opnd>,
14111410
state: &FrameState,
14121411
) -> lir::Opnd {
1413-
gen_prepare_non_leaf_call(jit, asm, state);
1412+
gen_prepare_leaf_call_with_gc(asm, state);
14141413

14151414
let num: c_long = elements.len().try_into().expect("Unable to fit length of elements into c_long");
14161415

0 commit comments

Comments
 (0)