diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 08:11:27 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 08:11:27 +0000 |
commit | 156c7e33e11c1c0f571ae706392a5c6efbc7bcd5 (patch) | |
tree | c8b0717023f5ee5c2d08820edd5de0fdb7b0b97c | |
parent | d3fe5f15963b47fde209dcdda0b9d868fd91f613 (diff) | |
download | ruby-156c7e33e11c1c0f571ae706392a5c6efbc7bcd5.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | compile.c | 2 | ||||
-rw-r--r-- | iseq.h | 2 | ||||
-rw-r--r-- | vm_core.h | 2 |
4 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,11 @@ +Wed Dec 2 17:10:32 2015 Koichi Sasada <ko1@atdot.net> + + * 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@atdot.net> * iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro. @@ -5635,7 +5635,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) 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)); @@ -26,7 +26,7 @@ rb_call_info_kw_arg_bytes(int keyword_len) #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 */ @@ -388,7 +388,7 @@ struct rb_iseq_constant_body { 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) */ |