1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
Aaron Patterson 2020-09-18 17:04:59 -07:00
parent e193dd1e3d
commit 6cb6d5abc3
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6

View file

@ -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;