Top Fields Constructors Methods
org.jruby.ir

public Class IRMethod

extends IRScope
Class Inheritance
Imports
org.jruby.RubySymbol, org.jruby.ir.builder.IRBuilder, .LazyMethodDefinition, org.jruby.ir.instructions.CallBase, .GetFieldInstr, .Instr, .JumpTargetInstr, .LabelInstr, .PutFieldInstr, org.jruby.ir.interpreter.ExitableInterpreterContext, .InterpreterContext, org.jruby.ir.operands.Label, .LocalVariable, org.jruby.ir.representations.BasicBlock, org.jruby.parser.StaticScope, org.jruby.runtime.ArgumentDescriptor, .CallType, org.jruby.runtime.ivars.MethodData, org.jruby.util.ByteList, java.util.ArrayList, .HashMap, .List, .Map

Field Summary

Modifier and TypeField and Description
protected ArgumentDescriptor[]
private volatile LazyMethodDefinition<U, V, W, X, Y, Z>
private volatile ExitableInterpreterContext
public final boolean
Inherited from org.jruby.ir.IRScope:
compilablefullInterpreterContextinterpreterContextlocalVarsLOGnextClosureIndexoptimizedInterpreterContext

Constructor Summary

AccessConstructor and Description
public
IRMethod(IRManager manager, IRScope lexicalParent, LazyMethodDefinition<U, V, W, X, Y, Z> defn, ByteList name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope, int coverageMode)

Method Summary

Modifier and TypeMethod and Description
private synchronized void
public ExitableInterpreterContext
builtInterperterContextForJavaConstructor()
Deprecated

This method was renamed (due a typo).

public InterpreterContext
public ExitableInterpreterContext

Returns:

appropriate interpretercontext
builtInterpreterContextForJavaConstructor
()

initialize methods in reified Java types will try and dispatch to the Java base classes constructor when the Ruby in the initialize: a) The super call is still valid in terms of Java (e.g. you cannot access self/this before the super call b) We can detect the validity of 'a'.

private synchronized ExitableInterpreterContext
protected LocalVariable
public ArgumentDescriptor[]
public LocalVariable
getLocalVariable(RubySymbol name, int scopeDepth)

Overrides org.jruby.ir.IRScope.getLocalVariable.

Find or create a local variable.

public MethodData
public IRScopeType
public boolean
hasBeenBuilt()

Overrides org.jruby.ir.IRScope.hasBeenBuilt.

For lazy scopes which IRBuild on demand we can ask this method whether it has been built yet...

public final InterpreterContext
public BasicBlock[]
prepareForCompilation()

Overrides org.jruby.ir.IRScope.prepareForCompilation.

Run any necessary passes to get the IR ready for compilation (AOT and/or JIT)

public void
setArgumentDescriptors(ArgumentDescriptor[] argDesc)

Set upon completion of IRBuild of this IRMethod.

Inherited from org.jruby.ir.IRScope:
accessesParentsLocalVariablesaddChildScopeaddClosureallocateInitialFlagsallocateInterpreterContextallocateInterpreterContextanyUsesEvalbuildJVMExceptionTablecanCaptureCallersBindingcanReceiveBreakscanReceiveNonlocalReturnscaptureParentRefinementscleanupAfterExecutioncorrectVariableDepthForForLoopsForEncodingdebugOutputdependsdumpToIGVequalsexecutesOncegetASTgetByteNamegetClosuresgetCoverageModegetDynamicScopegetEncodinggetExecutedPassesgetExecutionContextgetFilegetFileNamegetFullInterpreterContextgetFullyQualifiedNamegetIdgetInterpreterContextgetLexicalParentgetLexicalScopesgetLinegetLineNumbergetLocalVariablesgetManagergetNamegetNearestMethodgetNearestModuleReferencingScopeDepthgetNearestNonClosurelikeScopegetNearestTopLocalVariableScopegetNewLabelgetNewLabelgetNewLocalVariablegetNextClosureIdgetNextLabelIndexgetOptimizedInterpreterContextgetRootLexicalScopegetScopeIdgetSelfgetStaticScopehasBreakInstructionshasFlipFlopshashCodehasLoopshasNonLocalReturnsinlineMethodinlineMethodCompiledinlineMethodJITinliningAllowedisModuleBodyisNestedInClosureisNonSingletonClassBodyisRuby2KeywordsisScopeContainedByisScriptScopeisTopLocalVariableScopeisWhereFlipFlopStateVariableIsisWithinENDlookupExistingLVarmaybeUsingRefinementsneedsCodeCoverageparentMaybeUsingRefinementspersistScopeFlagspersistScopeHeaderprepareFullBuildreceivesClosureArgreceivesKeywordArgsremoveClosuresetAccessesParentsLocalVariablessetByteNamesetCanCaptureCallersBindingsetCanReceiveBreakssetCanReceiveNonlocalReturnssetCoverageModesetFileNamesetHasBreakInstructionssetHasFlipFlopssetHasLoopssetHasNonLocalReturnssetIsMaybeUsingRefinementssetNeedsCodeCoveragesetNextLabelIndexsetReceivesClosureArgsetReceivesKeywordArgssetRuby2KeywordssetUsesEvalsetUsesSupersetUsesZSupertoStringtoStringCompileFormtoStringInstrsusesEvalusesSuperusesZSuper

Field Detail

argDescback to summary
protected ArgumentDescriptor[] argDesc
defNodeback to summary
private volatile LazyMethodDefinition<U, V, W, X, Y, Z> defNode
interpreterContextForJavaConstructorback to summary
private volatile ExitableInterpreterContext interpreterContextForJavaConstructor
isInstanceMethodback to summary
public final boolean isInstanceMethod

Constructor Detail

IRMethodback to summary
public IRMethod(IRManager manager, IRScope lexicalParent, LazyMethodDefinition<U, V, W, X, Y, Z> defn, ByteList name, boolean isInstanceMethod, int lineNumber, StaticScope staticScope, int coverageMode)

Method Detail

buildMethodImplback to summary
private synchronized void buildMethodImpl()
builtInterperterContextForJavaConstructorback to summary
public ExitableInterpreterContext builtInterperterContextForJavaConstructor()

Deprecated

This method was renamed (due a typo).

Annotations
@Deprecated
See Also
builtInterpreterContextForJavaConstructor()
builtInterpreterContextback to summary
public InterpreterContext builtInterpreterContext()

Overrides org.jruby.ir.IRScope.builtInterpreterContext.

Annotations
@Override
builtInterpreterContextForJavaConstructorback to summary
public ExitableInterpreterContext builtInterpreterContextForJavaConstructor()

initialize methods in reified Java types will try and dispatch to the Java base classes constructor when the Ruby in the initialize: a) The super call is still valid in terms of Java (e.g. you cannot access self/this before the super call b) We can detect the validity of 'a'. Limitations like super in all paths of branches is not supported (for now). In cases where no super exists or it is unsupported we will return a normal interpreter (and a warning when unsupported):

Returns:ExitableInterpreterContext

appropriate interpretercontext

builtInterpreterContextForJavaConstructorImplback to summary
private synchronized ExitableInterpreterContext builtInterpreterContextForJavaConstructorImpl()
findExistingLocalVariableback to summary
protected LocalVariable findExistingLocalVariable(RubySymbol name, int scopeDepth)

Overrides org.jruby.ir.IRScope.findExistingLocalVariable.

Annotations
@Override
getArgumentDescriptorsback to summary
public ArgumentDescriptor[] getArgumentDescriptors()
getLocalVariableback to summary
public LocalVariable getLocalVariable(RubySymbol name, int scopeDepth)

Overrides org.jruby.ir.IRScope.getLocalVariable.

Doc from org.jruby.ir.IRScope.getLocalVariable.

Find or create a local variable. By default, scopes are assumed to only check current depth. Blocks/Closures override this because they have special nesting rules.

Annotations
@Override
getMethodDataback to summary
public MethodData getMethodData()
getScopeTypeback to summary
public IRScopeType getScopeType()

Implements abstract org.jruby.ir.IRScope.getScopeType.

Annotations
@Override
hasBeenBuiltback to summary
public boolean hasBeenBuilt()

Overrides org.jruby.ir.IRScope.hasBeenBuilt.

Doc from org.jruby.ir.IRScope.hasBeenBuilt.

For lazy scopes which IRBuild on demand we can ask this method whether it has been built yet...

Annotations
@Override
lazilyAcquireInterpreterContextback to summary
public final InterpreterContext lazilyAcquireInterpreterContext()
prepareForCompilationback to summary
public BasicBlock[] prepareForCompilation()

Overrides org.jruby.ir.IRScope.prepareForCompilation.

Doc from org.jruby.ir.IRScope.prepareForCompilation.

Run any necessary passes to get the IR ready for compilation (AOT and/or JIT)

setArgumentDescriptorsback to summary
public void setArgumentDescriptors(ArgumentDescriptor[] argDesc)

Set upon completion of IRBuild of this IRMethod.