feat(env): move env out of vm,

This commit is contained in:
2025-05-23 19:19:20 +08:00
parent 5291e49313
commit b41fd38bcc
10 changed files with 62 additions and 41 deletions

View File

@@ -2,9 +2,10 @@ use std::rc::Rc;
use hashbrown::HashMap;
use crate::env::VmEnv;
use crate::ty::common::Const;
use crate::ty::internal::{AttrSet, PrimOp, Value};
use crate::vm::{VM, VmEnv};
use crate::vm::VM;
pub fn env<'jit, 'vm>(vm: &'vm VM<'jit>) -> VmEnv<'jit, 'vm> {
let primops = [
@@ -50,7 +51,6 @@ pub fn env<'jit, 'vm>(vm: &'vm VM<'jit>) -> VmEnv<'jit, 'vm> {
env_map.insert(vm.new_sym("true"), Value::Const(Const::Bool(true)));
env_map.insert(vm.new_sym("false"), Value::Const(Const::Bool(false)));
let mut map = HashMap::new();
for primop in primops {
let primop = Rc::new(primop);