| Modifier and Type | Field and Description |
|---|---|
| private ArrayList | branchWorklist
Worklist of potential branches to convert to gotos |
| private ArrayList | cfgPhiWorklist
Worklist of executed basic blocks with phis to be processed |
| private ArrayList | cfgWorklist
Worklist of basic blocks to be processed |
| private static final int | |
| private BitSet | executableBlocks
Bitset containing bits for each block that has been found executable |
| private Constant[] | latticeConstants
For those registers that are constant, this is the constant value |
| private int[] | latticeValues
Lattice values for each SSA register |
| private int | regCount
ssaMeth.getRegCount() |
| private SsaMethod | ssaMeth
method we're processing |
| private ArrayList | ssaWorklist
Worklist for SSA edges. |
| private static final int | TOP
Lattice values |
| private static final int | |
| private ArrayList | varyingWorklist
Worklist for SSA edges that represent varying values. |
| Modifier and Type | Method and Description |
|---|---|
| private void | addBlockToWorklist(SsaBasicBlock
Block to add ssaBlock)Adds a SSA basic block to the CFG worklist if it's unexecuted, or to the CFG phi worklist if it's already executed. |
| private void | addUsersToWorklist(int
SSA register reg, int new lattice value for @param reg. latticeValue)Adds an SSA register's uses to the SSA worklist. |
| private static String | |
| public static void | |
| private void | |
| private void | replaceConstants()
Replaces TypeBearers in source register specs with constant type bearers if possible. |
| private void | |
| private boolean | Returns: true if the lattice value changed.SSA register reg, int Lattice value value, Constant Constant value (may be null) cst)Sets a lattice value for a register to value. |
| private void | simulateBlock(SsaBasicBlock
Block to visit block)Simulate a block and note the results in the lattice. |
| private void | |
| private Constant | Returns: constant result or null if not simulatable.non-null insn to simulate insn, int basic type of the result resultType)Simulates math insns, if possible. |
| private void | simulatePhi(PhiInsn
PHI to simulate. insn)Simulates a PHI node and set the lattice for the result to the appropriate value. |
| private void | simulatePhiBlock(SsaBasicBlock
Block to visit block)Simulate the phis in a block and note the results in the lattice. |
| private void | simulateStmt(SsaInsn
instruction to simulate insn)Simulates a statement and set the result lattice value. |
| branchWorklist | back to summary |
|---|---|
| private ArrayList<SsaInsn> branchWorklist Worklist of potential branches to convert to gotos | |
| cfgPhiWorklist | back to summary |
|---|---|
| private ArrayList<SsaBasicBlock> cfgPhiWorklist Worklist of executed basic blocks with phis to be processed | |
| cfgWorklist | back to summary |
|---|---|
| private ArrayList<SsaBasicBlock> cfgWorklist Worklist of basic blocks to be processed | |
| CONSTANT | back to summary |
|---|---|
| private static final int CONSTANT | |
| executableBlocks | back to summary |
|---|---|
| private BitSet executableBlocks Bitset containing bits for each block that has been found executable | |
| latticeConstants | back to summary |
|---|---|
| private Constant[] latticeConstants For those registers that are constant, this is the constant value | |
| latticeValues | back to summary |
|---|---|
| private int[] latticeValues Lattice values for each SSA register | |
| regCount | back to summary |
|---|---|
| private int regCount ssaMeth.getRegCount() | |
| ssaMeth | back to summary |
|---|---|
| private SsaMethod ssaMeth method we're processing | |
| ssaWorklist | back to summary |
|---|---|
| private ArrayList<SsaInsn> ssaWorklist Worklist for SSA edges. This is a list of registers to process | |
| TOP | back to summary |
|---|---|
| private static final int TOP Lattice values | |
| VARYING | back to summary |
|---|---|
| private static final int VARYING | |
| varyingWorklist | back to summary |
|---|---|
| private ArrayList<SsaInsn> varyingWorklist Worklist for SSA edges that represent varying values. It makes the algorithm much faster if you move all values to VARYING as fast as possible. | |
| SCCP | back to summary |
|---|---|
| private SCCP(SsaMethod ssaMeth) | |
| addBlockToWorklist | back to summary |
|---|---|
| private void addBlockToWorklist(SsaBasicBlock ssaBlock) Adds a SSA basic block to the CFG worklist if it's unexecuted, or to the CFG phi worklist if it's already executed.
| |
| addUsersToWorklist | back to summary |
|---|---|
| private void addUsersToWorklist(int reg, int latticeValue) Adds an SSA register's uses to the SSA worklist.
| |
| latticeValName | back to summary |
|---|---|
| private static String latticeValName(int latticeVal) | |
| process | back to summary |
|---|---|
| public static void process(SsaMethod ssaMethod) Performs sparse conditional constant propagation on a method.
| |
| replaceBranches | back to summary |
|---|---|
| private void replaceBranches() Replaces branches that have constant conditions with gotos | |
| replaceConstants | back to summary |
|---|---|
| private void replaceConstants() Replaces TypeBearers in source register specs with constant type bearers if possible. These are then referenced in later optimization steps. | |
| run | back to summary |
|---|---|
| private void run() | |
| setLatticeValueTo | back to summary |
|---|---|
| private boolean setLatticeValueTo(int reg, int value, Constant cst) Sets a lattice value for a register to value.
| |
| simulateBlock | back to summary |
|---|---|
| private void simulateBlock(SsaBasicBlock block) Simulate a block and note the results in the lattice.
| |
| simulateBranch | back to summary |
|---|---|
| private void simulateBranch(SsaInsn insn) Simulates branch insns, if possible. Adds reachable successor blocks to the CFG worklists.
| |
| simulateMath | back to summary |
|---|---|
| private Constant simulateMath(SsaInsn insn, int resultType) Simulates math insns, if possible. | |
| simulatePhi | back to summary |
|---|---|
| private void simulatePhi(PhiInsn insn) Simulates a PHI node and set the lattice for the result to the appropriate value. Meet values: TOP x anything = TOP VARYING x anything = VARYING CONSTANT x CONSTANT = CONSTANT if equal constants, VARYING otherwise
| |
| simulatePhiBlock | back to summary |
|---|---|
| private void simulatePhiBlock(SsaBasicBlock block) Simulate the phis in a block and note the results in the lattice.
| |
| simulateStmt | back to summary |
|---|---|
| private void simulateStmt(SsaInsn insn) Simulates a statement and set the result lattice value.
| |