1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ujit_compile.h
Alan Wu ceebc7fc98 MicroJIT: generate less code for CFUNCs
Added UJIT_CHECK_MODE. Set to 1 to double check method dispatch in
generated code.

It's surprising to me that we need to watch both cc and cme. There might
be opportunities to simplify there.
2020-10-28 16:32:19 -04:00

31 lines
658 B
C

#ifndef UJIT_COMPILE_H
#define UJIT_COMPILE_H 1
#include "stddef.h"
#include "stdint.h"
#include "stdbool.h"
#include "method.h"
#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_init(void);
uint8_t *ujit_compile_insn(const rb_iseq_t *iseq, unsigned int insn_idx, unsigned int *next_ujit_idx);
void rb_ujit_compile_iseq(const rb_iseq_t *iseq);
#endif