feat: gc (does compile, but WIP)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use hashbrown::HashMap;
|
||||
use ecow::EcoString;
|
||||
use gc_arena::Collect;
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use crate::ty::common::Const;
|
||||
use crate::ty::internal::Param;
|
||||
@@ -18,10 +18,14 @@ pub enum OpCode {
|
||||
LookUp { sym: usize },
|
||||
/// load a thunk lazily onto stack
|
||||
LoadThunk { idx: usize },
|
||||
/// load a thunk value onto stack
|
||||
LoadValue { idx: usize },
|
||||
/// let TOS capture current environment
|
||||
CaptureEnv,
|
||||
/// force TOS to value
|
||||
ForceValue,
|
||||
/// TODO:
|
||||
InsertValue,
|
||||
|
||||
/// [ .. func arg ] consume 2 elements, call `func` with arg
|
||||
Call,
|
||||
@@ -73,18 +77,19 @@ pub enum OpCode {
|
||||
SelectDynamicOrDefault,
|
||||
/// enter the let environment of the attribute set at TOS
|
||||
EnterLetEnv,
|
||||
/// exit current let envrironment
|
||||
LeaveLetEnv,
|
||||
/// enter the with environment of the attribute set at TOS
|
||||
EnterWithEnv,
|
||||
/// exit current with envrironment
|
||||
LeaveWithEnv,
|
||||
/// exit current envrironment
|
||||
LeaveEnv,
|
||||
/// TODO:
|
||||
PopEnv,
|
||||
|
||||
/// illegal operation, used as termporary placeholder
|
||||
Illegal,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone, Copy, Collect)]
|
||||
#[collect(no_drop)]
|
||||
pub enum BinOp {
|
||||
Add,
|
||||
Sub,
|
||||
@@ -98,7 +103,8 @@ pub enum BinOp {
|
||||
Upd,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[derive(Debug, Clone, Copy, Collect)]
|
||||
#[collect(no_drop)]
|
||||
pub enum UnOp {
|
||||
Neg,
|
||||
Not,
|
||||
|
||||
Reference in New Issue
Block a user