Commit b5230188 authored by mirichi's avatar mirichi

OP_SEND refactoring

parent 9a10900a
...@@ -992,12 +992,6 @@ RETRY_TRY_BLOCK: ...@@ -992,12 +992,6 @@ RETRY_TRY_BLOCK:
ci->mid = mid; ci->mid = mid;
ci->proc = m; ci->proc = m;
ci->stackent = mrb->c->stack; ci->stackent = mrb->c->stack;
if (n == CALL_MAXARGS) {
ci->argc = -1;
}
else {
ci->argc = n;
}
if (c->tt == MRB_TT_ICLASS) { if (c->tt == MRB_TT_ICLASS) {
ci->target_class = c->c; ci->target_class = c->c;
} }
...@@ -1013,9 +1007,11 @@ RETRY_TRY_BLOCK: ...@@ -1013,9 +1007,11 @@ RETRY_TRY_BLOCK:
if (MRB_PROC_CFUNC_P(m)) { if (MRB_PROC_CFUNC_P(m)) {
if (n == CALL_MAXARGS) { if (n == CALL_MAXARGS) {
ci->argc = -1;
ci->nregs = 3; ci->nregs = 3;
} }
else { else {
ci->argc = n;
ci->nregs = n + 2; ci->nregs = n + 2;
} }
result = m->body.func(mrb, recv); result = m->body.func(mrb, recv);
...@@ -1044,11 +1040,13 @@ RETRY_TRY_BLOCK: ...@@ -1044,11 +1040,13 @@ RETRY_TRY_BLOCK:
pool = irep->pool; pool = irep->pool;
syms = irep->syms; syms = irep->syms;
ci->nregs = irep->nregs; ci->nregs = irep->nregs;
if (ci->argc < 0) { if (n == CALL_MAXARGS) {
ci->argc = -1;
stack_extend(mrb, (irep->nregs < 3) ? 3 : irep->nregs, 3); stack_extend(mrb, (irep->nregs < 3) ? 3 : irep->nregs, 3);
} }
else { else {
stack_extend(mrb, irep->nregs, ci->argc+2); ci->argc = n;
stack_extend(mrb, irep->nregs, n+2);
} }
regs = mrb->c->stack; regs = mrb->c->stack;
pc = irep->iseq; pc = irep->iseq;
......
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