aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-12-20 22:41:52 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2020-12-20 22:58:45 -0800
commit1fdc97f1b76b7532d011b20d52f843a2bb0d1a2f (patch)
treedfd8ef016c8b8eb49821c85947f1e50abeea2169 /mjit.h
parenta574df14e45b8b5a1de7bfe949e08b61ae51b0bd (diff)
downloadruby-1fdc97f1b76b7532d011b20d52f843a2bb0d1a2f.tar.gz
Mark active_units
to avoid SEGV on mjit_recompile and compact_all_jit_code. For some reason, ISeqs on stack are sometimes GC-ed (why?) and therefore it may run mjit_recompile on a GC-ed ISeq, which I expected d07183ec85d to fix but apparently it may refer to random things if already GC-ed. Marking active_units would workaround the situation. http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3292740 Also, while compact_all_jit_code was executed, we saw some SEGVs where CCs seemed to be already GC-ed, meaning their owner ISeq was not marked properly. Even if units are still in active_units, it's not guaranteed that their ISeqs are in use. So in this case we need to mark active_units for a legitimate reason. http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293277 http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293090
Diffstat (limited to 'mjit.h')
-rw-r--r--mjit.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/mjit.h b/mjit.h
index 89d9a7ae85..a523bc9512 100644
--- a/mjit.h
+++ b/mjit.h
@@ -98,6 +98,7 @@ extern void mjit_gc_start_hook(void);
extern void mjit_gc_exit_hook(void);
extern void mjit_free_iseq(const rb_iseq_t *iseq);
extern void mjit_update_references(const rb_iseq_t *iseq);
+extern void mjit_mark(void);
extern struct mjit_cont *mjit_cont_new(rb_execution_context_t *ec);
extern void mjit_cont_free(struct mjit_cont *cont);
extern void mjit_add_class_serial(rb_serial_t class_serial);
@@ -200,6 +201,7 @@ static inline void mjit_cont_free(struct mjit_cont *cont){}
static inline void mjit_gc_start_hook(void){}
static inline void mjit_gc_exit_hook(void){}
static inline void mjit_free_iseq(const rb_iseq_t *iseq){}
+static inline void mjit_mark(void){}
static inline void mjit_add_class_serial(rb_serial_t class_serial){}
static inline void mjit_remove_class_serial(rb_serial_t class_serial){}
static inline VALUE mjit_exec(rb_execution_context_t *ec) { return Qundef; /* unreachable */ }