summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-11-16 17:57:49 +0900
committerKoichi Sasada <ko1@atdot.net>2021-11-17 22:21:42 +0900
commitb2255153cf2fe9d7b851c59cc09b358c0630e0a2 (patch)
tree7d4142a5872963a91d94bbc5103e904258eb83c6 /vm.c
parent84aba250315d7fea728a6708e33ae8bf11f607b2 (diff)
`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`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5122
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c16
1 files changed, 16 insertions, 0 deletions
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 */