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

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.WideInstruction

public class WideInstruction
extends GenericInstruction

Wide Java instruction.

Author:
Mathias Ricken

Field Summary
 
Fields inherited from class edu.rice.cs.cunit.classFile.code.instructions.GenericInstruction
_code
 
Constructor Summary
WideInstruction(byte[] code)
          Constructor.
WideInstruction(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.
 
Method Summary
 int getBytecodeLength(int pc)
          Get the length bytecode for this instruction, padded for the specified program counter value.
 byte getOpcode()
          Get the opcode of this instruction.
 int hashCode()
          Return hash code.
 void setBranchTargets(int[] branchTargets)
          Set the branch target indices.
 java.lang.String toString()
          Return instruction in human-readable form.
 
Methods inherited from class edu.rice.cs.cunit.classFile.code.instructions.GenericInstruction
equals, getBranchTargets, getBytecode, getBytecode
 
Methods inherited from class edu.rice.cs.cunit.classFile.code.instructions.AInstruction
getCorrespondingLoad, getCorrespondingStore, makeInstruction, toStringVerbose
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WideInstruction

public WideInstruction(byte[] code)
Constructor.

Parameters:
code - bytecode for generic instruction, excluding the WIDE opcode

WideInstruction

public WideInstruction(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

getOpcode

public byte getOpcode()
Get the opcode of this instruction.

Overrides:
getOpcode in class GenericInstruction
Returns:
opcode

getBytecodeLength

public int getBytecodeLength(int pc)
Get the length bytecode for this instruction, padded for the specified program counter value.

Overrides:
getBytecodeLength in class GenericInstruction
Parameters:
pc - PC for padding
Returns:
bytecode length

hashCode

public int hashCode()
Return hash code.

Overrides:
hashCode in class GenericInstruction
Returns:
hash code

setBranchTargets

public void setBranchTargets(int[] branchTargets)
Set the branch target indices.

Overrides:
setBranchTargets in class GenericInstruction
Parameters:
branchTargets - array of target indices

toString

public java.lang.String toString()
Return instruction in human-readable form.

Overrides:
toString in class GenericInstruction
Returns:
string representation