summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-09-19 12:15:53 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-09-19 12:18:18 +0900
commit66c644da5e80258bb3217941223d923f923c3548 (patch)
treeeb683709b785c60738ae7aa07465bf213faef022
parent69e209a3450bd6b281dcad1d96a34e9cab184845 (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.
-rw-r--r--vm_eval.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 8bbbe7c42d..706301ebaa 100644
--- a/vm_eval.c
+++ b/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
+ );
}
}