[前][次][番号順一覧][スレッド一覧]

ruby-changes:61618

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 9 Jun 2020 09:53:16 +0900 (JST)
Subject: [ruby-changes:61618] 367263c3dd (master): vm_call_method: no call vm_cc_fill

https://git.ruby-lang.org/ruby.git/commit/?id=367263c3dd

From 367263c3dd7df3c412e29cefb55561d10715a96a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Mon, 1 Jun 2020 15:02:44 +0900
Subject: vm_call_method: no call vm_cc_fill

This changeset reduces the generated binary of vm_call_method from 600
bytes to 566 bytes on my machine, accroding to nm(1).

diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 9a97c7d..3024a2c 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3181,12 +3181,10 @@ vm_call_method(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_ca https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3181
 		else {
 		    /* caching method info to dummy cc */
 		    VM_ASSERT(vm_cc_cme(cc) != NULL);
-                    struct rb_callcache cc_body;
-                    struct rb_call_data cd_body = {
+                    return vm_call_method_each_type(ec, cfp, calling, &(struct rb_call_data) {
                         .ci = ci,
-                        .cc = vm_cc_fill(&cc_body, cc->klass, vm_cc_cme(cc), vm_cc_call(cc)),
-                    };
-                    return vm_call_method_each_type(ec, cfp, calling, &cd_body);
+                        .cc = &VM_CC_ON_STACK(cc->klass, vm_cc_call(cc), { 0 }, vm_cc_cme(cc)),
+                    });
 		}
 	    }
             return vm_call_method_each_type(ec, cfp, calling, cd);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]