ruby-changes:48445
From: ko1 <ko1@a...>
Date: Mon, 30 Oct 2017 00:25:37 +0900 (JST)
Subject: [ruby-changes:48445] ko1:r60559 (trunk): constify `rb_vm_bh_to_procval()`
ko1 2017-10-30 00:25:32 +0900 (Mon, 30 Oct 2017) New Revision: 60559 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60559 Log: constify `rb_vm_bh_to_procval()` * vm_insnhelper.c (rb_vm_bh_to_procval): constify 1st param (ec). * vm_args.c (args_setup_block_parameter): accepts (const) `ec`. Modified files: trunk/vm_args.c trunk/vm_core.h trunk/vm_insnhelper.c Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 60558) +++ vm_insnhelper.c (revision 60559) @@ -345,7 +345,7 @@ rb_vm_env_write(const VALUE *ep, int ind https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L345 } VALUE -rb_vm_bh_to_procval(rb_execution_context_t *ec, VALUE block_handler) +rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler) { if (block_handler == VM_BLOCK_HANDLER_NONE) { return Qnil; Index: vm_core.h =================================================================== --- vm_core.h (revision 60558) +++ vm_core.h (revision 60559) @@ -1550,7 +1550,7 @@ void rb_vm_stack_to_heap(rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1550 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); -VALUE rb_vm_bh_to_procval(rb_execution_context_t *ec, VALUE block_handler); +VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler); void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg); Index: vm_args.c =================================================================== --- vm_args.c (revision 60558) +++ vm_args.c (revision 60559) @@ -474,10 +474,10 @@ args_setup_kw_rest_parameter(VALUE keywo https://github.com/ruby/ruby/blob/trunk/vm_args.c#L474 } static inline void -args_setup_block_parameter(rb_thread_t *th, struct rb_calling_info *calling, VALUE *locals) +args_setup_block_parameter(const rb_execution_context_t *ec, struct rb_calling_info *calling, VALUE *locals) { VALUE block_handler = calling->block_handler; - *locals = rb_vm_bh_to_procval(th->ec, block_handler); + *locals = rb_vm_bh_to_procval(ec, block_handler); } struct fill_values_arg { @@ -670,7 +670,7 @@ setup_parameters_complex(rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm_args.c#L670 /* Do nothing */ } else { - args_setup_block_parameter(rb_ec_thread_ptr(ec), calling, locals + iseq->body->param.block_start); + args_setup_block_parameter(ec, calling, locals + iseq->body->param.block_start); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/