mjc

org.multijava.util.backend
Class CodeSequence

java.lang.Object
  extended byorg.multijava.util.backend.CodeSequence

public class CodeSequence
extends Object

This class reconstructs the code sequence


Field Summary
private  InstructionHandle codeStart
           
private  InstructionHandle current
           
private  int max
           
private  Stack stack
           
 
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(InstructionHandle handle)
          Adds an instruction at the end of the sequence
 void plantInstruction(Instruction insn)
          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
 

Field Detail

codeStart

private InstructionHandle codeStart

current

private InstructionHandle current

max

private int max

stack

private Stack stack
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


mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.