diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-09-08 12:01:39 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:40 -0400 |
commit | 4b58d698b14752f4dfd405637df384c758cae396 (patch) | |
tree | ca3d3ae9e45d6ebba3aa78795c40d6ada9e5caf1 /yjit.h | |
parent | 9bd6ce47454a03ad1cec422f36017bcae56790dd (diff) |
Count interpreter instructions when -DYJIT_STATS=1
The interpreter instruction count was enabled based on RUBY_DEBUG as
opposed to YJIT_STATS. In builds with YJIT_STATS=1 but RUBY_DEBUG=0,
the count was not available.
Move YJIT_STATS in yjit.h where declarations are expoed to code outside
of YJIT. Also reduce the changes made to the interpreter for calling
into YJIT's instruction counting function.
Diffstat (limited to 'yjit.h')
-rw-r--r-- | yjit.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -5,6 +5,8 @@ #ifndef YJIT_H #define YJIT_H 1 +#include "ruby/internal/config.h" +#include "ruby_assert.h" // for RUBY_DEBUG #include "vm_core.h" #include "method.h" @@ -26,6 +28,10 @@ #define YJIT_DUMP_MODE 0 #endif +#ifndef YJIT_STATS +# define YJIT_STATS RUBY_DEBUG +#endif // ifndef YJIT_STATS + #ifndef rb_iseq_t typedef struct rb_iseq_struct rb_iseq_t; #define rb_iseq_t rb_iseq_t |