aboutsummaryrefslogtreecommitdiffstats
path: root/ujit_iface.h
blob: 597b0cbbb52add8ed5f57c7dd75176c1f5aeaaa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// 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"
#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

RUBY_EXTERN struct rb_ujit_options rb_ujit_opts;
RUBY_EXTERN int64_t rb_ujit_exec_insns_count;

void cb_write_pre_call_bytes(codeblock_t* cb);
void cb_write_post_call_bytes(codeblock_t* cb);

void map_addr2insn(void *code_ptr, int insn);
int opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc);

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);
void assume_method_lookup_stable(const struct rb_callcache *cc, const rb_callable_method_entry_t *cme, block_t* block);

#endif // #ifndef UJIT_IFACE_H