diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-07 05:54:34 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-07 05:54:34 +0000 |
commit | 7285177c9700c7176c767047f1f788997623cbd0 (patch) | |
tree | 2f445a553b2a50506c1e41c7971ae37bc9b2bcfe | |
parent | 8b7f06d2d66695b3997fb5588cad1d55da402960 (diff) |
* vm_trace.c (rb_exec_event_hooks): accepts pop_p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vm_core.h | 7 | ||||
-rw-r--r-- | vm_trace.c | 16 |
2 files changed, 5 insertions, 18 deletions
@@ -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) { |