/** * Returns the first instruction offset between the given offsets at which * the given variable goes alive. */ private int firstLiveness(int startOffset, int endOffset, int variableIndex) { for (int offset = startOffset; offset < endOffset; offset++) { if (livenessAnalyzer.isTraced(offset) && livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return offset; } } return endOffset; }
/** * Returns the first instruction offset between the given offsets at which * the given variable goes alive. */ private int firstLiveness(int startOffset, int endOffset, int variableIndex) { for (int offset = startOffset; offset < endOffset; offset++) { if (livenessAnalyzer.isTraced(offset) && livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return offset; } } return endOffset; }
/** * Returns the first instruction offset between the given offsets at which * the given variable goes alive. */ private int firstLiveness(int startOffset, int endOffset, int variableIndex) { for (int offset = startOffset; offset < endOffset; offset++) { if (livenessAnalyzer.isTraced(offset) && livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return offset; } } return endOffset; }
/** * Returns the last instruction offset between the given offsets before * which the given variable is still alive. */ private int lastLiveness(int startOffset, int endOffset, int variableIndex) { int previousOffset = endOffset; for (int offset = endOffset-1; offset >= startOffset; offset--) { if (livenessAnalyzer.isTraced(offset)) { if (livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return previousOffset; } previousOffset = offset; } } return endOffset; } }
/** * Returns the last instruction offset between the given offsets before * which the given variable is still alive. */ private int lastLiveness(int startOffset, int endOffset, int variableIndex) { int previousOffset = endOffset; for (int offset = endOffset-1; offset >= startOffset; offset--) { if (livenessAnalyzer.isTraced(offset)) { if (livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return previousOffset; } previousOffset = offset; } } return endOffset; } }
/** * Returns the last instruction offset between the given offsets before * which the given variable is still alive. */ private int lastLiveness(int startOffset, int endOffset, int variableIndex) { int previousOffset = endOffset; for (int offset = endOffset-1; offset >= startOffset; offset--) { if (livenessAnalyzer.isTraced(offset)) { if (livenessAnalyzer.isAliveBefore(offset, variableIndex)) { return previousOffset; } previousOffset = offset; } } return endOffset; } }