void write(DataOutput out) throws IOException { super.write(out); out.writeShort(_index); if (getOpcode() == Constants.INVOKEINTERFACE) { String[] args = getMethodParamNames(); int count = 1; for (int i = 0; i < args.length; i++, count++) if (long.class.getName().equals(args[i]) || double.class.getName().equals(args[i])) count++; out.writeByte(count); out.writeByte(0); } else if (getOpcode() == Constants.INVOKEDYNAMIC) { out.writeByte(0); out.writeByte(0); } } }
void write(DataOutput out) throws IOException { super.write(out); out.writeShort(_index); if (getOpcode() == Constants.INVOKEINTERFACE) { String[] args = getMethodParamNames(); int count = 1; for (int i = 0; i < args.length; i++, count++) if (long.class.getName().equals(args[i]) || double.class.getName().equals(args[i])) count++; out.writeByte(count); out.writeByte(0); } else if (getOpcode() == Constants.INVOKEDYNAMIC) { out.writeByte(0); out.writeByte(0); } } }
public int getStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg (2 for longs, doubles) String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++, stack--) if (long.class.getName().equals(params[i]) || double.class.getName().equals(params[i])) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; if (long.class.getName().equals(ret) || double.class.getName().equals(ret)) stack++; return stack; }
public int getStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg (2 for longs, doubles) String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++, stack--) if (long.class.getName().equals(params[i]) || double.class.getName().equals(params[i])) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; if (long.class.getName().equals(ret) || double.class.getName().equals(ret)) stack++; return stack; }
public int getLogicalStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; return stack; }
public int getLogicalStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; return stack; }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public String getMethodDeclarerName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { // InvokeDynamic doesn't hvae a method declarer, but it does have a bootstrap index. InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = String.valueOf(ide.getBootstrapMethodAttrIndex()); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = getProject().getNameCache().getExternalForm (entry.getClassEntry().getNameEntry().getValue(), false); } if (name.length() == 0) return null; return name; }
/** * Return the declaring type of the method this instruction operates on, * or null if not set. */ public String getMethodDeclarerName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { // InvokeDynamic doesn't hvae a method declarer, but it does have a bootstrap index. InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = String.valueOf(ide.getBootstrapMethodAttrIndex()); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = getProject().getNameCache().getExternalForm (entry.getClassEntry().getNameEntry().getValue(), false); } if (name.length() == 0) return null; return name; }
/** * Return the name of the method this instruction operates on, or null * if not set. */ public String getMethodName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = ide.getNameAndTypeEntry().getNameEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = entry.getNameAndTypeEntry().getNameEntry().getValue(); } if (name.length() == 0) { name = null; } return name; }
/** * Return the name of the method this instruction operates on, or null * if not set. */ public String getMethodName() { if (_index == 0) return null; String name = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); name = ide.getNameAndTypeEntry().getNameEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); name = entry.getNameAndTypeEntry().getNameEntry().getValue(); } if (name.length() == 0) { name = null; } return name; }
if (getOpcode() == Constants.INVOKEINTERFACE) return setMethodIndex(getPool().findInterfaceMethodEntry(dec, name, desc, true)); if (getOpcode() == Constants.INVOKEDYNAMIC) { int bootstrapindex = Integer.parseInt(dec); // Dec represents the bootstrap index return setMethodIndex(getPool().findInvokeDynamicEntry(bootstrapindex, name, desc, true));
if (getOpcode() == Constants.INVOKEINTERFACE) return setMethodIndex(getPool().findInterfaceMethodEntry(dec, name, desc, true)); if (getOpcode() == Constants.INVOKEDYNAMIC) { int bootstrapindex = Integer.parseInt(dec); // Dec represents the bootstrap index return setMethodIndex(getPool().findInvokeDynamicEntry(bootstrapindex, name, desc, true));
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public String getMethodReturnName() { if (_index == 0) return null; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry().getValue(); } NameCache cache = getProject().getNameCache(); String name = cache.getExternalForm(cache.getDescriptorReturnName(desc), false); if (name.length() == 0) return null; return name; }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public String getMethodReturnName() { if (_index == 0) return null; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry().getValue(); } NameCache cache = getProject().getNameCache(); String name = cache.getExternalForm(cache.getDescriptorReturnName(desc), false); if (name.length() == 0) return null; return name; }
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public String[] getMethodParamNames() { if (_index == 0) return new String[0]; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry(). getValue(); } NameCache cache = getProject().getNameCache(); String[] names = cache.getDescriptorParamNames(desc); for (int i = 0; i < names.length; i++) names[i] = cache.getExternalForm(names[i], false); return names; }
/** * Return the param types of the method this instruction operates on, * or empty array if none. */ public String[] getMethodParamNames() { if (_index == 0) return new String[0]; String desc = null; if (getOpcode() == Constants.INVOKEDYNAMIC) { InvokeDynamicEntry ide = (InvokeDynamicEntry) getPool().getEntry(_index); desc = ide.getNameAndTypeEntry().getDescriptorEntry().getValue(); } else { ComplexEntry entry = (ComplexEntry) getPool().getEntry(_index); desc = entry.getNameAndTypeEntry().getDescriptorEntry(). getValue(); } NameCache cache = getProject().getNameCache(); String[] names = cache.getDescriptorParamNames(desc); for (int i = 0; i < names.length; i++) names[i] = cache.getExternalForm(names[i], false); return names; }