YJIT: Let RubyVM::YJIT.enable respect --yjit-stats (#9415)

This commit is contained in:
Takashi Kokubun 2024-01-05 11:08:57 -08:00 committed by GitHub
parent 4d03140009
commit 7f9c174102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View file

@ -28,7 +28,11 @@ module RubyVM::YJIT
Primitive.rb_yjit_reset_stats_bang
end
# Enable \YJIT compilation.
# Enable \YJIT compilation. `stats` option decides whether to enable \YJIT stats or not.
#
# * `false`: Disable stats.
# * `true`: Enable stats. Print stats at exit.
# * `:quiet`: Enable stats. Do not print stats at exit.
def self.enable(stats: false)
return false if enabled?
at_exit { print_and_dump_stats } if stats