Package org.jruby.ir.operands
Class SymbolProc
java.lang.Object
org.jruby.ir.operands.Operand
org.jruby.ir.operands.ImmutableLiteral
org.jruby.ir.operands.SymbolProc
A literal representing proc'ified symbols, as in &:foo.
Used to cache a unique and constant proc at the use site to reduce allocation and improve caching.
-
Field Summary
Fields inherited from class org.jruby.ir.operands.Operand
EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCacheObject
(ThreadContext context) Implementing class is responsible for constructing the cached value.static SymbolProc
void
boolean
getId()
getName()
int
hashCode()
boolean
Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)toString()
void
Methods inherited from class org.jruby.ir.operands.ImmutableLiteral
addUsedVariables, cachedObject, canCopyPropagate, cloneForInlining, hasKnownValue, isCached, retrieve
Methods inherited from class org.jruby.ir.operands.Operand
getSimplifiedOperand, getValue, isFalseyImmediate
-
Constructor Details
-
SymbolProc
-
-
Method Details
-
getOperandType
- Specified by:
getOperandType
in classOperand
-
createCacheObject
Description copied from class:ImmutableLiteral
Implementing class is responsible for constructing the cached value.- Specified by:
createCacheObject
in classImmutableLiteral
-
hashCode
public int hashCode() -
equals
-
visit
-
getId
-
getName
-
encode
-
decode
-
toString
-
isTruthyImmediate
public boolean isTruthyImmediate()Description copied from class:Operand
Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)- Overrides:
isTruthyImmediate
in classOperand
- Returns:
-