diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-12-29 23:01:10 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-12-29 23:01:11 -0800 |
commit | ac2df89113d6ead77032aaa21cf2b0253c8975db (patch) | |
tree | 156c6a203d57e3891e666cfa2e3bd6566100a62d /mjit.c | |
parent | 11b8bb99e6722253974c73d96ed653f97495e1c5 (diff) |
Stop managing valid class serials
`mjit_valid_class_serial_p` has no longer been used since b9007b6c548.
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 49 |
1 files changed, 1 insertions, 48 deletions
@@ -521,19 +521,6 @@ init_header_filename(void) return true; } -static enum rb_id_table_iterator_result -valid_class_serials_add_i(ID key, VALUE v, void *unused) -{ - rb_const_entry_t *ce = (rb_const_entry_t *)v; - VALUE value = ce->value; - - if (!rb_is_const_id(key)) return ID_TABLE_CONTINUE; - if (RB_TYPE_P(value, T_MODULE) || RB_TYPE_P(value, T_CLASS)) { - mjit_add_class_serial(RCLASS_SERIAL(value)); - } - return ID_TABLE_CONTINUE; -} - #ifdef _WIN32 UINT rb_w32_system_tmpdir(WCHAR *path, UINT len); #endif @@ -738,16 +725,6 @@ mjit_init(const struct mjit_options *opts) // rb_fiber_init_mjit_cont again with mjit_enabled=true to set the root_fiber's mjit_cont. rb_fiber_init_mjit_cont(GET_EC()->fiber_ptr); - // Initialize class_serials cache for compilation - valid_class_serials = rb_hash_new(); - rb_obj_hide(valid_class_serials); - rb_gc_register_mark_object(valid_class_serials); - mjit_add_class_serial(RCLASS_SERIAL(rb_cObject)); - mjit_add_class_serial(RCLASS_SERIAL(CLASS_OF(rb_vm_top_self()))); - if (RCLASS_CONST_TBL(rb_cObject)) { - rb_id_table_foreach(RCLASS_CONST_TBL(rb_cObject), valid_class_serials_add_i, NULL); - } - // Initialize worker thread start_worker(); } @@ -996,28 +973,4 @@ mjit_mark_cc_entries(const struct rb_iseq_constant_body *const body) } } -// A hook to update valid_class_serials. -void -mjit_add_class_serial(rb_serial_t class_serial) -{ - if (!mjit_enabled) - return; - - // Do not wrap CRITICAL_SECTION here. This function is only called in main thread - // and guarded by GVL, and `rb_hash_aset` may cause GC and deadlock in it. - rb_hash_aset(valid_class_serials, LONG2FIX(class_serial), Qtrue); -} - -// A hook to update valid_class_serials. -void -mjit_remove_class_serial(rb_serial_t class_serial) -{ - if (!mjit_enabled) - return; - - CRITICAL_SECTION_START(3, "in mjit_remove_class_serial"); - rb_hash_delete_entry(valid_class_serials, LONG2FIX(class_serial)); - CRITICAL_SECTION_FINISH(3, "in mjit_remove_class_serial"); -} - -#endif +#endif // USE_MJIT |