vm/instructions.rb
# [Operation]
#   Sends a message with arguments and a block on the stack
# [Format]
#   \send_stack_with_block method argc
# [Stack Before]
#   * block
#   * argN
#   * ...
#   * arg2
#   * arg1
#   * receiver
# [Stack After]
#   * retval
#   * ...
# [Description]
#   Pops the receiver +receiver+ and a block off the stack, and sends the
#   message +method+ with +argc+ arguments. The arguments to the method
#   remain on the stack, ready to be converted to locals as part of method
#   activation.
#
#   When the method returns, the return value will be on top of the stack.
# [See Also]
#   * send_stack
# [Notes]
#   This opcode passes a block to the receiver; see send_stack for the
#   equivalent op code used when no block is to be passed.


When the method returns, the return value will be on top of the stack.
[See Also]
send_stack
[Notes]
This opcode passes a block to the receiver; see send_stack for the
equivalent op code used when no block is to be passed.
When the method returns the return value will be on top of the stack . [ See Also ] send_stack [ Notes ] This opcode passes a block to the receiver ; see send_stack for the equivalent op code used when no block is to be passed .
def send_stack_with_block(index, count)
    <<-CODE
    Object* block = stack_pop();
    Object* recv = stack_back(count);
    SendSite::Internal* cache = reinterpret_cast<SendSite::Internal*>(index);
    Class* const klass = recv->lookup_begin(state);
    Arguments args(recv, block, count,
                   call_frame->stack_back_position(count - 1));
    if(unlikely(cache->recv_class != klass)) {
      if(SendSite::fill(state, klass, call_frame, cache, ALLOW_PRIVATE())) {
        args.unshift(state, cache->name);
      }
    }
    SET_ALLOW_PRIVATE(false);
    Object* ret = cache->execute(state, call_frame, *cache, args);
    call_frame->clear_stack(count + 1);
    HANDLE_EXCEPTION(ret);
    stack_push(ret);
    CODE
  end
def send_stack_with_block ( index , count ) <<-CODE 
    Object* block = stack_pop();
    Object* recv = stack_back(count);
    SendSite::Internal* cache = reinterpret_cast<SendSite::Internal*>(index);
    Class* const klass = recv->lookup_begin(state);

    Arguments args(recv, block, count,
                   call_frame->stack_back_position(count - 1));

    if(unlikely(cache->recv_class != klass)) {
      if(SendSite::fill(state, klass, call_frame, cache, ALLOW_PRIVATE())) {
        args.unshift(state, cache->name);
      }
    }

    SET_ALLOW_PRIVATE(false);

    Object* ret = cache->execute(state, call_frame, *cache, args);

    call_frame->clear_stack(count + 1);

    HANDLE_EXCEPTION(ret);
    stack_push(ret);
     CODE end
[Operation]
Sends a message with arguments and a block on the stack
[Format]
\send_stack_with_block method argc
[Stack Before]
 block
 argN
 ...
 arg2
 arg1
 receiver
[Stack After]
 retval
 ...
[Description]
Pops the receiver +receiver+ and a block off the stack, and sends the
message +method+ with +argc+ arguments.
[ Operation ] Sends a message with arguments and a block on the stack [ Format ] \ send_stack_with_block method argc [ Stack Before ] block argN ... arg2 arg1 receiver [ Stack After ] retval ... [ Description ] Pops the receiver + receiver + and a block off the stack and sends the message + method + with + argc + arguments .
index
<not_specific>
count
<not_specific>