8000 add a callback for when method cache changes · github/ruby@9a41ea2 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9a41ea2

Browse files
committed
add a callback for when method cache changes
1 parent 9bbf893 commit 9a41ea2

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

ujit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ void rb_ujit_method_lookup_change(VALUE cme_or_cc);
5353
void rb_ujit_compile_iseq(const rb_iseq_t *iseq);
5454
void rb_ujit_init(struct rb_ujit_options *options);
5555
void rb_ujit_bop_redefined(VALUE klass, const rb_method_entry_t *me, enum ruby_basic_operators bop);
56+
void rb_ujit_constant_state_changed(void);
5657

5758
#endif // #ifndef UJIT_H

ujit_iface.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,13 @@ rb_ujit_bop_redefined(VALUE klass, const rb_method_entry_t *me, enum ruby_basic_
423423
//fprintf(stderr, "bop redefined\n");
424424
}
425425

426+
/* Called when the constant state changes */
427+
void
428+
rb_ujit_constant_state_changed(void)
429+
{
430+
//fprintf(stderr, "bop redefined\n");
431+
}
432+
426433
#if HAVE_LIBCAPSTONE
427434
static const rb_data_type_t ujit_disasm_type = {
428435
"UJIT/Disasm",

vm_method.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ vm_cme_invalidate(rb_callable_method_entry_t *cme)
140140
void
141141
rb_clear_constant_cache(void)
142142
{
143+
rb_ujit_constant_state_changed();
143144
INC_GLOBAL_CONSTANT_STATE();
144145
}
145146

0 commit comments

Comments
 (0)
0