de.fub.bytecode.generic
Class InvokeInstruction

java.lang.Object
  |
  +--de.fub.bytecode.generic.Instruction
        |
        +--de.fub.bytecode.generic.CPInstruction
              |
              +--de.fub.bytecode.generic.FieldOrMethod
                    |
                    +--de.fub.bytecode.generic.InvokeInstruction
Direct Known Subclasses:
INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL

public abstract class InvokeInstruction
extends FieldOrMethod
implements ExceptionThrower

Super class for the INVOKExxx family of instructions.

Version:
$Id: InvokeInstruction.java,v 1.8 1999/09/22 13:00:11 dahm Exp $
Author:
M. Dahm
See Also:
Serialized Form

Fields inherited from class de.fub.bytecode.generic.CPInstruction
index
 
Fields inherited from class de.fub.bytecode.generic.Instruction
length, tag
 
Constructor Summary
protected InvokeInstruction(short tag, int index)
           
 
Method Summary
 int consumeStack(ConstantPoolGen cpg)
          Also works for instructions whose stack effect depends on the constant pool entry they reference.
 Type[] getArgumentTypes(ConstantPoolGen cpg)
           
 java.lang.String getMethodName(ConstantPoolGen cpg)
           
 Type getReturnType(ConstantPoolGen cpg)
           
 Type getType(ConstantPoolGen cpg)
           
 int produceStack(ConstantPoolGen cpg)
          Also works for instructions whose stack effect depends on the constant pool entry they reference.
 java.lang.String toString(ConstantPool cp)
           
 
Methods inherited from class de.fub.bytecode.generic.FieldOrMethod
getClassName, getClassType, getName, getSignature
 
Methods inherited from class de.fub.bytecode.generic.CPInstruction
dump, getIndex, initFromFile, setIndex, toString
 
Methods inherited from class de.fub.bytecode.generic.Instruction
consumeStack, copy, getLength, getTag, produceStack, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvokeInstruction

protected InvokeInstruction(short tag,
                            int index)
Parameters:
index - to constant pool
Method Detail

toString

public java.lang.String toString(ConstantPool cp)
Returns:
mnemonic for instruction with symbolic references resolved
Overrides:
toString in class CPInstruction

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
Overrides:
consumeStack in class Instruction

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
Overrides:
produceStack in class Instruction

getType

public Type getType(ConstantPoolGen cpg)
Returns:
return type of referenced method.
Overrides:
getType in class CPInstruction

getMethodName

public java.lang.String getMethodName(ConstantPoolGen cpg)
Returns:
name of referenced method.

getReturnType

public Type getReturnType(ConstantPoolGen cpg)
Returns:
return type of referenced method.

getArgumentTypes

public Type[] getArgumentTypes(ConstantPoolGen cpg)
Returns:
argument types of referenced method.