edu.rice.cs.cunit.classFile.code.instructions
Class ReferenceInstruction

java.lang.Object
  extended by edu.rice.cs.cunit.classFile.code.instructions.AInstruction
      extended by edu.rice.cs.cunit.classFile.code.instructions.GenericInstruction
          extended by edu.rice.cs.cunit.classFile.code.instructions.ReferenceInstruction

public class ReferenceInstruction
extends GenericInstruction

Instruction containing a reference to the constant pool.

Author:
Mathias

Field Summary
(package private)  int _refSize
          Size of the reference in bytes.
 
Fields inherited from class edu.rice.cs.cunit.classFile.code.instructions.GenericInstruction
_code
 
Constructor Summary
ReferenceInstruction(byte[] bytecode, int pc, int paddingPC, LineNumberTable lnt)
          Make a new generic instruction from the bytecode stating at pc, padded using paddingPC, and use the line number table for branches.
ReferenceInstruction(byte opcode, int constantPoolId)
          Constructor.
 
Method Summary
private  void checkOpcode(byte opcode)
          Check the opcode to make sure it is a reference instruction.
 int getReference()
          Get the constant pool id.
 void setReference(int constantPoolId)
          Set the constant pool id.
 java.lang.String toStringVerbose(ConstantPool cp)
          Return a verbose string representation.
 
Methods inherited from class edu.rice.cs.cunit.classFile.code.instructions.GenericInstruction
equals, getBranchTargets, getBytecode, getBytecode, getBytecodeLength, getOpcode, hashCode, setBranchTargets, toString
 
Methods inherited from class edu.rice.cs.cunit.classFile.code.instructions.AInstruction
getCorrespondingLoad, getCorrespondingStore, makeInstruction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_refSize

int _refSize
Size of the reference in bytes.

Constructor Detail

ReferenceInstruction

public ReferenceInstruction(byte opcode,
                            int constantPoolId)
Constructor.

Parameters:
opcode - invoke opcode
constantPoolId - method id in constant pool

ReferenceInstruction

public ReferenceInstruction(byte[] bytecode,
                            int pc,
                            int paddingPC,
                            LineNumberTable lnt)
Make a new generic instruction from the bytecode stating at pc, padded using paddingPC, and use the line number table for branches.

Parameters:
bytecode - bytecode
pc - starting index in bytecode
paddingPC - PC for padding
lnt - line number table for branches
Method Detail

checkOpcode

private void checkOpcode(byte opcode)
Check the opcode to make sure it is a reference instruction.

Parameters:
opcode - opcode to check

setReference

public void setReference(int constantPoolId)
Set the constant pool id.

Parameters:
constantPoolId - new constant pool id

getReference

public int getReference()
Get the constant pool id.

Returns:
constant pool id

toStringVerbose

public java.lang.String toStringVerbose(ConstantPool cp)
Return a verbose string representation.

Overrides:
toStringVerbose in class AInstruction
Parameters:
cp - constant pool
Returns:
verbose string representation