public abstract class ImmutableLiteral<T> extends Operand
EMPTY_ARRAY| Constructor and Description |
|---|
ImmutableLiteral() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUsedVariables(java.util.List<Variable> l)
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.
|
T |
cachedObject(ThreadContext context)
Returns the cached object.
|
boolean |
canCopyPropagate()
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.
|
Operand |
cloneForInlining(CloneInfo ii) |
abstract T |
createCacheObject(ThreadContext context)
Implementing class is responsible for constructing the cached value.
|
boolean |
hasKnownValue()
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).
|
boolean |
isCached()
Has this object already been cached?
|
T |
retrieve(ThreadContext context,
IRubyObject self,
StaticScope currScope,
DynamicScope currDynScope,
java.lang.Object[] temp)
retrieve the live value represented by this immutable literal.
|
encode, getOperandType, getSimplifiedOperand, getValue, isFalseyImmediate, isTruthyImmediate, visitpublic boolean hasKnownValue()
OperandhasKnownValue in class Operandpublic boolean canCopyPropagate()
OperandcanCopyPropagate in class Operandpublic void addUsedVariables(java.util.List<Variable> l)
OperandaddUsedVariables in class Operandpublic Operand cloneForInlining(CloneInfo ii)
cloneForInlining in class Operandpublic abstract T createCacheObject(ThreadContext context)
public T cachedObject(ThreadContext context)
public boolean isCached()
public T retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, java.lang.Object[] temp)
Copyright © 2001-2020 JRuby. All Rights Reserved.