mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
RJIT: Share rb_vm_insns_count for vm_insns_count
This commit is contained in:
parent
dee45ac231
commit
eb872d1752
8 changed files with 13 additions and 41 deletions
|
@ -16,23 +16,13 @@ RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_invalidations;
|
|||
RUBY_EXTERN rb_serial_t ruby_vm_constant_cache_misses;
|
||||
RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
|
||||
|
||||
#ifndef RJIT_STATS
|
||||
# define RJIT_STATS RUBY_DEBUG
|
||||
#endif
|
||||
|
||||
#if USE_YJIT // We want vm_insns_count on any YJIT-enabled build
|
||||
#if USE_YJIT || USE_RJIT // We want vm_insns_count on any JIT-enabled build.
|
||||
// Increment vm_insns_count for --yjit-stats. We increment this even when
|
||||
// --yjit or --yjit-stats is not used because branching to skip it is slower.
|
||||
// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors.
|
||||
#define YJIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++
|
||||
#define JIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++
|
||||
#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
|
||||
#define JIT_COLLECT_USAGE_INSN(insn) // none
|
||||
#endif
|
||||
|
||||
#if VM_COLLECT_USAGE_DETAILS
|
||||
|
@ -40,7 +30,7 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
|
|||
#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))
|
||||
#else
|
||||
#define COLLECT_USAGE_INSN(insn) YJIT_COLLECT_USAGE_INSN(insn); RJIT_COLLECT_USAGE_INSN(insn)
|
||||
#define COLLECT_USAGE_INSN(insn) JIT_COLLECT_USAGE_INSN(insn)
|
||||
#define COLLECT_USAGE_OPERAND(insn, n, op) // none
|
||||
#define COLLECT_USAGE_REGISTER(reg, s) // none
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue