Package org.jruby.ir.operands
Class MutableString
java.lang.Object
org.jruby.ir.operands.Operand
org.jruby.ir.operands.MutableString
- All Implemented Interfaces:
Stringable
,StringLiteral
- Direct Known Subclasses:
ChilledString
Represents a literal string value.
This is not an immutable literal because I can gsub!,
for example, and modify the contents of the string.
This is not like a Java string.
-
Field Summary
FieldsFields inherited from class org.jruby.ir.operands.Operand
EMPTY_ARRAY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MutableString
(FrozenString frozenString) MutableString
(RubySymbol symbol) MutableString
(ByteList val, int coderange, String file, int line) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Append the list of variables used in this operand to the input list -- force every operand to implement this because a missing implementation can cause bad failures.static MutableString
void
boolean
int
int
hashCode()
boolean
Do we know the value of this operand at compile-time? If we do then it may be possible to constant propagate (one case: We also know it is also an ImmutableLiteral).retrieve
(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) toString()
void
Methods inherited from class org.jruby.ir.operands.Operand
canCopyPropagate, getSimplifiedOperand, getValue, isFalseyImmediate, isTruthyImmediate
-
Field Details
-
EMPTY_STRING
-
frozenString
-
-
Constructor Details
-
MutableString
-
MutableString
-
MutableString
-
MutableString
-
-
Method Details
-
getOperandType
- Specified by:
getOperandType
in classOperand
-
hasKnownValue
public boolean hasKnownValue()Description copied from class:Operand
Do we know the value of this operand at compile-time? If we do then it may be possible to constant propagate (one case: We also know it is also an ImmutableLiteral).- Overrides:
hasKnownValue
in classOperand
- Returns:
- true if a known compile-time value.
-
addUsedVariables
Description copied from class:Operand
Append the list of variables used in this operand to the input list -- force every operand to implement this because a missing implementation can cause bad failures.- Specified by:
addUsedVariables
in classOperand
-
hashCode
public int hashCode() -
equals
-
toString
-
cloneForInlining
- Specified by:
cloneForInlining
in classOperand
-
retrieve
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) -
visit
-
getByteList
- Specified by:
getByteList
in interfaceStringLiteral
-
getString
- Specified by:
getString
in interfaceStringable
-
encode
-
decode
-
getCodeRange
public int getCodeRange()- Specified by:
getCodeRange
in interfaceStringLiteral
-