protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
@Override protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
/** * Adds a new <code>CONSTANT_InterfaceMethodref_info</code> * structure. * * <p>This also adds a new <code>CONSTANT_NameAndType_info</code> * structure. * * @param classInfo <code>class_index</code> * @param name <code>name_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @param type <code>descriptor_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @return the index of the added entry. */ public int addInterfaceMethodrefInfo(int classInfo, String name, String type) { int nt = addNameAndTypeInfo(name, type); return addInterfaceMethodrefInfo(classInfo, nt); }
/** * Adds a new <code>CONSTANT_InterfaceMethodref_info</code> * structure. * * <p>This also adds a new <code>CONSTANT_NameAndType_info</code> * structure. * * @param classInfo <code>class_index</code> * @param name <code>name_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @param type <code>descriptor_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @return the index of the added entry. */ public int addInterfaceMethodrefInfo(int classInfo, String name, String type) { int nt = addNameAndTypeInfo(name, type); return addInterfaceMethodrefInfo(classInfo, nt); }
/** * Appends INVOKESPECIAL. * * @param isInterface true if the invoked method is a default method * declared in an interface. * @param clazz the index of <code>CONSTANT_Class_info</code> * structure. * @param name the method name * @param desc the descriptor of the method signature. * * @see Descriptor#ofMethod(CtClass,CtClass[]) * @see Descriptor#ofConstructor(CtClass[]) */ public void addInvokespecial(boolean isInterface, int clazz, String name, String desc) { int index; if (isInterface) index = constPool.addInterfaceMethodrefInfo(clazz, name, desc); else index = constPool.addMethodrefInfo(clazz, name, desc); addInvokespecial(index, desc); }
/** * Appends INVOKESPECIAL. * * @param isInterface true if the invoked method is a default method * declared in an interface. * @param clazz the index of <code>CONSTANT_Class_info</code> * structure. * @param name the method name * @param desc the descriptor of the method signature. * * @see Descriptor#ofMethod(CtClass,CtClass[]) * @see Descriptor#ofConstructor(CtClass[]) */ public void addInvokespecial(boolean isInterface, int clazz, String name, String desc) { int index; if (isInterface) index = constPool.addInterfaceMethodrefInfo(clazz, name, desc); else index = constPool.addMethodrefInfo(clazz, name, desc); addInvokespecial(index, desc); }
private void addInvokestatic(int clazz, String name, String desc, boolean isInterface) { add(INVOKESTATIC); int index; if (isInterface) index = constPool.addInterfaceMethodrefInfo(clazz, name, desc); else index = constPool.addMethodrefInfo(clazz, name, desc); addIndex(index); growStack(Descriptor.dataSize(desc)); }
private void addInvokestatic(int clazz, String name, String desc, boolean isInterface) { add(INVOKESTATIC); int index; if (isInterface) index = constPool.addInterfaceMethodrefInfo(clazz, name, desc); else index = constPool.addMethodrefInfo(clazz, name, desc); addIndex(index); growStack(Descriptor.dataSize(desc)); }
/** * Appends INVOKEINTERFACE. * * @param clazz the index of <code>CONSTANT_Class_info</code> * structure. * @param name the method name * @param desc the descriptor of the method signature. * @param count the count operand of the instruction. * * @see Descriptor#ofMethod(CtClass,CtClass[]) */ public void addInvokeinterface(int clazz, String name, String desc, int count) { add(INVOKEINTERFACE); addIndex(constPool.addInterfaceMethodrefInfo(clazz, name, desc)); add(count); add(0); growStack(Descriptor.dataSize(desc) - 1); }
protected int match(int c, int pos, CodeIterator iterator, int typedesc, ConstPool cp) throws BadBytecode { if (newIndex == 0) { int nt = cp.addNameAndTypeInfo(cp.addUtf8Info(newMethodname), typedesc); int ci = cp.addClassInfo(newClassname); if (c == INVOKEINTERFACE) newIndex = cp.addInterfaceMethodrefInfo(ci, nt); else { if (newMethodIsPrivate && c == INVOKEVIRTUAL) iterator.writeByte(INVOKESPECIAL, pos); newIndex = cp.addMethodrefInfo(ci, nt); } constPool = cp; } iterator.write16bit(newIndex, pos + 1); return pos; } }
/** * Appends INVOKEINTERFACE. * * @param clazz the index of <code>CONSTANT_Class_info</code> * structure. * @param name the method name * @param desc the descriptor of the method signature. * @param count the count operand of the instruction. * * @see Descriptor#ofMethod(CtClass,CtClass[]) */ public void addInvokeinterface(int clazz, String name, String desc, int count) { add(INVOKEINTERFACE); addIndex(constPool.addInterfaceMethodrefInfo(clazz, name, desc)); add(count); add(0); growStack(Descriptor.dataSize(desc) - 1); }
protected int match(int c, int pos, CodeIterator iterator, int typedesc, ConstPool cp) throws BadBytecode { if (newIndex == 0) { int nt = cp.addNameAndTypeInfo(cp.addUtf8Info(newMethodname), typedesc); int ci = cp.addClassInfo(newClassname); if (c == INVOKEINTERFACE) newIndex = cp.addInterfaceMethodrefInfo(ci, nt); else { if (newMethodIsPrivate && c == INVOKEVIRTUAL) iterator.writeByte(INVOKESPECIAL, pos); newIndex = cp.addMethodrefInfo(ci, nt); } constPool = cp; } iterator.write16bit(newIndex, pos + 1); return pos; } }
protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
protected int copy2(ConstPool dest, int cindex, int ntindex) { return dest.addInterfaceMethodrefInfo(cindex, ntindex); } }
/** * Adds a new <code>CONSTANT_InterfaceMethodref_info</code> * structure. * * <p>This also adds a new <code>CONSTANT_NameAndType_info</code> * structure. * * @param classInfo <code>class_index</code> * @param name <code>name_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @param type <code>descriptor_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @return the index of the added entry. */ public int addInterfaceMethodrefInfo(int classInfo, String name, String type) { int nt = addNameAndTypeInfo(name, type); return addInterfaceMethodrefInfo(classInfo, nt); }
/** * Adds a new <code>CONSTANT_InterfaceMethodref_info</code> * structure. * * <p>This also adds a new <code>CONSTANT_NameAndType_info</code> * structure. * * @param classInfo <code>class_index</code> * @param name <code>name_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @param type <code>descriptor_index</code> * of <code>CONSTANT_NameAndType_info</code>. * @return the index of the added entry. */ public int addInterfaceMethodrefInfo(int classInfo, String name, String type) { int nt = addNameAndTypeInfo(name, type); return addInterfaceMethodrefInfo(classInfo, nt); }
/** * Appends INVOKEINTERFACE. * * @param clazz the index of <code>CONSTANT_Class_info</code> * structure. * @param name the method name * @param desc the descriptor of the method signature. * @param count the count operand of the instruction. * * @see Descriptor#ofMethod(CtClass,CtClass[]) */ public void addInvokeinterface(int clazz, String name, String desc, int count) { add(INVOKEINTERFACE); addIndex(constPool.addInterfaceMethodrefInfo(clazz, name, desc)); add(count); add(0); growStack(Descriptor.dataSize(desc) - 1); }