ruby-changes:48400
From: ko1 <ko1@a...>
Date: Sat, 28 Oct 2017 20:16:02 +0900 (JST)
Subject: [ruby-changes:48400] ko1:r60514 (trunk): `th` -> `ec` for rb_vm_make_binding().
ko1 2017-10-28 20:15:56 +0900 (Sat, 28 Oct 2017) New Revision: 60514 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60514 Log: `th` -> `ec` for rb_vm_make_binding(). * vm.c (rb_vm_make_binding): accepts (const) `ec` instead of `th`. Modified files: trunk/proc.c trunk/vm.c trunk/vm_backtrace.c trunk/vm_core.h trunk/vm_trace.c Index: vm_trace.c =================================================================== --- vm_trace.c (revision 60513) +++ vm_trace.c (revision 60514) @@ -810,7 +810,7 @@ rb_tracearg_binding(rb_trace_arg_t *trac https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L810 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); + return rb_vm_make_binding(trace_arg->th->ec, cfp); } else { return Qnil; Index: vm.c =================================================================== --- vm.c (revision 60513) +++ vm.c (revision 60514) @@ -893,10 +893,10 @@ rb_vm_make_proc_lambda(const rb_executio https://github.com/ruby/ruby/blob/trunk/vm.c#L893 /* Binding */ VALUE -rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp) +rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *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); + rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(ec, src_cfp); + rb_control_frame_t *ruby_level_cfp = rb_vm_get_ruby_level_next_cfp(ec, src_cfp); VALUE bindval, envval; rb_binding_t *bind; @@ -905,11 +905,11 @@ rb_vm_make_binding(rb_thread_t *th, cons https://github.com/ruby/ruby/blob/trunk/vm.c#L905 } while (1) { - envval = vm_make_env_object(th->ec, cfp); + envval = vm_make_env_object(ec, cfp); if (cfp == ruby_level_cfp) { break; } - cfp = rb_vm_get_binding_creatable_next_cfp(th->ec, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)); + cfp = rb_vm_get_binding_creatable_next_cfp(ec, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)); } bindval = rb_binding_alloc(rb_cBinding); Index: vm_core.h =================================================================== --- vm_core.h (revision 60513) +++ vm_core.h (revision 60514) @@ -1502,7 +1502,7 @@ int rb_ec_frame_method_id_and_class(cons https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1502 VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, VALUE block_handler); VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda); VALUE rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass); -VALUE rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp); +VALUE rb_vm_make_binding(const rb_execution_context_t *th, const rb_control_frame_t *src_cfp); VALUE rb_vm_env_local_variables(const rb_env_t *env); const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env); const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars); Index: proc.c =================================================================== --- proc.c (revision 60513) +++ proc.c (revision 60514) @@ -332,8 +332,8 @@ binding_clone(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L332 VALUE rb_binding_new(void) { - rb_thread_t *th = GET_THREAD(); - return rb_vm_make_binding(th, th->ec->cfp); + rb_execution_context_t *ec = GET_EC(); + return rb_vm_make_binding(ec, ec->cfp); } /* Index: vm_backtrace.c =================================================================== --- vm_backtrace.c (revision 60513) +++ vm_backtrace.c (revision 60514) @@ -1156,7 +1156,7 @@ collect_caller_bindings(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm_backtrace.c#L1156 if (!NIL_P(cfp_val)) { rb_control_frame_t *cfp = GC_GUARDED_PTR_REF(cfp_val); - rb_ary_store(entry, CALLER_BINDING_BINDING, rb_vm_make_binding(th, cfp)); + rb_ary_store(entry, CALLER_BINDING_BINDING, rb_vm_make_binding(th->ec, cfp)); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/