feat(vm): threaded VM

This commit is contained in:
2026-04-11 10:30:03 +08:00
parent 8e67f9f636
commit 9983458b31
9 changed files with 1253 additions and 1264 deletions
+5 -5
View File
@@ -263,11 +263,11 @@ impl<'gc> Value<'gc> {
}
#[inline]
pub(crate) fn restrict(self) -> Option<StrictValue<'gc>> {
if !self.is::<Thunk<'gc>>() {
Some(StrictValue(self))
pub(crate) fn restrict(self) -> Result<StrictValue<'gc>, Gc<'gc, Thunk<'gc>>> {
if let Some(thunk) = self.as_gc::<Thunk<'gc>>() {
Err(thunk)
} else {
None
Ok(StrictValue(self))
}
}
}
@@ -462,7 +462,7 @@ pub(crate) enum ThunkState<'gc> {
arg: Value<'gc>,
},
Blackhole,
Evaluated(Value<'gc>),
Evaluated(StrictValue<'gc>),
}
#[derive(Collect, Debug)]