summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2023-04-04 16:41:52 -0400
committerGitHub <noreply@github.com>2023-04-04 16:41:52 -0400
commitd26d3575cab676ade7d0257138a044e22b373e68 (patch)
treee2dd06e4f9985172e5a74890115187f8bdcd2acd /yjit
parent8525603c72e22c90aa423431684042af66d1d100 (diff)
downloadruby-d26d3575cab676ade7d0257138a044e22b373e68.tar.gz
YJIT: add stats for ratio of versions per block (#7653)
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/core.rs5
-rw-r--r--yjit/src/stats.rs1
2 files changed, 6 insertions, 0 deletions
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index 05e9f85b18..98b9e792c8 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -1416,6 +1416,11 @@ unsafe fn add_block_version(blockref: BlockRef, cb: &CodeBlock) {
let version_list = get_or_create_version_list(block.get_blockid());
+ // If this the first block being compiled with this block id
+ if version_list.len() == 0 {
+ incr_counter!(compiled_blockid_count);
+ }
+
version_list.push(blockref);
version_list.shrink_to_fit();
diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs
index 6ca19c93f3..0e832dbe71 100644
--- a/yjit/src/stats.rs
+++ b/yjit/src/stats.rs
@@ -316,6 +316,7 @@ make_counters! {
vm_insns_count,
compiled_iseq_count,
+ compiled_blockid_count,
compiled_block_count,
compiled_branch_count,
compilation_failure,