YJIT: add context cache size stat, lazily allocate cache

* YJIT: add context cache size stat
* Allocate the context cache in a box so CRuby doesn't pay overhead
* Add an extra debug assertion
This commit is contained in:
Maxime Chevalier-Boisvert 2024-06-11 12:46:11 -04:00 committed by GitHub
parent 568132af16
commit 39019b6a63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 25 deletions

View file

@ -390,6 +390,7 @@ module RubyVM::YJIT
out.puts "yjit_alloc_size: " + format_number(13, stats[:yjit_alloc_size]) if stats.key?(:yjit_alloc_size)
bytes_per_context = stats[:context_data_bytes].fdiv(stats[:num_contexts_encoded])
out.puts "context_cache_bytes: " + format_number(13, stats[:context_cache_bytes])
out.puts "context_data_bytes: " + format_number(13, stats[:context_data_bytes])
out.puts "num_contexts_encoded: " + format_number(13, stats[:num_contexts_encoded])
out.puts "bytes_per_context: " + ("%13.2f" % bytes_per_context)