summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-12-18 23:49:54 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2023-12-18 23:55:40 -0800
commiteb872d17524f299bdd023f005da38ffcddffa90a (patch)
tree5c3b6356ac5b7e9602ec4a436d300c6771e5924b /vm_insnhelper.h
parentdee45ac231afd02797640cb335d86550aa620cbe (diff)
RJIT: Share rb_vm_insns_count for vm_insns_count
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 90372853dd..e4a6c5b492 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -16,23 +16,13 @@ RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_invalidations;
RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_misses;
RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
-#ifndef RJIT_STATS
-# define RJIT_STATS RUBY_DEBUG
-#endif
-
-#if USE_YJIT // We want vm_insns_count on any YJIT-enabled build
+#if USE_YJIT || USE_RJIT // We want vm_insns_count on any JIT-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
-
-#if RJIT_STATS
-#define RJIT_COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn)
+#define JIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++
#else
-#define RJIT_COLLECT_USAGE_INSN(insn) // none
+#define JIT_COLLECT_USAGE_INSN(insn) // none
#endif
#if VM_COLLECT_USAGE_DETAILS
@@ -40,7 +30,7 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
#define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op)))
#define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s))
#else
-#define COLLECT_USAGE_INSN(insn) YJIT_COLLECT_USAGE_INSN(insn); RJIT_COLLECT_USAGE_INSN(insn)
+#define COLLECT_USAGE_INSN(insn) JIT_COLLECT_USAGE_INSN(insn)
#define COLLECT_USAGE_OPERAND(insn, n, op) // none
#define COLLECT_USAGE_REGISTER(reg, s) // none
#endif