optimize(env): single arg

This commit is contained in:
2025-05-20 09:47:30 +08:00
parent b4db46d48a
commit d0298ce2a6
8 changed files with 76 additions and 38 deletions

View File

@@ -1,3 +1,5 @@
use std::rc::Rc;
use hashbrown::{HashMap, HashSet};
use derive_more::Constructor;
@@ -47,7 +49,7 @@ impl<'jit: 'vm, 'vm> AttrSet<'jit, 'vm> {
self.data.get(&sym).is_some()
}
pub fn capture(&mut self, env: &LetEnv<'jit, 'vm>) {
pub fn capture(&mut self, env: &Rc<LetEnv<'jit, 'vm>>) {
self.data.iter().for_each(|(_, v)| match v.clone() {
Value::Thunk(ref thunk) => {
thunk.capture(env.clone());