зеркало из https://github.com/github/ruby.git
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:
Родитель
69e209a345
Коммит
66c644da5e
13
vm_eval.c
13
vm_eval.c
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче