JML

org.multijava.util.backend
Class QStack

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

class QStack
extends QTemporary

This class represents a stack placeholder


Field Summary
static QTemporary[] EMPTY
           
static int UNINITIALIZED
           
static int UNUSED
           
 
Constructor Summary
(package private) QStack(int type)
           
 
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

UNINITIALIZED

public static final int UNINITIALIZED

UNUSED

public static final int UNUSED

EMPTY

public static final QTemporary[] EMPTY
Constructor Detail

QStack

QStack(int type)
Method Detail

toString

public String toString()
Human readable form

Overrides:
toString in class QTemporary

getDef

public QTemporary getDef()
Returns the defined temporary.

Specified by:
getDef in interface QDestination
Overrides:
getDef in class QTemporary

getUses

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

Specified by:
getUses in interface QOrigin
Overrides:
getUses in class QTemporary

generate

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

Specified by:
generate in interface QOrigin
Overrides:
generate in class QTemporary
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
Overrides:
store in class QTemporary
Parameters:
seq - The code sequence of instruction
isLive - Is the destination live after this store ?

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

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)

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.