diff --git a/lib/cell.h b/lib/cell.h index f07407bf..0ce4c56b 100644 --- a/lib/cell.h +++ b/lib/cell.h @@ -5,6 +5,8 @@ #include "toywasm_config.h" +#include "platform.h" + enum valtype; struct localtype; struct resulttype; @@ -20,7 +22,7 @@ struct cell { #endif }; -uint32_t valtype_cellsize(enum valtype t); +uint32_t valtype_cellsize(enum valtype t) __constfunc; uint32_t resulttype_cellidx(const struct resulttype *rt, uint32_t idx, uint32_t *cszp); diff --git a/lib/context.h b/lib/context.h index d30f1890..c6552d35 100644 --- a/lib/context.h +++ b/lib/context.h @@ -4,6 +4,7 @@ #include "toywasm_config.h" #include "cell.h" +#include "platform.h" #include "report.h" #include "vec.h" @@ -248,7 +249,7 @@ int frame_enter(struct exec_context *ctx, struct instance *inst, void frame_clear(struct funcframe *frame); void frame_exit(struct exec_context *ctx); struct cell *frame_locals(struct exec_context *ctx, - const struct funcframe *frame); + const struct funcframe *frame) __purefunc; void exec_context_init(struct exec_context *ctx, struct instance *inst); void exec_context_clear(struct exec_context *ctx); void exec_context_print_stats(struct exec_context *ctx); diff --git a/lib/type.h b/lib/type.h index 5fb16b3d..ccfd483e 100644 --- a/lib/type.h +++ b/lib/type.h @@ -9,6 +9,7 @@ #include "bitmap.h" #include "cell.h" #include "lock.h" +#include "platform.h" #include "vec.h" #define WASM_MAGIC 0x6d736100 @@ -462,10 +463,10 @@ struct import_object { struct import_object *next; }; -bool is_numtype(enum valtype vt); -bool is_vectype(enum valtype vt); -bool is_reftype(enum valtype vt); -bool is_valtype(enum valtype vt); +bool is_numtype(enum valtype vt) __constfunc; +bool is_vectype(enum valtype vt) __constfunc; +bool is_reftype(enum valtype vt) __constfunc; +bool is_valtype(enum valtype vt) __constfunc; int compare_resulttype(const struct resulttype *a, const struct resulttype *b); int compare_functype(const struct functype *a, const struct functype *b); int compare_name(const struct name *a, const struct name *b);