From c08e8886badd47890a54bdc54f1c09de7ad5c8e8 Mon Sep 17 00:00:00 2001 From: mame Date: Wed, 20 Dec 2017 04:24:14 +0000 Subject: compile.c: add a RUBY_EVENT_COVERAGE_LINE event for line coverage 2.5's line coverage measurement was about two times slower than 2.4 because of two reasons; (1) vm_trace uses rb_iseq_event_flags (which takes O(n) currently where n is the length of iseq) to get an event type, and (2) RUBY_EVENT_LINE uses setjmp to call an event hook. This change adds a special event for line coverage, RUBY_EVENT_COVERAGE_LINE, and adds `tracecoverage` instructions where the event occurs in iseq. `tracecoverage` instruction calls an event hook without vm_trace. And, RUBY_EVENT_COVERAGE_LINE is an internal event which does not use setjmp. This change also cancells lineno change due to the deletion of trace instructions [Feature #14104]. So fixes [Bug #14191]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/ruby/ruby.h') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 3210103c64..0959413dac 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2111,7 +2111,7 @@ int ruby_native_thread_p(void); #define RUBY_INTERNAL_EVENT_GC_ENTER 0x2000000 #define RUBY_INTERNAL_EVENT_GC_EXIT 0x4000000 #define RUBY_INTERNAL_EVENT_OBJSPACE_MASK 0x7f00000 -#define RUBY_INTERNAL_EVENT_MASK 0xfffe0000 +#define RUBY_INTERNAL_EVENT_MASK 0xffff0000 typedef uint32_t rb_event_flag_t; typedef void (*rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass); -- cgit v1.2.3