public abstract class ImmutableLiteral extends Operand
EMPTY_ARRAY| Constructor and Description |
|---|
ImmutableLiteral() |
| Modifier and Type | Method and Description |
|---|---|
void |
addUsedVariables(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.
|
Object |
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(InlinerInfo ii) |
abstract Object |
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?
|
Object |
retrieve(ThreadContext context,
IRubyObject self,
DynamicScope currDynScope,
Object[] temp)
retrieve the live value represented by this immutable literal.
|
fetchCompileTimeArrayElement, getSimplifiedOperand, getValue, visitpublic boolean hasKnownValue()
OperandhasKnownValue in class Operandpublic boolean canCopyPropagate()
OperandcanCopyPropagate in class Operandpublic void addUsedVariables(List<Variable> l)
OperandaddUsedVariables in class Operandpublic Operand cloneForInlining(InlinerInfo ii)
cloneForInlining in class Operandpublic abstract Object createCacheObject(ThreadContext context)
public Object cachedObject(ThreadContext context)
public boolean isCached()
public Object retrieve(ThreadContext context, IRubyObject self, DynamicScope currDynScope, Object[] temp)
Copyright © 2001–2024 JRuby. All rights reserved.