summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vm_core.h7
-rw-r--r--vm_trace.c16
2 files changed, 5 insertions, 18 deletions
diff --git a/vm_core.h b/vm_core.h
index 2140778ade..fc0d611e29 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1708,8 +1708,7 @@ struct rb_trace_arg_struct {
VALUE path;
};
-void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg);
-void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg);
+void rb_exec_event_hooks(struct rb_trace_arg_struct *trace_arg, int pop_p);
#define EXEC_EVENT_HOOK_ORIG(ec_, flag_, self_, id_, called_id_, klass_, data_, pop_p_) do { \
const rb_event_flag_t flag_arg_ = (flag_); \
@@ -1724,6 +1723,7 @@ ruby_exec_event_hook_orig(rb_execution_context_t *ec, const rb_event_flag_t flag
VALUE self, ID id, ID called_id, VALUE klass, VALUE data, int pop_p)
{
const rb_thread_t *th = rb_ec_thread_ptr(ec);
+
if ((th->event_hooks.events | th->vm->event_hooks.events) & flag) {
struct rb_trace_arg_struct trace_arg;
trace_arg.event = flag;
@@ -1736,8 +1736,7 @@ ruby_exec_event_hook_orig(rb_execution_context_t *ec, const rb_event_flag_t flag
trace_arg.data = data;
trace_arg.path = Qundef;
trace_arg.klass_solved = 0;
- if (pop_p) rb_threadptr_exec_event_hooks_and_pop_frame(&trace_arg);
- else rb_threadptr_exec_event_hooks(&trace_arg);
+ rb_exec_event_hooks(&trace_arg, pop_p);
}
}
diff --git a/vm_trace.c b/vm_trace.c
index f26808fa63..4e79ae279a 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -298,8 +298,8 @@ exec_hooks_protected(rb_execution_context_t *ec, rb_hook_list_t *list, const rb_
return state;
}
-static void
-rb_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p)
+void
+rb_exec_event_hooks(rb_trace_arg_t *trace_arg, int pop_p)
{
rb_execution_context_t *ec = trace_arg->ec;
rb_vm_t *vm = rb_ec_vm_ptr(ec);
@@ -362,18 +362,6 @@ rb_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p)
}
}
-void
-rb_threadptr_exec_event_hooks_and_pop_frame(rb_trace_arg_t *trace_arg)
-{
- rb_exec_event_hooks_orig(trace_arg, 1);
-}
-
-void
-rb_threadptr_exec_event_hooks(rb_trace_arg_t *trace_arg)
-{
- rb_exec_event_hooks_orig(trace_arg, 0);
-}
-
VALUE
rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg)
{