diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-10 20:32:07 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-10 20:32:07 +0000 |
commit | cb223b7533d31f7388c835fa369af95a02b235d5 (patch) | |
tree | 2acfe0f2ae6f50efc6f95796473b9cdf979b9e28 /vm_insnhelper.c | |
parent | d8736ecff27972901353dea9fe8c1f6a066e37f9 (diff) | |
download | ruby-cb223b7533d31f7388c835fa369af95a02b235d5.tar.gz |
* vm.c (invoke_block_from_c): split this function into several
functions.
* vm_insnhelper.c (vm_yield_callee_setup_arg): remove this function
beacuse it is only delegation function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 0024b56ef2..abb7aeb81d 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2275,7 +2275,7 @@ block_proc_is_lambda(const VALUE procval) } } -static inline VALUE +static VALUE vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockargptr) @@ -2318,14 +2318,6 @@ vm_yield_with_cfunc(rb_thread_t *th, const rb_block_t *block, VALUE self, } static int -vm_yield_callee_setup_arg(rb_thread_t *th, struct rb_calling_info *calling, - const struct rb_call_info *ci, const rb_iseq_t *iseq, - VALUE *argv, enum arg_setup_type arg_setup_type) -{ - return vm_callee_setup_block_arg(th, calling, ci, iseq, argv, arg_setup_type); -} - -static int vm_yield_setup_args(rb_thread_t *th, const rb_iseq_t *iseq, const int argc, VALUE *argv, const rb_block_t *blockptr, enum arg_setup_type arg_setup_type) { struct rb_calling_info calling_entry, *calling; @@ -2338,10 +2330,11 @@ vm_yield_setup_args(rb_thread_t *th, const rb_iseq_t *iseq, const int argc, VALU ci_entry.flag = 0; ci = &ci_entry; - return vm_yield_callee_setup_arg(th, calling, ci, iseq, argv, arg_setup_type); + return vm_callee_setup_block_arg(th, calling, ci, iseq, argv, arg_setup_type); } /* ruby iseq -> ruby block iseq */ + static VALUE vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci) { @@ -2354,11 +2347,11 @@ vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, struct rb_calling_ } iseq = block->iseq; - if (!RUBY_VM_IFUNC_P(iseq)) { + if (RUBY_VM_NORMAL_ISEQ_P(iseq)) { const int arg_size = iseq->body->param.size; int is_lambda = block_proc_is_lambda(block->proc); VALUE * const rsp = GET_SP() - calling->argc; - int opt_pc = vm_yield_callee_setup_arg(th, calling, ci, iseq, rsp, is_lambda ? arg_setup_lambda : arg_setup_block); + int opt_pc = vm_callee_setup_block_arg(th, calling, ci, iseq, rsp, is_lambda ? arg_setup_lambda : arg_setup_block); SET_SP(rsp); |