diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-26 15:15:46 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-27 13:00:05 -0400 |
commit | fdbae38546c6cd352e5becfd6c555ea22eb64b96 (patch) | |
tree | 230bc7a25b7c363ee91c3398e20f5bf0b24b4ab2 /yjit.rb | |
parent | 6875d6d1fa086fcec58c9d888cbacc1e108a0935 (diff) |
YJIT: move --yjit-stats at_exit call into Ruby
This change fixes `-v --yjit-stats`. Previously in this situation,
YJIT._print_stats wasn't defined as yjit.rb is not evaluated when there
is only "-v" and no Ruby code to run.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5022
Diffstat (limited to 'yjit.rb')
-rw-r--r-- | yjit.rb | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -142,13 +142,18 @@ module YJIT end def self.stats_enabled? - Primitive.cexpr! 'rb_yjit_opts.gen_stats ? Qtrue : Qfalse' + Primitive.yjit_stats_enabled_p end def self.enabled? Primitive.cexpr! 'rb_yjit_enabled_p() ? Qtrue : Qfalse' end + # Avoid calling a method here to not interfere with compilation tests + if Primitive.yjit_stats_enabled_p + at_exit { _print_stats } + end + class << self private |