at.dms.backend
Class CodeSequence

java.lang.Object
  extended by at.dms.backend.CodeSequence

public class CodeSequence
extends 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(at.dms.backend.BasicBlock block)
          Adds a basic block and a jump instruction as needed
 void plantBasicBlock(at.dms.backend.BasicBlock block)
          Adds a basic block at the end of the sequence
 void plantBasicBlock(at.dms.backend.BasicBlock block, int max)
          Adds a basic block at the end of the sequence
 void plantBasicBlock(at.dms.backend.BasicBlock block, JumpInstruction jump, at.dms.backend.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(at.dms.backend.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(at.dms.backend.QNode node)
Adds a quadruple at the end of the sequence

Parameters:
node - the node of the quadruple

jumpToBasicBlock

public void jumpToBasicBlock(at.dms.backend.BasicBlock block)
Adds a basic block and a jump instruction as needed

Parameters:
block - the destination (BasicBlock)

plantBasicBlock

public void plantBasicBlock(at.dms.backend.BasicBlock block)
Adds a basic block at the end of the sequence

Parameters:
block - the destination (BasicBlock)

plantBasicBlock

public void plantBasicBlock(at.dms.backend.BasicBlock block,
                            JumpInstruction jump,
                            at.dms.backend.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(at.dms.backend.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