optimize: make all call single arg

to allow more aggressive optimization
This commit is contained in:
2025-05-23 09:21:40 +08:00
parent f380e5fd70
commit 53cbb37b00
8 changed files with 60 additions and 101 deletions

View File

@@ -17,8 +17,9 @@ pub fn env<'jit, 'vm>(vm: &'vm VM<'jit>) -> VmEnv<'jit, 'vm> {
first.ok()
}),
PrimOp::new("sub", 2, |_, args| {
let [mut first, second]: [Value; 2] = args.try_into().unwrap();
first.add(second.neg());
let [mut first, mut second]: [Value; 2] = args.try_into().unwrap();
second.neg();
first.add(second);
first.ok()
}),
PrimOp::new("mul", 2, |_, args| {