From a8fed4716e51fd9ed602b39762cfac69eec80c23 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 7 Nov 2017 03:41:34 +0000 Subject: prepare local variables (th and vm). * vm_trace.c (rb_threadptr_exec_event_hooks_orig): prepare local variables `th` and `vm` instead of using rb_ec_... functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 28be72eb9a..0171539808 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -302,6 +302,8 @@ static void rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) { rb_execution_context_t *ec = trace_arg->ec; + rb_thread_t *th = rb_ec_thread_ptr(ec); + rb_vm_t *vm = th->vm; if (trace_arg->event & RUBY_INTERNAL_EVENT_MASK) { if (ec->trace_arg && (ec->trace_arg->event & RUBY_INTERNAL_EVENT_MASK)) { @@ -309,12 +311,12 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) } else { rb_trace_arg_t *prev_trace_arg = ec->trace_arg; - rb_ec_vm_ptr(ec)->trace_running++; + vm->trace_running++; ec->trace_arg = trace_arg; - exec_hooks_unprotected(rb_ec_thread_ptr(ec), &rb_ec_thread_ptr(ec)->event_hooks, trace_arg); - exec_hooks_unprotected(rb_ec_thread_ptr(ec), &rb_ec_thread_ptr(ec)->vm->event_hooks, trace_arg); + exec_hooks_unprotected(th, &th->event_hooks, trace_arg); + exec_hooks_unprotected(th, &vm->event_hooks, trace_arg); ec->trace_arg = prev_trace_arg; - rb_ec_vm_ptr(ec)->trace_running--; + vm->trace_running--; } } else { @@ -327,22 +329,22 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) ec->local_storage_recursive_hash = ec->local_storage_recursive_hash_for_trace; ec->errinfo = Qnil; - rb_ec_vm_ptr(ec)->trace_running++; + vm->trace_running++; ec->trace_arg = trace_arg; { /* thread local traces */ - state = exec_hooks_protected(rb_ec_thread_ptr(ec), &rb_ec_thread_ptr(ec)->event_hooks, trace_arg); + state = exec_hooks_protected(th, &th->event_hooks, trace_arg); if (state) goto terminate; /* vm global traces */ - state = exec_hooks_protected(rb_ec_thread_ptr(ec), &rb_ec_thread_ptr(ec)->vm->event_hooks, trace_arg); + state = exec_hooks_protected(th, &vm->event_hooks, trace_arg); if (state) goto terminate; ec->errinfo = errinfo; } terminate: ec->trace_arg = NULL; - rb_ec_vm_ptr(ec)->trace_running--; + vm->trace_running--; ec->local_storage_recursive_hash_for_trace = ec->local_storage_recursive_hash; ec->local_storage_recursive_hash = old_recursive; -- cgit v1.2.3