summaryrefslogtreecommitdiff
path: root/yjit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-11-17 12:59:59 -0800
committerGitHub <noreply@github.com>2022-11-17 12:59:59 -0800
commitc80edc9f98f58826d6c6d4b5ee11a2886bbfb006 (patch)
tree9ecd1f170899f3fdacbd5c1dac3d29bf39023b3d /yjit.rb
parent4b29eb17f2b01442198c81c5f62fcd3045aab659 (diff)
downloadruby-c80edc9f98f58826d6c6d4b5ee11a2886bbfb006.tar.gz
YJIT: Add object shape count to stats (#6754)
Diffstat (limited to 'yjit.rb')
-rw-r--r--yjit.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/yjit.rb b/yjit.rb
index 0bd0fb8c7e..8d67069b13 100644
--- a/yjit.rb
+++ b/yjit.rb
@@ -146,7 +146,10 @@ module RubyVM::YJIT
# Return nil when option is not passed or unavailable.
def self.runtime_stats
stats = Primitive.rb_yjit_get_stats
- return stats if stats.nil? || !Primitive.rb_yjit_stats_enabled_p
+ return stats if stats.nil?
+
+ stats[:object_shape_count] = Primitive.object_shape_count
+ return stats unless Primitive.rb_yjit_stats_enabled_p
side_exits = total_exit_count(stats)
total_exits = side_exits + stats[:leave_interp_return]
@@ -270,6 +273,7 @@ module RubyVM::YJIT
$stderr.puts "freed_page_count: " + ("%10d" % stats[:freed_page_count])
$stderr.puts "code_gc_count: " + ("%10d" % stats[:code_gc_count])
$stderr.puts "num_gc_obj_refs: " + ("%10d" % stats[:num_gc_obj_refs])
+ $stderr.puts "object_shape_count: " + ("%10d" % stats[:object_shape_count])
$stderr.puts "side_exit_count: " + ("%10d" % stats[:side_exit_count])
$stderr.puts "total_exit_count: " + ("%10d" % stats[:total_exit_count])
$stderr.puts "total_insns_count: " + ("%10d" % stats[:total_insns_count]) if stats.key?(:total_insns_count)