This commit is contained in:
Takashi Kokubun 2023-07-11 17:26:03 -07:00
Родитель 503f987ead
Коммит dfe782be17
1 изменённых файлов: 15 добавлений и 19 удалений

Просмотреть файл

@ -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
/**********************************************************/