aboutsummaryrefslogtreecommitdiffstats
path: root/mjit_worker.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-09-18 17:04:59 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2020-09-18 17:07:08 -0700
commit6cb6d5abc36ede9d5158c2cd90734134838e6bfb (patch)
tree695123bba75794ad9b6d8a568d2fb42eb0bfc121 /mjit_worker.c
parente193dd1e3db681504dd83f878d5999342a53116d (diff)
downloadruby-6cb6d5abc36ede9d5158c2cd90734134838e6bfb.tar.gz
Add assertions when inline caches are copied to MJIT
This is a temporary commit to try to find a GC issue. It seems like mjit is pointing at a moved address in the call cache. I want to assert that they aren't TMOVED or garbage objects at the time they get copied
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index a9d0bf3313..160b8cfe99 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1261,6 +1261,17 @@ mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const
// Capture cc to cc_enties
for (unsigned int i = 0; i < captured_iseq->ci_size; i++) {
cc_entries[i] = captured_iseq->call_data[i].cc;
+
+ // Adding assertions to debug GC problem.
+ // FIXME: remove these when we find it
+ const struct rb_callcache *cc = cc_entries[i];
+
+ if (cc && vm_cc_markable(cc)) {
+ assert(BUILTIN_TYPE(cc) != T_MOVED);
+ assert(BUILTIN_TYPE(vm_cc_cme(cc)) != T_MOVED);
+ assert(!rb_objspace_garbage_object_p(cc));
+ assert(!rb_objspace_garbage_object_p(vm_cc_cme(cc)));
+ }
}
return cc_entries_index;