18#define REDUCT_EVAL_REGS_INITIAL 64
19#define REDUCT_EVAL_REGS_GROWTH_FACTOR 2
21#define REDUCT_EVAL_FRAMES_INITIAL 32
22#define REDUCT_EVAL_FRAMES_GROWTH_FACTOR 2
28typedef struct reduct_eval_frame
41typedef struct reduct_eval_state
REDUCT_API reduct_handle_t reduct_eval_string(struct reduct *reduct, const char *str, size_t len, reduct_optimize_flags_t optimize)
Parses, builds, optimizes, emits and evaluates a string.
REDUCT_API reduct_handle_t reduct_eval_file(struct reduct *reduct, const char *path, reduct_optimize_flags_t optimize)
Parses, builds, optimizes, emits and evaluates a file.
REDUCT_API reduct_handle_t reduct_eval_call_v(struct reduct *reduct, reduct_handle_t callable, size_t argc,...)
Calls a Reduct callable (closure or native) with variadic arguments.
REDUCT_API void reduct_eval_local_deinit(reduct_eval_local_t *local)
Deinitialize a local eval state.
REDUCT_API reduct_handle_t reduct_eval(struct reduct *reduct, reduct_handle_t handle)
Evaluates a handle.
REDUCT_API reduct_handle_t reduct_eval_call(struct reduct *reduct, reduct_handle_t callable, size_t argc, reduct_handle_t *argv)
Calls a Reduct callable (closure or native) with arguments.
REDUCT_API void reduct_eval_local_init(reduct_eval_local_t *local)
Initialize a local eval state.
uint32_t reduct_inst_t
Instruction type.
reduct_optimize_flags_t
Optimization flags.
Evaluation frame structure.
uint32_t base
The base register, where the functions registers start.
struct reduct_closure * closure
The closure being evaluated.
uint32_t prevRegCount
The previous register count to restore upon return.
reduct_inst_t * ip
The current instruction pointer.
reduct_handle_t * constants
Cached pointer to closure constants.
Per-thread eval-related state structure.
struct reduct_eval_frame * frames