Top Fields Constructors Methods
org.jruby.ir.operands

public abstract Class Operand

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.ir.operands.Reference, org.jruby.ir.operands.Scope, org.jruby.ir.operands.ScopeModule, org.jruby.ir.operands.StandardError, org.jruby.ir.operands.SValue, org.jruby.ir.operands.UndefinedValue, org.jruby.ir.operands.Variable, org.jruby.ir.operands.WrappedIRClosure, org.jruby.ir.operands.Splat, org.jruby.ir.operands.Array, org.jruby.ir.operands.BuiltinClass, org.jruby.ir.operands.CurrentScope, org.jruby.ir.operands.DynamicSymbol, org.jruby.ir.operands.Filename, org.jruby.ir.operands.Hash, org.jruby.ir.operands.ImmutableLiteral, org.jruby.ir.operands.IRException, org.jruby.ir.operands.Label, org.jruby.ir.operands.MutableString
Imports
org.jruby.ir.IRVisitor, .Interp, org.jruby.ir.persistence.IRWriterEncoder, org.jruby.ir.transformations.inlining.CloneInfo, org.jruby.parser.StaticScope, org.jruby.runtime.DynamicScope, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, java.util.List, .Map

Field Summary

Modifier and TypeField and Description
public static final Operand[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract 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.

public boolean

Returns:

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

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

public abstract Operand
public void
public abstract OperandType
public Operand
getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force)

public Operand
public boolean

Returns:

true if a known compile-time value.
hasKnownValue
()

Do we know the value of this operand at compile-time?

public boolean
public boolean
isTruthyImmediate()

Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)

public Object
retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)

public void
visit(IRVisitor visitor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_ARRAYback to summary
public static final Operand[] EMPTY_ARRAY

Constructor Detail

Operandback to summary
public Operand()

Method Detail

addUsedVariablesback to summary
public abstract 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.

canCopyPropagateback to summary
public 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. 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.

cloneForInliningback to summary
public abstract Operand cloneForInlining(CloneInfo ii)
encodeback to summary
public void encode(IRWriterEncoder e)
getOperandTypeback to summary
public abstract OperandType getOperandType()
getSimplifiedOperandback to summary
public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force)
getValueback to summary
public Operand getValue(Map<Operand, Operand> valueMap)
hasKnownValueback to summary
public 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).

Returns:boolean

true if a known compile-time value.

isFalseyImmediateback to summary
public boolean isFalseyImmediate()
isTruthyImmediateback to summary
public boolean isTruthyImmediate()

Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)

retrieveback to summary
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)
Annotations
@Interp
visitback to summary
public void visit(IRVisitor visitor)