[ruby-cvs:54657] normal:r47509 (trunk): rb_call_info_t: shrink to 96 bytes from 104 bytes on 64-bit

normal at ruby-lang.org normal at ruby-lang.org
Wed Sep 10 15:32:46 JST 2014


normal	2014-09-10 15:32:44 +0900 (Wed, 10 Sep 2014)

  New Revision: 47509

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

  Log:
    rb_call_info_t: shrink to 96 bytes from 104 bytes on 64-bit
    
    This keeps ci->flag and ci->aux.index consistent across 32-bit
    and 64-bit platforms.
    
    ci->flag: VM_CALL_* flags only use 9 bits, currently
    ci->aux.index: 2 billion ivars per class should be enough for anybody
    
    This saves around 50K allocations on "valgrind ruby -e exit" on x86-64
    before:
      total heap usage: 48,122 allocs, 19,253 frees, 8,099,197 bytes allocated
    after:
      total heap usage: 48,069 allocs, 19,214 frees, 8,047,266 bytes allocated
    
    * vm_core.h (rb_call_info_t): ci->flag becomes 32-bit unsigned int
      ci->index becomes a 32-bit signed int (from signed long).
      Reorder for better packing on 64-bit, giving an 8 byte reduction
      from 104 to 96 bytes for each ci.
    
    * compile.c (new_callinfo, setup_args, iseq_compile_each,
      iseq_build_from_ary_body): adjust for type changes
    
    * vm_insnhelper.c (vm_getivar): ditto

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/include/ruby/ruby.h
    trunk/variable.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list