aboutsummaryrefslogtreecommitdiffstats
path: root/vm_trace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 03:41:34 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-07 03:41:34 +0000
commita8fed4716e51fd9ed602b39762cfac69eec80c23 (patch)
treebc4076b05735edc5406fdaebc4861dcdd8ab512e /vm_trace.c
parent297c5975f232f508e7ed5d81fc6c48bcc354b298 (diff)
downloadruby-a8fed4716e51fd9ed602b39762cfac69eec80c23.tar.gz
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
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c18
1 files changed, 10 insertions, 8 deletions
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;