private void updateFrameSizes(Clazz clazz, Method method, CodeAttribute codeAttribute) { if (updateFrameSizes) { stackSizeUpdater.visitCodeAttribute(clazz, method, codeAttribute); variableSizeUpdater.visitCodeAttribute(clazz, method, codeAttribute); } }
/** * Creates a new ExceptionAdder that will copy classes into the given * target exceptions attribute. */ public ExceptionAdder(ProgramClass targetClass, ExceptionsAttribute targetExceptionsAttribute) { constantAdder = new ConstantAdder(targetClass); exceptionsAttributeEditor = new ExceptionsAttributeEditor(targetExceptionsAttribute); }
/** * Remembers to place the given instruction right after the instruction * at the given offset. */ private void insertAfterInstruction(int instructionOffset, Instruction instruction) { ensureCodeAttributeEditor(); // Replace the instruction. codeAttributeEditor.insertAfterInstruction(instructionOffset, instruction); }
/** * Creates a new InterfaceAdder that will add interfaces to the given * target class. */ public InterfaceAdder(ProgramClass targetClass) { constantAdder = new ConstantAdder(targetClass); interfacesEditor = new InterfacesEditor(targetClass); }
/** * Creates a new LocalVariableInfoAdder that will copy line numbers into the * given target line number table. */ public LocalVariableInfoAdder(ProgramClass targetClass, LocalVariableTableAttribute targetLocalVariableTableAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.localVariableTableAttributeEditor = new LocalVariableTableAttributeEditor(targetLocalVariableTableAttribute); }
/** * Remembers to replace the instruction at the given offset by the given * instruction. */ private void replaceInstruction(int instructionOffset, Instruction instruction) { ensureCodeAttributeEditor(); // Replace the instruction. codeAttributeEditor.replaceInstruction(instructionOffset, instruction); }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { interfacesEditor.addInterface(constantAdder.addConstant(clazz, classConstant)); } }
/** * Remembers to place the given instruction right before the instruction * at the given offset. */ private void insertBeforeInstruction(int instructionOffset, Instruction instruction) { ensureCodeAttributeEditor(); // Replace the instruction. codeAttributeEditor.insertBeforeInstruction(instructionOffset, instruction); }
/** * Creates a new LocalVariableTypeInfoAdder that will copy line numbers into the * given target line number table. */ public LocalVariableTypeInfoAdder(ProgramClass targetClass, LocalVariableTypeTableAttribute targetLocalVariableTypeTableAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.localVariableTypeTableAttributeEditor = new LocalVariableTypeTableAttributeEditor(targetLocalVariableTypeTableAttribute); }
public InstructionSequenceBuilder invokevirtual(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokevirtual(constantPoolEditor.addMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public InstructionSequenceBuilder invokespecial_interface(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokespecial(constantPoolEditor.addInterfaceMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public InstructionSequenceBuilder invokespecial(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokespecial(constantPoolEditor.addMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public InstructionSequenceBuilder invokestatic(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokestatic(constantPoolEditor.addMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public CompactCodeAttributeComposer putfield(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return putfield(constantPoolEditor.addFieldrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public InstructionSequenceBuilder ldc2_w(long value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addLongConstant(value)); }
public InstructionSequenceBuilder ldc2_w(double value) { // If we can shrink the instruction, we may not need to create a constant. return ldc2_w(constantPoolEditor.addDoubleConstant(value)); }
/** * Creates a new BootstrapMethodInfoAdder that will copy bootstrap methods * into the given bootstrap methods attribute. */ public BootstrapMethodInfoAdder(ProgramClass targetClass, BootstrapMethodsAttribute targetBootstrapMethodsAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.bootstrapMethodsAttributeEditor = new BootstrapMethodsAttributeEditor(targetBootstrapMethodsAttribute); }
/** * Creates a new InterfaceAdder that will add interfaces to the given * target class. */ public InterfaceAdder(ProgramClass targetClass) { constantAdder = new ConstantAdder(targetClass); interfacesEditor = new InterfacesEditor(targetClass); }
public InstructionSequenceBuilder invokevirtual(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokevirtual(constantPoolEditor.addMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }
public InstructionSequenceBuilder invokespecial_interface(String className, String name, String descriptor, Clazz referencedClass, Member referencedMember) { return invokespecial(constantPoolEditor.addInterfaceMethodrefConstant(className, name, descriptor, referencedClass, referencedMember)); }