summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-22 07:25:51 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-22 07:25:51 +0000
commitb1c1ee7183f6c9b6f585d35a5a8786594e1e7733 (patch)
tree14204cd198626c7217314a280cfd74a9a3bb96b2 /vm_eval.c
parent4af7f77d0ffe4371610143731e08f6e74314b4a1 (diff)
change `cfunc->invoker` type for opt.
* vm_insnhelper.c: change `call_cfunc_*` parameters order and specify a function type for the passed func ptr. This fix reduce the number of asm instructions, such as: # before this patch 0000000000000110 <call_cfunc_0>: 110: 48 89 fa mov %rdi,%rdx 113: 31 c0 xor %eax,%eax 115: 48 89 f7 mov %rsi,%rdi 118: ff e2 jmpq *%rdx 11a: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) # after this patch 0000000000000110 <call_cfunc_0>: 110: ff e1 jmpq *%rcx However, this kind of instruction reduction doesn't affect any performance because of great CPU architectures :p git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index de1d73b81e..ad29c77551 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -83,7 +83,7 @@ vm_call0_cfunc_with_frame(rb_execution_context_t* ec, struct rb_calling_info *ca
if (len >= 0) rb_check_arity(argc, len, len);
- val = (*cfunc->invoker)(cfunc->func, recv, argc, argv);
+ val = (*cfunc->invoker)(recv, argc, argv, cfunc->func);
CHECK_CFP_CONSISTENCY("vm_call0_cfunc_with_frame");
rb_vm_pop_frame(ec);