/** * 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); } }
/** * 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); } }
/** * Replaces the given 'jsr' instruction by a simpler branch instruction, * if it jumps to a subroutine that doesn't return or a subroutine that * is only called from one place. */ private void replaceJsrInstruction(Clazz clazz, int offset, BranchInstruction branchInstruction) { // Is the subroutine ever returning? int subroutineStart = offset + branchInstruction.branchOffset; if (!partialEvaluator.isSubroutineReturning(subroutineStart) || partialEvaluator.branchOrigins(subroutineStart).instructionOffsetCount() == 1) { // All 'jsr' instructions to this subroutine can be replaced // by unconditional branch instructions. replaceBranchInstruction(clazz, offset, branchInstruction); } else if (!partialEvaluator.isTraced(offset + branchInstruction.length(offset))) { // We have to make sure the instruction after this 'jsr' // instruction is valid, even if it is never reached. replaceByInfiniteLoop(clazz, offset + branchInstruction.length(offset), branchInstruction); } }
/** * Replaces the given 'jsr' instruction by a simpler branch instruction, * if it jumps to a subroutine that doesn't return or a subroutine that * is only called from one place. */ private void replaceJsrInstruction(Clazz clazz, int offset, BranchInstruction branchInstruction) { // Is the subroutine ever returning? int subroutineStart = offset + branchInstruction.branchOffset; if (!partialEvaluator.isSubroutineReturning(subroutineStart) || partialEvaluator.branchOrigins(subroutineStart).instructionOffsetCount() == 1) { // All 'jsr' instructions to this subroutine can be replaced // by unconditional branch instructions. replaceBranchInstruction(clazz, offset, branchInstruction); } else if (!partialEvaluator.isTraced(offset + branchInstruction.length(offset))) { // We have to make sure the instruction after this 'jsr' // instruction is valid, even if it is never reached. replaceByInfiniteLoop(clazz, offset + branchInstruction.length(offset), branchInstruction); } }
/** * Replaces the given 'jsr' instruction by a simpler branch instruction, * if it jumps to a subroutine that doesn't return or a subroutine that * is only called from one place. */ private void replaceJsrInstruction(Clazz clazz, int offset, BranchInstruction branchInstruction) { // Is the subroutine ever returning? int subroutineStart = offset + branchInstruction.branchOffset; if (!partialEvaluator.isSubroutineReturning(subroutineStart) || partialEvaluator.branchOrigins(subroutineStart).instructionOffsetCount() == 1) { // All 'jsr' instructions to this subroutine can be replaced // by unconditional branch instructions. replaceBranchInstruction(clazz, offset, branchInstruction); } else if (!partialEvaluator.isTraced(offset + branchInstruction.length(offset))) { // We have to make sure the instruction after this 'jsr' // instruction is valid, even if it is never reached. replaceByInfiniteLoop(clazz, offset + branchInstruction.length(offset), branchInstruction); } }
/** * Replaces the given 'jsr' instruction by a simpler branch instruction, * if it jumps to a subroutine that doesn't return or a subroutine that * is only called from one place. */ private void replaceJsrInstruction(Clazz clazz, int offset, BranchInstruction branchInstruction) { // Is the subroutine ever returning? int subroutineStart = offset + branchInstruction.branchOffset; if (!partialEvaluator.isSubroutineReturning(subroutineStart) || partialEvaluator.branchOrigins(subroutineStart).instructionOffsetCount() == 1) { // All 'jsr' instructions to this subroutine can be replaced // by unconditional branch instructions. replaceBranchInstruction(clazz, offset, branchInstruction); } else if (!partialEvaluator.isTraced(offset + branchInstruction.length(offset))) { // We have to make sure the instruction after this 'jsr' // instruction is valid, even if it is never reached. replaceByInfiniteLoop(clazz, offset + branchInstruction.length(offset), branchInstruction); } }
partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false);
partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false);
partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false);
checkAgain |= offset < maxOffset(partialEvaluator.branchOrigins(offset));
InstructionOffsetValue branchOrigins = partialEvaluator.branchOrigins(offset); if (branchOrigins != null && offset < branchOrigins.maximumValue())
InstructionOffsetValue branchOrigins = partialEvaluator.branchOrigins(offset); if (branchOrigins != null && offset < branchOrigins.maximumValue())
InstructionOffsetValue branchOrigins = partialEvaluator.branchOrigins(offset); if (branchOrigins != null && offset < branchOrigins.maximumValue())
partialEvaluator.branchOrigins(offset), false); partialEvaluator.branchOrigins(offset), false);