diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2020-12-08 16:54:41 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:26 -0400 |
commit | e4c65ec49c5e2cba537f2d9ee00888c5dfbcac34 (patch) | |
tree | aa7a7732a3172ac4524da5de4b72c65622c02e44 /ujit.h | |
parent | 7be67a6c080dd7d0d571c50d01bb0195e0d3262d (diff) | |
download | ruby-e4c65ec49c5e2cba537f2d9ee00888c5dfbcac34.tar.gz |
Refactor uJIT code into more files for readability
Diffstat (limited to 'ujit.h')
-rw-r--r-- | ujit.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ujit.h b/ujit.h new file mode 100644 index 0000000000..b4a83ae0e6 --- /dev/null +++ b/ujit.h @@ -0,0 +1,50 @@ +// +// This file contains definitions uJIT exposes to the CRuby codebase +// + +#ifndef UJIT_H +#define UJIT_H 1 + +#include "stddef.h" +#include "stdint.h" +#include "stdbool.h" +#include "method.h" + +#ifdef _WIN32 +#define PLATFORM_SUPPORTED_P 0 +#else +#define PLATFORM_SUPPORTED_P 1 +#endif + +#ifndef UJIT_CHECK_MODE +#define UJIT_CHECK_MODE 0 +#endif + +// >= 1: print when output code invalidation happens +// >= 2: dump list of instructions when regions compile +#ifndef UJIT_DUMP_MODE +#define UJIT_DUMP_MODE 0 +#endif + +#ifndef rb_iseq_t +typedef struct rb_iseq_struct rb_iseq_t; +#define rb_iseq_t rb_iseq_t +#endif + +RUBY_SYMBOL_EXPORT_BEGIN +RUBY_EXTERN bool rb_ujit_enabled; +RUBY_SYMBOL_EXPORT_END + +static inline +bool rb_ujit_enabled_p(void) +{ + return rb_ujit_enabled; +} + +#define UJIT_CALL_THRESHOLD (10u) + +void rb_ujit_method_lookup_change(VALUE cme_or_cc); +void rb_ujit_compile_iseq(const rb_iseq_t *iseq); +void rb_ujit_init(void); + +#endif // #ifndef UJIT_H |