feat: suspend managed calls on generic awaitable operands

This commit is contained in:
2026-10-23 20:14:15 +08:00
parent b33d322690
commit 16816c38c7
9 changed files with 90 additions and 10 deletions
+12 -2
View File
@@ -38,6 +38,7 @@ pub struct EndorFrame {
pub(crate) name: String,
pub(crate) instruction_offset: usize,
pub(crate) current_offset: usize,
pub(crate) waiting: bool,
pub(crate) localsplus: Vec<Option<Value>>,
pub(crate) stack: Vec<StackEntry>,
}
@@ -118,8 +119,17 @@ pub(crate) struct SuspendedCall {
/// not keep a VM-wide heap scope active between quanta.
#[derive(Debug)]
pub enum CoroutineProgress {
Pending { instructions: usize },
Complete { value: Value, instructions: usize },
Waiting {
awaitable: ObjectRef,
instructions: usize,
},
Pending {
instructions: usize,
},
Complete {
value: Value,
instructions: usize,
},
}
#[derive(Debug)]
pub(crate) enum CoroutineState {