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 TypeMethodDescriptionboolean
Can 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 Symbol
void
boolean
getBytes()
org.jcodings.Encoding
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, cloneForInlining, hasKnownValue, isCached, retrieve
Methods 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:
getOperandType
in classOperand
-
getBytes
-
getSymbol
-
getString
- Specified by:
getString
in interfaceStringable
-
createCacheObject
Description copied from class:ImmutableLiteral
Implementing class is responsible for constructing the cached value.- Specified by:
createCacheObject
in classImmutableLiteral
-
canCopyPropagate
public boolean canCopyPropagate()Description copied from class:Operand
Can 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:
canCopyPropagate
in 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:Operand
Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)- Overrides:
isTruthyImmediate
in classOperand
- Returns:
-