wip: working on extern in VM

- Feat: add usage of vm reader instead of old way in vm.c
- Ref: update debug opcodes printing
This commit is contained in:
samsonium
2026-11-05 23:23:38 +03:00
parent 1db42c1e8e
commit d95ff88b66
19 changed files with 133 additions and 146 deletions
+3 -13
View File
@@ -1,26 +1,16 @@
#ifndef FZL_VM_H
#define FZL_VM_H
#include <common/fzl_value.h>
#include <compiler/utils/fzl_const_pool.h> // NOTE: move outside compiler scope to common
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <vm/fzl_vm_env.h>
#include <vm/fzl_vm_extern.h>
#include <vm/fzl_vm_object.h>
#include <vm/fzl_vm_reader.h>
// VM descriptor
typedef struct
{
fzl_const_t *consts;
size_t consts_count;
fzl_vm_extern_t *externs;
size_t externs_count;
uint64_t *ops;
size_t ops_count;
fzl_vm_reader_t *reader;
size_t ip;
@@ -41,7 +31,7 @@ typedef struct
} fzl_vm_t;
// Allocate FZL VM
fzl_vm_t *fzl_mkvm(const char *filepath);
fzl_vm_t *fzl_mkvm(fzl_vm_reader_t *reader);
// Load and run code
int fzl_vm_run(fzl_vm_t *vm);