From ffe58b9c8bde9fa95e91a458e334b375a37ef974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Fri, 5 Jun 2020 15:55:05 +0900 Subject: vm_ccs_push: do not cache non-heap entries Entires not GC-able must be considered to be volatile. Not eligible for later use. --- vm_insnhelper.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 15ccf23386..11e03f853d 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1473,6 +1473,13 @@ vm_ccs_create(VALUE klass, const rb_callable_method_entry_t *cme) static void vm_ccs_push(VALUE klass, struct rb_class_cc_entries *ccs, const struct rb_callinfo *ci, const struct rb_callcache *cc) { + if (! vm_cc_markable(cc)) { + return; + } + else if (! vm_ci_markable(ci)) { + return; + } + if (UNLIKELY(ccs->len == ccs->capa)) { const int nsize = ccs->capa * 2; struct rb_class_cc_entries_entry *nents = ALLOC_N(struct rb_class_cc_entries_entry, nsize); -- cgit v1.2.3