mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_insnhelper.c (vm_call_method): fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9eef2ad282
commit
34df0e5c9f
1 changed files with 34 additions and 35 deletions
|
@ -547,46 +547,45 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case VM_METHOD_TYPE_OPTIMIZED:{
|
case VM_METHOD_TYPE_OPTIMIZED:{
|
||||||
switch (me->body.optimize_type) {
|
switch (me->body.optimize_type) {
|
||||||
case OPTIMIZED_METHOD_TYPE_SEND: {
|
case OPTIMIZED_METHOD_TYPE_SEND: {
|
||||||
rb_control_frame_t *reg_cfp = cfp;
|
rb_control_frame_t *reg_cfp = cfp;
|
||||||
rb_num_t i = num - 1;
|
rb_num_t i = num - 1;
|
||||||
VALUE sym;
|
VALUE sym;
|
||||||
|
|
||||||
if (num == 0) {
|
if (num == 0) {
|
||||||
rb_raise(rb_eArgError, "no method name given");
|
rb_raise(rb_eArgError, "no method name given");
|
||||||
}
|
|
||||||
|
|
||||||
sym = TOPN(i);
|
|
||||||
id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym);
|
|
||||||
/* shift arguments */
|
|
||||||
if (i > 0) {
|
|
||||||
MEMMOVE(&TOPN(i), &TOPN(i-1), VALUE, i);
|
|
||||||
}
|
|
||||||
me = rb_method_entry(CLASS_OF(recv), id);
|
|
||||||
num -= 1;
|
|
||||||
DEC_SP(1);
|
|
||||||
flag |= VM_CALL_FCALL_BIT;
|
|
||||||
|
|
||||||
goto start_method_dispatch;
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case OPTIMIZED_METHOD_TYPE_CALL: {
|
|
||||||
rb_proc_t *proc;
|
|
||||||
int argc = num;
|
|
||||||
VALUE *argv = ALLOCA_N(VALUE, num);
|
|
||||||
GetProcPtr(recv, proc);
|
|
||||||
MEMCPY(argv, cfp->sp - num, VALUE, num);
|
|
||||||
cfp->sp -= num + 1;
|
|
||||||
|
|
||||||
val = rb_vm_invoke_proc(th, proc, proc->block.self, argc, argv, blockptr);
|
sym = TOPN(i);
|
||||||
|
id = SYMBOL_P(sym) ? SYM2ID(sym) : rb_to_id(sym);
|
||||||
|
/* shift arguments */
|
||||||
|
if (i > 0) {
|
||||||
|
MEMMOVE(&TOPN(i), &TOPN(i-1), VALUE, i);
|
||||||
}
|
}
|
||||||
break;
|
me = rb_method_entry(CLASS_OF(recv), id);
|
||||||
default:
|
num -= 1;
|
||||||
rb_bug("eval_invoke_method: unsupported optimized method type (%d)",
|
DEC_SP(1);
|
||||||
me->body.optimize_type);
|
flag |= VM_CALL_FCALL_BIT;
|
||||||
|
|
||||||
|
goto start_method_dispatch;
|
||||||
}
|
}
|
||||||
break;
|
case OPTIMIZED_METHOD_TYPE_CALL: {
|
||||||
|
rb_proc_t *proc;
|
||||||
|
int argc = num;
|
||||||
|
VALUE *argv = ALLOCA_N(VALUE, num);
|
||||||
|
GetProcPtr(recv, proc);
|
||||||
|
MEMCPY(argv, cfp->sp - num, VALUE, num);
|
||||||
|
cfp->sp -= num + 1;
|
||||||
|
|
||||||
|
val = rb_vm_invoke_proc(th, proc, proc->block.self, argc, argv, blockptr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
rb_bug("eval_invoke_method: unsupported optimized method type (%d)",
|
||||||
|
me->body.optimize_type);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
rb_bug("eval_invoke_method: unsupported method type (%d)", me->type);
|
rb_bug("eval_invoke_method: unsupported method type (%d)", me->type);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue