Top Fields Constructors Methods
org.jruby.ir.operands

public abstract Class Variable

extends Operand
Class Inheritance
Known Direct Subclasses
org.jruby.ir.operands.LocalVariable, org.jruby.ir.operands.Self, org.jruby.ir.operands.TemporaryVariable
Imports
org.jruby.ir.transformations.inlining.CloneInfo, .SimpleCloneInfo, java.util.List, .Map

Field Summary

Inherited from org.jruby.ir.operands.Operand:
EMPTY_ARRAY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addUsedVariables(List<Variable> l)

Implements abstract org.jruby.ir.operands.Operand.addUsedVariables.

Append the list of variables used in this operand to the input list

public boolean
canCopyPropagate()

Overrides org.jruby.ir.operands.Operand.canCopyPropagate.

Can we replace every use of a variable 'v' that contains the value of this operand with the operand itself?

public abstract Variable
public Operand
public abstract String
public Operand
public Operand
public boolean
Inherited from org.jruby.ir.operands.Operand:
encodegetOperandTypehasKnownValueisFalseyImmediateisTruthyImmediateretrievevisit

Constructor Detail

Variableback to summary
public Variable()

Method Detail

addUsedVariablesback to summary
public void addUsedVariables(List<Variable> l)

Implements abstract org.jruby.ir.operands.Operand.addUsedVariables.

Append the list of variables used in this operand to the input list

Annotations
@Override
canCopyPropagateback to summary
public boolean canCopyPropagate()

Overrides org.jruby.ir.operands.Operand.canCopyPropagate.

Doc from org.jruby.ir.operands.Operand.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. Ex: v = [1,2,3]; x = v; y = v In this case, we cannot replace the occurrences of 'v' because we would then get x = [1,2,3]; y = [1,2,3] which would then result in two different array objects being constructed instead of a single one.

Returns:boolean

true if it is safe to copy-propagate the operand.

Annotations
@Override
cloneback to summary
public abstract Variable clone(SimpleCloneInfo ii)
cloneForInliningback to summary
public Operand cloneForInlining(CloneInfo ii)

Implements abstract org.jruby.ir.operands.Operand.cloneForInlining.

Annotations
@Override
getIdback to summary
public abstract String getId()
getSimplifiedOperandback to summary
public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force)

Overrides org.jruby.ir.operands.Operand.getSimplifiedOperand.

Annotations
@Override
getValueback to summary
public Operand getValue(Map<Operand, Operand> valueMap)

Overrides org.jruby.ir.operands.Operand.getValue.

Annotations
@Override
isSelfback to summary
public boolean isSelf()