From 73eeb8643b8dcb5a059cb55a21da2e77a2febd24 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Fri, 26 Apr 2024 20:03:48 -0400 Subject: YJIT: Fix reference update for `Invariants::no_ep_escape_iseqs` Previously, the update was done in the ISEQ callback. That effectively never updated anything because the callback itself is given an intact reference, so it could update its content, and `rb_gc_location(iseq)` never returned a new address. Update the whole table once in the YJIT root instead. --- yjit.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'yjit.c') diff --git a/yjit.c b/yjit.c index 8ae010ac40..258114772c 100644 --- a/yjit.c +++ b/yjit.c @@ -1164,20 +1164,14 @@ yjit_root_memsize(const void *ptr) return 0; // TODO: more accurate accounting } -// GC callback during compaction -static void -yjit_root_update_references(void *ptr) -{ - // Do nothing since we use rb_gc_mark(), which pins. -} - void rb_yjit_root_mark(void *ptr); // in Rust +void rb_yjit_root_update_references(void *ptr); // in Rust // Custom type for interacting with the GC // TODO: make this write barrier protected static const rb_data_type_t yjit_root_type = { "yjit_root", - {rb_yjit_root_mark, yjit_root_free, yjit_root_memsize, yjit_root_update_references}, + {rb_yjit_root_mark, yjit_root_free, yjit_root_memsize, rb_yjit_root_update_references}, 0, 0, RUBY_TYPED_FREE_IMMEDIATELY }; -- cgit v1.2.3