ruby-changes:48578
From: ko1 <ko1@a...>
Date: Tue, 7 Nov 2017 15:14:04 +0900 (JST)
Subject: [ruby-changes:48578] ko1:r60693 (trunk): th->ec: vm_once_dispatch.
ko1 2017-11-07 15:14:00 +0900 (Tue, 07 Nov 2017) New Revision: 60693 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60693 Log: th->ec: vm_once_dispatch. * vm_insnhelper.c (vm_once_dispatch): accepts `ec`. Modified files: trunk/insns.def trunk/vm_insnhelper.c Index: insns.def =================================================================== --- insns.def (revision 60692) +++ insns.def (revision 60693) @@ -1164,7 +1164,7 @@ once https://github.com/ruby/ruby/blob/trunk/insns.def#L1164 () (VALUE val) { - val = vm_once_dispatch(iseq, ic, rb_ec_thread_ptr(ec)); + val = vm_once_dispatch(ec, iseq, ic); } /** Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 60692) +++ vm_insnhelper.c (revision 60693) @@ -3260,8 +3260,9 @@ vm_ic_update(IC ic, VALUE val, const VAL https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3260 } static VALUE -vm_once_dispatch(ISEQ iseq, IC ic, rb_thread_t *th) +vm_once_dispatch(rb_execution_context_t *ec, ISEQ iseq, IC ic) { + rb_thread_t *th = rb_ec_thread_ptr(ec); rb_thread_t *const RUNNING_THREAD_ONCE_DONE = (rb_thread_t *)(0x1); union iseq_inline_storage_entry *const is = (union iseq_inline_storage_entry *)ic; @@ -3275,7 +3276,7 @@ vm_once_dispatch(ISEQ iseq, IC ic, rb_th https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3276 val = is->once.value = rb_ensure(vm_once_exec, (VALUE)iseq, vm_once_clear, (VALUE)is); /* is->once.running_thread is cleared by vm_once_clear() */ is->once.running_thread = RUNNING_THREAD_ONCE_DONE; /* success */ - rb_iseq_add_mark_object(th->ec->cfp->iseq, val); + rb_iseq_add_mark_object(ec->cfp->iseq, val); return val; } else if (is->once.running_thread == th) { @@ -3284,7 +3285,7 @@ vm_once_dispatch(ISEQ iseq, IC ic, rb_th https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3285 } else { /* waiting for finish */ - RUBY_VM_CHECK_INTS(th->ec); + RUBY_VM_CHECK_INTS(ec); rb_thread_schedule(); goto again; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/