mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
move to runtime
This commit is contained in:
parent
6c39c65076
commit
26a42d4c81
21 changed files with 477 additions and 1879 deletions
34
byterun/include/stack.h
Normal file
34
byterun/include/stack.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue