diff options
Diffstat (limited to 'vm.h')
-rw-r--r-- | vm.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -10,12 +10,21 @@ typedef struct _thread Thread; #include "val.h" #include "com.h" -#define STACKSIZE 128 +typedef struct { + size_t ip; + Chunk *ch; + +} StackFrame; + +#define MAXDEPTH 64 +#define STACKSIZE 256*MAXDEPTH typedef struct _thread { Chunk *ch; size_t ip; Val stack[STACKSIZE]; size_t sp; + StackFrame rstack[MAXDEPTH]; + size_t rsp; } Thread; Thread thread_new(State *S); @@ -34,6 +43,7 @@ typedef enum { OP_EQU, OP_CMP, + OP_HALT, OP_DROP, @@ -47,6 +57,8 @@ typedef enum { OP_0BRANCH, OP_SKIP, OP_REDO, + + OP_CALL, } Op; int runvm(State *S); |