summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-12-29 23:01:10 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2020-12-29 23:01:11 -0800
commitac2df89113d6ead77032aaa21cf2b0253c8975db (patch)
tree156c6a203d57e3891e666cfa2e3bd6566100a62d /mjit.c
parent11b8bb99e6722253974c73d96ed653f97495e1c5 (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.c49
1 files changed, 1 insertions, 48 deletions
diff --git a/mjit.c b/mjit.c
index d87961d7cc..b98f742068 100644
--- a/mjit.c
+++ b/mjit.c
@@ -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