public abstract class LocalLiveness extends Object
Modifier and Type | Field and Description |
---|---|
protected BciBlockMapping.BciBlock[] |
blocks |
Modifier | Constructor and Description |
---|---|
protected |
LocalLiveness(BciBlockMapping.BciBlock[] blocks) |
Modifier and Type | Method and Description |
---|---|
static LocalLiveness |
compute(BytecodeStream stream,
BciBlockMapping.BciBlock[] blocks,
int maxLocals,
int loopCount) |
(package private) void |
computeLiveness(BytecodeStream stream) |
private void |
computeLocalLiveness(BytecodeStream stream,
BciBlockMapping.BciBlock block) |
protected abstract String |
debugLiveGen(int blockID)
Returns a string representation of the liveGen values of the given block.
|
protected abstract String |
debugLiveIn(int blockID)
Returns a string representation of the liveIn values of the given block.
|
protected abstract String |
debugLiveKill(int blockID)
Returns a string representation of the liveKill values of the given block.
|
protected abstract String |
debugLiveOut(int blockID)
Returns a string representation of the liveOut values of the given block.
|
protected abstract int |
liveOutCardinality(int blockID)
Returns the number of live locals at the end of the given block.
|
protected abstract void |
loadOne(int blockID,
int local)
Adds the local to liveGen if it wasn't already killed in this block.
|
private void |
loadTwo(int blockID,
int local) |
abstract boolean |
localIsChangedInLoop(int loopId,
int local)
Returns whether the local is set in the given loop.
|
abstract boolean |
localIsLiveIn(BciBlockMapping.BciBlock block,
int local)
Returns whether the local is live at the beginning of the given block.
|
abstract boolean |
localIsLiveOut(BciBlockMapping.BciBlock block,
int local)
Returns whether the local is live at the end of the given block.
|
protected abstract void |
propagateLiveness(int blockID,
int successorID)
Adds all locals the are in the liveIn of the successor to the liveOut of the block.
|
protected abstract void |
storeOne(int blockID,
int local)
Add this local to liveKill if it wasn't already generated in this block.
|
private void |
storeTwo(int blockID,
int local) |
private boolean |
traceEnd(BciBlockMapping.BciBlock block,
int blockID) |
private static boolean |
traceIteration(int iteration) |
private boolean |
traceStart(BciBlockMapping.BciBlock block,
int blockID) |
private boolean |
traceSuccessor(BciBlockMapping.BciBlock sux) |
protected abstract void |
updateLiveness(int blockID)
Calculates a new liveIn for the given block from liveOut, liveKill and liveGen.
|
protected final BciBlockMapping.BciBlock[] blocks
protected LocalLiveness(BciBlockMapping.BciBlock[] blocks)
public static LocalLiveness compute(BytecodeStream stream, BciBlockMapping.BciBlock[] blocks, int maxLocals, int loopCount)
void computeLiveness(BytecodeStream stream)
private static boolean traceIteration(int iteration)
private boolean traceEnd(BciBlockMapping.BciBlock block, int blockID)
private boolean traceSuccessor(BciBlockMapping.BciBlock sux)
private boolean traceStart(BciBlockMapping.BciBlock block, int blockID)
public abstract boolean localIsLiveIn(BciBlockMapping.BciBlock block, int local)
public abstract boolean localIsChangedInLoop(int loopId, int local)
public abstract boolean localIsLiveOut(BciBlockMapping.BciBlock block, int local)
protected abstract String debugLiveIn(int blockID)
protected abstract String debugLiveOut(int blockID)
protected abstract String debugLiveGen(int blockID)
protected abstract String debugLiveKill(int blockID)
protected abstract int liveOutCardinality(int blockID)
protected abstract void propagateLiveness(int blockID, int successorID)
protected abstract void updateLiveness(int blockID)
protected abstract void loadOne(int blockID, int local)
protected abstract void storeOne(int blockID, int local)
private void computeLocalLiveness(BytecodeStream stream, BciBlockMapping.BciBlock block)
private void loadTwo(int blockID, int local)
private void storeTwo(int blockID, int local)