Skip to content

Commit

Permalink
Avoid trampoline code if mrb_f_send is called from funcall; fix #3383
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Mar 5, 2017
1 parent d050694 commit 8a15abd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a15abd

Please sign in to comment.