Add VM insns counter like debug_counter (#2789)

This commit is contained in:
Takashi Kokubun 2019-12-28 00:44:09 -08:00 committed by GitHub
parent bf04fe086b
commit a994b0aee7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2019-12-28 17:44:33 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
2 changed files with 36 additions and 1 deletions

View file

@ -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)