path: root/mjit_worker.c
diff options
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 08:34:25 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 08:34:25 (GMT)
commit6306aa9222ec1b67c5c94811bd2aff5e43ba779e (patch)
treeb981f52a4f7fe4fb9c13afae75675eaa27cdeea5 /mjit_worker.c
parentb2e0d54024766009567baa708ae3bed1f50dd5ed (diff)
mjit.c: exclude mjit_valid_class_serial_p
from mjit.c because it's executed only on MJIT worker thread. Instead of that, `valid_class_serials` is shared with mjit_ prefix. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
1 files changed, 13 insertions, 2 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 5b0d28d..dc084c2 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -76,8 +76,6 @@
#include "vm_core.h"
#include "mjit.h"
#include "gc.h"
-#include "constant.h"
-#include "id_table.h"
#include "ruby_assert.h"
#include "ruby/thread.h"
#include "ruby/util.h"
@@ -208,6 +206,19 @@ static const char *const CC_LIBS[] = {
shared by the workers and the pch thread. */
enum pch_status_t mjit_pch_status;
+/* Return TRUE if class_serial is not obsoleted. */
+mjit_valid_class_serial_p(rb_serial_t class_serial)
+ extern VALUE mjit_valid_class_serials;
+ int found_p;
+ CRITICAL_SECTION_START(3, "in valid_class_serial_p");
+ found_p = st_lookup(RHASH_TBL_RAW(mjit_valid_class_serials), LONG2FIX(class_serial), NULL);
+ CRITICAL_SECTION_FINISH(3, "in valid_class_serial_p");
+ return found_p;
/* Return the best unit from list. The best is the first
high priority unit or the unit whose iseq has the biggest number
of calls so far. */