aboutsummaryrefslogtreecommitdiffstats
path: root/vm_exec.h
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-12-28 00:44:09 -0800
committerGitHub <noreply@github.com>2019-12-28 00:44:09 -0800
commita994b0aee73a78de1137f195fb252b3660199f0b (patch)
treed62127e73cc8224cf5a1a262065df72850890bb4 /vm_exec.h
parentbf04fe086bca47184c6ab13603e064b3c0e88d8e (diff)
downloadruby-a994b0aee73a78de1137f195fb252b3660199f0b.tar.gz
Add VM insns counter like debug_counter (#2789)
Diffstat (limited to 'vm_exec.h')
-rw-r--r--vm_exec.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/vm_exec.h b/vm_exec.h
index 9c8b42371d..86a70fe8ad 100644
--- a/vm_exec.h
+++ b/vm_exec.h
@@ -41,6 +41,10 @@ typedef rb_iseq_t *ISEQ;
#define throwdebug if(0)printf
/* #define throwdebug printf */
+#ifndef USE_INSNS_COUNTER
+#define USE_INSNS_COUNTER 0
+#endif
+
/************************************************/
#if defined(DISPATCH_XXX)
error !
@@ -75,7 +79,8 @@ error !
(reg_pc - reg_cfp->iseq->body->iseq_encoded), \
(reg_cfp->pc - reg_cfp->iseq->body->iseq_encoded), \
RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \
- rb_iseq_line_no(reg_cfp->iseq, reg_pc - reg_cfp->iseq->body->iseq_encoded));
+ rb_iseq_line_no(reg_cfp->iseq, reg_pc - reg_cfp->iseq->body->iseq_encoded)); \
+ if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn));
#define INSN_DISPATCH_SIG(insn)