Top Description Fields Constructors Methods
org.jruby.ir.operands

public Class Scope

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

Reference a StaticScope/IRScope. This could be used wherever we know a staticscope will be used but we initially favor CurrentScope as it is a single instance and it reduces an object allocation for every scope in the system.

Note

we store IRScope because JIT can easily store IRScopes vs making new JIT infrastructure for StaticScope (and from a scoping standpoint these two types are 1:1). However, once we inline we are migrating things referencing a currentscope which no longer exists. In this case, we need replace CurrentScope with a Scope.

Field Summary

Modifier and TypeField and Description
private final IRScope
Inherited from org.jruby.ir.operands.Operand:
EMPTY_ARRAY

Constructor Summary

AccessConstructor and Description
public
Scope(IRScope scope)

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 Operand
public OperandType
public IRScope
public Object
public void
Inherited from org.jruby.ir.operands.Operand:
canCopyPropagateencodegetSimplifiedOperandgetValuehasKnownValueisFalseyImmediateisTruthyImmediate

Field Detail

scopeback to summary
private final IRScope scope

Constructor Detail

Scopeback to summary
public Scope(IRScope scope)

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

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

Annotations
@Override
getOperandTypeback to summary
public OperandType getOperandType()

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

Annotations
@Override
getScopeback to summary
public IRScope getScope()
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
visitback to summary
public void visit(IRVisitor visitor)

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

Annotations
@Override