diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 01:55:30 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 01:55:30 +0000 |
commit | d1b290d5ba8ef97beb1707dcf30665cb6bc43c16 (patch) | |
tree | 6c5844012dc4f566806730e5678c60386e2d4352 /insns.def | |
parent | a4eedafb132deefd25fe8dc62b2305213b0bbed7 (diff) | |
download | ruby-d1b290d5ba8ef97beb1707dcf30665cb6bc43c16.tar.gz |
Add a new instruction `trace2` for hooking with custom data
This is needed for passing to the hook function the measuring target
type (line/branch/method) and the site of coverage event fired.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -732,6 +732,23 @@ trace (flag & (RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN)) ? TOPN(0) : Qundef); } +/** + @c setting + @e trace + @j trace 用の命令。 + */ +DEFINE_INSN +trace2 +(rb_num_t nf, VALUE data) +() +() +{ + rb_event_flag_t flag = (rb_event_flag_t)nf; + + vm_dtrace(flag, th); + EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0, 0 /* id and klass are resolved at callee */, data); +} + /**********************************************************/ /* deal with control flow 1: class/module */ /**********************************************************/ |