mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
48 lines
2.0 KiB
C
48 lines
2.0 KiB
C
#ifndef ZJIT_H
|
|
#define ZJIT_H 1
|
|
//
|
|
// This file contains definitions ZJIT exposes to the CRuby codebase
|
|
//
|
|
|
|
// ZJIT_STATS controls whether to support runtime counters in the interpreter
|
|
#ifndef ZJIT_STATS
|
|
# define ZJIT_STATS (USE_ZJIT && RUBY_DEBUG)
|
|
#endif
|
|
|
|
#if USE_ZJIT
|
|
extern void *rb_zjit_entry;
|
|
extern uint64_t rb_zjit_call_threshold;
|
|
extern uint64_t rb_zjit_profile_threshold;
|
|
void rb_zjit_compile_iseq(const rb_iseq_t *iseq, bool jit_exception);
|
|
void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec);
|
|
void rb_zjit_profile_enable(const rb_iseq_t *iseq);
|
|
void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
|
|
void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme);
|
|
void rb_zjit_cme_free(const rb_callable_method_entry_t *cme);
|
|
void rb_zjit_klass_free(VALUE klass);
|
|
void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq);
|
|
void rb_zjit_constant_state_changed(ID id);
|
|
void rb_zjit_iseq_mark(void *payload);
|
|
void rb_zjit_iseq_update_references(void *payload);
|
|
void rb_zjit_iseq_free(const rb_iseq_t *iseq);
|
|
void rb_zjit_before_ractor_spawn(void);
|
|
void rb_zjit_tracing_invalidate_all(void);
|
|
void rb_zjit_invalidate_no_singleton_class(VALUE klass);
|
|
#else
|
|
#define rb_zjit_entry 0
|
|
static inline void rb_zjit_compile_iseq(const rb_iseq_t *iseq, bool jit_exception) {}
|
|
static inline void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec) {}
|
|
static inline void rb_zjit_profile_enable(const rb_iseq_t *iseq) {}
|
|
static inline void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
|
|
static inline void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme) {}
|
|
static inline void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq) {}
|
|
static inline void rb_zjit_constant_state_changed(ID id) {}
|
|
static inline void rb_zjit_before_ractor_spawn(void) {}
|
|
static inline void rb_zjit_tracing_invalidate_all(void) {}
|
|
static inline void rb_zjit_invalidate_no_singleton_class(VALUE klass) {}
|
|
#endif // #if USE_ZJIT
|
|
|
|
#define rb_zjit_enabled_p (rb_zjit_entry != 0)
|
|
|
|
#endif // #ifndef ZJIT_H
|