summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-06-03 15:06:18 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-09 09:52:46 +0900
commit4fbe86d0e22e06ecd4f79282fc66ddc40d963d60 (patch)
tree6a76994bb96e2090b6befadb1223e665d89d38fb
parent88e6799759374cbd6af77a5feb596d806b4e1bd9 (diff)
vm_call_method: use struct assignment
This further reduces the generated binary of vm_call_method from 566 bytes to 545 bytes on my machine, according to nm(1).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3179
-rw-r--r--vm_insnhelper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 6d4afa2d24..e4d58f9fe7 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3159,9 +3159,10 @@ vm_call_method(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_ca
else {
/* caching method info to dummy cc */
VM_ASSERT(vm_cc_cme(cc) != NULL);
+ const struct rb_callcache cc_on_stack = *cc;
return vm_call_method_each_type(ec, cfp, calling, &(struct rb_call_data) {
.ci = ci,
- .cc = &VM_CC_ON_STACK(cc->klass, vm_cc_call(cc), { 0 }, vm_cc_cme(cc)),
+ .cc = &cc_on_stack,
});
}
}