From e7fc353f044f9280222ca41b029b1368d2bf2fe3 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Mon, 4 Jan 2021 18:08:25 +0900 Subject: enable constant cache on ractors constant cache `IC` is accessed by non-atomic manner and there are thread-safety issues, so Ruby 3.0 disables to use const cache on non-main ractors. This patch enables it by introducing `imemo_constcache` and allocates it by every re-fill of const cache like `imemo_callcache`. [Bug #17510] Now `IC` only has one entry `IC::entry` and it points to `iseq_inline_constant_cache_entry`, managed by T_IMEMO object. `IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and `rb_mjit_after_vm_ic_update()` is not needed. --- mjit.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'mjit.h') diff --git a/mjit.h b/mjit.h index 3ef3379485..986a3adb92 100644 --- a/mjit.h +++ b/mjit.h @@ -83,8 +83,6 @@ RUBY_EXTERN bool mjit_call_p; extern void rb_mjit_add_iseq_to_process(const rb_iseq_t *iseq); extern VALUE rb_mjit_wait_call(rb_execution_context_t *ec, struct rb_iseq_constant_body *body); extern struct rb_mjit_compile_info* rb_mjit_iseq_compile_info(const struct rb_iseq_constant_body *body); -extern void rb_mjit_before_vm_ic_update(void); -extern void rb_mjit_after_vm_ic_update(void); 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); @@ -187,8 +185,6 @@ void mjit_finish(bool close_handle_p); # else // USE_MJIT -static inline void rb_mjit_before_vm_ic_update(void){} -static inline void rb_mjit_after_vm_ic_update(void){} static inline struct mjit_cont *mjit_cont_new(rb_execution_context_t *ec){return NULL;} static inline void mjit_cont_free(struct mjit_cont *cont){} static inline void mjit_gc_start_hook(void){} -- cgit v1.2.3