[ruby-cvs:53957] normal:r46811 (trunk): vm_core.h (struct rb_iseq_struct): reduce to 296 bytes on 64-bit

normal at ruby-lang.org normal at ruby-lang.org
Mon Jul 14 16:06:29 JST 2014


normal	2014-07-14 16:06:26 +0900 (Mon, 14 Jul 2014)

  New Revision: 46811

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

  Log:
    vm_core.h (struct rb_iseq_struct): reduce to 296 bytes on 64-bit
    
    Most iseq do not have a catch_table, so avoid needlessly adding
    4-8 bytes to the struct for the common case.
    
    Changes from v2:
    - iseq_catch_table_size removed, use if (...) for (;...;)
    
    Changes from v1:
    - renamed iseq->_catch_table to iseq->catch_table
    - iseq_catch_table_bytes: made a static inline function
    - iseq_catch_table_size: new function replaces the
      iseq_catch_table_each iterator macro
    
    * iseq.h (struct iseq_catch_table): new flexible array struct
             (iseq_catch_table_bytes): allocated size function
    * vm_core.h (struct rb_iseq_struct): uupdate catch_table member
    * compile.c (iseq_set_exception_table): update for struct changes
    * iseq.c (iseq_free): ditto
    * iseq.c (iseq_memsize): ditto
    * iseq.c (rb_iseq_disasm): ditto
    * iseq.c (iseq_data_to_ary): ditto
    * iseq.c (rb_iseq_build_for_ruby2cext): ditto (untested)
    * vm.c (vm_exec): ditto
    * vm_core.h (struct rb_iseq_struct): ditto
    * vm_insnhelper.c (vm_throw): ditto

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/iseq.c
    trunk/iseq.h
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list