ruby-changes:72183
From: Takashi <ko1@a...>
Date: Thu, 16 Jun 2022 14:10:02 +0900 (JST)
Subject: [ruby-changes:72183] b5079794fd (master): MJIT: Handle compaction units on stop_worker
https://git.ruby-lang.org/ruby.git/commit/?id=b5079794fd From b5079794fd8be0552e758d8b0713f7e633610214 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Wed, 15 Jun 2022 22:09:37 -0700 Subject: MJIT: Handle compaction units on stop_worker --- mjit.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mjit.c b/mjit.c index 9531172a66..cd283d686f 100644 --- a/mjit.c +++ b/mjit.c @@ -453,6 +453,17 @@ mjit_wait(struct rb_iseq_constant_body *body) https://github.com/ruby/ruby/blob/trunk/mjit.c#L453 } } +static void +mjit_wait_unit(struct rb_mjit_unit *unit) +{ + if (unit->compact_p) { + mjit_wait(NULL); + } + else { + mjit_wait(current_cc_unit->iseq->body); + } +} + // Wait for JIT compilation finish for --jit-wait, and call the function pointer // if the compiled result is not NOT_COMPILED_JIT_ISEQ_FUNC. VALUE @@ -909,7 +920,7 @@ stop_worker(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L920 { stop_worker_p = true; if (current_cc_unit != NULL) { - mjit_wait(current_cc_unit->iseq->body); // TODO: consider unit->compact_p + mjit_wait_unit(current_cc_unit); } worker_stopped = true; } @@ -928,11 +939,7 @@ mjit_pause(bool wait_p) https://github.com/ruby/ruby/blob/trunk/mjit.c#L939 // Flush all queued units with no option or `wait: true` if (wait_p) { while (current_cc_unit != NULL) { - if (current_cc_unit->compact_p) { - mjit_wait(NULL); - } else { - mjit_wait(current_cc_unit->iseq->body); - } + mjit_wait_unit(current_cc_unit); } } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/