diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-03 12:55:12 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-03 12:55:12 +0000 |
commit | 74f4445df249bbc846d06a77c7796298e6aea9c1 (patch) | |
tree | 9572fae0dd214bcdb10eaeec2b6643107b84986c /insns.def | |
parent | 935207ef6f38ce3fb95cf60a2a482603323f94a1 (diff) | |
download | ruby-74f4445df249bbc846d06a77c7796298e6aea9c1.tar.gz ruby-74f4445df249bbc846d06a77c7796298e6aea9c1.tar.xz ruby-74f4445df249bbc846d06a77c7796298e6aea9c1.zip |
* ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminate
COVERAGE__ and introduce coverage.so instead. How to measure
coverage: (1) require "coverage.so", (2) require or load Ruby source
file, and (3) Coverage.result will return the same hash as COVERAGE__.
[ruby-dev:35324]
* thread.c (rb_enable_coverages): start coverage measurement by using
rb_add_event_hook.
* thread.c (rb_get_coverages): returns current results of coverage
measurement.
* include/ruby/intern.h: add prototype for above two functions.
* vm_core.h, vm.c: add field of coverages to rb_vm_t.
* insns.def (trace): remove special handling for COVERAGE__.
* iseq.c (prepare_iseq_build): switch COVERAGE__ to
rb_get_coverages().
* parse.y (coverage): ditto.
* thread.c (clear_coverage): ditto.
* lib/coverage.rb: use coverage.so instead of COVERAGE__.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 18 |
1 files changed, 1 insertions, 17 deletions
@@ -853,23 +853,7 @@ trace { rb_event_flag_t flag = nf; - if (flag == RUBY_EVENT_COVERAGE) { - VALUE coverage = GET_ISEQ()->coverage; - if (coverage) { - long line = vm_get_sourceline(GET_CFP()) - 1; - long count; - if (RARRAY_PTR(coverage)[line] == Qnil) { - rb_bug("bug"); - } - count = FIX2LONG(RARRAY_PTR(coverage)[line]) + 1; - if (POSFIXABLE(count)) { - RARRAY_PTR(coverage)[line] = LONG2FIX(count); - } - } - } - else { - EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); - } + EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* TODO: id, klass */); } /**********************************************************/ |