diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-19 12:15:53 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2019-09-19 12:18:18 +0900 |
commit | 66c644da5e80258bb3217941223d923f923c3548 (patch) | |
tree | eb683709b785c60738ae7aa07465bf213faef022 /vm_eval.c | |
parent | 69e209a3450bd6b281dcad1d96a34e9cab184845 (diff) |
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.
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 + ); } } |