2021-03-06 18:46:56 -05:00
|
|
|
#ifndef YJIT_CODEGEN_H
|
|
|
|
#define YJIT_CODEGEN_H 1
|
2020-12-08 16:54:41 -05:00
|
|
|
|
2021-03-01 20:43:58 -05:00
|
|
|
typedef enum codegen_status {
|
2021-03-06 18:46:56 -05:00
|
|
|
YJIT_END_BLOCK,
|
|
|
|
YJIT_KEEP_COMPILING,
|
|
|
|
YJIT_CANT_COMPILE
|
2021-03-01 20:43:58 -05:00
|
|
|
} codegen_status_t;
|
2021-01-07 17:09:25 -05:00
|
|
|
|
2021-03-01 20:43:58 -05:00
|
|
|
// Code generation function signature
|
2021-09-29 14:58:01 -04:00
|
|
|
typedef codegen_status_t (*codegen_fn)(jitstate_t *jit, ctx_t *ctx, codeblock_t *cb);
|
2021-01-07 17:09:25 -05:00
|
|
|
|
2021-11-04 12:30:30 -04:00
|
|
|
static void jit_ensure_block_entry_exit(jitstate_t *jit);
|
|
|
|
|
2021-10-01 18:38:39 -04:00
|
|
|
static uint8_t *yjit_entry_prologue(codeblock_t *cb, const rb_iseq_t *iseq);
|
2020-12-18 13:49:53 -05:00
|
|
|
|
2021-10-01 18:38:39 -04:00
|
|
|
static void yjit_gen_block(block_t *block, rb_execution_context_t *ec);
|
2020-12-08 16:54:41 -05:00
|
|
|
|
2021-10-01 18:38:39 -04:00
|
|
|
static void yjit_init_codegen(void);
|
2020-12-08 16:54:41 -05:00
|
|
|
|
2021-03-06 18:46:56 -05:00
|
|
|
#endif // #ifndef YJIT_CODEGEN_H
|