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

@@ -5,9 +5,10 @@ use inkwell::module::Module;
use inkwell::types::{FloatType, FunctionType, IntType, PointerType, StructType};
use inkwell::values::{BasicValueEnum, FunctionValue};
use crate::env::VmEnv;
use crate::jit::JITValueData;
use crate::ty::internal::{Thunk, Value};
use crate::vm::{VM, VmEnv};
use crate::vm::VM;
use super::{JITValue, ValueTag};
@@ -91,11 +92,7 @@ impl<'ctx> Helpers<'ctx> {
let call = module.add_function(
"call",
value_type.fn_type(
&[
value_type.into(),
value_type.into(),
ptr_type.into(),
],
&[value_type.into(), value_type.into(), ptr_type.into()],
false,
),
None,
@@ -311,11 +308,7 @@ extern "C" fn helper_or(lhs: JITValue, rhs: JITValue) -> JITValue {
}
}
extern "C" fn helper_call<'jit>(
func: JITValue,
arg: JITValue,
vm: *const VM<'jit>,
) -> JITValue {
extern "C" fn helper_call<'jit>(func: JITValue, arg: JITValue, vm: *const VM<'jit>) -> JITValue {
use ValueTag::*;
match func.tag {
Function => {