optimize(env): single arg
This commit is contained in:
@@ -485,7 +485,7 @@ pub struct Thunk<'jit, 'vm> {
|
||||
|
||||
#[derive(Debug, IsVariant, Unwrap, Clone)]
|
||||
pub enum _Thunk<'jit, 'vm> {
|
||||
Code(&'vm OpCodes, OnceCell<LetEnv<'jit, 'vm>>),
|
||||
Code(&'vm OpCodes, OnceCell<Rc<LetEnv<'jit, 'vm>>>),
|
||||
SuspendedFrom(*const Thunk<'jit, 'vm>),
|
||||
Value(Value<'jit, 'vm>),
|
||||
}
|
||||
@@ -497,7 +497,7 @@ impl<'jit, 'vm> Thunk<'jit, 'vm> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn capture(&self, env: LetEnv<'jit, 'vm>) {
|
||||
pub fn capture(&self, env: Rc<LetEnv<'jit, 'vm>>) {
|
||||
if let _Thunk::Code(_, envcell) = &*self.thunk.borrow() {
|
||||
envcell.get_or_init(|| env);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user