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
ConstructorsModifierConstructorDescriptionprotectedMutableString(FrozenString frozenString) MutableString(RubySymbol symbol) MutableString(ByteList val, int coderange, String file, int line) -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend 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 MutableStringvoidbooleanintinthashCode()booleanDo 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()voidMethods 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:
getOperandTypein classOperand
-
hasKnownValue
public boolean hasKnownValue()Description copied from class:OperandDo 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:
hasKnownValuein classOperand- Returns:
- true if a known compile-time value.
-
addUsedVariables
Description copied from class:OperandAppend 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:
addUsedVariablesin classOperand
-
hashCode
public int hashCode() -
equals
-
toString
-
cloneForInlining
- Specified by:
cloneForInliningin classOperand
-
retrieve
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) -
visit
-
getByteList
- Specified by:
getByteListin interfaceStringLiteral
-
getString
- Specified by:
getStringin interfaceStringable
-
encode
-
decode
-
getCodeRange
public int getCodeRange()- Specified by:
getCodeRangein interfaceStringLiteral
-