public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (branchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the branch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, branchInstruction.branchOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing branch instruction "+branchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, branchInstruction); } }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (switchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the switch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, switchInstruction.defaultOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing switch instruction "+switchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, switchInstruction); } }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (switchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the switch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, switchInstruction.defaultOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing switch instruction "+switchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, switchInstruction); } }
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (branchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the branch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, branchInstruction.branchOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing branch instruction "+branchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, branchInstruction); } }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (switchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the switch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, switchInstruction.defaultOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing switch instruction "+switchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, switchInstruction); } }
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction) { if (instructionUsageMarker.isInstructionNecessary(offset)) { if (branchInstruction.stackPopCount(clazz) > 0 && !instructionUsageMarker.isStackEntryPresentBefore(offset, instructionUsageMarker.getStackBefore(offset).size() - 1)) { // Replace the branch instruction by a simple goto. Instruction replacementInstruction = new BranchInstruction(InstructionConstants.OP_GOTO, branchInstruction.branchOffset); codeAttributeEditor.replaceInstruction(offset, replacementInstruction); if (DEBUG) System.out.println(" Replacing branch instruction "+branchInstruction.toString(offset)+" by "+replacementInstruction.toString()); } } else { visitAnyInstruction(clazz, method, codeAttribute, offset, branchInstruction); } }
isDupOrSwap(simpleInstruction)) int topBefore = instructionUsageMarker.getStackBefore(offset).size() - 1; int topAfter = instructionUsageMarker.getStackAfter(offset).size() - 1;
isDupOrSwap(simpleInstruction)) int topBefore = instructionUsageMarker.getStackBefore(offset).size() - 1; int topAfter = instructionUsageMarker.getStackAfter(offset).size() - 1;
isDupOrSwap(simpleInstruction)) int topBefore = instructionUsageMarker.getStackBefore(offset).size() - 1; int topAfter = instructionUsageMarker.getStackAfter(offset).size() - 1;
instructionUsageMarker.getStackBefore(offset); instructionUsageMarker.getStackBefore(offset);
instructionUsageMarker.getStackBefore(offset); instructionUsageMarker.getStackBefore(offset);
instructionUsageMarker.getStackBefore(offset); instructionUsageMarker.getStackBefore(offset);