From b64f81c81729bbc248d19af01cafde88eb60fdc7 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 12 Aug 2021 23:15:34 -0700 Subject: [PATCH] Pause an MJIT worker when JIT is cancelled --- NEWS.md | 2 ++ mjit.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index 85f49d4846..6b78cec01a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -179,6 +179,8 @@ Excluding feature bug fixes. * `--jit-verbose` and `--jit-warning` output "JIT cancel" when JIT-ed code is disabled because TracePoint or GC.compact is used. +* Pause an MJIT worker when JIT-ed code gets disabled. + * `RubyVM::MJIT` is renamed to `RubyVM::JIT`. [[Feature #17490]] ## Static analysis diff --git a/mjit.c b/mjit.c index 57f28476ca..1f90ac0007 100644 --- a/mjit.c +++ b/mjit.c @@ -91,6 +91,9 @@ mjit_cancel_all(const char *reason) if (mjit_opts.warnings || mjit_opts.verbose) { fprintf(stderr, "JIT cancel: Disabled JIT-ed code because %s\n", reason); } + + // Currently we never re-enable JIT calls. Thus we don't need to run JIT anymore. + mjit_pause(false); } // Deal with ISeq movement from compactor