Package org.jruby.ir.operands
Class Symbol
java.lang.Object
org.jruby.ir.operands.Operand
org.jruby.ir.operands.ImmutableLiteral
org.jruby.ir.operands.Symbol
- All Implemented Interfaces:
Stringable
-
Field Summary
FieldsFields inherited from class org.jruby.ir.operands.Operand
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCan we replace every use of a variable 'v' that contains the value of this operand with the operand itself? This takes importance when there are at least two uses of 'v' within this scope.createCacheObject(ThreadContext context) Implementing class is responsible for constructing the cached value.static SymbolvoidbooleangetBytes()org.jcodings.EncodinginthashCode()booleanReturns true if this is an immediate value that will always be considered truthy (true, numbers, etc)toString()voidMethods inherited from class org.jruby.ir.operands.ImmutableLiteral
addUsedVariables, cachedObject, cloneForInlining, hasKnownValue, isCached, retrieveMethods inherited from class org.jruby.ir.operands.Operand
getSimplifiedOperand, getValue, isFalseyImmediate
-
Field Details
-
KW_REST_ARG_DUMMY
-
-
Constructor Details
-
Symbol
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getOperandType
- Specified by:
getOperandTypein classOperand
-
getBytes
-
getSymbol
-
getString
- Specified by:
getStringin interfaceStringable
-
createCacheObject
Description copied from class:ImmutableLiteralImplementing class is responsible for constructing the cached value.- Specified by:
createCacheObjectin classImmutableLiteral
-
canCopyPropagate
public boolean canCopyPropagate()Description copied from class:OperandCan we replace every use of a variable 'v' that contains the value of this operand with the operand itself? This takes importance when there are at least two uses of 'v' within this scope. Ex: v = [1,2,3]; x = v; y = v In this case, we cannot replace the occurrences of 'v' because we would then get x = [1,2,3]; y = [1,2,3] which would then result in two different array objects being constructed instead of a single one.- Overrides:
canCopyPropagatein classImmutableLiteral- Returns:
- true if it is safe to copy-propagate the operand.
-
getEncoding
public org.jcodings.Encoding getEncoding() -
toString
-
encode
-
decode
-
visit
-
isTruthyImmediate
public boolean isTruthyImmediate()Description copied from class:OperandReturns true if this is an immediate value that will always be considered truthy (true, numbers, etc)- Overrides:
isTruthyImmediatein classOperand- Returns:
-