Package org.jruby.ir
Class IRClosure
java.lang.Object
org.jruby.ir.IRScope
org.jruby.ir.IRClosure
- All Implemented Interfaces:
ParseResult
- Direct Known Subclasses:
IREvalScript,IRFor
-
Field Summary
FieldsFields inherited from class org.jruby.ir.IRScope
compilable, fullInterpreterContext, interpreterContext, LOG, nextClosureIndex, optimizedInterpreterContext -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUsed by cloning code for inliningprotectedIRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, int closureId, ByteList fullName) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, int coverageMode) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, int coverageMode) IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, int coverageMode) protectedIRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) protectedIRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix, int coverageMode) -
Method Summary
Modifier and TypeMethodDescriptionallocateInterpreterContext(Supplier<List<Instr>> instructions, int temporaryVariableCount, EnumSet<IRFlags> flags) Make version specific to scope which needs it (e.g.allocateInterpreterContext(List<Instr> instructions, int temporaryVariableCount, EnumSet<IRFlags> flags) Make version specific to scope which needs it (e.g.protected IRClosurecloneForInlining(CloneInfo ii, IRClosure clone) convertToMethod(ByteList name) protected LocalVariablefindExistingLocalVariable(RubySymbol name, int scopeDepth) getLocalVariable(RubySymbol name, int depth) Find or create a local variable.getNewLocalVariable(RubySymbol name, int depth) intbooleanisEND()booleanbooleanbooleanvoidvoidsetArgumentDescriptors(ArgumentDescriptor[] argDesc) Set upon completion of IRBuild of this IRClosure.voidsetIsEND()voidsetSignature(Signature signature) voidMethods inherited from class org.jruby.ir.IRScope
accessesParentsLocalVariables, addChildScope, addClosure, allocateInitialFlags, anyUsesEval, buildJVMExceptionTable, builtInterpreterContext, canCaptureCallersBinding, canReceiveBreaks, canReceiveNonlocalReturns, captureParentRefinements, cleanupAfterExecution, correctVariableDepthForForLoopsForEncoding, debugOutput, depends, dumpToIGV, equals, executesOnce, getAST, getByteName, getClosures, getCoverageMode, getDynamicScope, getEncoding, getExecutedPasses, getExecutionContext, getFile, getFileName, getFullInterpreterContext, getFullyQualifiedName, getId, getInterpreterContext, getLexicalParent, getLexicalScopes, getLine, getLineNumber, getLocalVariables, getManager, getName, getNearestMethod, getNearestModuleReferencingScopeDepth, getNearestNonClosurelikeScope, getNearestTopLocalVariableScope, getNewLabel, getNextLabelIndex, getOptimizedInterpreterContext, getRootLexicalScope, getScopeId, getSelf, getStaticScope, hasBeenBuilt, hasBreakInstructions, hasFlipFlops, hashCode, hasLoops, hasNonLocalReturns, inlineMethod, inlineMethodCompiled, inlineMethodJIT, inliningAllowed, isModuleBody, isNestedInClosure, isNonSingletonClassBody, isRuby2Keywords, isScopeContainedBy, isScriptScope, isWithinEND, lookupExistingLVar, maybeUsingRefinements, needsCodeCoverage, parentMaybeUsingRefinements, persistScopeFlags, prepareForCompilation, prepareFullBuild, receivesClosureArg, receivesKeywordArgs, removeClosure, setAccessesParentsLocalVariables, setByteName, setCanCaptureCallersBinding, setCanReceiveBreaks, setCanReceiveNonlocalReturns, setCoverageMode, setFileName, setHasBreakInstructions, setHasFlipFlops, setHasLoops, setHasNonLocalReturns, setIsMaybeUsingRefinements, setNeedsCodeCoverage, setNextLabelIndex, setReceivesClosureArg, setReceivesKeywordArgs, setRuby2Keywords, setUsesEval, setUsesSuper, setUsesZSuper, toString, toStringCompileForm, toStringInstrs, usesEval, usesSuper, usesZSuper
-
Field Details
-
closureId
public final int closureId -
argDesc
-
-
Constructor Details
-
IRClosure
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix, int coverageMode) -
IRClosure
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) -
IRClosure
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, int closureId, ByteList fullName) -
IRClosure
Used by cloning code for inlining -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature) -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, int coverageMode) -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, int coverageMode) -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix) -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock) -
IRClosure
public IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, Signature signature, ByteList prefix, boolean isBeginEndBlock, int coverageMode)
-
-
Method Details
-
allocateInterpreterContext
public InterpreterContext allocateInterpreterContext(List<Instr> instructions, int temporaryVariableCount, EnumSet<IRFlags> flags) Description copied from class:IRScopeMake version specific to scope which needs it (e.g. Closure vs non-closure).- Overrides:
allocateInterpreterContextin classIRScope
-
allocateInterpreterContext
public InterpreterContext allocateInterpreterContext(Supplier<List<Instr>> instructions, int temporaryVariableCount, EnumSet<IRFlags> flags) Description copied from class:IRScopeMake version specific to scope which needs it (e.g. Closure vs non-closure).- Overrides:
allocateInterpreterContextin classIRScope
-
setIsEND
public void setIsEND() -
isEND
public boolean isEND() -
isWhereFlipFlopStateVariableIs
public boolean isWhereFlipFlopStateVariableIs()- Overrides:
isWhereFlipFlopStateVariableIsin classIRScope
-
getNextClosureId
public int getNextClosureId()- Overrides:
getNextClosureIdin classIRScope
-
getNewLabel
- Overrides:
getNewLabelin classIRScope
-
getScopeType
- Specified by:
getScopeTypein classIRScope
-
isTopLocalVariableScope
public boolean isTopLocalVariableScope()- Overrides:
isTopLocalVariableScopein classIRScope
-
toStringBody
-
getBlockBody
-
isNestedClosuresSafeForMethodConversion
public boolean isNestedClosuresSafeForMethodConversion() -
convertToMethod
-
setSignature
-
setSource
-
findExistingLocalVariable
- Overrides:
findExistingLocalVariablein classIRScope
-
getNewLocalVariable
- Overrides:
getNewLocalVariablein classIRScope
-
getLocalVariable
Description copied from class:IRScopeFind 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.- Overrides:
getLocalVariablein classIRScope
-
cloneForInlining
-
cloneForInlining
-
getSignature
-
getArgumentDescriptors
-
setArgumentDescriptors
Set upon completion of IRBuild of this IRClosure. -
persistScopeHeader
- Overrides:
persistScopeHeaderin classIRScope
-