public void visitAnyInstruction( Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction) { // Add the instruction. codeAttributeComposer.appendInstruction(offset, instruction); }
public void visitConstantInstruction( Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Create a copy of the instruction. Instruction newConstantInstruction = new ConstantInstruction( constantInstruction.opcode, constantAdder.addConstant(clazz, constantInstruction.constantIndex), constantInstruction.constant) .shrink(); // Add the instruction. codeAttributeComposer.appendInstruction(offset, newConstantInstruction); }