36typedef enum JITStatus {
40 JIT_ERR_CODEGEN_FAILED,
41 JIT_ERR_COMPILE_FAILED,
42 JIT_ERR_LOOKUP_FAILED,
44 JIT_ERR_ALREADY_COMPILED
75typedef struct JITContext JITContext;
84typedef uint16_t (*JITShiftActionFn)(uint16_t iLookAhead);
102typedef uint32_t (*JITFindShiftActionFn)(uint32_t state, uint32_t lookahead);
115JITStatus jit_create(JITContext **ctx_out);
121void jit_destroy(JITContext *ctx);
136JITStatus jit_compile_snapshot(JITContext *ctx,
const ParserSnapshot *snap);
145JITShiftActionFn jit_get_shift_action(
const JITContext *ctx, uint32_t state_id);
159JITFindShiftActionFn jit_get_find_shift_action(
const JITContext *ctx);
178JITStatus jit_warmup(JITContext *ctx,
const uint32_t *hot_states, uint32_t n);
183JITStats jit_get_stats(
const JITContext *ctx);
189const char *jit_status_string(JITStatus status);
196bool jit_is_available(
void);
241#if (defined(__GNUC__) || defined(__clang__)) && (!defined(_WIN32) || defined(__MINGW32__))
242#define LIME_WEAK __attribute__((weak))
277uint16_t jit_find_shift_action(
const ParserSnapshot *snap, uint16_t stateno, uint16_t iLookAhead);
292void jit_parse_batch(
const ParserSnapshot *snap, uint16_t *tokens, uint32_t count,
293 uint16_t *state_inout);
JIT compilation statistics for a snapshot.
uint64_t code_size_bytes
Approximate generated code size in bytes.
bool available
True if JIT support is available at runtime.
bool skip_opts
True if codegen elected to skip optimisation passes (very large grammars where O2 does not scale).
uint64_t compile_time_ns
Wall-clock nanoseconds spent compiling.
uint32_t states_total
Total number of states in the snapshot.
uint32_t states_compiled
Number of states with JIT code attached.