org.jruby.compiler.ir
Class IRClosure

java.lang.Object
  extended by org.jruby.compiler.ir.IRScopeImpl
      extended by org.jruby.compiler.ir.IRExecutionScope
          extended by org.jruby.compiler.ir.IRClosure
All Implemented Interfaces:
IRScope

public class IRClosure
extends IRExecutionScope


Field Summary
 int closureId
           
 Label endLabel
           
 Label startLabel
           
 
Fields inherited from class org.jruby.compiler.ir.IRExecutionScope
optionalArgs, requiredArgs, restArg
 
Constructor Summary
IRClosure(IRScope lexicalParent, StaticScope staticScope, Arity arity, int argumentType)
           
 
Method Summary
protected  StaticScope constructStaticScope(StaticScope parent)
          Closures and Methods have different static scopes.
 BlockBody getBlockBody()
           
 Label getNewLabel()
          Get a new label using a generic prefix
 Variable getNewTemporaryVariable()
          create a new temporary variable
 int getNextClosureId()
          Get the next available unique closure id for closures in this scope
 java.lang.String getScopeName()
           
 int getTemporaryVariableSize()
          How many temporary variables are in this scope?
 java.lang.String toStringBody()
           
 
Methods inherited from class org.jruby.compiler.ir.IRExecutionScope
addClosure, addInstr, allocateStaticScope, buildCFG, calculateParameterCounts, canCaptureCallersBinding, computeExecutionScopeFlags, endLoop, getCFG, getClosestMethodAncestor, getClosures, getCurrentLoop, getInstrs, getLiveLocalVariables, getLocalVariable, getLocalVariablesCount, getSelf, modifiesCode, requiresBinding, runCompilerPassOnNestedScopes, setCodeModificationFlag, startLoop, toStringInstrs, toStringVariables
 
Methods inherited from class org.jruby.compiler.ir.IRScopeImpl
getContainer, getContainerModule, getLexicalParent, getName, getNearestModule, getNewInlineVariable, getNewLabel, getNewTemporaryClosureVariable, getPrefixCountSize, getRenamedVariableSize, getStaticScope, prepareForInterpretation, recordMethodAlias, runCompilerPass, setContainer, setName, toString, unaliasMethodName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startLabel

public final Label startLabel

endLabel

public final Label endLabel

closureId

public final int closureId
Constructor Detail

IRClosure

public IRClosure(IRScope lexicalParent,
                 StaticScope staticScope,
                 Arity arity,
                 int argumentType)
Method Detail

getNextClosureId

public int getNextClosureId()
Description copied from interface: IRScope
Get the next available unique closure id for closures in this scope

Specified by:
getNextClosureId in interface IRScope
Overrides:
getNextClosureId in class IRScopeImpl

getTemporaryVariableSize

public int getTemporaryVariableSize()
Description copied from interface: IRScope
How many temporary variables are in this scope?

Specified by:
getTemporaryVariableSize in interface IRScope
Overrides:
getTemporaryVariableSize in class IRScopeImpl

getNewTemporaryVariable

public Variable getNewTemporaryVariable()
Description copied from interface: IRScope
create a new temporary variable

Specified by:
getNewTemporaryVariable in interface IRScope
Overrides:
getNewTemporaryVariable in class IRScopeImpl

getNewLabel

public Label getNewLabel()
Description copied from interface: IRScope
Get a new label using a generic prefix

Specified by:
getNewLabel in interface IRScope
Overrides:
getNewLabel in class IRScopeImpl

getScopeName

public java.lang.String getScopeName()
Specified by:
getScopeName in class IRScopeImpl

toStringBody

public java.lang.String toStringBody()

constructStaticScope

protected StaticScope constructStaticScope(StaticScope parent)
Description copied from class: IRExecutionScope
Closures and Methods have different static scopes. This returns the correct instance.

Specified by:
constructStaticScope in class IRExecutionScope
Parameters:
parent - scope should be non-null for all closures and null for methods
Returns:
a newly allocated static scope

getBlockBody

public BlockBody getBlockBody()


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