Top Fields Constructors Methods
org.jruby.ir.dataflow.analyses

public Class LiveVariablesProblem

extends DataFlowProblem<LiveVariablesProblem, LiveVariableNode>
Class Inheritance
Imports
org.jruby.ir.dataflow.DataFlowProblem, org.jruby.ir.interpreter.FullInterpreterContext, org.jruby.ir.operands.LocalVariable, .Variable, org.jruby.ir.representations.BasicBlock, java.util.*

Field Summary

Modifier and TypeField and Description
private final HashMap<Variable, Integer>
private final HashSet<LocalVariable>
public static final String
private final HashMap<Integer, Variable>
private final Collection<LocalVariable>
Inherited from org.jruby.ir.dataflow.DataFlowProblem:
directionficflowGraphNodes

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public LiveVariableNode
public boolean
public Set<Variable>
public String
public Integer
public Collection<LocalVariable>
getLocalVarsLiveOnScopeEntry()

Get variables that are live on entry to the cfg.

public String
public Set<LocalVariable>
public Variable
getVariable(int id)

public Collection<LocalVariable>
public void
public void
Inherited from org.jruby.ir.dataflow.DataFlowProblem:
addDataFlowVarcompute_MOP_SolutiongenerateWorkListgetDFVarsCountgetEntryNodegetExitNodegetFICgetFlowDirectiongetFlowGraphNodeisEmptysetuptoString

Field Detail

dfVarMapback to summary
private final HashMap<Variable, Integer> dfVarMap
localVarsback to summary
private final HashSet<LocalVariable> localVars
NAMEback to summary
public static final String NAME
varDfVarMapback to summary
private final HashMap<Integer, Variable> varDfVarMap
varsLiveOnScopeExitback to summary
private final Collection<LocalVariable> varsLiveOnScopeExit

Constructor Detail

LiveVariablesProblemback to summary
public LiveVariablesProblem(FullInterpreterContext fic)

Method Detail

addDFVarback to summary
public void addDFVar(Variable v)
buildFlowGraphNodeback to summary
public LiveVariableNode buildFlowGraphNode(BasicBlock bb)

Implements abstract org.jruby.ir.dataflow.DataFlowProblem.buildFlowGraphNode.

Annotations
@Override
dfVarExistsback to summary
public boolean dfVarExists(Variable v)
getAllVarsback to summary
public Set<Variable> getAllVars()
getDataFlowVarsForOutputback to summary
public String getDataFlowVarsForOutput()

Overrides org.jruby.ir.dataflow.DataFlowProblem.getDataFlowVarsForOutput.

Annotations
@Override
getDFVarback to summary
public Integer getDFVar(Variable v)
getLocalVarsLiveOnScopeEntryback to summary
public Collection<LocalVariable> getLocalVarsLiveOnScopeEntry()

Get variables that are live on entry to the cfg. This is the case for closures which access variables from the parent scope. sum = 0; a.each { |i| sum += i }; return sum In the code snippet above, 'sum' is live on entry to the closure

getNameback to summary
public String getName()

Implements abstract org.jruby.ir.dataflow.DataFlowProblem.getName.

Annotations
@Override
getNonSelfLocalVarsback to summary
public Set<LocalVariable> getNonSelfLocalVars()
getVariableback to summary
public Variable getVariable(int id)
getVarsLiveOnScopeExitback to summary
public Collection<LocalVariable> getVarsLiveOnScopeExit()
markDeadInstructionsback to summary
public void markDeadInstructions()
setVarsLiveOnScopeExitback to summary
public void setVarsLiveOnScopeExit(Collection<LocalVariable> vars)