Top Fields Constructors Methods
org.jruby.ir.operands

public Class CurrentScope

extends Operand
Class Inheritance
Imports
java.util.List, org.jruby.ir.persistence.IRReaderDecoder, .IRWriterEncoder, org.jruby.ir.transformations.inlining.CloneInfo, .InlineCloneInfo, org.jruby.parser.StaticScope, org.jruby.ir.IRVisitor, org.jruby.runtime.DynamicScope, .ThreadContext, org.jruby.runtime.builtin.IRubyObject

Field Summary

Modifier and TypeField and Description
public static final CurrentScope
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 CurrentScope
public void
public OperandType
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:
getSimplifiedOperandgetValuehasKnownValueisFalseyImmediateisTruthyImmediate

Field Detail

INSTANCEback to summary
public static final CurrentScope INSTANCE

Constructor Detail

CurrentScopeback to summary
public CurrentScope()

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 ii)

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

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

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

Annotations
@Override
getOperandTypeback to summary
public OperandType getOperandType()

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

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