diff options
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -740,12 +740,13 @@ send (VALUE val) // attr rb_snum_t sp_inc = sp_inc_of_sendish(ci); { - struct rb_calling_info calling; + VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), ci, blockiseq, false); + val = vm_sendish(ec, GET_CFP(), ci, cc, bh, vm_search_method_wrap); - calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, ci, blockiseq, FALSE); - calling.recv = TOPN(calling.argc = ci->orig_argc); - vm_search_method(ci, cc, calling.recv); - CALL_METHOD(&calling, ci, cc); + if (val == Qundef) { + RESTORE_REGS(); + NEXT_INSN(); + } } /* Invoke method without block */ @@ -757,10 +758,13 @@ opt_send_without_block // attr bool handles_sp = true; // attr rb_snum_t sp_inc = sp_inc_of_sendish(ci); { - struct rb_calling_info calling; - calling.block_handler = VM_BLOCK_HANDLER_NONE; - vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc)); - CALL_METHOD(&calling, ci, cc); + VALUE bh = VM_BLOCK_HANDLER_NONE; + val = vm_sendish(ec, GET_CFP(), ci, cc, bh, vm_search_method_wrap); + + if (val == Qundef) { + RESTORE_REGS(); + NEXT_INSN(); + } } DEFINE_INSN @@ -826,12 +830,13 @@ invokesuper (VALUE val) // attr rb_snum_t sp_inc = sp_inc_of_sendish(ci); { - struct rb_calling_info calling; + VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), ci, blockiseq, true); + val = vm_sendish(ec, GET_CFP(), ci, cc, bh, vm_search_super_method); - calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, ci, blockiseq, TRUE); - calling.recv = TOPN(calling.argc = ci->orig_argc); - vm_search_super_method(ec, GET_CFP(), &calling, ci, cc); - CALL_METHOD(&calling, ci, cc); + if (val == Qundef) { + RESTORE_REGS(); + NEXT_INSN(); + } } /* yield(args) */ @@ -843,21 +848,16 @@ invokeblock // attr bool handles_sp = true; // attr rb_snum_t sp_inc = sp_inc_of_invokeblock(ci); { - struct rb_calling_info calling; - VALUE block_handler; + static struct rb_call_cache cc = { + 0, 0, NULL, vm_invokeblock_i, + }; - calling.argc = ci->orig_argc; - calling.block_handler = VM_BLOCK_HANDLER_NONE; - calling.recv = Qundef; /* should not be used */ - - block_handler = VM_CF_BLOCK_HANDLER(GET_CFP()); - if (block_handler == VM_BLOCK_HANDLER_NONE) { - rb_vm_localjump_error("no block given (yield)", Qnil, 0); - } + VALUE bh = VM_BLOCK_HANDLER_NONE; + val = vm_sendish(ec, GET_CFP(), ci, &cc, bh, vm_search_invokeblock); - val = vm_invoke_block(ec, GET_CFP(), &calling, ci, block_handler); if (val == Qundef) { - EXEC_EC_CFP(val); + RESTORE_REGS(); + NEXT_INSN(); } } |