org.jruby.runtime
Class BlockBody

java.lang.Object
  extended by org.jruby.runtime.BlockBody
All Implemented Interfaces:
JumpTarget
Direct Known Subclasses:
CallBlock, CompiledBlock, CompiledBlock19, Interpreted19Block, InterpretedBlock, MethodBlock, NullBlockBody

public abstract class BlockBody
extends java.lang.Object
implements JumpTarget

The executable body portion of a closure.


Field Summary
protected  int argumentType
           
static int ARRAY
           
static int MULTIPLE_ASSIGNMENT
           
static BlockBody NULL_BODY
           
static int SINGLE_RESTARG
           
static int ZERO_ARGS
           
 
Constructor Summary
BlockBody(int argumentType)
           
 
Method Summary
abstract  Arity arity()
          What is the arity of this block?
static int asArgumentType(NodeType nodeId)
          Compiled codes way of examining arguments
 IRubyObject call(ThreadContext context, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject[] args, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, Binding binding, Block.Type type, Block unusedBlock)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9, Binding binding, Block.Type type)
           
 IRubyObject call(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9, Binding binding, Block.Type type, Block unusedBlock)
           
abstract  Block cloneBlock(Binding binding)
           
 int getArgumentType()
           
static NodeType getArgumentTypeWackyHack(IterNode iterNode)
           
abstract  StaticScope getStaticScope()
           
 boolean isGiven()
          Is the current block a real yield'able block instead a null one
 IRubyObject[] prepareArgumentsForCall(ThreadContext context, IRubyObject[] args, Block.Type type)
           
abstract  void setStaticScope(StaticScope newScope)
           
abstract  IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type)
           
abstract  IRubyObject yield(ThreadContext context, IRubyObject value, IRubyObject self, RubyModule klass, boolean aValue, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, Binding binding, Block.Type type)
           
 IRubyObject yieldSpecific(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9, Binding binding, Block.Type type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_ARGS

public static final int ZERO_ARGS
See Also:
Constant Field Values

MULTIPLE_ASSIGNMENT

public static final int MULTIPLE_ASSIGNMENT
See Also:
Constant Field Values

ARRAY

public static final int ARRAY
See Also:
Constant Field Values

SINGLE_RESTARG

public static final int SINGLE_RESTARG
See Also:
Constant Field Values

argumentType

protected final int argumentType

NULL_BODY

public static final BlockBody NULL_BODY
Constructor Detail

BlockBody

public BlockBody(int argumentType)
Method Detail

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject[] args,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yield

public abstract IRubyObject yield(ThreadContext context,
                                  IRubyObject value,
                                  Binding binding,
                                  Block.Type type)

yield

public abstract IRubyObject yield(ThreadContext context,
                                  IRubyObject value,
                                  IRubyObject self,
                                  RubyModule klass,
                                  boolean aValue,
                                  Binding binding,
                                  Block.Type type)

getArgumentType

public int getArgumentType()

call

public IRubyObject call(ThreadContext context,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7,
                                 IRubyObject arg8,
                                 Binding binding,
                                 Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        IRubyObject arg9,
                        Binding binding,
                        Block.Type type)

call

public IRubyObject call(ThreadContext context,
                        IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        IRubyObject arg4,
                        IRubyObject arg5,
                        IRubyObject arg6,
                        IRubyObject arg7,
                        IRubyObject arg8,
                        IRubyObject arg9,
                        Binding binding,
                        Block.Type type,
                        Block unusedBlock)

yieldSpecific

public IRubyObject yieldSpecific(ThreadContext context,
                                 IRubyObject arg0,
                                 IRubyObject arg1,
                                 IRubyObject arg2,
                                 IRubyObject arg3,
                                 IRubyObject arg4,
                                 IRubyObject arg5,
                                 IRubyObject arg6,
                                 IRubyObject arg7,
                                 IRubyObject arg8,
                                 IRubyObject arg9,
                                 Binding binding,
                                 Block.Type type)

getStaticScope

public abstract StaticScope getStaticScope()

setStaticScope

public abstract void setStaticScope(StaticScope newScope)

cloneBlock

public abstract Block cloneBlock(Binding binding)

arity

public abstract Arity arity()
What is the arity of this block?

Returns:
the arity

isGiven

public boolean isGiven()
Is the current block a real yield'able block instead a null one

Returns:
true if this is a valid block or false otherwise

asArgumentType

public static int asArgumentType(NodeType nodeId)
Compiled codes way of examining arguments

Parameters:
nodeId - to be considered
Returns:
something not linked to AST and a constant to make compiler happy

prepareArgumentsForCall

public IRubyObject[] prepareArgumentsForCall(ThreadContext context,
                                             IRubyObject[] args,
                                             Block.Type type)

getArgumentTypeWackyHack

public static NodeType getArgumentTypeWackyHack(IterNode iterNode)


Copyright © 2002-2007 JRuby Team. All Rights Reserved.