| Modifier and Type | Field and Description |
|---|---|
| private final BasicBlockList | |
| private final BasicBlockList | |
| private final RopMethod |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | combineBlocks(int
block that will replace all the beta block alphaLabel, IntList label list of blocks to combine betaLabels)Combines blocks proven identical into one alpha block, re-writing all of the successor links that point to the beta blocks to point to the alpha block instead. |
| private static boolean | Returns: true iff the two blocks' instructions are the samenon-null; a block to comparenon-null; another block to compareHelper method to compare the contents of two blocks. |
| public RopMethod | |
| private void | replaceSucc(BasicBlock
block to replace block, int label of successor to replace oldLabel, int label of new successor newLabel)Replaces one of a block's successors with a different label. |
| blocks | back to summary |
|---|---|
| private final BasicBlockList blocks | |
| newBlocks | back to summary |
|---|---|
| private final BasicBlockList newBlocks | |
| ropMethod | back to summary |
|---|---|
| private final RopMethod ropMethod | |
| IdenticalBlockCombiner | back to summary |
|---|---|
| public IdenticalBlockCombiner(RopMethod rm) Constructs instance. Call
| |
| combineBlocks | back to summary |
|---|---|
| private void combineBlocks(int alphaLabel, IntList betaLabels) Combines blocks proven identical into one alpha block, re-writing all of the successor links that point to the beta blocks to point to the alpha block instead.
| |
| compareInsns | back to summary |
|---|---|
| private static boolean compareInsns(BasicBlock a, BasicBlock b) Helper method to compare the contents of two blocks.
| |
| process | back to summary |
|---|---|
| public RopMethod process() Runs algorithm. Todo This is n^2, and could be made linear-ish with a hash. In particular, hash the contents of each block and only compare blocks with the same hash.
| |
| replaceSucc | back to summary |
|---|---|
| private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) Replaces one of a block's successors with a different label. Constructs
an updated BasicBlock instance and places it in
| |