mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
YJIT: Let RubyVM::YJIT.enable respect --yjit-stats (#9415)
This commit is contained in:
parent
4d03140009
commit
7f9c174102
3 changed files with 23 additions and 5 deletions
6
yjit.rb
6
yjit.rb
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue