2020-12-08 16:54:41 -05:00
|
|
|
//
|
|
|
|
// This file contains definitions uJIT exposes to the CRuby codebase
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef UJIT_H
|
|
|
|
#define UJIT_H 1
|
2020-09-10 17:20:46 -04:00
|
|
|
|
|
|
|
#include "stddef.h"
|
|
|
|
#include "stdint.h"
|
2020-09-28 07:03:28 -04:00
|
|
|
#include "stdbool.h"
|
2020-10-27 18:49:17 -04:00
|
|
|
#include "method.h"
|
2020-09-10 17:20:46 -04:00
|
|
|
|
2020-12-08 16:54:41 -05:00
|
|
|
#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
|
|
|
|
|
2020-09-10 17:20:46 -04:00
|
|
|
#ifndef rb_iseq_t
|
|
|
|
typedef struct rb_iseq_struct rb_iseq_t;
|
|
|
|
#define rb_iseq_t rb_iseq_t
|
|
|
|
#endif
|
|
|
|
|
2020-10-16 13:44:09 -04:00
|
|
|
RUBY_SYMBOL_EXPORT_BEGIN
|
2020-10-19 10:27:16 -04:00
|
|
|
RUBY_EXTERN bool rb_ujit_enabled;
|
2020-10-16 13:44:09 -04:00
|
|
|
RUBY_SYMBOL_EXPORT_END
|
2020-10-13 11:15:22 -04:00
|
|
|
|
|
|
|
static inline
|
|
|
|
bool rb_ujit_enabled_p(void)
|
|
|
|
{
|
|
|
|
return rb_ujit_enabled;
|
|
|
|
}
|
|
|
|
|
2021-01-07 13:32:46 -05:00
|
|
|
#define UJIT_CALL_THRESHOLD (1u)
|
2020-10-22 14:16:39 -04:00
|
|
|
|
2020-10-27 18:49:17 -04:00
|
|
|
void rb_ujit_method_lookup_change(VALUE cme_or_cc);
|
2020-10-13 11:15:22 -04:00
|
|
|
void rb_ujit_compile_iseq(const rb_iseq_t *iseq);
|
2020-12-08 16:54:41 -05:00
|
|
|
void rb_ujit_init(void);
|
2020-09-10 17:20:46 -04:00
|
|
|
|
2020-12-08 16:54:41 -05:00
|
|
|
#endif // #ifndef UJIT_H
|