From 0a6816ecd79fac5dfb32eb237f4c31bb45c9460d Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 5 Dec 2017 07:16:42 +0000 Subject: Revamp method coverage to support define_method Traditionally, method coverage measurement was implemented by inserting `trace2` instruction to the head of method iseq. So, it just measured methods defined by `def` keyword. This commit drastically changes the measuring mechanism of method coverage; at `RUBY_EVENT_CALL`, it keeps a hash from rb_method_entry_t* to runs (i.e., it counts the runs per method entry), and at `Coverage.result`, it creates the result hash by enumerating all `rb_method_entry_t*` objects (by `ObjectSpace.each_object`). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- method.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'method.h') diff --git a/method.h b/method.h index 0ec1a09759..584332561b 100644 --- a/method.h +++ b/method.h @@ -190,6 +190,9 @@ const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id); const rb_method_entry_t *rb_method_entry(VALUE klass, ID id); const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class); const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me); +RUBY_SYMBOL_EXPORT_BEGIN +const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[2]); +RUBY_SYMBOL_EXPORT_END const rb_callable_method_entry_t *rb_callable_method_entry(VALUE klass, ID id); const rb_callable_method_entry_t *rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class); -- cgit v1.2.3