Kernel#send does not use mrb_funcall anymore for most cases; ref #1680

parent 933f8013
......@@ -451,7 +451,8 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
c = mrb_class(mrb, self);
p = mrb_method_search_vm(mrb, &c, name);
if (!p || MRB_PROC_CFUNC_P(p)) {
if (!p) { /* call method_mising */
return mrb_funcall_with_block(mrb, self, name, argc, argv, block);
}
......@@ -470,6 +471,11 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
else { /* variable length arguments */
mrb_ary_shift(mrb, regs[0]);
}
if (MRB_PROC_CFUNC_P(p)) {
return p->body.func(mrb, self);
}
cipush(mrb);
ci = mrb->c->ci;
ci->target_class = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment