[fine] Methods!

This commit is contained in:
John Doty 2024-01-24 09:03:45 -08:00
parent 2839b43f6d
commit 0c69758b11
5 changed files with 352 additions and 95 deletions

View file

@ -102,6 +102,18 @@ impl Frame {
}
}
pub fn func(&self) -> Rc<Function> {
self.func.clone()
}
pub fn args(&self) -> &[StackValue] {
&self.args
}
pub fn pc(&self) -> usize {
self.pc
}
fn pop_value(&mut self) -> Result<StackValue> {
self.stack.pop().ok_or_else(|| VMErrorCode::StackUnderflow)
}