aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-01-26 15:21:47 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:27 -0400
commitb7f93e81dfe6864273707172be92896b54b6053e (patch)
tree0e04e68ed0d2e472a5819de3e5acbc7a3051e661 /vm_insnhelper.h
parent36232a48a63923e6d3bd3ccad30a12a02b20e89b (diff)
downloadruby-b7f93e81dfe6864273707172be92896b54b6053e.tar.gz
Implement --ujit-stats and instructoin counting
VM and ujit instruction counting in debug builds. shopify/ruby#19
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 0d90eb9434..9c610304f8 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -25,6 +25,11 @@ MJIT_SYMBOL_EXPORT_END
#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 RUBY_DEBUG
+/* for --ujit-stats */
+#define COLLECT_USAGE_INSN(insn) vm_ujit_collect_usage_insn(insn)
+#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
+#define COLLECT_USAGE_REGISTER(reg, s) /* none */
#else
#define COLLECT_USAGE_INSN(insn) /* none */
#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */