1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add a callback for when method cache changes

This commit is contained in:
Aaron Patterson 2021-02-03 15:09:34 -08:00 committed by Alan Wu
parent d2d564be1d
commit ab5760307b
3 changed files with 9 additions and 0 deletions

1
ujit.h
View file

@ -53,5 +53,6 @@ void rb_ujit_method_lookup_change(VALUE cme_or_cc);
void rb_ujit_compile_iseq(const rb_iseq_t *iseq);
void rb_ujit_init(struct rb_ujit_options *options);
void rb_ujit_bop_redefined(VALUE klass, const rb_method_entry_t *me, enum ruby_basic_operators bop);
void rb_ujit_constant_state_changed(void);
#endif // #ifndef UJIT_H

View file

@ -423,6 +423,13 @@ rb_ujit_bop_redefined(VALUE klass, const rb_method_entry_t *me, enum ruby_basic_
//fprintf(stderr, "bop redefined\n");
}
/* Called when the constant state changes */
void
rb_ujit_constant_state_changed(void)
{
//fprintf(stderr, "bop redefined\n");
}
#if HAVE_LIBCAPSTONE
static const rb_data_type_t ujit_disasm_type = {
"UJIT/Disasm",

View file

@ -141,6 +141,7 @@ vm_cme_invalidate(rb_callable_method_entry_t *cme)
void
rb_clear_constant_cache(void)
{
rb_ujit_constant_state_changed();
INC_GLOBAL_CONSTANT_STATE();
}