diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-06 23:17:25 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-06 23:44:01 -0800 |
commit | 23ec248e48f696ae986e2b19cd572ece02a5ba55 (patch) | |
tree | 3973e15ea1c34d000b40a64bd64e78880f28efec /rjit.h | |
parent | 2e875549a934fa04b7939810fa0d8a2762702aaa (diff) | |
download | ruby-23ec248e48f696ae986e2b19cd572ece02a5ba55.tar.gz |
s/mjit/rjit/
Diffstat (limited to 'rjit.h')
-rw-r--r-- | rjit.h | 127 |
1 files changed, 63 insertions, 64 deletions
@@ -2,10 +2,9 @@ #define RUBY_RJIT_H 1 /********************************************************************** - mjit.h - Interface to MRI method JIT compiler + rjit.h - Interface to RJIT - Copyright (C) 2017 Vladimir Makarov <vmakarov@redhat.com>. - Copyright (C) 2017 Takashi Kokubun <k0kubun@ruby-lang.org>. + Copyright (C) 2023 Takashi Kokubun <k0kubun@ruby-lang.org>. **********************************************************************/ @@ -24,7 +23,7 @@ // Special address values of a function generated from the // corresponding iseq by RJIT: -enum rb_mjit_func_state { +enum rb_rjit_func_state { // ISEQ has not been compiled yet RJIT_FUNC_NOT_COMPILED = 0, // ISEQ is already queued for the machine code generation but the @@ -34,11 +33,11 @@ enum rb_mjit_func_state { // or the unit is unloaded RJIT_FUNC_FAILED = 2, }; -// Return true if jit_func is part of enum rb_mjit_func_state +// Return true if jit_func is part of enum rb_rjit_func_state #define RJIT_FUNC_STATE_P(jit_func) ((uintptr_t)(jit_func) <= (uintptr_t)RJIT_FUNC_FAILED) // RJIT options which can be defined on the MRI command line. -struct mjit_options { +struct rjit_options { // Converted from "jit" feature flag to tell the enablement // information to ruby_show_version(). bool on; @@ -74,7 +73,7 @@ struct mjit_options { }; // State of optimization switches -struct rb_mjit_compile_info { +struct rb_rjit_compile_info { // Disable getinstancevariable/setinstancevariable optimizations based on inline cache (T_OBJECT) bool disable_ivar_cache; // Disable getinstancevariable/setinstancevariable optimizations based on inline cache (FL_EXIVAR) @@ -90,69 +89,69 @@ struct rb_mjit_compile_info { typedef VALUE (*jit_func_t)(rb_execution_context_t *, rb_control_frame_t *); RUBY_SYMBOL_EXPORT_BEGIN -RUBY_EXTERN struct mjit_options mjit_opts; -RUBY_EXTERN bool mjit_call_p; - -extern void rb_mjit_compile(const rb_iseq_t *iseq); -extern struct rb_mjit_compile_info* rb_mjit_iseq_compile_info(const struct rb_iseq_constant_body *body); -extern void rb_mjit_recompile_send(const rb_iseq_t *iseq); -extern void rb_mjit_recompile_ivar(const rb_iseq_t *iseq); -extern void rb_mjit_recompile_exivar(const rb_iseq_t *iseq); -extern void rb_mjit_recompile_inlining(const rb_iseq_t *iseq); -extern void rb_mjit_recompile_const(const rb_iseq_t *iseq); +RUBY_EXTERN struct rjit_options rjit_opts; +RUBY_EXTERN bool rjit_call_p; + +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); +extern void rb_rjit_recompile_ivar(const rb_iseq_t *iseq); +extern void rb_rjit_recompile_exivar(const rb_iseq_t *iseq); +extern void rb_rjit_recompile_inlining(const rb_iseq_t *iseq); +extern void rb_rjit_recompile_const(const rb_iseq_t *iseq); RUBY_SYMBOL_EXPORT_END -extern void mjit_cancel_all(const char *reason); -extern bool mjit_compile(FILE *f, const rb_iseq_t *iseq, const char *funcname, int id); -extern void mjit_init(const struct mjit_options *opts); -extern void mjit_free_iseq(const rb_iseq_t *iseq); -extern void rb_mjit_iseq_update_references(struct rb_iseq_constant_body *const body); -extern void mjit_mark(void); -extern void rb_mjit_iseq_mark(VALUE mjit_blocks); -extern void mjit_notify_waitpid(int exit_code); - -extern void rb_mjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_mjit_cme_invalidate(rb_callable_method_entry_t *cme); -extern void rb_mjit_before_ractor_spawn(void); -extern void rb_mjit_constant_state_changed(ID id); -extern void rb_mjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); -extern void rb_mjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); - -void mjit_child_after_fork(void); - -extern void rb_mjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); -extern void rb_mjit_before_ractor_spawn(void); -extern void rb_mjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); -extern void rb_mjit_collect_vm_usage_insn(int insn); - -extern bool mjit_enabled; -extern bool mjit_stats_enabled; -VALUE mjit_pause(bool wait_p); -VALUE mjit_resume(void); -void mjit_finish(bool close_handle_p); +extern void rjit_cancel_all(const char *reason); +extern bool rjit_compile(FILE *f, const rb_iseq_t *iseq, const char *funcname, int id); +extern void rjit_init(const struct rjit_options *opts); +extern void rjit_free_iseq(const rb_iseq_t *iseq); +extern void rb_rjit_iseq_update_references(struct rb_iseq_constant_body *const body); +extern void rjit_mark(void); +extern void rb_rjit_iseq_mark(VALUE rjit_blocks); +extern void rjit_notify_waitpid(int exit_code); + +extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); +extern void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme); +extern void rb_rjit_before_ractor_spawn(void); +extern void rb_rjit_constant_state_changed(ID id); +extern void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); +extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); + +void rjit_child_after_fork(void); + +extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); +extern void rb_rjit_before_ractor_spawn(void); +extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events); +extern void rb_rjit_collect_vm_usage_insn(int insn); + +extern bool rjit_enabled; +extern bool rjit_stats_enabled; +VALUE rjit_pause(bool wait_p); +VALUE rjit_resume(void); +void rjit_finish(bool close_handle_p); # else // USE_RJIT -static inline void mjit_cancel_all(const char *reason){} -static inline void mjit_free_iseq(const rb_iseq_t *iseq){} -static inline void mjit_mark(void){} +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 mjit_child_after_fork(void){} - -static inline void rb_mjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} -static inline void rb_mjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_mjit_before_ractor_spawn(void) {} -static inline void rb_mjit_constant_state_changed(ID id) {} -static inline void rb_mjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} -static inline void rb_mjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {} - -#define mjit_enabled false -#define mjit_stats_enabled false -static inline VALUE mjit_pause(bool wait_p){ return Qnil; } // unreachable -static inline VALUE mjit_resume(void){ return Qnil; } // unreachable -static inline void mjit_finish(bool close_handle_p){} - -static inline void rb_mjit_collect_vm_usage_insn(int insn) {} +static inline void rjit_child_after_fork(void){} + +static inline void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} +static inline void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme) {} +static inline void rb_rjit_before_ractor_spawn(void) {} +static inline void rb_rjit_constant_state_changed(ID id) {} +static inline void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {} +static inline void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {} + +#define rjit_enabled false +#define rjit_stats_enabled false +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){} + +static inline void rb_rjit_collect_vm_usage_insn(int insn) {} # endif // USE_RJIT #endif // RUBY_RJIT_H |