* 2022-01-18 [ci skip]
[ruby-80x24.org.git] / yjit_iface.h
blob7fed846b4d67a53286bdba5b65b1580e9f742bf1
1 //
2 // These are definitions YJIT uses to interface with the CRuby codebase,
3 // but which are only used internally by YJIT.
4 //
6 #ifndef YJIT_IFACE_H
7 #define YJIT_IFACE_H 1
9 #include "ruby/internal/config.h"
10 #include "ruby_assert.h" // for RUBY_DEBUG
11 #include "yjit.h" // for YJIT_STATS
12 #include "vm_core.h"
13 #include "yjit_core.h"
15 #ifndef YJIT_DEFAULT_CALL_THRESHOLD
16 # define YJIT_DEFAULT_CALL_THRESHOLD 10
17 #endif
19 RUBY_EXTERN struct rb_yjit_options rb_yjit_opts;
21 static VALUE *yjit_iseq_pc_at_idx(const rb_iseq_t *iseq, uint32_t insn_idx);
22 static int yjit_opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc);
23 static void yjit_print_iseq(const rb_iseq_t *iseq);
25 #if YJIT_STATS
26 // this function *must* return passed exit_pc
27 static const VALUE *yjit_count_side_exit_op(const VALUE *exit_pc);
28 #endif
30 static void yjit_unlink_method_lookup_dependency(block_t *block);
31 static void yjit_block_assumptions_free(block_t *block);
33 static VALUE yjit_get_code_page(uint32_t cb_bytes_needed, uint32_t ocb_bytes_needed);
34 //code_page_t *rb_yjit_code_page_unwrap(VALUE cp_obj);
35 //void rb_yjit_get_cb(codeblock_t* cb, uint8_t* code_ptr);
36 //void rb_yjit_get_ocb(codeblock_t* cb, uint8_t* code_ptr);
38 #endif // #ifndef YJIT_IFACE_H