Package com.ibm.wala.cast.ir.ssa
Class AbstractSSAConversion
- java.lang.Object
-
- com.ibm.wala.cast.ir.ssa.AbstractSSAConversion
-
- Direct Known Subclasses:
SSAConversion
public abstract class AbstractSSAConversion extends Object
Abstract core of traditional SSA conversion (Cytron et al.). This implementation is abstract in the sense that it is designed to work over the instructions and CFG of a Domo IR, but it is abstract with respect to several integral portions of the traditional algorithm:- The notion of uses and defs of a given instruction.
- Assignments (
:=
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
C
protected SSACFG
CFG
protected SSAOptions.DefaultValues
defaultValues
protected DominanceFrontiers<ISSABasicBlock>
DF
protected SSAInstruction[]
instructions
protected int[]
phiCounts
protected IntStack[]
S
protected SymbolTable
symbolTable
protected int[]
valueMap
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSSAConversion(IR ir, SSAOptions options)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
fail(int v)
protected abstract int
getDef(SSAInstruction inst, int index)
protected int
getDefaultValue(int valueNumber)
protected SSAInstruction[]
getInstructions(IR ir)
protected abstract int
getMaxValueNumber()
protected abstract int
getNextNewValueNumber()
protected abstract int
getNumberOfDefs(SSAInstruction inst)
protected abstract int
getNumberOfUses(SSAInstruction inst)
protected abstract SSAPhiInstruction
getPhi(SSACFG.BasicBlock B, int index)
protected abstract int
getUse(SSAInstruction inst, int index)
protected boolean
hasDefaultValue(int valueNumber)
protected void
init()
protected abstract void
initializeVariables()
protected abstract boolean
isAssignInstruction(SSAInstruction inst)
protected abstract boolean
isConstant(int valueNumber)
protected abstract boolean
isLive(SSACFG.BasicBlock Y, int V)
protected Iterator<SSAInstruction>
iterateInstructions(IR ir)
protected void
perform()
protected abstract void
placeNewPhiAt(int value, SSACFG.BasicBlock Y)
protected void
placePhiNodes()
protected abstract void
popAssignment(SSAInstruction inst, int index)
protected abstract void
pushAssignment(SSAInstruction inst, int index, int newRhs)
protected abstract void
repairExit()
protected abstract void
repairInstructionDefs(SSAInstruction inst, int index, int[] newDefs, int[] newUses)
protected abstract void
repairInstructionUses(SSAInstruction inst, int index, int[] newUses)
protected abstract SSAPhiInstruction
repairPhiDefs(SSAPhiInstruction phi, int[] newDefs)
protected abstract void
repairPhiUse(SSACFG.BasicBlock BB, int phiIndex, int rvalIndex, int newRval)
protected abstract void
setPhi(SSACFG.BasicBlock B, int index, SSAPhiInstruction inst)
protected abstract boolean
skip(int vn)
protected boolean
skipRepair(SSAInstruction inst, int index)
protected int
top(int v)
-
-
-
Field Detail
-
CFG
protected final SSACFG CFG
-
DF
protected final DominanceFrontiers<ISSABasicBlock> DF
-
phiCounts
protected final int[] phiCounts
-
instructions
protected final SSAInstruction[] instructions
-
symbolTable
protected final SymbolTable symbolTable
-
defaultValues
protected final SSAOptions.DefaultValues defaultValues
-
S
protected IntStack[] S
-
C
protected int[] C
-
valueMap
protected int[] valueMap
-
-
Constructor Detail
-
AbstractSSAConversion
protected AbstractSSAConversion(IR ir, SSAOptions options)
-
-
Method Detail
-
getNumberOfDefs
protected abstract int getNumberOfDefs(SSAInstruction inst)
-
getDef
protected abstract int getDef(SSAInstruction inst, int index)
-
getNumberOfUses
protected abstract int getNumberOfUses(SSAInstruction inst)
-
getUse
protected abstract int getUse(SSAInstruction inst, int index)
-
isAssignInstruction
protected abstract boolean isAssignInstruction(SSAInstruction inst)
-
getMaxValueNumber
protected abstract int getMaxValueNumber()
-
isLive
protected abstract boolean isLive(SSACFG.BasicBlock Y, int V)
-
skip
protected abstract boolean skip(int vn)
-
isConstant
protected abstract boolean isConstant(int valueNumber)
-
getNextNewValueNumber
protected abstract int getNextNewValueNumber()
-
initializeVariables
protected abstract void initializeVariables()
-
repairExit
protected abstract void repairExit()
-
placeNewPhiAt
protected abstract void placeNewPhiAt(int value, SSACFG.BasicBlock Y)
-
getPhi
protected abstract SSAPhiInstruction getPhi(SSACFG.BasicBlock B, int index)
-
setPhi
protected abstract void setPhi(SSACFG.BasicBlock B, int index, SSAPhiInstruction inst)
-
repairPhiDefs
protected abstract SSAPhiInstruction repairPhiDefs(SSAPhiInstruction phi, int[] newDefs)
-
repairPhiUse
protected abstract void repairPhiUse(SSACFG.BasicBlock BB, int phiIndex, int rvalIndex, int newRval)
-
repairInstructionUses
protected abstract void repairInstructionUses(SSAInstruction inst, int index, int[] newUses)
-
repairInstructionDefs
protected abstract void repairInstructionDefs(SSAInstruction inst, int index, int[] newDefs, int[] newUses)
-
pushAssignment
protected abstract void pushAssignment(SSAInstruction inst, int index, int newRhs)
-
popAssignment
protected abstract void popAssignment(SSAInstruction inst, int index)
-
perform
protected void perform()
-
getInstructions
protected SSAInstruction[] getInstructions(IR ir)
-
iterateInstructions
protected final Iterator<SSAInstruction> iterateInstructions(IR ir)
-
init
protected void init()
-
placePhiNodes
protected void placePhiNodes()
-
skipRepair
protected boolean skipRepair(SSAInstruction inst, int index)
-
fail
protected void fail(int v)
-
hasDefaultValue
protected boolean hasDefaultValue(int valueNumber)
-
getDefaultValue
protected int getDefaultValue(int valueNumber)
-
top
protected int top(int v)
-
-