ruby--ruby/yjit_codegen.h

28 lines
668 B
C
Raw Normal View History

#ifndef YJIT_CODEGEN_H
#define YJIT_CODEGEN_H 1
#include "stddef.h"
#include "yjit_core.h"
2020-12-17 02:45:51 +00:00
// Code blocks we generate code into
extern codeblock_t *cb;
extern codeblock_t *ocb;
extern uint32_t yjit_codepage_frozen_bytes;
2020-12-17 02:45:51 +00:00
typedef enum codegen_status {
YJIT_END_BLOCK,
YJIT_KEEP_COMPILING,
YJIT_CANT_COMPILE
} codegen_status_t;
// Code generation function signature
2021-09-29 18:58:01 +00:00
typedef codegen_status_t (*codegen_fn)(jitstate_t *jit, ctx_t *ctx, codeblock_t *cb);
2021-09-29 18:58:01 +00:00
uint8_t *yjit_entry_prologue(codeblock_t *cb, const rb_iseq_t *iseq);
2021-09-29 18:58:01 +00:00
void yjit_gen_block(block_t *block, rb_execution_context_t *ec);
void yjit_init_codegen(void);
#endif // #ifndef YJIT_CODEGEN_H