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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-03-03 13:31:29 +09:00
parent 933f8013e0
commit 369c6c3649
+7 -1
View File
@@ -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;