ruby-changes:48394
From: ko1 <ko1@a...>
Date: Sat, 28 Oct 2017 19:47:25 +0900 (JST)
Subject: [ruby-changes:48394] ko1:r60508 (trunk): `th` -> `ec` for some functions.
ko1 2017-10-28 19:47:19 +0900 (Sat, 28 Oct 2017) New Revision: 60508 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60508 Log: `th` -> `ec` for some functions. * vm.c (rb_vm_get_binding_creatable_next_cfp): accepts `ec` instead of `th`. * vm.c (rb_vm_stack_to_heap): ditto. Modified files: trunk/cont.c trunk/safe.c trunk/vm.c trunk/vm_core.h trunk/vm_trace.c Index: cont.c =================================================================== --- cont.c (revision 60507) +++ cont.c (revision 60508) @@ -606,7 +606,7 @@ cont_capture(volatile int *volatile stat https://github.com/ruby/ruby/blob/trunk/cont.c#L606 const rb_execution_context_t *ec = th->ec; THREAD_MUST_BE_RUNNING(th); - rb_vm_stack_to_heap(th); + rb_vm_stack_to_heap(th->ec); cont = cont_new(rb_cContinuation); contval = cont->self; Index: safe.c =================================================================== --- safe.c (revision 60507) +++ safe.c (revision 60508) @@ -82,7 +82,7 @@ safe_setter(VALUE val) https://github.com/ruby/ruby/blob/trunk/safe.c#L82 } /* block parameters */ - rb_vm_stack_to_heap(th); + rb_vm_stack_to_heap(th->ec); th->ec->safe_level = level; } Index: vm_core.h =================================================================== --- vm_core.h (revision 60507) +++ vm_core.h (revision 60508) @@ -1541,10 +1541,10 @@ rb_vm_living_threads_remove(rb_vm_t *vm, https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1541 typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE); rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); -rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp); +rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *th, const rb_control_frame_t *cfp); int rb_vm_get_sourceline(const rb_control_frame_t *); VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method); -void rb_vm_stack_to_heap(rb_thread_t *th); +void rb_vm_stack_to_heap(rb_execution_context_t *ec); void ruby_thread_init_stack(rb_thread_t *th); int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp); void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp); Index: vm.c =================================================================== --- vm.c (revision 60507) +++ vm.c (revision 60508) @@ -483,9 +483,9 @@ vm_set_main_stack(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm.c#L483 } rb_control_frame_t * -rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp) +rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp) { - while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th->ec, cfp)) { + while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(ec, cfp)) { if (cfp->iseq) { return (rb_control_frame_t *)cfp; } @@ -729,11 +729,11 @@ vm_make_env_object(const rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm.c#L729 } void -rb_vm_stack_to_heap(rb_thread_t *th) +rb_vm_stack_to_heap(rb_execution_context_t *ec) { - rb_control_frame_t *cfp = th->ec->cfp; - while ((cfp = rb_vm_get_binding_creatable_next_cfp(th, cfp)) != 0) { - vm_make_env_object(th->ec, cfp); + rb_control_frame_t *cfp = ec->cfp; + while ((cfp = rb_vm_get_binding_creatable_next_cfp(ec, cfp)) != 0) { + vm_make_env_object(ec, cfp); cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp); } } @@ -895,7 +895,7 @@ rb_vm_make_proc_lambda(const rb_executio https://github.com/ruby/ruby/blob/trunk/vm.c#L895 VALUE rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp) { - rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(th, src_cfp); + rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(th->ec, src_cfp); rb_control_frame_t *ruby_level_cfp = rb_vm_get_ruby_level_next_cfp(th->ec, src_cfp); VALUE bindval, envval; rb_binding_t *bind; @@ -909,7 +909,7 @@ rb_vm_make_binding(rb_thread_t *th, cons https://github.com/ruby/ruby/blob/trunk/vm.c#L909 if (cfp == ruby_level_cfp) { break; } - cfp = rb_vm_get_binding_creatable_next_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)); + cfp = rb_vm_get_binding_creatable_next_cfp(th->ec, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)); } bindval = rb_binding_alloc(rb_cBinding); Index: vm_trace.c =================================================================== --- vm_trace.c (revision 60507) +++ vm_trace.c (revision 60508) @@ -807,7 +807,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L807 rb_tracearg_binding(rb_trace_arg_t *trace_arg) { rb_control_frame_t *cfp; - cfp = rb_vm_get_binding_creatable_next_cfp(trace_arg->th, trace_arg->cfp); + cfp = rb_vm_get_binding_creatable_next_cfp(trace_arg->th->ec, trace_arg->cfp); if (cfp) { return rb_vm_make_binding(trace_arg->th, cfp); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/