diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-26 23:33:59 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-26 23:33:59 +0000 |
commit | a8868b3fe56384d9f57ff5803bd843b26afa1584 (patch) | |
tree | 90b5f79c6d755ca5137c9097df63ad2bdfd3ece1 | |
parent | 06000a03a82630b1a1c524ea00ad93ccd2947812 (diff) | |
download | ruby-a8868b3fe56384d9f57ff5803bd843b26afa1584.tar.gz |
rb_vm_bh_to_procval() accepts `ec` instead of `th`.
* vm_insnhelper.c (rb_vm_bh_to_procval): accepts `ec` instead of `th`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | insns.def | 2 | ||||
-rw-r--r-- | proc.c | 4 | ||||
-rw-r--r-- | vm_args.c | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 4 |
4 files changed, 5 insertions, 7 deletions
@@ -95,7 +95,7 @@ getblockparam VM_ASSERT(VM_ENV_LOCAL_P(ep)); if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - val = rb_vm_bh_to_procval(th, VM_ENV_BLOCK_HANDLER(ep)); + val = rb_vm_bh_to_procval(th->ec, VM_ENV_BLOCK_HANDLER(ep)); vm_env_write(ep, -(int)idx, val); VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); } @@ -384,8 +384,6 @@ bind_eval(int argc, VALUE *argv, VALUE bindval) return rb_f_eval(argc+1, args, Qnil /* self will be searched in eval */); } -VALUE rb_vm_bh_to_procval(rb_thread_t *th, VALUE block_handler); - static const VALUE * get_local_variable_ptr(const rb_env_t **envp, ID lid) { @@ -404,7 +402,7 @@ get_local_variable_ptr(const rb_env_t **envp, ID lid) (unsigned int)iseq->body->param.block_start == i) { const VALUE *ep = env->ep; if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - RB_OBJ_WRITE(env, &env->env[i], rb_vm_bh_to_procval(GET_THREAD(), VM_ENV_BLOCK_HANDLER(ep))); + RB_OBJ_WRITE(env, &env->env[i], rb_vm_bh_to_procval(GET_EC(), VM_ENV_BLOCK_HANDLER(ep))); VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); } } @@ -477,7 +477,7 @@ static inline void args_setup_block_parameter(rb_thread_t *th, struct rb_calling_info *calling, VALUE *locals) { VALUE block_handler = calling->block_handler; - *locals = rb_vm_bh_to_procval(th, block_handler); + *locals = rb_vm_bh_to_procval(th->ec, block_handler); } struct fill_values_arg { diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 5fc8aa52b4..69a3bdbcb5 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -345,7 +345,7 @@ rb_vm_env_write(const VALUE *ep, int index, VALUE v) } VALUE -rb_vm_bh_to_procval(rb_thread_t *th, VALUE block_handler) +rb_vm_bh_to_procval(rb_execution_context_t *ec, VALUE block_handler) { if (block_handler == VM_BLOCK_HANDLER_NONE) { return Qnil; @@ -354,7 +354,7 @@ rb_vm_bh_to_procval(rb_thread_t *th, VALUE block_handler) switch (vm_block_handler_type(block_handler)) { case block_handler_type_iseq: case block_handler_type_ifunc: - return rb_vm_make_proc(th->ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc); + return rb_vm_make_proc(ec, VM_BH_TO_CAPT_BLOCK(block_handler), rb_cProc); case block_handler_type_symbol: return rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler)); case block_handler_type_proc: |