diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-04-07 15:27:05 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:33 -0400 |
commit | 515fb988fe3c3ad28fdcaea4f043ea6a445c5213 (patch) | |
tree | 85168fefe3b4222796a3f21c8dc456dcbc8dddfc /yjit_iface.h | |
parent | 543bdde6c21f071e673aa8090086e1045ee4f2d9 (diff) |
YJIT: add comments to disassembly
Introduce a new macro `ADD_COMMENT(cb, comment)` that records a comment
for the current write position in the code block.
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Aaron Patterson <aaron.patterson@shopify.com>
Diffstat (limited to 'yjit_iface.h')
-rw-r--r-- | yjit_iface.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/yjit_iface.h b/yjit_iface.h index 6428906b28..63871d24c2 100644 --- a/yjit_iface.h +++ b/yjit_iface.h @@ -67,6 +67,15 @@ YJIT_DECLARE_COUNTERS( #undef YJIT_DECLARE_COUNTERS +struct yjit_comment { + int32_t offset; + const char *comment; +}; + +typedef rb_darray(struct yjit_comment) yjit_comment_array_t; + +extern yjit_comment_array_t yjit_code_comments; + #endif // if RUBY_DEBUG RUBY_EXTERN struct rb_yjit_options rb_yjit_opts; |