harpoon.IR.Bytecode
Class InGen

java.lang.Object
  extended by harpoon.IR.Bytecode.Instr
      extended by harpoon.IR.Bytecode.InGen
All Implemented Interfaces:
HCodeElement, CFGraphable<Instr,harpoon.IR.Bytecode.InstrEdge>, Graph.Node<Instr,harpoon.IR.Bytecode.InstrEdge>, Comparable<Instr>

public class InGen
extends Instr

InGen is used for non-branching instructions. An InGen has an opcode and optional operands. An InGen has exactly one predecessor and exactly one successor.

Note that InGen contain Operand objects for all relevant, explicit or implicit operands of the bytecode instruction. This means that, for example, an iload_0 will be given an OpLocalVariable operand corresponding to the implicit '0', and conversely that invokeinterface will not contain operands for the nargs operand (which is obvious from the method signature) nor for the dummy placeholder value which trails the opcode in the raw bytecode array.

Version:
$Id: InGen.java,v 1.4 2002/02/25 21:04:17 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Field Summary
 
Fields inherited from class harpoon.IR.Bytecode.Instr
arrayFactory
 
Constructor Summary
InGen(String sourcefile, int linenumber, byte[] code, int pc, Code parent)
          Create an InGen from a chunk of bytecode starting at offset pc.
 
Method Summary
 byte getOpcode()
          Return the bytecode opcode of this instruction.
 Operand getOperand(int i)
          Return a specific operand of this instruction.
 Operand[] getOperands()
          Get all the operands of this instruction.
 String toString()
          Return human-readable instruction string.
 
Methods inherited from class harpoon.IR.Bytecode.Instr
compareTo, edgeC, edges, equals, getID, getLineNumber, getSourceFile, hashCode, isPred, isSucc, newEdge, next, next, pred, predC, prev, prev, succ, succC
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InGen

public InGen(String sourcefile,
             int linenumber,
             byte[] code,
             int pc,
             Code parent)
Create an InGen from a chunk of bytecode starting at offset pc. parent is used to lookup constant_pool references.

Method Detail

getOpcode

public byte getOpcode()
Return the bytecode opcode of this instruction.

Specified by:
getOpcode in class Instr
See Also:
Op

getOperand

public Operand getOperand(int i)
Return a specific operand of this instruction.


getOperands

public Operand[] getOperands()
Get all the operands of this instruction.


toString

public String toString()
Return human-readable instruction string.

Overrides:
toString in class Object