summaryrefslogtreecommitdiff
path: root/rjit.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-03-07 22:43:37 -0800
committerGitHub <noreply@github.com>2023-03-07 22:43:37 -0800
commit6d91df08b53d0b17fa8cd949a3c6b42164c46c8d (patch)
tree8aea38651881189841c537dd8c8ca097a850f351 /rjit.h
parent0bf4cd8e1c3178345a63ce5b9d80d02781d93497 (diff)
downloadruby-6d91df08b53d0b17fa8cd949a3c6b42164c46c8d.tar.gz
Allow enabling YJIT and RJIT independently (#7474)
We used to require MJIT is supported when YJIT is supported. However, now that RJIT dropped some platforms that YJIT supports, it no longer makes sense. We should be able to enable only YJIT, and vice versa.
Diffstat (limited to 'rjit.h')
-rw-r--r--rjit.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/rjit.h b/rjit.h
index 212b22bc80..4f61927760 100644
--- a/rjit.h
+++ b/rjit.h
@@ -86,12 +86,12 @@ struct rb_rjit_compile_info {
bool disable_const_cache;
};
-typedef VALUE (*jit_func_t)(rb_execution_context_t *, rb_control_frame_t *);
-
RUBY_SYMBOL_EXPORT_BEGIN
RUBY_EXTERN struct rjit_options rjit_opts;
RUBY_EXTERN bool rjit_call_p;
+#define rb_rjit_call_threshold() rjit_opts.call_threshold
+
extern void rb_rjit_compile(const rb_iseq_t *iseq);
extern struct rb_rjit_compile_info* rb_rjit_iseq_compile_info(const struct rb_iseq_constant_body *body);
extern void rb_rjit_recompile_send(const rb_iseq_t *iseq);
@@ -132,10 +132,11 @@ void rjit_finish(bool close_handle_p);
# else // USE_RJIT
+static inline void rb_rjit_compile(const rb_iseq_t *iseq){}
+
static inline void rjit_cancel_all(const char *reason){}
static inline void rjit_free_iseq(const rb_iseq_t *iseq){}
static inline void rjit_mark(void){}
-static inline VALUE jit_exec(rb_execution_context_t *ec) { return Qundef; /* unreachable */ }
static inline void rjit_child_after_fork(void){}
static inline void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
@@ -146,7 +147,11 @@ static inline void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic
static inline void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {}
#define rjit_enabled false
+#define rjit_call_p false
#define rjit_stats_enabled false
+
+#define rb_rjit_call_threshold() UINT_MAX
+
static inline VALUE rjit_pause(bool wait_p){ return Qnil; } // unreachable
static inline VALUE rjit_resume(void){ return Qnil; } // unreachable
static inline void rjit_finish(bool close_handle_p){}