diff options
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r-- | vm_insnhelper.h | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h index ac60c40ef5..0e5f12c3b2 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -20,30 +20,26 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state; # define RJIT_STATS RUBY_DEBUG #endif +#if YJIT_STATS +#define YJIT_COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_usage_insn(insn) +#else +#define YJIT_COLLECT_USAGE_INSN(insn) // none +#endif + +#if RJIT_STATS +#define RJIT_COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn) +#else +#define RJIT_COLLECT_USAGE_INSN(insn) // none +#endif + #if VM_COLLECT_USAGE_DETAILS #define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn) #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 RJIT_STATS && YJIT_STATS -// Both flags could be enabled at the same time. You need to call both in that case. -#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn); rb_yjit_collect_vm_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ -#elif RJIT_STATS -// for --rjit-stats -#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ -#elif YJIT_STATS -/* for --yjit-stats */ -#define COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_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 */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ +#define COLLECT_USAGE_INSN(insn) YJIT_COLLECT_USAGE_INSN(insn); RJIT_COLLECT_USAGE_INSN(insn) +#define COLLECT_USAGE_OPERAND(insn, n, op) // none +#define COLLECT_USAGE_REGISTER(reg, s) // none #endif /**********************************************************/ |