ruby-changes:40782
From: ko1 <ko1@a...>
Date: Wed, 2 Dec 2015 17:11:34 +0900 (JST)
Subject: [ruby-changes:40782] ko1:r52861 (trunk): * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro.
ko1 2015-12-02 17:11:27 +0900 (Wed, 02 Dec 2015) New Revision: 52861 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52861 Log: * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro. * compile.c (iseq_compile_each): use it. * vm_core.h: rename flip_cnt field to support this fix. Modified files: trunk/ChangeLog trunk/compile.c trunk/iseq.h trunk/vm_core.h Index: ChangeLog =================================================================== --- ChangeLog (revision 52860) +++ ChangeLog (revision 52861) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Dec 2 17:10:32 2015 Koichi Sasada <ko1@a...> + + * iseq.h: introduce ISEQ_FLIP_CNT_INCREMENT() macro. + + * compile.c (iseq_compile_each): use it. + + * vm_core.h: rename flip_cnt field to support this fix. + Wed Dec 2 17:05:15 2015 Koichi Sasada <ko1@a...> * iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro. Index: vm_core.h =================================================================== --- vm_core.h (revision 52860) +++ vm_core.h (revision 52861) @@ -388,7 +388,7 @@ struct rb_iseq_constant_body { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L388 struct rb_iseq_variable_body { const VALUE coverage_; /* coverage array */ - rb_num_t flip_cnt; + rb_num_t flip_cnt_; /* original iseq, before encoding * used for debug/dump (TODO: union with compile_data) */ Index: iseq.h =================================================================== --- iseq.h (revision 52860) +++ iseq.h (revision 52861) @@ -26,7 +26,7 @@ rb_call_info_kw_arg_bytes(int keyword_le https://github.com/ruby/ruby/blob/trunk/iseq.h#L26 #define ISEQ_COMPILE_DATA(iseq) (iseq)->compile_data_ #define ISEQ_COVERAGE(iseq) (iseq)->variable_body->coverage_ #define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE((iseq), &(iseq)->variable_body->coverage_, cov) - +#define ISEQ_FLIP_CNT_INCREMENT(iseq) ((iseq)->variable_body->flip_cnt_++) RUBY_SYMBOL_EXPORT_BEGIN /* compile.c */ Index: compile.c =================================================================== --- compile.c (revision 52860) +++ compile.c (revision 52861) @@ -5635,7 +5635,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5635 rb_num_t cnt; VALUE key; - cnt = local_iseq->variable_body->flip_cnt++ + VM_SVAR_FLIPFLOP_START; + cnt = ISEQ_FLIP_CNT_INCREMENT(local_iseq) + VM_SVAR_FLIPFLOP_START; key = INT2FIX(cnt); ADD_INSN2(ret, line, getspecial, key, INT2FIX(0)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/