summaryrefslogtreecommitdiff
path: root/vm_exec.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-09 23:21:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-09-11 08:41:32 +0900
commitcd829bb078e6a3486d9b5ea57fc5111d289c1860 (patch)
treef1c903880d0ed454250f95d95a6e6d765a899796 /vm_exec.h
parent967b9743faac0b55a3d8deb176a08fdff449bba8 (diff)
Remove printf family from the mjit header
Linking printf family functions makes mjit objects to link unnecessary code.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4820
Diffstat (limited to 'vm_exec.h')
-rw-r--r--vm_exec.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/vm_exec.h b/vm_exec.h
index 10434fc37d..89c925cbb4 100644
--- a/vm_exec.h
+++ b/vm_exec.h
@@ -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)