/** * Returns whether the given variables are never alive at the same time. */ private boolean areNonOverlapping(int variableIndex1, int variableIndex2, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { if ((livenessAnalyzer.isAliveBefore(offset, variableIndex1) && livenessAnalyzer.isAliveBefore(offset, variableIndex2)) || (livenessAnalyzer.isAliveAfter(offset, variableIndex1) && livenessAnalyzer.isAliveAfter(offset, variableIndex2)) || // For now, exclude Category 2 variables. livenessAnalyzer.isCategory2(offset, variableIndex1)) { return false; } } return true; }
/** * Returns whether the given variables are never alive at the same time. */ private boolean areNonOverlapping(int variableIndex1, int variableIndex2, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { if ((livenessAnalyzer.isAliveBefore(offset, variableIndex1) && livenessAnalyzer.isAliveBefore(offset, variableIndex2)) || (livenessAnalyzer.isAliveAfter(offset, variableIndex1) && livenessAnalyzer.isAliveAfter(offset, variableIndex2)) || // For now, exclude Category 2 variables. livenessAnalyzer.isCategory2(offset, variableIndex1)) { return false; } } return true; }
/** * Returns whether the given variables are never alive at the same time. */ private boolean areNonOverlapping(int variableIndex1, int variableIndex2, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { if ((livenessAnalyzer.isAliveBefore(offset, variableIndex1) && livenessAnalyzer.isAliveBefore(offset, variableIndex2)) || (livenessAnalyzer.isAliveAfter(offset, variableIndex1) && livenessAnalyzer.isAliveAfter(offset, variableIndex2)) || // For now, exclude Category 2 variables. livenessAnalyzer.isCategory2(offset, variableIndex1)) { return false; } } return true; }
/** * Returns whether the given variables are never alive at the same time. */ private boolean areNonOverlapping(int variableIndex1, int variableIndex2, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { if ((livenessAnalyzer.isAliveBefore(offset, variableIndex1) && livenessAnalyzer.isAliveBefore(offset, variableIndex2)) || (livenessAnalyzer.isAliveAfter(offset, variableIndex1) && livenessAnalyzer.isAliveAfter(offset, variableIndex2)) || // For now, exclude Category 2 variables. livenessAnalyzer.isCategory2(offset, variableIndex1)) { return false; } } return true; }
/** * Updates the liveness resulting from mapping the given old variable on * the given new variable. */ private void updateLiveness(int oldVariableIndex, int newVariableIndex, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { // Update the liveness before the instruction. if (livenessAnalyzer.isAliveBefore(offset, oldVariableIndex)) { livenessAnalyzer.setAliveBefore(offset, oldVariableIndex, false); livenessAnalyzer.setAliveBefore(offset, newVariableIndex, true); } // Update the liveness after the instruction. if (livenessAnalyzer.isAliveAfter(offset, oldVariableIndex)) { livenessAnalyzer.setAliveAfter(offset, oldVariableIndex, false); livenessAnalyzer.setAliveAfter(offset, newVariableIndex, true); } } } }
/** * Updates the liveness resulting from mapping the given old variable on * the given new variable. */ private void updateLiveness(int oldVariableIndex, int newVariableIndex, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { // Update the liveness before the instruction. if (livenessAnalyzer.isAliveBefore(offset, oldVariableIndex)) { livenessAnalyzer.setAliveBefore(offset, oldVariableIndex, false); livenessAnalyzer.setAliveBefore(offset, newVariableIndex, true); } // Update the liveness after the instruction. if (livenessAnalyzer.isAliveAfter(offset, oldVariableIndex)) { livenessAnalyzer.setAliveAfter(offset, oldVariableIndex, false); livenessAnalyzer.setAliveAfter(offset, newVariableIndex, true); } } }
/** * Updates the liveness resulting from mapping the given old variable on * the given new variable. */ private void updateLiveness(int oldVariableIndex, int newVariableIndex, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { // Update the liveness before the instruction. if (livenessAnalyzer.isAliveBefore(offset, oldVariableIndex)) { livenessAnalyzer.setAliveBefore(offset, oldVariableIndex, false); livenessAnalyzer.setAliveBefore(offset, newVariableIndex, true); } // Update the liveness after the instruction. if (livenessAnalyzer.isAliveAfter(offset, oldVariableIndex)) { livenessAnalyzer.setAliveAfter(offset, oldVariableIndex, false); livenessAnalyzer.setAliveAfter(offset, newVariableIndex, true); } } }
/** * Updates the liveness resulting from mapping the given old variable on * the given new variable. */ private void updateLiveness(int oldVariableIndex, int newVariableIndex, int codeLength) { // Loop over all instructions. for (int offset = 0; offset < codeLength; offset++) { // Update the liveness before the instruction. if (livenessAnalyzer.isAliveBefore(offset, oldVariableIndex)) { livenessAnalyzer.setAliveBefore(offset, oldVariableIndex, false); livenessAnalyzer.setAliveBefore(offset, newVariableIndex, true); } // Update the liveness after the instruction. if (livenessAnalyzer.isAliveAfter(offset, oldVariableIndex)) { livenessAnalyzer.setAliveAfter(offset, oldVariableIndex, false); livenessAnalyzer.setAliveAfter(offset, newVariableIndex, true); } } }
if (isAliveAfter(offset, variableIndex))
if (isAliveAfter(offset, variableIndex))
if (isAliveAfter(offset, variableIndex))
if (isAliveAfter(offset, variableIndex))