[前][次][番号順一覧][スレッド一覧]

ruby-changes:61632

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 9 Jun 2020 12:41:10 +0900 (JST)
Subject: [ruby-changes:61632] f4950145cf (master): mjit_mark_cc_entries: should consider VM_CALLCACHE_UNMARKABLE

https://git.ruby-lang.org/ruby.git/commit/?id=f4950145cf

From f4950145cff638c4713e5cd06aead0e41c338e61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 9 Jun 2020 12:38:46 +0900
Subject: mjit_mark_cc_entries: should consider VM_CALLCACHE_UNMARKABLE

Now that vm_empty_cc is VM_CALLCACHE_UNMARKABLE, it has to be properly
ruled out from being GCed.

diff --git a/mjit.c b/mjit.c
index f2443e0..39de0e0 100644
--- a/mjit.c
+++ b/mjit.c
@@ -1082,7 +1082,7 @@ mjit_mark_cc_entries(const struct rb_iseq_constant_body *const body) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1082
         // It must be `body->jit_unit->cc_entries_size` instead of `body->ci_size` to mark children's cc_entries
         for (unsigned int i = 0; i < body->jit_unit->cc_entries_size; i++) {
             const struct rb_callcache *cc = cc_entries[i];
-            if (cc != NULL) {
+            if (cc != NULL && vm_cc_markable(cc)) {
                 // Pin `cc` and `cc->cme` against GC.compact as their addresses may be written in JIT-ed code.
                 rb_gc_mark((VALUE)cc);
                 rb_gc_mark((VALUE)vm_cc_cme(cc));
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]