Functions are implemented and VM should be able to handle function calls

* VM Signals are used by running functions to dictate whether a function
  should return, or if it should call another function. These signals
  can be injected at any time allowing for user functions to inject
  themselves at runtime.
* obj::Method is gone since it's not being used yet.
* Obj impls must implement as_any(&self) -> &dyn Any now. This allows
  for UserFun and NativeFun to be explicitly cast (among other things,
  in the future).

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-09-24 15:29:44 -07:00
parent f0032afe12
commit 3976b2135a
11 changed files with 236 additions and 71 deletions

View File

@@ -4,8 +4,7 @@ use shredder::{GcSafe, Scan, Scanner};
/// A stack call frame.
#[derive(Debug, Clone)]
pub enum FrameKind {
Root,
Native,
Native(NativeFunRef, Vec<ObjRef>),
User {
last_pc: usize,
stack_base: usize,