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
ConstructorsModifierConstructorDescriptionprotected
Used by cloning code for inliningprotected
IRClosure
(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) protected
IRClosure
(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) protected
IRClosure
(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 IRClosure
cloneForInlining
(CloneInfo ii, IRClosure clone) convertToMethod
(ByteList name) protected LocalVariable
findExistingLocalVariable
(RubySymbol name, int scopeDepth) getLocalVariable
(RubySymbol name, int depth) Find or create a local variable.getNewLocalVariable
(RubySymbol name, int depth) int
boolean
isEND()
boolean
boolean
boolean
void
void
setArgumentDescriptors
(ArgumentDescriptor[] argDesc) Set upon completion of IRBuild of this IRClosure.void
setIsEND()
void
setSignature
(Signature signature) void
Methods 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:IRScope
Make version specific to scope which needs it (e.g. Closure vs non-closure).- Overrides:
allocateInterpreterContext
in classIRScope
-
allocateInterpreterContext
public InterpreterContext allocateInterpreterContext(Supplier<List<Instr>> instructions, int temporaryVariableCount, EnumSet<IRFlags> flags) Description copied from class:IRScope
Make version specific to scope which needs it (e.g. Closure vs non-closure).- Overrides:
allocateInterpreterContext
in classIRScope
-
setIsEND
public void setIsEND() -
isEND
public boolean isEND() -
isWhereFlipFlopStateVariableIs
public boolean isWhereFlipFlopStateVariableIs()- Overrides:
isWhereFlipFlopStateVariableIs
in classIRScope
-
getNextClosureId
public int getNextClosureId()- Overrides:
getNextClosureId
in classIRScope
-
getNewLabel
- Overrides:
getNewLabel
in classIRScope
-
getScopeType
- Specified by:
getScopeType
in classIRScope
-
isTopLocalVariableScope
public boolean isTopLocalVariableScope()- Overrides:
isTopLocalVariableScope
in classIRScope
-
toStringBody
-
getBlockBody
-
isNestedClosuresSafeForMethodConversion
public boolean isNestedClosuresSafeForMethodConversion() -
convertToMethod
-
setSignature
-
setSource
-
findExistingLocalVariable
- Overrides:
findExistingLocalVariable
in classIRScope
-
getNewLocalVariable
- Overrides:
getNewLocalVariable
in classIRScope
-
getLocalVariable
Description copied from class:IRScope
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.- Overrides:
getLocalVariable
in classIRScope
-
cloneForInlining
-
cloneForInlining
-
getSignature
-
getArgumentDescriptors
-
setArgumentDescriptors
Set upon completion of IRBuild of this IRClosure. -
persistScopeHeader
- Overrides:
persistScopeHeader
in classIRScope
-