summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 01:55:30 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 01:55:30 +0000
commitd1b290d5ba8ef97beb1707dcf30665cb6bc43c16 (patch)
tree6c5844012dc4f566806730e5678c60386e2d4352 /insns.def
parenta4eedafb132deefd25fe8dc62b2305213b0bbed7 (diff)
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.def17
1 files changed, 17 insertions, 0 deletions
diff --git a/insns.def b/insns.def
index 8abc5340cf..70062c983c 100644
--- a/insns.def
+++ b/insns.def
@@ -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 */
/**********************************************************/