summaryrefslogtreecommitdiff
path: root/yjit.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2022-09-14 13:15:55 -0700
committerGitHub <noreply@github.com>2022-09-14 16:15:55 -0400
commitf98d6d3f389e8e46775c5895ddc1a3eec4544533 (patch)
tree1267208755ae53ad583c71a81826772ed31ebcdd /yjit.c
parentd5cdc2edd02eb6990d045c932aaedb60213143e1 (diff)
downloadruby-f98d6d3f389e8e46775c5895ddc1a3eec4544533.tar.gz
YJIT: Implement specialized respond_to? (#6363)
* Add rb_callable_method_entry_or_negative * YJIT: Implement specialized respond_to? This implements a specialized respond_to? in YJIT. * Update yjit/src/codegen.rs Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'yjit.c')
-rw-r--r--yjit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/yjit.c b/yjit.c
index facddcca0a..afa329e024 100644
--- a/yjit.c
+++ b/yjit.c
@@ -486,7 +486,11 @@ rb_METHOD_ENTRY_VISI(const rb_callable_method_entry_t *me)
rb_method_type_t
rb_get_cme_def_type(const rb_callable_method_entry_t *cme)
{
- return cme->def->type;
+ if (UNDEFINED_METHOD_ENTRY_P(cme)) {
+ return VM_METHOD_TYPE_UNDEF;
+ } else {
+ return cme->def->type;
+ }
}
ID