diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-10-20 13:12:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 13:12:38 -0700 |
| commit | 8a88172fd44defba0e73ebef41d33a44ac71941d (patch) | |
| tree | 4e19d448860470b1b8ecebab48fbe4263338487a | |
| parent | 01787d53bfef987a34832ade02376b2f9e364327 (diff) | |
YJIT: Skip printing stats at exit if --yjit-disable (#8727)
| -rw-r--r-- | test/ruby/test_yjit.rb | 4 | ||||
| -rw-r--r-- | yjit/src/stats.rs | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 591a6c25ff..3ff78e658f 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -1388,6 +1388,10 @@ class TestYJIT < Test::Unit::TestCase assert_no_exits('0xfff_ffff_ffff_ffff * 0x10') end + def test_disable_stats + assert_in_out_err(%w[--yjit-stats --yjit-disable]) + end + private def code_gc_helpers diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index d35cdc22a4..4cd7c1979d 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -515,7 +515,7 @@ pub extern "C" fn rb_yjit_stats_enabled_p(_ec: EcPtr, _ruby_self: VALUE) -> VALU /// Check if stats generation should print at exit #[no_mangle] pub extern "C" fn rb_yjit_print_stats_p(_ec: EcPtr, _ruby_self: VALUE) -> VALUE { - if get_option!(print_stats) { + if yjit_enabled_p() && get_option!(print_stats) { return Qtrue; } else { return Qfalse; |
