Skip to content

Commit d016241

Browse files
committed
ZJIT: Avoid unnecessary PopOpnds codegen
If there's no opnds to restore, we don't need to do anything.
1 parent 2ad3fbb commit d016241

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎zjit/src/codegen.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,11 @@ fn gen_push_opnds(jit: &mut JITState, asm: &mut Assembler, opnds: &[Opnd]) -> li
20242024
}
20252025

20262026
fn gen_pop_opnds(asm: &mut Assembler, opnds: &[Opnd]) {
2027+
if opnds.is_empty() {
2028+
asm_comment!(asm, "no opnds to restore");
2029+
return
2030+
}
2031+
20272032
asm_comment!(asm, "restore C stack pointer");
20282033
let allocation_size = aligned_stack_bytes(opnds.len());
20292034
asm.add_into(NATIVE_STACK_PTR, allocation_size.into());

0 commit comments

Comments
 (0)