summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 2096ea7bda..ba90cca7b6 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1103,6 +1103,8 @@ compile_prelude(FILE *f)
#endif
}
+static rb_iseq_t *compiling_iseq = NULL;
+
// Compile ISeq in UNIT and return function pointer of JIT-ed code.
// It may return NOT_COMPILED_JIT_ISEQ_FUNC if something went wrong.
static mjit_func_t
@@ -1136,6 +1138,8 @@ convert_unit_to_func(struct rb_mjit_unit *unit)
}
// We need to check again here because we could've waited on GC above
in_jit = (unit->iseq != NULL);
+ if (in_jit)
+ compiling_iseq = unit->iseq;
CRITICAL_SECTION_FINISH(3, "before mjit_compile to wait GC finish");
if (!in_jit) {
fclose(f);
@@ -1160,6 +1164,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit)
// release blocking mjit_gc_start_hook
CRITICAL_SECTION_START(3, "after mjit_compile to wakeup client for GC");
+ compiling_iseq = NULL;
in_jit = false;
verbose(3, "Sending wakeup signal to client in a mjit-worker for GC");
rb_native_cond_signal(&mjit_client_wakeup);