[ruby-cvs:74226] ko1:r67122 (trunk): change `cfunc->invoker` type for opt.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Fri Feb 22 16:25:51 JST 2019


ko1	2019-02-22 16:25:51 +0900 (Fri, 22 Feb 2019)

  New Revision: 67122

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67122

  Log:
    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

  Modified files:
    trunk/method.h
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_method.c


More information about the ruby-cvs mailing list