org.jruby.runtime
Class CompiledBlock

java.lang.Object
  extended by org.jruby.runtime.BlockBody
      extended by org.jruby.runtime.CompiledBlock
All Implemented Interfaces:
JumpTarget
Direct Known Subclasses:
CompiledBlockLight

public class CompiledBlock
extends BlockBody

A Block implemented using a Java-based BlockCallback implementation rather than with an ICallable. For lightweight block logic within Java code.


Field Summary
protected  Arity arity
           
protected  CompiledBlockCallback callback
           
protected  boolean hasMultipleArgsHead
           
protected  StaticScope scope
           
 
Fields inherited from class org.jruby.runtime.BlockBody
argumentType, ARRAY, MULTIPLE_ASSIGNMENT, NULL_BODY, SINGLE_RESTARG, ZERO_ARGS
 
Constructor Summary
protected CompiledBlock(Arity arity, StaticScope scope, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType)
           
 
Method Summary
 Arity arity()
          What is the arity of this block?
 Block cloneBlock(Binding binding)
           
 StaticScope getStaticScope()
           
static BlockBody newCompiledBlock(Arity arity, StaticScope scope, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType)
           
static Block newCompiledClosure(IRubyObject self, Frame frame, Visibility visibility, RubyModule klass, DynamicScope dynamicScope, Arity arity, StaticScope scope, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType)
           
static Block newCompiledClosure(ThreadContext context, IRubyObject self, Arity arity, StaticScope scope, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argumentType)
           
static Block newCompiledClosure(ThreadContext context, IRubyObject self, BlockBody body)
           
protected  void post(ThreadContext context, Binding binding, Visibility vis, Frame lastFrame)
           
protected  Frame pre(ThreadContext context, RubyModule klass, Binding binding)
           
protected  IRubyObject setupBlockArg(Ruby ruby, IRubyObject value, IRubyObject self)
           
protected  IRubyObject setupBlockArgs(ThreadContext context, IRubyObject value, IRubyObject self)
           
 IRubyObject yield(ThreadContext context, IRubyObject value, Binding binding, Block.Type type)
           
 IRubyObject yield(ThreadContext context, IRubyObject args, IRubyObject self, RubyModule klass, boolean aValue, Binding binding, Block.Type type)
           
 
Methods inherited from class org.jruby.runtime.BlockBody
asArgumentType, call, call, getArgumentType, getArgumentTypeWackyHack, isGiven, prepareArgumentsForCall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

callback

protected final CompiledBlockCallback callback

hasMultipleArgsHead

protected final boolean hasMultipleArgsHead

arity

protected final Arity arity

scope

protected final StaticScope scope
Constructor Detail

CompiledBlock

protected CompiledBlock(Arity arity,
                        StaticScope scope,
                        CompiledBlockCallback callback,
                        boolean hasMultipleArgsHead,
                        int argumentType)
Method Detail

newCompiledClosure

public static Block newCompiledClosure(IRubyObject self,
                                       Frame frame,
                                       Visibility visibility,
                                       RubyModule klass,
                                       DynamicScope dynamicScope,
                                       Arity arity,
                                       StaticScope scope,
                                       CompiledBlockCallback callback,
                                       boolean hasMultipleArgsHead,
                                       int argumentType)

newCompiledClosure

public static Block newCompiledClosure(ThreadContext context,
                                       IRubyObject self,
                                       Arity arity,
                                       StaticScope scope,
                                       CompiledBlockCallback callback,
                                       boolean hasMultipleArgsHead,
                                       int argumentType)

newCompiledClosure

public static Block newCompiledClosure(ThreadContext context,
                                       IRubyObject self,
                                       BlockBody body)

newCompiledBlock

public static BlockBody newCompiledBlock(Arity arity,
                                         StaticScope scope,
                                         CompiledBlockCallback callback,
                                         boolean hasMultipleArgsHead,
                                         int argumentType)

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject value,
                         Binding binding,
                         Block.Type type)
Specified by:
yield in class BlockBody

yield

public IRubyObject yield(ThreadContext context,
                         IRubyObject args,
                         IRubyObject self,
                         RubyModule klass,
                         boolean aValue,
                         Binding binding,
                         Block.Type type)
Specified by:
yield in class BlockBody

pre

protected Frame pre(ThreadContext context,
                    RubyModule klass,
                    Binding binding)

post

protected void post(ThreadContext context,
                    Binding binding,
                    Visibility vis,
                    Frame lastFrame)

setupBlockArgs

protected IRubyObject setupBlockArgs(ThreadContext context,
                                     IRubyObject value,
                                     IRubyObject self)

setupBlockArg

protected IRubyObject setupBlockArg(Ruby ruby,
                                    IRubyObject value,
                                    IRubyObject self)

getStaticScope

public StaticScope getStaticScope()
Specified by:
getStaticScope in class BlockBody

cloneBlock

public Block cloneBlock(Binding binding)
Specified by:
cloneBlock in class BlockBody

arity

public Arity arity()
Description copied from class: BlockBody
What is the arity of this block?

Specified by:
arity in class BlockBody
Returns:
the arity


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