diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 08:05:36 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 08:05:36 +0000 |
commit | d3fe5f15963b47fde209dcdda0b9d868fd91f613 (patch) | |
tree | 349d7d5fefde37c5dcd2e964743f1e7595345370 /iseq.c | |
parent | 369795b71b3323ff837b9ffd6fa49224bf799bea (diff) | |
download | ruby-d3fe5f15963b47fde209dcdda0b9d868fd91f613.tar.gz |
* iseq.h: introduce ISEQ_COVERAGE() and ISEQ_COVERAGE_SET() macro.
* compile.c: use them.
* iseq.c: ditto.
* iseq.c (rb_iseq_coverage): added.
* thread.c (update_coverage): use rb_iseq_coverage().
* vm_core.h: rename coverage field name to support this fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -117,7 +117,7 @@ rb_iseq_mark(const rb_iseq_t *iseq) } if (iseq->variable_body) { - RUBY_MARK_UNLESS_NULL(iseq->variable_body->coverage); + RUBY_MARK_UNLESS_NULL(ISEQ_COVERAGE(iseq)); } if (ISEQ_COMPILE_DATA(iseq) != 0) { @@ -311,13 +311,13 @@ prepare_iseq_build(rb_iseq_t *iseq, ISEQ_COMPILE_DATA(iseq)->option = option; ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1; - RB_OBJ_WRITE(iseq, &iseq->variable_body->coverage, Qfalse); + ISEQ_COVERAGE_SET(iseq, Qfalse); if (!GET_THREAD()->parse_in_eval) { VALUE coverages = rb_get_coverages(); if (RTEST(coverages)) { - RB_OBJ_WRITE(iseq, &iseq->variable_body->coverage, rb_hash_lookup(coverages, path)); - if (NIL_P(iseq->variable_body->coverage)) RB_OBJ_WRITE(iseq, &iseq->variable_body->coverage, Qfalse); + ISEQ_COVERAGE_SET(iseq, rb_hash_lookup(coverages, path)); + if (NIL_P(ISEQ_COVERAGE(iseq))) ISEQ_COVERAGE_SET(iseq, Qfalse); } } @@ -699,6 +699,12 @@ rb_iseq_method_name(const rb_iseq_t *iseq) } } +VALUE +rb_iseq_coverage(const rb_iseq_t *iseq) +{ + return ISEQ_COVERAGE(iseq); +} + /* define wrapper class methods (RubyVM::InstructionSequence) */ static void |