JML

org.multijava.util.backend
Class QQuadruple

java.lang.Object
  extended byorg.multijava.util.backend.QNode
      extended byorg.multijava.util.backend.QQuadruple
All Implemented Interfaces:
QOrigin

class QQuadruple
extends QNode
implements QOrigin

This class represents a quadruple: a source and a destination


Field Summary
private  QDestination dest
           
private  QOrigin origin
           
 
Constructor Summary
QQuadruple(QDestination dest, QOrigin origin)
           
 
Method Summary
static QTemporary[] buildQuadruples(MethodEnv env, BasicBlock block, InstructionHandle[] insns, QTemporary[] entryStack, ArrayList vect)
          Builds the quadruple list
 QOrigin duplicate()
          Duplicate this node
 void generate(CodeSequence seq)
          Generates instructions for this quadruple
 QTemporary getDef()
          Returns the defined temporary.
 InstructionHandle getInstruction()
          Returns the primitive instruction
 QJump getJump()
          Returns this node a a jump
 QTemporary[] getLivein()
          Returns the livein temporary.
 QTemporary[] getLiveout()
          Returns the liveout temporary.
 QOrigin[] getOrigins()
          returns the parameters of this instruction
 QQuadruple getStore()
          Returns this node a a jump
 QSwitch getSwitch()
          Returns this node a a jump
 int getType()
          The type of this instruction
 QTemporary[] getUses()
          Returns the used temporaries.
 boolean hasSideEffect()
          Returns this node a a jump
 boolean isJump()
          isJump
 boolean isLive(QTemporary temp)
          Is a temporary live at a certin point
 boolean isStore()
          isStore
 boolean isSwitch()
          isJump
private static QOperand[] readOperands(Stack stack, int size)
           
 void setLivein(QTemporary[] livein)
          Sets the livein temporary.
 void setLiveout(QTemporary[] liveout)
          Sets the liveout temporary.
 void setOrigin(QOrigin origin, int i)
          Sets the parameters of this instruction
 String toString()
          Human readable form
 void useStack()
          Uses the stack instead of a local var
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dest

private QDestination dest

origin

private QOrigin origin
Constructor Detail

QQuadruple

public QQuadruple(QDestination dest,
                  QOrigin origin)
Method Detail

isStore

public boolean isStore()
isStore

Overrides:
isStore in class QNode

getStore

public QQuadruple getStore()
Returns this node a a jump

Overrides:
getStore in class QNode

toString

public String toString()
Human readable form

Overrides:
toString in class Object

getType

public int getType()
The type of this instruction

Specified by:
getType in interface QOrigin

duplicate

public QOrigin duplicate()
Duplicate this node

Specified by:
duplicate in interface QOrigin

useStack

public void useStack()
Uses the stack instead of a local var


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

getDef

public QTemporary getDef()
Returns the defined temporary.


getUses

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

Specified by:
getUses in interface QOrigin

generate

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

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

buildQuadruples

public static QTemporary[] buildQuadruples(MethodEnv env,
                                           BasicBlock block,
                                           InstructionHandle[] insns,
                                           QTemporary[] entryStack,
                                           ArrayList vect)
Builds the quadruple list

Parameters:
insns - the list of instructionx
entryStack - the stack in entry
vect - a place holder for quadruples
Returns:
the stack at the end of this basic block

readOperands

private static QOperand[] readOperands(Stack stack,
                                       int size)

getInstruction

public InstructionHandle getInstruction()
Returns the primitive instruction


isJump

public boolean isJump()
isJump


getJump

public QJump getJump()
Returns this node a a jump


isSwitch

public boolean isSwitch()
isJump


getSwitch

public QSwitch getSwitch()
Returns this node a a jump


hasSideEffect

public boolean hasSideEffect()
Returns this node a a jump


getLivein

public QTemporary[] getLivein()
Returns the livein temporary.


setLivein

public void setLivein(QTemporary[] livein)
Sets the livein temporary.


getLiveout

public QTemporary[] getLiveout()
Returns the liveout temporary.


setLiveout

public void setLiveout(QTemporary[] liveout)
Sets the liveout temporary.


isLive

public boolean isLive(QTemporary temp)
Is a temporary live at a certin point


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.