From 91f446fa6a6b530c9bc4be0849ab592e0cef1483 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 1 Jul 2023 18:17:22 +0900 Subject: [PATCH] add a stat for loop --- lib/exec.c | 2 ++ lib/exec_context.h | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/exec.c b/lib/exec.c index 80fbace0..9a866ad3 100644 --- a/lib/exec.c +++ b/lib/exec.c @@ -765,6 +765,7 @@ block_exit(struct exec_context *ctx, uint32_t blockpc, bool goto_else, } get_arity_for_blocktype(m, blocktype, ¶m_arity, &arity); } else { + STAT_INC(ctx->stats.jump_loop); const int64_t blocktype = read_leb_s33_nocheck(&p); get_arity_for_blocktype(m, blocktype, ¶m_arity, &arity); ctx->p = blockp; @@ -1399,6 +1400,7 @@ exec_context_print_stats(struct exec_context *ctx) STAT_PRINT(jump_cache2_hit); STAT_PRINT(jump_cache_hit); STAT_PRINT(jump_table_search); + STAT_PRINT(jump_loop); STAT_PRINT(type_annotation_lookup1); STAT_PRINT(type_annotation_lookup2); STAT_PRINT(type_annotation_lookup3); diff --git a/lib/exec_context.h b/lib/exec_context.h index 1c9d2a09..58e4e2fd 100644 --- a/lib/exec_context.h +++ b/lib/exec_context.h @@ -111,6 +111,7 @@ struct exec_stat { uint64_t jump_cache_hit; uint64_t jump_cache2_hit; uint64_t jump_table_search; + uint64_t jump_loop; uint64_t type_annotation_lookup1; uint64_t type_annotation_lookup2; uint64_t type_annotation_lookup3;