use method cache on Object#respond_to?

rb_method_boundp (method_boundp) searches method_entry, but this
search did not use pCMC, so change to use it.
This commit is contained in:
Koichi Sasada 2020-12-14 14:51:39 +09:00
parent 0362b4c689
commit 53edb27bac
Notes: git 2020-12-14 15:28:33 +09:00
2 changed files with 36 additions and 14 deletions

View file

@ -389,8 +389,8 @@ check_funcall_failed(VALUE v, VALUE e)
struct rescue_funcall_args *args = (void *)v;
int ret = args->respond;
if (!ret) {
switch (rb_method_boundp(args->defined_class, args->mid,
BOUND_PRIVATE|BOUND_RESPONDS)) {
switch (method_boundp(args->defined_class, args->mid,
BOUND_PRIVATE|BOUND_RESPONDS)) {
case 2:
ret = TRUE;
break;