public abstract class ImmutableLiteral extends Operand
EMPTY_ARRAY
Constructor and Description |
---|
ImmutableLiteral(OperandType type) |
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(CloneInfo 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,
StaticScope currScope,
DynamicScope currDynScope,
Object[] temp)
retrieve the live value represented by this immutable literal.
|
encode, getOperandType, getSimplifiedOperand, getValue, visit
public ImmutableLiteral(OperandType type)
public boolean hasKnownValue()
Operand
hasKnownValue
in class Operand
public boolean canCopyPropagate()
Operand
canCopyPropagate
in class Operand
public void addUsedVariables(List<Variable> l)
Operand
addUsedVariables
in class Operand
public Operand cloneForInlining(CloneInfo ii)
cloneForInlining
in class Operand
public abstract Object createCacheObject(ThreadContext context)
public Object cachedObject(ThreadContext context)
public boolean isCached()
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
Copyright © 2001-2015 JRuby. All Rights Reserved.