From b2255153cf2fe9d7b851c59cc09b358c0630e0a2 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Tue, 16 Nov 2021 17:57:49 +0900 Subject: `vm_empty_cc_for_super` Same as `vm_empty_cc`, introduce a global variable which has `.call_ = vm_call_super_method`. Use it if the `cme == NULL` on `vm_search_super_method`. --- vm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vm.c') diff --git a/vm.c b/vm.c index f13e07cef3..a868355bbe 100644 --- a/vm.c +++ b/vm.c @@ -439,6 +439,16 @@ static const struct rb_callcache vm_empty_cc = { } }; +static const struct rb_callcache vm_empty_cc_for_super = { + .flags = T_IMEMO | (imemo_callcache << FL_USHIFT) | VM_CALLCACHE_UNMARKABLE, + .klass = Qfalse, + .cme_ = NULL, + .call_ = vm_call_super_method, + .aux_ = { + .v = Qfalse, + } +}; + static void thread_free(void *ptr); void @@ -4176,6 +4186,12 @@ rb_vm_empty_cc(void) return &vm_empty_cc; } +MJIT_FUNC_EXPORTED const struct rb_callcache * +rb_vm_empty_cc_for_super(void) +{ + return &vm_empty_cc_for_super; +} + #endif /* #ifndef MJIT_HEADER */ #include "vm_call_iseq_optimized.inc" /* required from vm_insnhelper.c */ -- cgit v1.2.3