public String toString() { return getName()+" ("+jumpOffsets.length+" offsets, default="+defaultOffset+")"; } }
public String toString(int offset) { return "["+offset+"] "+toString()+" (target="+(offset+defaultOffset)+")"; }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Try to write out the instruction. // Switch instructions should always fit. switchInstruction.write(codeAttribute, offset); }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is an instruction of a subroutine. checkSubroutine(offset); // Mark the branch targets of the default jump offset. markBranch(offset, switchInstruction.defaultOffset); // Mark the branch targets of the jump offsets. markBranches(offset, switchInstruction.jumpOffsets); // Mark the next instruction. markAfterBranchOrigin(offset + switchInstruction.length(offset)); }
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); } }
replacementSwitchInstruction.accept(clazz, null, null,
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is the first instruction of a subroutine. checkSubroutine(offset); // Mark the branch targets of the default jump offset. markBranchTarget(offset, switchInstruction.defaultOffset); // Mark the branch targets of the jump offsets. markBranchTargets(offset, switchInstruction.jumpOffsets); // Mark the next instruction. markAfterBranchOrigin(offset + switchInstruction.length(offset)); }
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); } }
replacementSwitchInstruction.accept(clazz, null, null,
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Try to write out the instruction. // Switch instructions should always fit. switchInstruction.write(codeAttribute, offset); }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is an instruction of a subroutine. checkSubroutine(offset); // Mark the branch targets of the default jump offset. markBranch(offset, switchInstruction.defaultOffset); // Mark the branch targets of the jump offsets. markBranches(offset, switchInstruction.jumpOffsets); // Mark the next instruction. markAfterBranchOrigin(offset + switchInstruction.length(offset)); }
public String toString(int offset) { return "["+offset+"] "+toString()+" (target="+(offset+defaultOffset)+")"; }
public String toString() { return getName()+" ("+jumpOffsets.length+" offsets, default="+defaultOffset+")"; } }
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); } }
replacementSwitchInstruction.accept(clazz, null, null,
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Try to write out the instruction. // Switch instructions should always fit. switchInstruction.write(codeAttribute, offset); }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Mark the branch origin. markBranchOrigin(offset); // Check if this is an instruction of a subroutine. checkSubroutine(offset); // Mark the branch targets of the default jump offset. markBranch(offset, switchInstruction.defaultOffset); // Mark the branch targets of the jump offsets. markBranches(offset, switchInstruction.jumpOffsets); // Mark the next instruction. markAfterBranchOrigin(offset + switchInstruction.length(offset)); }
public String toString(int offset) { return "["+offset+"] "+toString()+" (target="+(offset+defaultOffset)+")"; }
public String toString() { return getName()+" ("+jumpOffsets.length+" offsets, default="+defaultOffset+")"; } }
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction) { // Try to write out the instruction. // Switch instructions should always fit. switchInstruction.write(codeAttribute, offset); }