diff options
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/common.h b/src/common.h index b7038d8..eb91409 100644 --- a/src/common.h +++ b/src/common.h @@ -1,7 +1,23 @@ #ifndef EJIT_COMMON_H #define EJIT_COMMON_H +#include <ejit/ejit.h> #include <stdbool.h> + +#define VEC_TYPE struct ejit_arg +#define VEC_NAME args +#include "vec.h" + +#define VEC_TYPE int64_t +#define VEC_NAME gprs +#include "vec.h" + +#define VEC_TYPE double +#define VEC_NAME fprs +#include "vec.h" + +#define VEC_TYPE size_t +#define VEC_NAME labels #include "vec.h" enum ejit_opcode { @@ -228,9 +244,13 @@ struct ejit_insn { }; }; +#define VEC_TYPE struct ejit_insn +#define VEC_NAME insns +#include "vec.h" + struct ejit_func { - struct vec insns; - struct vec labels; + struct insns insns; + struct labels labels; enum ejit_type rtype; size_t gpr; @@ -247,9 +267,9 @@ union interp_ret { }; struct interp_state { - struct vec gprs; - struct vec fprs; - struct vec args; + struct gprs gprs; + struct fprs fprs; + struct args args; }; union interp_ret ejit_interp(struct ejit_func *f, size_t argc, @@ -258,7 +278,10 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, void ***labels_wb); int64_t ejit_run_interp(struct ejit_func *f, size_t argc, - struct ejit_arg args[argc], struct interp_state *state); + struct ejit_arg args[static argc], struct interp_state *state); + +double ejit_run_interp_f(struct ejit_func *f, size_t argc, + struct ejit_arg args[static argc], struct interp_state *state); bool ejit_compile(struct ejit_func *f, bool use_64); |