diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-05 07:16:42 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-05 07:16:42 +0000 |
commit | 0a6816ecd79fac5dfb32eb237f4c31bb45c9460d (patch) | |
tree | 63c3def6ba4957dace4d3fba56f1da964b9750de /internal.h | |
parent | aa87ae7a04b9c4845ef4326b63150027ed1036a9 (diff) | |
download | ruby-0a6816ecd79fac5dfb32eb237f4c31bb45c9460d.tar.gz |
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
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal.h b/internal.h index 81ecb876ad..229a555533 100644 --- a/internal.h +++ b/internal.h @@ -1272,6 +1272,9 @@ void ruby_sized_xfree(void *x, size_t size); /* hash.c */ struct st_table *rb_hash_tbl_raw(VALUE hash); VALUE rb_hash_new_with_size(st_index_t size); +RUBY_SYMBOL_EXPORT_BEGIN +VALUE rb_hash_new_compare_by_id(void); +RUBY_SYMBOL_EXPORT_END VALUE rb_hash_has_key(VALUE hash, VALUE key); VALUE rb_hash_default_value(VALUE hash, VALUE key); VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc); @@ -1758,7 +1761,6 @@ struct timeval rb_time_timeval(VALUE); /* thread.c */ #define COVERAGE_INDEX_LINES 0 #define COVERAGE_INDEX_BRANCHES 1 -#define COVERAGE_INDEX_METHODS 2 #define COVERAGE_TARGET_LINES 1 #define COVERAGE_TARGET_BRANCHES 2 #define COVERAGE_TARGET_METHODS 4 |