public Instruction shrink() { for (int index = 0; index < instructions.length; index++) { instructions[index] = instructions[index].shrink(); } return this; }
public Instruction shrink() { for (int index = 0; index < instructions.length; index++) { instructions[index] = instructions[index].shrink(); } return this; }
public Instruction shrink() { for (int index = 0; index < instructions.length; index++) { instructions[index] = instructions[index].shrink(); } return this; }
public Instruction shrink() { for (int index = 0; index < instructions.length; index++) { instructions[index] = instructions[index].shrink(); } return this; }
/** * Remembers to replace the instruction at the given offset by the given * instruction. * @param instructionOffset the offset of the instruction to be replaced. * @param instruction the new instruction. */ public void replaceInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } replacements[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; }
/** * Remembers to replace the instruction at the given offset by the given * instruction. * @param instructionOffset the offset of the instruction to be replaced. * @param instruction the new instruction. */ public void replaceInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } replacements[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; }
/** * Remembers to replace the instruction at the given offset by the given * instruction. * @param instructionOffset the offset of the instruction to be replaced. * @param instruction the new instruction. */ public void replaceInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } replacements[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; }
/** * Remembers to place the given instruction right after the instruction * at the given offset. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertAfterInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } postInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right after the instruction * at the given offset. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertAfterInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } postInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right after the instruction * at the given offset. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertAfterInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } postInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * also go to the new instruction. Similarly, any try blocks that include * the existing instruction will also include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * also go to the new instruction. Similarly, any try blocks that include * the existing instruction will also include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * also go to the new instruction. Similarly, any try blocks that include * the existing instruction will also include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeInstruction(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * land after the new instruction. Similarly, any try blocks that start at * the existing instruction will not include the new instruction. However, * any try blocks that end right before the existing instruction wil now * include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeOffset(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preOffsetInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * land after the new instruction. Similarly, any try blocks that start at * the existing instruction will not include the new instruction. However, * any try blocks that end right before the existing instruction wil now * include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeOffset(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preOffsetInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
/** * Remembers to place the given instruction right before the instruction * at the given offset. Any branches to the existing instruction will * land after the new instruction. Similarly, any try blocks that start at * the existing instruction will not include the new instruction. However, * any try blocks that end right before the existing instruction wil now * include the new instruction. * @param instructionOffset the offset of the instruction. * @param instruction the new instruction. */ public void insertBeforeOffset(int instructionOffset, Instruction instruction) { if (instructionOffset < 0 || instructionOffset >= codeLength) { throw new IllegalArgumentException("Invalid instruction offset ["+instructionOffset+"] in code with length ["+codeLength+"]"); } preOffsetInsertions[instructionOffset] = shrinkInstructions ? instruction.shrink() : instruction; modified = true; simple = false; }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { // Append the instruction. codeAttributeComposer.appendInstruction(offset, instruction.shrink()); }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { // Copy the instruction. codeAttributeComposer.appendInstruction(offset, instruction.shrink()); }
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { codeAttributeComposer.appendInstruction(offset, instruction.shrink()); }
/** * Creates the replacement instruction for the given index in the * instruction sequence. */ public Instruction create(int index) { // Create the instruction. replacementInstructions[index].accept(null, null, null, instructionSequenceMatcher.matchedInstructionOffset(index), this); // Return it. return replacementInstruction.shrink(); }