org.jruby.compiler.ir
Class IRMethod

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

public class IRMethod
extends IRExecutionScope


Field Summary
 Label endLabel
           
 boolean isInstanceMethod
           
 Label startLabel
           
 
Fields inherited from class org.jruby.compiler.ir.IRExecutionScope
optionalArgs, requiredArgs, restArg
 
Constructor Summary
IRMethod(IRScope lexicalParent, Operand container, java.lang.String name, boolean isInstanceMethod, StaticScope staticScope)
           
 
Method Summary
 void addInstr(Instr i)
          methods and closures
 int assignBindingSlot(java.lang.String varName)
           
protected  StaticScope constructStaticScope(StaticScope unused)
          Closures and Methods have different static scopes.
 java.lang.Integer getBindingSlot(java.lang.String varName)
           
 int getBindingSlotsCount()
           
 Operand[] getCallArgs()
           
 IRModule getDefiningIRModule()
           
 java.lang.String getFullyQualifiedName()
           
 LocalVariable getLocalVariable(java.lang.String name)
          Get Local Variable from this scope
 int getLocalVariablesCount()
           
 java.lang.String getScopeName()
           
 CodeVersion getVersion()
           
 boolean isAClassRootMethod()
           
 void updateVersion()
           
 
Methods inherited from class org.jruby.compiler.ir.IRExecutionScope
addClosure, allocateStaticScope, buildCFG, calculateParameterCounts, canCaptureCallersBinding, computeExecutionScopeFlags, endLoop, getCFG, getClosestMethodAncestor, getClosures, getCurrentLoop, getInstrs, getLiveLocalVariables, getSelf, modifiesCode, requiresBinding, runCompilerPassOnNestedScopes, setCodeModificationFlag, startLoop, toStringInstrs, toStringVariables
 
Methods inherited from class org.jruby.compiler.ir.IRScopeImpl
getContainer, getContainerModule, getLexicalParent, getName, getNearestModule, getNewInlineVariable, getNewLabel, getNewLabel, getNewTemporaryClosureVariable, getNewTemporaryVariable, getNextClosureId, getPrefixCountSize, getRenamedVariableSize, getStaticScope, getTemporaryVariableSize, 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

isInstanceMethod

public final boolean isInstanceMethod

startLabel

public final Label startLabel

endLabel

public final Label endLabel
Constructor Detail

IRMethod

public IRMethod(IRScope lexicalParent,
                Operand container,
                java.lang.String name,
                boolean isInstanceMethod,
                StaticScope staticScope)
Method Detail

updateVersion

public final void updateVersion()

getScopeName

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

getVersion

public CodeVersion getVersion()

addInstr

public void addInstr(Instr i)
Description copied from interface: IRScope
methods and closures

Specified by:
addInstr in interface IRScope
Overrides:
addInstr in class IRExecutionScope

getCallArgs

public Operand[] getCallArgs()

isAClassRootMethod

public boolean isAClassRootMethod()

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()

getDefiningIRModule

public IRModule getDefiningIRModule()

constructStaticScope

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

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

getLocalVariable

public LocalVariable getLocalVariable(java.lang.String name)
Description copied from interface: IRScope
Get Local Variable from this scope

Specified by:
getLocalVariable in interface IRScope
Overrides:
getLocalVariable in class IRExecutionScope

assignBindingSlot

public int assignBindingSlot(java.lang.String varName)

getBindingSlot

public java.lang.Integer getBindingSlot(java.lang.String varName)

getBindingSlotsCount

public int getBindingSlotsCount()

getLocalVariablesCount

public int getLocalVariablesCount()
Overrides:
getLocalVariablesCount in class IRExecutionScope


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