optimize: make all call single arg
to allow more aggressive optimization
This commit is contained in:
@@ -95,8 +95,7 @@ impl<'ctx> Helpers<'ctx> {
|
||||
value_type.fn_type(
|
||||
&[
|
||||
value_type.into(),
|
||||
ptr_type.into(),
|
||||
ptr_int_type.into(),
|
||||
value_type.into(),
|
||||
ptr_type.into(),
|
||||
],
|
||||
false,
|
||||
@@ -317,21 +316,16 @@ extern "C" fn helper_or(lhs: JITValue, rhs: JITValue) -> JITValue {
|
||||
|
||||
extern "C" fn helper_call<'jit>(
|
||||
func: JITValue,
|
||||
args: *mut JITValue,
|
||||
arity: usize,
|
||||
arg: JITValue,
|
||||
vm: *const VM<'jit>,
|
||||
) -> JITValue {
|
||||
use ValueTag::*;
|
||||
let args = unsafe { Vec::from_raw_parts(args, arity, arity) }
|
||||
.into_iter()
|
||||
.map(Value::from)
|
||||
.collect();
|
||||
match func.tag {
|
||||
Function => {
|
||||
let func: Value = func.into();
|
||||
func.call(unsafe { vm.as_ref() }.unwrap(), args)
|
||||
.unwrap()
|
||||
.into()
|
||||
let mut func: Value = func.into();
|
||||
func.call(unsafe { vm.as_ref() }.unwrap(), arg.into())
|
||||
.unwrap();
|
||||
func.into()
|
||||
}
|
||||
_ => todo!(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user