Top Fields Constructors Methods
org.jruby.ir.operands

public Class WrappedIRClosure

extends Operand
Class Inheritance
Imports
org.jruby.ir.IRClosure, .IRVisitor, org.jruby.ir.instructions.CopyInstr, org.jruby.ir.persistence.IRReaderDecoder, .IRWriterEncoder, org.jruby.ir.transformations.inlining.CloneInfo, .SimpleCloneInfo, org.jruby.parser.StaticScope, org.jruby.runtime.*, org.jruby.runtime.builtin.IRubyObject, java.util.List, .Map

Field Summary

Modifier and TypeField and Description
private final IRClosure
private final Variable
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 -- force every operand to implement this because a missing implementation can cause bad failures.

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 Operand
public static WrappedIRClosure
public void
public IRClosure
public OperandType
public Variable
public Operand
public Object
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from org.jruby.ir.operands.Operand:
getValuehasKnownValueisFalseyImmediateisTruthyImmediate

Field Detail

closureback to summary
private final IRClosure closure
selfback to summary
private final Variable self

Constructor Detail

WrappedIRClosureback to summary
public WrappedIRClosure(Variable self, IRClosure closure)

Method Detail

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

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

Doc from org.jruby.ir.operands.Operand.addUsedVariables.

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.

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
cloneForInliningback to summary
public Operand cloneForInlining(CloneInfo info)

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

Annotations
@Override
decodeback to summary
public static WrappedIRClosure decode(IRReaderDecoder d)
encodeback to summary
public void encode(IRWriterEncoder e)

Overrides org.jruby.ir.operands.Operand.encode.

Annotations
@Override
getClosureback to summary
public IRClosure getClosure()
getOperandTypeback to summary
public OperandType getOperandType()

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

Annotations
@Override
getSelfback to summary
public Variable getSelf()
getSimplifiedOperandback to summary
public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force)

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

Annotations
@Override
retrieveback to summary
public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp)

Overrides org.jruby.ir.operands.Operand.retrieve.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
visitback to summary
public void visit(IRVisitor visitor)

Overrides org.jruby.ir.operands.Operand.visit.

Annotations
@Override