mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
34 lines
825 B
C
34 lines
825 B
C
#pragma once
|
|
|
|
#include "../../runtime/gc.h"
|
|
#include "runtime_externs.h"
|
|
#include "types.h"
|
|
#include "utils.h"
|
|
|
|
#include "stdlib.h"
|
|
|
|
void s_push(struct State *s, void *val);
|
|
|
|
void s_push_nil(struct State *s);
|
|
|
|
void s_pushn_nil(struct State *s, size_t n);
|
|
|
|
void *s_pop(struct State *s);
|
|
|
|
void s_popn(struct State *s, size_t n);
|
|
|
|
// ------ functions ------
|
|
|
|
// |> param_0 ... param_n | frame[ ret rp prev_fp ¶ms &locals &end
|
|
// ]
|
|
// |> local_0 ... local_m |> | ...
|
|
//
|
|
// where |> defines corresponding frame pointer, | is stack pointer
|
|
// location before / after new frame added
|
|
void s_enter_f(struct State *s, char *func_ip, size_t params_sz,
|
|
size_t locals_sz);
|
|
|
|
void s_exit_f(struct State *s);
|
|
|
|
union VarT **var_by_category(struct State *s, enum VarCategory category,
|
|
int id);
|