aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-07-13 15:14:43 -0700
committerGitHub <noreply@github.com>2023-07-13 18:14:43 -0400
commitd814722fb8299c4baace3e76447a55a3d5478e3a (patch)
tree9a2c1ad1a2eec7f7df26ca4deef4a52cddb3750f /vm_insnhelper.h
parente850181acf0e68a162c75d47b7a0951ab7d878b1 (diff)
downloadruby-d814722fb8299c4baace3e76447a55a3d5478e3a.tar.gz
YJIT: Make ratio_in_yjit always available (#8064)
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 0e5f12c3b2..66895cd142 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -20,8 +20,11 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
# define RJIT_STATS RUBY_DEBUG
#endif
-#if YJIT_STATS
-#define YJIT_COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_usage_insn(insn)
+#if USE_YJIT // We want vm_insns_count on any YJIT-enabled build
+// Increment vm_insns_count for --yjit-stats. We increment this even when
+// --yjit or --yjit-stats is not used because branching to skip it is slower.
+// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors.
+#define YJIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++
#else
#define YJIT_COLLECT_USAGE_INSN(insn) // none
#endif