private void markVariableAfter(int instructionOffset, int variableIndex) { if (!isVariableNecessaryAfter(instructionOffset, variableIndex)) { if (DEBUG) System.out.print("["+instructionOffset+".v"+variableIndex+"],"); variablesNecessaryAfter[instructionOffset][variableIndex] = true; if (maxMarkedOffset < instructionOffset) { maxMarkedOffset = instructionOffset; } } }
/** * Returns whether the specified variable is ever necessary after any * instruction in the specified block. */ private boolean isVariableNecessaryAfterAny(int startOffset, int endOffset, int variableIndex) { for (int offset = startOffset; offset < endOffset; offset++) { if (isVariableNecessaryAfter(offset, variableIndex)) { return true; } } return false; }
/** * Returns whether the specified variable is ever necessary after any * instruction in the specified set of instructions offsets. */ private boolean isVariableNecessaryAfterAny(InstructionOffsetValue instructionOffsetValue, int variableIndex) { int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { if (isVariableNecessaryAfter(instructionOffsetValue.instructionOffset(index), variableIndex)) { return true; } } return false; }