summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-02 08:05:36 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-02 08:05:36 +0000
commit417240b7fb987e364421d4c4bfd77dd5bfea10c4 (patch)
tree349d7d5fefde37c5dcd2e964743f1e7595345370 /iseq.c
parente86f66b33fcf4de4bdf6e1d86275f4decec2270e (diff)
* 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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/iseq.c b/iseq.c
index 269ca8a..66fd11f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -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