Methods Summary |
---|
public int | consumeStack(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)Also works for instructions whose stack effect depends on the
constant pool entry they reference.
String signature = getSignature(cpg);
Type[] args = Type.getArgumentTypes(signature);
int sum;
if(opcode == Constants.INVOKESTATIC)
sum = 0;
else
sum = 1; // this reference
int n = args.length;
for (int i = 0; i < n; i++)
sum += args[i].getSize();
return sum;
|
public com.sun.org.apache.bcel.internal.generic.Type[] | getArgumentTypes(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
return Type.getArgumentTypes(getSignature(cpg));
|
public java.lang.String | getMethodName(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
return getName(cpg);
|
public com.sun.org.apache.bcel.internal.generic.Type | getReturnType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
return Type.getReturnType(getSignature(cpg));
|
public com.sun.org.apache.bcel.internal.generic.Type | getType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)
return getReturnType(cpg);
|
public int | produceStack(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cpg)Also works for instructions whose stack effect depends on the
constant pool entry they reference.
return getReturnType(cpg).getSize();
|
public java.lang.String | toString(com.sun.org.apache.bcel.internal.classfile.ConstantPool cp)
Constant c = cp.getConstant(index);
StringTokenizer tok = new StringTokenizer(cp.constantToString(c));
return Constants.OPCODE_NAMES[opcode] + " " +
tok.nextToken().replace('.", '/") + tok.nextToken();
|