diff options
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -656,7 +656,8 @@ rb_iseq_new_top(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath VALUE coverages = rb_get_coverages(); if (RTEST(coverages)) { if (ast->line_count >= 0) { - VALUE coverage = rb_default_coverage(ast->line_count); + int len = (rb_get_coverage_mode() & COVERAGE_TARGET_ONESHOT_LINES) ? 0 : ast->line_count; + VALUE coverage = rb_default_coverage(len); rb_hash_aset(coverages, path, coverage); } } @@ -1655,6 +1656,19 @@ rb_iseq_event_flags(const rb_iseq_t *iseq, size_t pos) } } +void +rb_iseq_clear_event_flags(const rb_iseq_t *iseq, size_t pos, rb_event_flag_t reset) +{ + struct iseq_insn_info_entry *entry = (struct iseq_insn_info_entry *)get_insn_info(iseq, pos); + if (entry) { + entry->events &= ~reset; + if (!(entry->events & iseq->aux.trace_events)) { + void rb_iseq_trace_flag_cleared(const rb_iseq_t *iseq, int pos); + rb_iseq_trace_flag_cleared(iseq, pos); + } + } +} + static VALUE local_var_name(const rb_iseq_t *diseq, VALUE level, VALUE op) { @@ -2935,6 +2949,14 @@ encoded_iseq_trace_instrument(VALUE *iseq_encoded_insn, rb_event_flag_t turnon) } void +rb_iseq_trace_flag_cleared(const rb_iseq_t *iseq, int pos) +{ + const struct rb_iseq_constant_body *const body = iseq->body; + VALUE *iseq_encoded = (VALUE *)body->iseq_encoded; + encoded_iseq_trace_instrument(&iseq_encoded[pos], 0); +} + +void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events) { VM_ASSERT((turnon_events & ~ISEQ_TRACE_EVENTS) == 0); |