summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-12-20 21:54:27 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2020-12-20 22:03:20 -0800
commita574df14e45b8b5a1de7bfe949e08b61ae51b0bd (patch)
treeb3378de36e14145f78a5246a83eb3d702f31ff1c /mjit.c
parent74a78778362a7ad9aa246f2cb1a30174a6007365 (diff)
downloadruby-a574df14e45b8b5a1de7bfe949e08b61ae51b0bd.tar.gz
Stop marking unit_queue
The original motivation of this marking was https://github.com/k0kubun/yarv-mjit/issues/20. As wanabe said, there are multiple options to mitigate the issue, and Eric Wong introduced another fix at 143776f6fe by checking unit->iseq inside the lock. Therefore this particular condition has been covered in two ways, and the script given by wanabe no longer crashes without mjit_mark().
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/mjit.c b/mjit.c
index 564d10db17..5c2042bd82 100644
--- a/mjit.c
+++ b/mjit.c
@@ -937,33 +937,6 @@ mjit_finish(bool close_handle_p)
verbose(1, "Successful MJIT finish");
}
-// Called by rb_vm_mark() to mark iseq being JIT-ed and iseqs in the unit queue.
-void
-mjit_mark(void)
-{
- if (!mjit_enabled)
- return;
- RUBY_MARK_ENTER("mjit");
-
- struct rb_mjit_unit *unit = NULL;
- CRITICAL_SECTION_START(4, "mjit_mark");
- list_for_each(&unit_queue.head, unit, unode) {
- if (unit->iseq) { // ISeq is still not GCed
- VALUE iseq = (VALUE)unit->iseq;
- CRITICAL_SECTION_FINISH(4, "mjit_mark rb_gc_mark");
-
- // Don't wrap critical section with this. This may trigger GC,
- // and in that case mjit_gc_start_hook causes deadlock.
- rb_gc_mark(iseq);
-
- CRITICAL_SECTION_START(4, "mjit_mark rb_gc_mark");
- }
- }
- CRITICAL_SECTION_FINISH(4, "mjit_mark");
-
- RUBY_MARK_LEAVE("mjit");
-}
-
// Called by rb_iseq_mark() to mark cc_entries captured for MJIT
void
mjit_mark_cc_entries(const struct rb_iseq_constant_body *const body)