org.apache.bcel.generic

Class InvokeInstruction

public abstract class InvokeInstruction extends FieldOrMethod implements ExceptionThrower, TypedInstruction, StackConsumer, StackProducer

Super class for the INVOKExxx family of instructions.
Constructor Summary
protected InvokeInstruction(short opcode, int index)
Method Summary
intconsumeStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Type[]getArgumentTypes(ConstantPoolGen cpg)
StringgetMethodName(ConstantPoolGen cpg)
TypegetReturnType(ConstantPoolGen cpg)
TypegetType(ConstantPoolGen cpg)
intproduceStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
StringtoString(ConstantPool cp)

Constructor Detail

InvokeInstruction

protected InvokeInstruction(short opcode, int index)

Parameters: index to constant pool

Method Detail

consumeStack

public int consumeStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.

Returns: Number of words consumed from stack by this instruction

getArgumentTypes

public Type[] getArgumentTypes(ConstantPoolGen cpg)

Returns: argument types of referenced method.

getMethodName

public String getMethodName(ConstantPoolGen cpg)

Returns: name of referenced method.

getReturnType

public Type getReturnType(ConstantPoolGen cpg)

Returns: return type of referenced method.

getType

public Type getType(ConstantPoolGen cpg)

Returns: return type of referenced method.

produceStack

public int produceStack(ConstantPoolGen cpg)
Also works for instructions whose stack effect depends on the constant pool entry they reference.

Returns: Number of words produced onto stack by this instruction

toString

public String toString(ConstantPool cp)

Returns: mnemonic for instruction with symbolic references resolved