ruby-changes:42002
From: nobu <ko1@a...>
Date: Thu, 10 Mar 2016 14:32:54 +0900 (JST)
Subject: [ruby-changes:42002] nobu:r54076 (trunk): iseq.c: set coverage at once
nobu 2016-03-10 14:32:49 +0900 (Thu, 10 Mar 2016) New Revision: 54076 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54076 Log: iseq.c: set coverage at once * iseq.c (prepare_iseq_build): set coverage at once, not repeatedly resetting. Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 54075) +++ iseq.c (revision 54076) @@ -267,6 +267,8 @@ prepare_iseq_build(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/iseq.c#L267 const rb_iseq_t *parent, enum iseq_type type, const rb_compile_option_t *option) { + VALUE coverage = Qfalse; + iseq->body->type = type; set_relation(iseq, parent); @@ -296,15 +298,14 @@ prepare_iseq_build(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/iseq.c#L298 ISEQ_COMPILE_DATA(iseq)->option = option; ISEQ_COMPILE_DATA(iseq)->last_coverable_line = -1; - ISEQ_COVERAGE_SET(iseq, Qfalse); - if (!GET_THREAD()->parse_in_eval) { VALUE coverages = rb_get_coverages(); if (RTEST(coverages)) { - ISEQ_COVERAGE_SET(iseq, rb_hash_lookup(coverages, path)); - if (NIL_P(ISEQ_COVERAGE(iseq))) ISEQ_COVERAGE_SET(iseq, Qfalse); + coverage = rb_hash_lookup(coverages, path); + if (NIL_P(coverage)) coverage = Qfalse; } } + ISEQ_COVERAGE_SET(iseq, coverage); return Qtrue; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/