Avoid trampoline code if mrb_f_send is called from funcall; fix #3383

parent d0506945
......@@ -521,15 +521,19 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
mrb_callinfo *ci;
mrb_get_args(mrb, "n*&", &name, &argv, &argc, &block);
ci = mrb->c->ci;
if (ci->acc < 0) {
funcall:
return mrb_funcall_with_block(mrb, self, name, argc, argv, block);
}
c = mrb_class(mrb, self);
p = mrb_method_search_vm(mrb, &c, name);
if (!p) { /* call method_mising */
return mrb_funcall_with_block(mrb, self, name, argc, argv, block);
goto funcall;
}
ci = mrb->c->ci;
ci->mid = name;
ci->target_class = c;
regs = mrb->c->stack+1;
......
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