refactor reuse existing on-stack structs

rb_vm_call0 allocates its own struct call_info etc.  But they are
already there in case of rb_funcallv_with_cc.  Let's just pass the
existing ones, instead of re-creation.
This commit is contained in:
卜部昌平 2019-09-19 12:15:53 +09:00
Родитель 69e209a345
Коммит 66c644da5e
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -991,7 +991,18 @@ rb_funcallv_with_cc(struct rb_call_cache_and_mid *cc, VALUE recv, ID mid, int ar
vm_search_method(&ci, &cc->cc, recv);
if (LIKELY(! UNDEFINED_METHOD_ENTRY_P(cc->cc.me))) {
return rb_vm_call0(GET_EC(), recv, mid, argc, argv, cc->cc.me, VM_NO_KEYWORDS);
return vm_call0_body(
GET_EC(),
&(struct rb_calling_info) {
Qundef,
recv,
argc,
VM_NO_KEYWORDS,
},
&ci,
&cc->cc,
argv
);
}
}