at.dms.backend
Class BasicBlock

java.lang.Object
  |
  +--at.dms.classfile.AbstractInstructionAccessor
        |
        +--at.dms.backend.BasicBlock
All Implemented Interfaces:
AccessorContainer, InstructionAccessor

class BasicBlock
extends AbstractInstructionAccessor
implements AccessorContainer

This class replaces all references to instructions by their associated handle. At the same time, it adds line numbers to the handles and checks if they are references by an instruction, handler or local variable info.


Constructor Summary
BasicBlock(int pos)
          Creates a new basic block
 
Method Summary
 void attachTo(AccessorContainer container)
          Notifies this handle that is has been attached to the specified container.
 void buildQuadruples(MethodEnv env)
          Builds quadruples
 void generateQuadruple(CodeSequence seq)
          Generates the flow of instructions
 InstructionHandle getFirstInstruction()
          Returns the first instruction of the basic block
 QNode getLastNode()
          Returns the last instruction of the basic block
 int getPosition()
          Returns the position of the BasicBlock in the list
 QNode[] getQuadruples()
          Returns the quadruples of this block
 QNode[][] getSuccessorAccess()
          Returns the successors of this block
 QNode[] getSuccessorNodes(int pos, int branch)
          Returns the successors of this block
 BasicBlock[] getSuccessors()
          Returns the successors of this block
 boolean isMarked()
          Sets this block to be marked
 void resolveJump()
          Resolves the jumps Make jumps point to basic block instead of instructions
 void setBody(InstructionHandle[] insns)
          Sets the body of this basic block
 void setBody(QQuadruple[] quads)
          Sets the body of this basic block
 void setMarked(boolean marked)
          Sets this block to be marked
 void setNext(BasicBlock next)
          Sets the next basic block in textual order
 java.lang.String toString()
          Human readable form
 void transformAccessors(AccessorTransformer transformer)
          Transforms the accessors contained in this class.
 
Methods inherited from class at.dms.classfile.AbstractInstructionAccessor
transform
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicBlock

public BasicBlock(int pos)
Creates a new basic block
Method Detail

getPosition

public int getPosition()
Returns the position of the BasicBlock in the list

getQuadruples

public QNode[] getQuadruples()
Returns the quadruples of this block

getSuccessors

public BasicBlock[] getSuccessors()
Returns the successors of this block

getSuccessorAccess

public QNode[][] getSuccessorAccess()
Returns the successors of this block

getSuccessorNodes

public QNode[] getSuccessorNodes(int pos,
                                 int branch)
Returns the successors of this block

setNext

public void setNext(BasicBlock next)
Sets the next basic block in textual order

setBody

public void setBody(InstructionHandle[] insns)
Sets the body of this basic block
Parameters:
insns - the array of instructions

setBody

public void setBody(QQuadruple[] quads)
Sets the body of this basic block
Parameters:
quads - the array of quadruples

getFirstInstruction

public final InstructionHandle getFirstInstruction()
Returns the first instruction of the basic block

getLastNode

public final QNode getLastNode()
Returns the last instruction of the basic block

buildQuadruples

public void buildQuadruples(MethodEnv env)
Builds quadruples

generateQuadruple

public void generateQuadruple(CodeSequence seq)
Generates the flow of instructions

resolveJump

public void resolveJump()
Resolves the jumps Make jumps point to basic block instead of instructions

setMarked

public void setMarked(boolean marked)
Sets this block to be marked

isMarked

public boolean isMarked()
Sets this block to be marked

toString

public java.lang.String toString()
Human readable form
Overrides:
toString in class java.lang.Object

transformAccessors

public void transformAccessors(AccessorTransformer transformer)
                        throws BadAccessorException
Transforms the accessors contained in this class.
Specified by:
transformAccessors in interface AccessorContainer
Parameters:
transformer - the transformer used to transform accessors

attachTo

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