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

ruby-changes:69065

From: Aaron <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:43 +0900 (JST)
Subject: [ruby-changes:69065] 234ab816ba (master): Exit if YJIT and MJIT are both enabled

https://git.ruby-lang.org/ruby.git/commit/?id=234ab816ba

From 234ab816bacd3b9d7895d1acacaee28e0ade4166 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@r...>
Date: Tue, 7 Sep 2021 12:57:33 -0700
Subject: Exit if YJIT and MJIT are both enabled

YJIT and MJIT can't be running in the same process otherwise they'll
clobber each other.  We should show an error and exit if they're both
enabled.
---
 ruby.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ruby.c b/ruby.c
index 8440969650..b523aee7da 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1834,13 +1834,18 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) https://github.com/ruby/ruby/blob/trunk/ruby.c#L1834
          */
         rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior");
 
-    if (opt->features.set & FEATURE_BIT(yjit))
-        rb_yjit_init(&opt->yjit);
 #if USE_MJIT
     if (opt->features.set & FEATURE_BIT(jit)) {
         opt->mjit.on = TRUE; /* set mjit.on for ruby_show_version() API and check to call mjit_init() */
     }
 #endif
+    if (opt->features.set & FEATURE_BIT(yjit)) {
+        if (opt->mjit.on) {
+            rb_warn("MJIT and YJIT are both enabled at the same time. Exiting");
+            exit(1);
+        }
+        rb_yjit_init(&opt->yjit);
+    }
     if (opt->dump & (DUMP_BIT(version) | DUMP_BIT(version_v))) {
 #if USE_MJIT
         mjit_opts.on = opt->mjit.on; /* used by ruby_show_version(). mjit_init() still can't be called here. */
-- 
cgit v1.2.1


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

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