at.dms.classfile
Class InstructionHandle

java.lang.Object
  |
  +--at.dms.classfile.AbstractInstructionAccessor
        |
        +--at.dms.classfile.InstructionHandle
All Implemented Interfaces:
InstructionAccessor

class InstructionHandle
extends AbstractInstructionAccessor


Constructor Summary
InstructionHandle(Instruction insn, InstructionHandle prev)
          Creates a new instruction handle.
 
Method Summary
 void attachTo(AccessorContainer container)
          Notifies this handle that is has been attached to the specified container.
(package private)  boolean checkInstruction(CodeEnv env, int curStack)
          Verifies the enclosed instruction and computes the stack height.
(package private)  void dump()
           
 Instruction getInstruction()
          Returns the enclosed instruction.
(package private)  int getLocalVar()
          Returns the maximum index of local vars used by this instruction.
 InstructionHandle getNext()
          Returns the handle of the next instruction in textual order.
(package private)  CodePosition getPosition()
          Gets the position of current instruction
(package private)  int getStackHeight()
          Returns the stack height after execution of this instruction.
(package private)  void setAddress()
          Sets the final position of this instruction in the code array.
(package private)  boolean setAddressAndAdvancePC(CodePosition position)
          Sets the position of this instruction and return true if address is final.
 
Methods inherited from class at.dms.classfile.AbstractInstructionAccessor
transform
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstructionHandle

public InstructionHandle(Instruction insn,
                         InstructionHandle prev)
Creates a new instruction handle.
Parameters:
insn - the instruction
prev - the handle of the next instruction in textual order
Method Detail

getInstruction

public Instruction getInstruction()
Returns the enclosed instruction.

getNext

public InstructionHandle getNext()
Returns the handle of the next instruction in textual order.

attachTo

public void attachTo(AccessorContainer container)
Notifies this handle that is has been attached to the specified container.

getPosition

CodePosition getPosition()
Gets the position of current instruction

getStackHeight

final int getStackHeight()
Returns the stack height after execution of this instruction.

getLocalVar

final int getLocalVar()
Returns the maximum index of local vars used by this instruction.

checkInstruction

final boolean checkInstruction(CodeEnv env,
                               int curStack)
                        throws ClassFileFormatException
Verifies the enclosed instruction and computes the stack height.
Parameters:
env - the check environment
curStack - the stack height at the beginning of the execution of the instruction
Returns:
true iff the next instruction in textual order needs to be checked, i.e. this instruction has not been checked before and it can complete normally
Throws:
ClassFileFormatException - a problem was detected

setAddressAndAdvancePC

boolean setAddressAndAdvancePC(CodePosition position)
Sets the position of this instruction and return true if address is final.

setAddress

void setAddress()
Sets the final position of this instruction in the code array.

dump

void dump()