All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.generic.Instruction

java.lang.Object
   |
   +----de.fub.bytecode.generic.Instruction

public abstract class Instruction
extends Object
implements Constants, Cloneable, Serializable
This abstract class is the super class for all java byte codes.

Version:
$Id: Instruction.java,v 1.13 1999/09/22 13:00:09 dahm Exp $
Author:
M. Dahm

Variable Index

 o length
 o tag

Constructor Index

 o Instruction(short, short)

Method Index

 o consumeStack()
 o consumeStack(ConstantPoolGen)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
 o copy()
Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic types are).
 o dump(DataOutputStream)
Dump instruction as byte code to stream out.
 o getLength()
 o getTag()
 o initFromFile(ByteSequence, boolean)
Read needed data (e.g.
 o produceStack()
 o produceStack(ConstantPoolGen)
Also works for instructions whose stack effect depends on the constant pool entry they reference.
 o toString()
 o toString(boolean)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"
 o toString(ConstantPool)

Variables

 o length
 protected short length
 o tag
 protected short tag

Constructors

 o Instruction
 public Instruction(short tag,
                    short length)

Methods

 o dump
 public void dump(DataOutputStream out) throws IOException
Dump instruction as byte code to stream out.

Parameters:
out - Output stream
 o toString
 public String toString(boolean verbose)
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"

Parameters:
verbose - long/short format switch
Returns:
mnemonic for instruction
 o toString
 public String toString()
Returns:
mnemonic for instruction in verbose format
Overrides:
toString in class Object
 o toString
 public String toString(ConstantPool cp)
Returns:
mnemonic for instruction with sumbolic references resolved
 o copy
 public Instruction copy()
Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic types are). This also applies for `Select' instructions with their multiple branch targets.

Returns:
(shallow) copy of an instruction
See Also:
BranchInstruction
 o initFromFile
 protected void initFromFile(ByteSequence bytes,
                             boolean wide) throws IOException
Read needed data (e.g. index) from file.

 o consumeStack
 public int consumeStack()
Returns:
Number of words consumed from stack by this instruction
 o produceStack
 public int produceStack()
Returns:
Number of words produced onto stack by this instruction
 o 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
 o 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
 o getTag
 public short getTag()
Returns:
opcode number
 o getLength
 public int getLength()
Returns:
length (in bytes) of instruction

All Packages  Class Hierarchy  This Package  Previous  Next  Index