JML

org.multijava.util.backend
Class QTemporary

java.lang.Object
  extended byorg.multijava.util.backend.QOperand
      extended byorg.multijava.util.backend.QTemporary
All Implemented Interfaces:
QDestination, QOrigin
Direct Known Subclasses:
QStack

class QTemporary
extends QOperand
implements QDestination

This class represents a temporary


Field Summary
private static int _count
           
private  int countUses
           
private  BasicBlock defBlock
           
private  int defPos
           
static QTemporary[] EMPTY
           
private  int pos
           
private  int precolor
           
private  int register
           
private  int type
           
static int UNINITIALIZED
           
static int UNUSED
           
private  BasicBlock useBlock
           
private  int usePos
           
private  boolean usePrecolor
           
 
Constructor Summary
(package private) QTemporary(int type)
           
(package private) QTemporary(int type, int precolor)
           
 
Method Summary
 void def(BasicBlock block, int pos)
          Uses a temporary
 QOrigin duplicate()
          Duplicate this node
 void enforceColor()
          Enforces the precolor
 void generate(CodeSequence seq)
          Generates instructions for this quadruple
 QTemporary getDef()
          Returns the defined temporary.
 InstructionHandle getInstruction()
          Returns the primitive instruction
 QOrigin[] getOrigins()
          returns the parameters of this instruction
 int getPosition()
          Gets position
 int getPrecolor()
          Returns the register number of this temporary
 int getRegister()
          Returns the register number of this temporary
 int getSize()
          Returns the size (the number of slot) of this temporary
 int getType()
          The size (in instruction) of the subtree
 int getUseCount()
          Returns the number of uses
 QTemporary[] getUses()
          Returns the used temporaries.
 void setOrigin(QOrigin origin, int i)
          Sets the parameters of this instruction
 void setPosition(int pos)
          Sets position
 void setRegister(int reg)
           
 void store(CodeSequence seq, boolean isLive)
          Generates instructions for destination
 String toString()
          Human readable form
 void use(BasicBlock block, int pos)
          Uses a temporary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private int type

defBlock

private BasicBlock defBlock

defPos

private int defPos

useBlock

private BasicBlock useBlock

usePos

private int usePos

countUses

private int countUses

register

private int register

precolor

private int precolor

usePrecolor

private boolean usePrecolor

pos

private int pos

_count

private static int _count

UNINITIALIZED

public static final int UNINITIALIZED

UNUSED

public static final int UNUSED

EMPTY

public static final QTemporary[] EMPTY
Constructor Detail

QTemporary

QTemporary(int type)

QTemporary

QTemporary(int type,
           int precolor)
Method Detail

getDef

public QTemporary getDef()
Returns the defined temporary.

Specified by:
getDef in interface QDestination

getUses

public QTemporary[] getUses()
Returns the used temporaries.

Specified by:
getUses in interface QOrigin

getSize

public int getSize()
Returns the size (the number of slot) of this temporary


getRegister

public int getRegister()
Returns the register number of this temporary


getPrecolor

public int getPrecolor()
Returns the register number of this temporary


enforceColor

public void enforceColor()
Enforces the precolor


getType

public int getType()
The size (in instruction) of the subtree

Specified by:
getType in interface QOrigin

toString

public String toString()
Human readable form

Overrides:
toString in class Object

duplicate

public QOrigin duplicate()
Duplicate this node

Specified by:
duplicate in interface QOrigin

use

public void use(BasicBlock block,
                int pos)
Uses a temporary


def

public void def(BasicBlock block,
                int pos)
Uses a temporary


getUseCount

public int getUseCount()
Returns the number of uses


setPosition

public void setPosition(int pos)
Sets position


getPosition

public int getPosition()
Gets position


setRegister

public void setRegister(int reg)

generate

public void generate(CodeSequence seq)
Generates instructions for this quadruple

Specified by:
generate in interface QOrigin
Parameters:
seq - The code sequence of instruction

store

public void store(CodeSequence seq,
                  boolean isLive)
Generates instructions for destination

Specified by:
store in interface QDestination
Parameters:
seq - The code sequence of instruction
isLive - Is the destination live after this store ?

getInstruction

public InstructionHandle getInstruction()
Returns the primitive instruction

Specified by:
getInstruction in interface QOrigin

getOrigins

public QOrigin[] getOrigins()
returns the parameters of this instruction

Specified by:
getOrigins in interface QOrigin

setOrigin

public void setOrigin(QOrigin origin,
                      int i)
Sets the parameters of this instruction

Specified by:
setOrigin in interface QOrigin

JML

JML is Copyright (C) 1998-2002 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. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.