feat: less gc (WIP)
This commit is contained in:
@@ -361,7 +361,7 @@ extern "C" fn helper_call<'gc>(
|
||||
ValueTag::Function => {
|
||||
let func = Value::from(func).unwrap_func();
|
||||
let env = unsafe { &mut *env };
|
||||
env.alloc_gc(func.call_compile(arg, vm, mc).unwrap(), mc).into()
|
||||
func.call_compile(arg, vm, mc).unwrap().clone().into()
|
||||
}
|
||||
_ => todo!(),
|
||||
}
|
||||
@@ -369,19 +369,19 @@ extern "C" fn helper_call<'gc>(
|
||||
|
||||
extern "C" fn helper_arg(idx: usize, env: *const VmEnv) -> JITValue {
|
||||
let env = unsafe { env.as_ref() }.unwrap();
|
||||
let val: JITValue = env.lookup_arg(idx).into();
|
||||
let val: JITValue = env.lookup_arg(idx).clone().into();
|
||||
val
|
||||
}
|
||||
|
||||
extern "C" fn helper_lookup_let(level: usize, idx: usize, env: *const VmEnv) -> JITValue {
|
||||
let env = unsafe { env.as_ref() }.unwrap();
|
||||
let val: JITValue = env.lookup_let(level, idx).into();
|
||||
let val: JITValue = env.lookup_let(level, idx).clone().into();
|
||||
val
|
||||
}
|
||||
|
||||
extern "C" fn helper_lookup(sym: usize, env: *const VmEnv) -> JITValue {
|
||||
let env = unsafe { env.as_ref() }.unwrap();
|
||||
let val: JITValue = env.lookup_with(&sym).unwrap().into();
|
||||
let val: JITValue = env.lookup_with(&sym).unwrap().clone().into();
|
||||
val
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ extern "C" fn helper_force<'gc>(
|
||||
let mc = unsafe { mc.as_ref() }.unwrap();
|
||||
let thunk = Value::from(thunk).unwrap_thunk();
|
||||
if let Some(val) = thunk.get_value() {
|
||||
return val.into();
|
||||
return val.clone().into();
|
||||
}
|
||||
let (opcodes, env) = thunk.suspend(mc).unwrap();
|
||||
let func = unsafe { jit.as_ref() }
|
||||
@@ -414,9 +414,9 @@ extern "C" fn helper_force<'gc>(
|
||||
extern "C" fn helper_new_thunk<'gc>(opcodes: *const OpCodes, env: *mut VmEnv<'gc>, mc: *const Mutation<'gc>) -> JITValue {
|
||||
let mc = unsafe { &*mc };
|
||||
let env = unsafe { &mut *env };
|
||||
env.alloc_gc(Value::Thunk(Thunk::new(
|
||||
Value::Thunk(Thunk::new(
|
||||
unsafe { opcodes.as_ref() }.unwrap(),
|
||||
mc
|
||||
)), mc)
|
||||
))
|
||||
.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user