chore: cargo fmt

This commit is contained in:
2025-05-19 19:40:26 +08:00
parent 9e172bf013
commit b4db46d48a
4 changed files with 44 additions and 33 deletions

View File

@@ -91,11 +91,7 @@ impl<'ctx> Helpers<'ctx> {
let call = module.add_function(
"call",
value_type.fn_type(
&[
value_type.into(),
value_type.into(),
ptr_type.into(),
],
&[value_type.into(), value_type.into(), ptr_type.into()],
false,
),
None,
@@ -142,7 +138,7 @@ impl<'ctx> Helpers<'ctx> {
or,
call,
lookup,
force
force,
}
}
@@ -283,7 +279,7 @@ extern "C" fn helper_eq(lhs: JITValue, rhs: JITValue) -> JITValue {
(Int, Int) => JITValue {
tag: Bool,
data: JITValueData {
bool: unsafe { lhs.data.int == rhs.data.int }
bool: unsafe { lhs.data.int == rhs.data.int },
},
},
_ => todo!(
@@ -322,7 +318,9 @@ extern "C" fn helper_call<'jit, 'vm>(
match func.tag {
Function => {
let func: Value = func.into();
func.call(unsafe { vm.as_ref() }.unwrap(), vec![arg.into()]).unwrap().into()
func.call(unsafe { vm.as_ref() }.unwrap(), vec![arg.into()])
.unwrap()
.into()
}
_ => todo!(),
}
@@ -332,7 +330,6 @@ extern "C" fn helper_call<'jit, 'vm>(
extern "C" fn helper_lookup<'jit, 'vm>(sym: usize, env: *const LetEnv<'jit, 'vm>) -> JITValue {
let env = unsafe { env.as_ref() }.unwrap();
let val = env.lookup(sym);
dbg!(val.as_ref().unwrap().typename());
val.unwrap().into()
}