at.dms.backend
Class CodeSequence

java.lang.Object
  |
  +--at.dms.backend.CodeSequence

public class CodeSequence
extends java.lang.Object

This class reconstructs the code sequence


Constructor Summary
CodeSequence()
           
 
Method Summary
 void close()
          Closes the code sequence Generates pending basic blocks code
 InstructionHandle getCodeStart()
          Returns the first instruction of the sequence
 InstructionHandle getCurrent()
          Returns the (current) last instruction of the sequence
 void jumpToBasicBlock(BasicBlock block)
          Adds a basic block and a jump instruction as needed
 void plantBasicBlock(BasicBlock block)
          Adds a basic block at the end of the sequence
 void plantBasicBlock(BasicBlock block, int max)
          Adds a basic block at the end of the sequence
 void plantBasicBlock(BasicBlock block, JumpInstruction jump, QQuadruple[] transition)
          Adds a basic block at the end of the sequence
 void plantInstruction(Instruction insn)
          Adds an instruction at the end of the sequence
 void plantInstruction(InstructionHandle handle)
          Adds an instruction at the end of the sequence
 void plantQuadruple(QNode node)
          Adds a quadruple at the end of the sequence
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeSequence

public CodeSequence()
Method Detail

getCodeStart

public InstructionHandle getCodeStart()
Returns the first instruction of the sequence

getCurrent

public InstructionHandle getCurrent()
Returns the (current) last instruction of the sequence

plantInstruction

public void plantInstruction(InstructionHandle handle)
Adds an instruction at the end of the sequence
Parameters:
handle - an instruction handle

plantInstruction

public void plantInstruction(Instruction insn)
Adds an instruction at the end of the sequence
Parameters:
insn - the instruction

plantQuadruple

public void plantQuadruple(QNode node)
Adds a quadruple at the end of the sequence
Parameters:
node - the node of the quadruple

jumpToBasicBlock

public void jumpToBasicBlock(BasicBlock block)
Adds a basic block and a jump instruction as needed
Parameters:
block - the destination (BasicBlock)

plantBasicBlock

public void plantBasicBlock(BasicBlock block)
Adds a basic block at the end of the sequence
Parameters:
block - the destination (BasicBlock)

plantBasicBlock

public void plantBasicBlock(BasicBlock block,
                            JumpInstruction jump,
                            QQuadruple[] transition)
Adds a basic block at the end of the sequence
Parameters:
block - the destination (BasicBlock)
jump - the jump instruction to this block
transition - the quadruple MOVE instructions

plantBasicBlock

public void plantBasicBlock(BasicBlock block,
                            int max)
Adds a basic block at the end of the sequence
Parameters:
block - the destination (BasicBlock)
max - the maximum position of this block on the original source this is made to avoid locality problems

close

public void close()
Closes the code sequence Generates pending basic blocks code