[前][次][番号順一覧][スレッド一覧]

ruby-changes:72179

From: Takashi <ko1@a...>
Date: Thu, 16 Jun 2022 08:53:02 +0900 (JST)
Subject: [ruby-changes:72179] 15a6dd56e0 (master): MJIT: Handle C compiler failures

https://git.ruby-lang.org/ruby.git/commit/?id=15a6dd56e0

From 15a6dd56e08dddea9201c072567986368e1c508e Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Wed, 15 Jun 2022 16:50:45 -0700
Subject: MJIT: Handle C compiler failures

---
 mjit.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/mjit.c b/mjit.c
index 3bceccfb4c..d66bde15bd 100644
--- a/mjit.c
+++ b/mjit.c
@@ -248,7 +248,7 @@ check_unit_queue(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L248
     // JIT failure
     if (current_cc_pid == -1) {
         current_cc_pid = 0;
-        current_cc_unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC;
+        current_cc_unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // TODO: consider unit->compact_p
         current_cc_unit = NULL;
         return;
     }
@@ -327,8 +327,9 @@ mjit_notify_waitpid(int status) https://github.com/ruby/ruby/blob/trunk/mjit.c#L327
     }
     if (!success) {
         verbose(2, "Failed to generate so");
-        // TODO: free unit?
-        // TODO: set NOT_COMPILED_JIT_ISEQ_FUNC?
+        current_cc_unit->iseq->body->jit_func = (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC; // TODO: consider unit->compact_p
+        free_unit(current_cc_unit);
+        current_cc_unit = NULL;
         return;
     }
 
@@ -906,7 +907,7 @@ stop_worker(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L907
 {
     stop_worker_p = true;
     if (current_cc_unit != NULL) {
-        mjit_wait(current_cc_unit->iseq->body);
+        mjit_wait(current_cc_unit->iseq->body); // TODO: consider unit->compact_p
     }
     worker_stopped = true;
 }
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]