/** * Returns the combined liveness mask of the variables right before the * specified instruction offsets. */ private long combinedLiveness(InstructionOffsetValue instructionOffsetValue) { long alive = 0L; int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { alive |= isAliveBefore[instructionOffsetValue.instructionOffset(index)]; } return alive; }
/** * Returns the combined liveness mask of the variables right before the * specified instruction offsets. */ private long combinedLiveness(InstructionOffsetValue instructionOffsetValue) { long alive = 0L; int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { alive |= isAliveBefore[instructionOffsetValue.instructionOffset(index)]; } return alive; } }
/** * Returns the combined liveness mask of the variables right before the * specified instruction offsets. */ private long combinedLiveness(InstructionOffsetValue instructionOffsetValue) { long alive = 0L; int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { alive |= isAliveBefore[instructionOffsetValue.instructionOffset(index)]; } return alive; } }
/** * Returns the combined liveness mask of the variables right before the * specified instruction offsets. */ private long combinedLiveness(InstructionOffsetValue instructionOffsetValue) { long alive = 0L; int count = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < count; index++) { alive |= isAliveBefore[instructionOffsetValue.instructionOffset(index)]; } return alive; } }
/** * Marks the specified instructions as used. * @param instructionOffsets the offsets of the instructions. */ private void markInstructions(InstructionOffsetValue instructionOffsets) { int count = instructionOffsets.instructionOffsetCount(); for (int index = 0; index < count; index++) { markInstruction(instructionOffsets.instructionOffset(index)); } }
/** * Marks the specified instructions as used. * @param instructionOffsets the offsets of the instructions. */ private void markInstructions(InstructionOffsetValue instructionOffsets) { int count = instructionOffsets.instructionOffsetCount(); for (int index = 0; index < count; index++) { markInstruction(instructionOffsets.instructionOffset(index)); } }
/** * Marks the specified instructions as used. * @param instructionOffsets the offsets of the instructions. */ private void markInstructions(InstructionOffsetValue instructionOffsets) { int count = instructionOffsets.instructionOffsetCount(); for (int index = 0; index < count; index++) { markInstruction(instructionOffsets.instructionOffset(index)); } }
private boolean isAnyStackEntryNecessaryAfter(InstructionOffsetValue instructionOffsets, int stackIndex) { int offsetCount = instructionOffsets.instructionOffsetCount(); for (int offsetIndex = 0; offsetIndex < offsetCount; offsetIndex++) { if (isStackEntryNecessaryAfter(instructionOffsets.instructionOffset(offsetIndex), stackIndex)) { 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; }
/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markEscapingReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceEscaping[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markReturnedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceReturned[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Marks the producing offsets of the given traced reference value. */ private void markModifiedReferenceValues(ReferenceValue referenceValue) { TracedReferenceValue tracedReferenceValue = (TracedReferenceValue)referenceValue; InstructionOffsetValue instructionOffsetValue = tracedReferenceValue.getTraceValue().instructionOffsetValue(); int parameterCount = instructionOffsetValue.instructionOffsetCount(); for (int index = 0; index < parameterCount; index++) { if (!instructionOffsetValue.isMethodParameter(index)) { instanceModified[instructionOffsetValue.instructionOffset(index)] = true; } } }
/** * Deletes the reference popping instruction at the given offset, if * it is at the start of a subroutine that doesn't return or a subroutine * that is only called from one place. */ private void deleteReferencePopInstruction(Clazz clazz, int offset, Instruction instruction) { if (partialEvaluator.isSubroutineStart(offset) && (!partialEvaluator.isSubroutineReturning(offset) || partialEvaluator.branchOrigins(offset).instructionOffsetCount() == 1)) { if (DEBUG) System.out.println(" Deleting store of subroutine return address "+instruction.toString(offset)); // A reference value can only be specific if it is null. codeAttributeEditor.deleteInstruction(offset); } }
/** * Deletes the reference popping instruction at the given offset, if * it is at the start of a subroutine that doesn't return or a subroutine * that is only called from one place. */ private void deleteReferencePopInstruction(Clazz clazz, int offset, Instruction instruction) { if (partialEvaluator.isSubroutineStart(offset) && (!partialEvaluator.isSubroutineReturning(offset) || partialEvaluator.branchOrigins(offset).instructionOffsetCount() == 1)) { if (DEBUG) System.out.println(" Deleting store of subroutine return address "+instruction.toString(offset)); // A reference value can only be specific if it is null. codeAttributeEditor.deleteInstruction(offset); } }