2020-12-09 00:54:41 +03:00
|
|
|
//
|
2021-03-07 02:46:56 +03:00
|
|
|
// These are definitions YJIT uses to interface with the CRuby codebase,
|
|
|
|
// but which are only used internally by YJIT.
|
2020-12-09 00:54:41 +03:00
|
|
|
//
|
|
|
|
|
2021-03-07 02:46:56 +03:00
|
|
|
#ifndef YJIT_IFACE_H
|
|
|
|
#define YJIT_IFACE_H 1
|
2020-12-09 00:54:41 +03:00
|
|
|
|
2021-09-14 22:13:15 +03:00
|
|
|
#include "ruby/internal/config.h"
|
|
|
|
#include "ruby_assert.h" // for RUBY_DEBUG
|
|
|
|
#include "yjit.h" // for YJIT_STATS
|
2020-12-09 00:54:41 +03:00
|
|
|
#include "vm_core.h"
|
2021-03-07 02:46:56 +03:00
|
|
|
#include "yjit_core.h"
|
2020-12-09 00:54:41 +03:00
|
|
|
|
2021-06-24 04:19:10 +03:00
|
|
|
#ifndef YJIT_DEFAULT_CALL_THRESHOLD
|
|
|
|
# define YJIT_DEFAULT_CALL_THRESHOLD 10
|
|
|
|
#endif
|
|
|
|
|
2021-03-07 02:46:56 +03:00
|
|
|
RUBY_EXTERN struct rb_yjit_options rb_yjit_opts;
|
2021-01-26 23:21:47 +03:00
|
|
|
|
2021-10-02 01:38:39 +03:00
|
|
|
static VALUE *yjit_iseq_pc_at_idx(const rb_iseq_t *iseq, uint32_t insn_idx);
|
|
|
|
static int yjit_opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc);
|
|
|
|
static void yjit_print_iseq(const rb_iseq_t *iseq);
|
2021-02-25 23:10:38 +03:00
|
|
|
|
2021-10-19 23:43:20 +03:00
|
|
|
#if YJIT_STATS
|
2021-01-28 00:13:27 +03:00
|
|
|
// this function *must* return passed exit_pc
|
2021-10-02 01:38:39 +03:00
|
|
|
static const VALUE *yjit_count_side_exit_op(const VALUE *exit_pc);
|
2021-10-19 23:43:20 +03:00
|
|
|
#endif
|
2021-02-25 23:10:38 +03:00
|
|
|
|
2021-10-02 01:38:39 +03:00
|
|
|
static void yjit_unlink_method_lookup_dependency(block_t *block);
|
|
|
|
static void yjit_block_assumptions_free(block_t *block);
|
2020-12-09 00:54:41 +03:00
|
|
|
|
2021-11-04 23:05:41 +03:00
|
|
|
static VALUE yjit_get_code_page(uint32_t cb_bytes_needed, uint32_t ocb_bytes_needed);
|
|
|
|
//code_page_t *rb_yjit_code_page_unwrap(VALUE cp_obj);
|
|
|
|
//void rb_yjit_get_cb(codeblock_t* cb, uint8_t* code_ptr);
|
|
|
|
//void rb_yjit_get_ocb(codeblock_t* cb, uint8_t* code_ptr);
|
2021-09-21 17:59:55 +03:00
|
|
|
|
2021-06-24 04:19:10 +03:00
|
|
|
#endif // #ifndef YJIT_IFACE_H
|