aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-01 16:01:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-09 09:52:46 +0900
commit46728557c16be2693c81c7c5ca51ea161ef28f65 (patch)
tree30cb78c0e60d233ff8e24e4b26753bc8ea8f5a67 /vm_eval.c
parentdb406daa60c1cc1585dd8a7227a87d45bbd3cb89 (diff)
downloadruby-46728557c16be2693c81c7c5ca51ea161ef28f65.tar.gz
rb_vm_call0: on-stack call info
This changeset reduces the generated binary of rb_vm_call0 from 281 bytes to 211 bytes on my machine. Should reduce GC pressure as well.
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 80b3e90c86..a03c61431c 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -45,12 +45,20 @@ static VALUE vm_call0_body(rb_execution_context_t* ec, struct rb_calling_info *c
MJIT_FUNC_EXPORTED VALUE
rb_vm_call0(rb_execution_context_t *ec, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat)
{
- struct rb_calling_info calling = { Qundef, recv, argc, kw_splat, };
- const struct rb_callinfo *ci = vm_ci_new_runtime(id, kw_splat ? VM_CALL_KW_SPLAT : 0, argc, NULL);
- struct rb_callcache cc_body;
- const struct rb_callcache *cc = vm_cc_fill(&cc_body, 0, me, vm_call_general);
- struct rb_call_data cd = { ci, cc, };
- return vm_call0_body(ec, &calling, &cd, argv);
+ return vm_call0_body(
+ ec,
+ &(struct rb_calling_info) {
+ .block_handler = VM_BLOCK_HANDLER_NONE,
+ .recv = recv,
+ .argc = argc,
+ .kw_splat = kw_splat,
+ },
+ &(struct rb_call_data) {
+ .ci = &VM_CI_ON_STACK(id, kw_splat ? VM_CALL_KW_SPLAT : 0, argc, NULL),
+ .cc = &VM_CC_ON_STACK(Qfalse, vm_call_general, { 0 }, me),
+ },
+ argv
+ );
}
static VALUE