[ruby-cvs:68531] mame:r61350 (trunk): compile.c: add a RUBY_EVENT_COVERAGE_LINE event for line coverage

mame at ruby-lang.org mame at ruby-lang.org
Wed Dec 20 13:24:14 JST 2017


mame	2017-12-20 13:24:14 +0900 (Wed, 20 Dec 2017)

  New Revision: 61350

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61350

  Log:
    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].

  Modified files:
    trunk/compile.c
    trunk/include/ruby/ruby.h
    trunk/insns.def
    trunk/iseq.c
    trunk/thread.c
    trunk/vm_core.h


More information about the ruby-cvs mailing list