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:
parent
d2d564be1d
commit
ab5760307b
3 changed files with 9 additions and 0 deletions
1
ujit.h
1
ujit.h
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue