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

ruby-changes:72500

From: Takashi <ko1@a...>
Date: Mon, 11 Jul 2022 15:59:01 +0900 (JST)
Subject: [ruby-changes:72500] fae568edbe (master): Use NO_JIT_DESCRIPTION only when needed

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

From fae568edbe61f816237aab230ced2ecc07135c45 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 10 Jul 2022 23:58:18 -0700
Subject: Use NO_JIT_DESCRIPTION only when needed

Apparently 203801566a186b7b1cbe899a06d0832923a1bdf9 broke YJIT's CI.
---
 test/ruby/test_rubyoptions.rb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 93ad73bccd..6d2c0fa5cd 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -7,10 +7,11 @@ require 'tempfile' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L7
 require_relative '../lib/jit_support'
 
 class TestRubyOptions < Test::Unit::TestCase
+  def self.mjit_enabled? = defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
   def self.yjit_enabled? = defined?(RubyVM::YJIT.enabled?) && RubyVM::YJIT.enabled?
 
   NO_JIT_DESCRIPTION =
-    if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
+    if mjit_enabled?
       RUBY_DESCRIPTION.sub(/\+MJIT /, '')
     elsif yjit_enabled?
       RUBY_DESCRIPTION.sub(/\+YJIT /, '')
@@ -148,7 +149,7 @@ class TestRubyOptions < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L149
   def test_verbose
     assert_in_out_err([{'RUBY_YJIT_ENABLE' => nil}, "-vve", ""]) do |r, e|
       assert_match(VERSION_PATTERN, r[0])
-      if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? && !JITSupport.mjit_force_enabled?
+      if self.class.mjit_enabled? && !JITSupport.mjit_force_enabled?
         assert_equal(NO_JIT_DESCRIPTION, r[0])
       elsif self.class.yjit_enabled? && !yjit_force_enabled? # checking -DYJIT_FORCE_ENABLE
         assert_equal(NO_JIT_DESCRIPTION, r[0])
@@ -216,7 +217,7 @@ class TestRubyOptions < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L217
       assert_match(VERSION_PATTERN, r[0])
       if ENV['RUBY_YJIT_ENABLE'] == '1'
         assert_equal(NO_JIT_DESCRIPTION, r[0])
-      elsif defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? || self.class.yjit_enabled? # checking -D(M|Y)JIT_FORCE_ENABLE
+      elsif self.class.mjit_enabled? || self.class.yjit_enabled? # checking -D(M|Y)JIT_FORCE_ENABLE
         assert_equal(EnvUtil.invoke_ruby(['-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
       else
         assert_equal(RUBY_DESCRIPTION, r[0])
@@ -740,7 +741,7 @@ class TestRubyOptions < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L741
         -e:(?:1:)?\s\[BUG\]\sSegmentation\sfault.*\n
       )x,
       %r(
-        #{ Regexp.quote(JITSupport.mjit_force_enabled? ? RUBY_DESCRIPTION : NO_JIT_DESCRIPTION) }\n\n
+        #{ Regexp.quote((TestRubyOptions.mjit_enabled? && !JITSupport.mjit_force_enabled?) ? NO_JIT_DESCRIPTION : RUBY_DESCRIPTION) }\n\n
       )x,
       %r(
         (?:--\s(?:.+\n)*\n)?
-- 
cgit v1.2.1


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

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