aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-10-18 19:46:35 -0400
committerGitHub <noreply@github.com>2023-10-18 23:46:35 +0000
commitd2b0c9da2e0148c8c12ca58e21c482c1e66c2358 (patch)
tree7f0ae18acae1a6d389b449498175cdf82bd66e20 /compile.c
parent0ac6fb225d15cbcd35b8122b151a17eaa92fafaf (diff)
downloadruby-d2b0c9da2e0148c8c12ca58e21c482c1e66c2358.tar.gz
YJIT: Add a live ISeq counter
It's an estimator for application size and could be used as a compilation heuristic later. Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 3dc4152700..12fe347f5b 100644
--- a/compile.c
+++ b/compile.c
@@ -39,6 +39,7 @@
#include "vm_core.h"
#include "vm_callinfo.h"
#include "vm_debug.h"
+#include "yjit.h"
#include "builtin.h"
#include "insns.inc"
@@ -1019,6 +1020,11 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
}
FL_SET((VALUE)iseq, ISEQ_TRANSLATED);
#endif
+
+#if USE_YJIT
+ rb_yjit_live_iseq_count++;
+#endif
+
return COMPILE_OK;
}