aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-12-26 22:46:40 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2023-03-05 22:11:20 -0800
commit9f8f1afba2572ead6ce5a8ca456cb9cabf094c98 (patch)
tree681863fd3b2bb86aba063e6bfffe361b7ddaf8cb /vm_insnhelper.h
parent5ab8cf3f0d01ea8bf11bb03b865669a68d56a35a (diff)
downloadruby-9f8f1afba2572ead6ce5a8ca456cb9cabf094c98.tar.gz
Implement --mjit-stats
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 51929ba4f2..f787419d6c 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -20,11 +20,20 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
MJIT_SYMBOL_EXPORT_END
+#ifndef MJIT_STATS
+# define MJIT_STATS RUBY_DEBUG
+#endif
+
#if VM_COLLECT_USAGE_DETAILS
#define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn)
#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))
+#elif MJIT_STATS
+// for --mjit-stats TODO: make it possible to support both MJIT_STATS and YJIT_STATS
+#define COLLECT_USAGE_INSN(insn) rb_mjit_collect_vm_usage_insn(insn)
+#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
+#define COLLECT_USAGE_REGISTER(reg, s) /* none */
#elif YJIT_STATS
/* for --yjit-stats */
#define COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_usage_insn(insn)