2020-12-08 16:54:41 -05:00
|
|
|
//
|
|
|
|
// These are definitions uJIT uses to interface with the CRuby codebase,
|
|
|
|
// but which are only used internally by uJIT.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef UJIT_IFACE_H
|
|
|
|
#define UJIT_IFACE_H 1
|
|
|
|
|
|
|
|
#include "stddef.h"
|
|
|
|
#include "stdint.h"
|
|
|
|
#include "stdbool.h"
|
|
|
|
#include "internal.h"
|
2021-02-25 15:10:38 -05:00
|
|
|
#include "ruby/internal/attr/nodiscard.h"
|
2020-12-08 16:54:41 -05:00
|
|
|
#include "vm_core.h"
|
|
|
|
#include "vm_callinfo.h"
|
|
|
|
#include "builtin.h"
|
|
|
|
#include "ujit_core.h"
|
|
|
|
|
|
|
|
#ifndef rb_callcache
|
|
|
|
struct rb_callcache;
|
|
|
|
#define rb_callcache rb_callcache
|
|
|
|
#endif
|
|
|
|
|
2021-01-26 15:21:47 -05:00
|
|
|
RUBY_EXTERN struct rb_ujit_options rb_ujit_opts;
|
|
|
|
RUBY_EXTERN int64_t rb_ujit_exec_insns_count;
|
2021-02-16 11:15:29 -05:00
|
|
|
RUBY_EXTERN int64_t rb_compiled_iseq_count;
|
2021-01-26 15:21:47 -05:00
|
|
|
|
2020-12-08 17:19:28 -05:00
|
|
|
void cb_write_pre_call_bytes(codeblock_t* cb);
|
|
|
|
void cb_write_post_call_bytes(codeblock_t* cb);
|
2021-01-15 17:10:52 -05:00
|
|
|
|
2020-12-08 16:54:41 -05:00
|
|
|
void map_addr2insn(void *code_ptr, int insn);
|
|
|
|
int opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc);
|
2021-01-15 17:10:52 -05:00
|
|
|
|
|
|
|
void check_cfunc_dispatch(VALUE receiver, struct rb_call_data *cd, void *callee, rb_callable_method_entry_t *compile_time_cme);
|
|
|
|
bool cfunc_needs_frame(const rb_method_cfunc_t *cfunc);
|
2021-02-25 15:10:38 -05:00
|
|
|
|
2021-01-14 16:58:20 -05:00
|
|
|
void assume_method_lookup_stable(const struct rb_callcache *cc, const rb_callable_method_entry_t *cme, block_t* block);
|
2021-02-25 15:10:38 -05:00
|
|
|
RBIMPL_ATTR_NODISCARD() bool assume_single_ractor_mode(block_t *block);
|
|
|
|
RBIMPL_ATTR_NODISCARD() bool assume_stable_global_constant_state(block_t *block);
|
|
|
|
|
2021-01-27 16:13:27 -05:00
|
|
|
// this function *must* return passed exit_pc
|
|
|
|
const VALUE *rb_ujit_count_side_exit_op(const VALUE *exit_pc);
|
2021-02-25 15:10:38 -05:00
|
|
|
|
2021-02-12 17:12:18 -05:00
|
|
|
void ujit_unlink_method_lookup_dependency(block_t *block);
|
2021-02-25 15:10:38 -05:00
|
|
|
void ujit_block_assumptions_free(block_t *block);
|
2020-12-08 16:54:41 -05:00
|
|
|
|
|
|
|
#endif // #ifndef UJIT_IFACE_H
|