11# define ZJIT_STATS (USE_ZJIT && RUBY_DEBUG)
27 bool materialize_block_code;
44#define ZJIT_STACK_MAP_VREG_TAG 0x08
45#define ZJIT_STACK_MAP_SKIP_TAG 0x10
46#define ZJIT_STACK_MAP_BASE_PTR_TAG 0x18
47#define ZJIT_STACK_MAP_TAG_MASK 0xff
48#define ZJIT_STACK_MAP_SHIFT 8
52#define ZJIT_STACK_MAP_BASE_PTR_SIZE_SHIFT 32
53#define ZJIT_STACK_MAP_BASE_PTR_INDEX_MASK 0xffffff
56ZJIT_STACK_MAP_VREG_P(
VALUE entry)
58 return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_VREG_TAG;
62ZJIT_STACK_MAP_VREG_INDEX(
VALUE entry)
64 return entry >> ZJIT_STACK_MAP_SHIFT;
68ZJIT_STACK_MAP_SKIP_P(
VALUE entry)
70 return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_SKIP_TAG;
74ZJIT_STACK_MAP_SKIP_SIZE(
VALUE entry)
76 return entry >> ZJIT_STACK_MAP_SHIFT;
86ZJIT_STACK_MAP_BASE_PTR_P(
VALUE entry)
88 return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_BASE_PTR_TAG;
96ZJIT_STACK_MAP_BASE_PTR_SLOT_INDEX(
VALUE entry)
98 return (entry >> ZJIT_STACK_MAP_SHIFT) & ZJIT_STACK_MAP_BASE_PTR_INDEX_MASK;
104ZJIT_STACK_MAP_BASE_PTR_STACK_SIZE(
VALUE entry)
106 return entry >> ZJIT_STACK_MAP_BASE_PTR_SIZE_SHIFT;
109extern void *rb_zjit_entry;
110extern bool rb_zjit_compiling_p;
112extern unsigned int rb_zjit_call_threshold;
113extern unsigned int rb_zjit_profile_threshold;
116void rb_zjit_profile_enable(
const rb_iseq_t *iseq);
117void rb_zjit_bop_redefined(
int redefined_flag,
enum ruby_basic_operators bop);
120void rb_zjit_klass_free(
VALUE klass);
121void rb_zjit_invalidate_no_ep_escape(
const rb_iseq_t *iseq);
122void rb_zjit_constant_state_changed(
ID id);
123void rb_zjit_iseq_mark(
void *payload);
124void rb_zjit_iseq_update_references(
void *payload);
125void rb_zjit_mark_all_writable(
void);
126void rb_zjit_mark_all_executable(
void);
127void rb_zjit_iseq_free(
const rb_iseq_t *iseq);
128void rb_zjit_invalidate_single_ractor(
void);
129void rb_zjit_tracing_invalidate_all(
void);
130void rb_zjit_invalidate_newobj_hook(
void);
131void rb_zjit_invalidate_no_singleton_class(
VALUE klass);
132void rb_zjit_invalidate_root_box(
void);
136size_t rb_zjit_hash_new_size(
VALUE *flags_out,
size_t size);
137VALUE rb_zjit_new_obj_shape(
VALUE flags,
size_t alloc_size);
138bool rb_zjit_class_allocate_instance_fastpath(
VALUE klass,
size_t *size_out,
VALUE *flags_out);
139bool rb_zjit_str_resurrect_fastpath(
VALUE str,
bool chilled,
size_t *size_out,
VALUE *flags_out,
long *len_out,
size_t *byte_size_out);
140bool rb_zjit_array_dup_can_fastpath(
VALUE ary,
size_t *alloc_size_out,
VALUE *flags_out,
long *len_out);
141bool rb_zjit_array_new_can_fastpath(
long len,
size_t *alloc_size_out,
VALUE *flags_out);
142bool rb_zjit_hash_dup_can_fastpath(
VALUE hash,
size_t *alloc_size_out,
VALUE *flags_out,
VALUE *ifnone_out,
long *bound_out);
143void rb_zjit_range_new_fastpath(
bool exclude_end,
size_t *alloc_size_out,
VALUE *flags_out);
144void rb_zjit_array_new_fastpath(
size_t *alloc_size_out,
VALUE *flags_out);
145bool rb_zjit_newobj_hook_enabled_p(
void);
151#define ZJIT_JIT_RETURN_C_FRAME 0x1
156 if ((
VALUE)cfp->jit_return == ZJIT_JIT_RETURN_C_FRAME) {
157 return &rb_zjit_c_frame;
173#define rb_zjit_entry 0
174#define rb_zjit_compiling_p false
177static inline void rb_zjit_profile_enable(
const rb_iseq_t *iseq) {}
178static inline void rb_zjit_bop_redefined(
int redefined_flag,
enum ruby_basic_operators bop) {}
180static inline void rb_zjit_invalidate_no_ep_escape(
const rb_iseq_t *iseq) {}
181static inline void rb_zjit_constant_state_changed(
ID id) {}
182static inline void rb_zjit_invalidate_single_ractor(
void) {}
183static inline void rb_zjit_tracing_invalidate_all(
void) {}
184static inline void rb_zjit_invalidate_newobj_hook(
void) {}
185static inline void rb_zjit_invalidate_no_singleton_class(
VALUE klass) {}
186static inline void rb_zjit_invalidate_root_box(
void) {}
187static inline void rb_zjit_jit_frame_update_references(
zjit_jit_frame_t *jit_frame) {}
193#define rb_zjit_enabled_p (rb_zjit_entry != 0)
199 if (!rb_zjit_enabled_p)
return false;
200 return cfp->jit_return != NULL;
203static inline const VALUE*
206 if (CFP_ZJIT_FRAME_P(cfp)) {
207 return CFP_ZJIT_FRAME(cfp)->pc;
215 if (CFP_ZJIT_FRAME_P(cfp)) {
216 return CFP_ZJIT_FRAME(cfp)->iseq;
int len
Length of the buffer.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
uintptr_t VALUE
Type that represents a Ruby object.