Remove printf family from the mjit header

Linking printf family functions makes mjit objects to link
unnecessary code.
This commit is contained in:
Nobuyoshi Nakada 2021-09-09 23:21:06 +09:00
parent 967b9743fa
commit cd829bb078
Notes: git 2021-09-11 08:41:53 +09:00
10 changed files with 72 additions and 57 deletions

View file

@ -37,8 +37,8 @@ typedef rb_iseq_t *ISEQ;
#define DEBUG_END_INSN()
#endif
#define throwdebug if(0)printf
/* #define throwdebug printf */
#define throwdebug if(0)ruby_debug_printf
/* #define throwdebug ruby_debug_printf */
#ifndef USE_INSNS_COUNTER
#define USE_INSNS_COUNTER 0
@ -74,11 +74,13 @@ error !
#define LABEL_PTR(x) RB_GNUC_EXTENSION(&&LABEL(x))
#define INSN_ENTRY_SIG(insn) \
if (0) fprintf(stderr, "exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \
(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)); \
if (0) { \
ruby_debug_printf("exec: %s@(%"PRIdPTRDIFF", %"PRIdPTRDIFF")@%s:%u\n", #insn, \
(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)); \
} \
if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn));
#define INSN_DISPATCH_SIG(insn)