coins.backend.sched
Class DependNode

java.lang.Object
  extended bycoins.backend.sched.DependNode
All Implemented Interfaces:
java.lang.Comparable

public class DependNode
extends java.lang.Object
implements java.lang.Comparable

LirNode with several information for dependency and scheduling.


Field Summary
(package private)  BiList beDepended
           
(package private) static int counter
           
(package private)  boolean dependMark
           
(package private)  BiList dependOn
           
(package private)  BiList falseDependOn
           
(package private)  boolean hasDelaySlot
          Flag indicates that this node has delayed-operation slot.
(package private)  BiList input
           
(package private)  LirNode instr
           
(package private) static int LAST_TIME
           
(package private)  int latency
           
(package private)  LirNodeInf lirInf
           
(package private)  int machineCodeSize
           
(package private)  int number
           
(package private)  BiList output
           
(package private)  int pathLength
           
(package private)  int scheduleTime
           
(package private)  BiList trueDependOn
           
(package private)  boolean visited
           
 
Constructor Summary
DependNode(LirNode ln, Schedule schedule)
           
 
Method Summary
 int compareTo(java.lang.Object dn)
           
(package private)  boolean contains(BiList bl, LirNode ln)
          return true if bl contains ln.
 boolean deleteDepend(DependNode dn)
          Delete dependent information from true/false-DependOn and set schedule time.
(package private)  BiList dependOn(BiList list)
          Return the list of DependNodes on which this node depends directly or indirectly
(package private)  boolean dependOn(DependNode dn)
          Return true if this DependNode depends on dn, and add this to dn.beDepended.
(package private)  LirNode getCalleeReg()
          Return callee register.
 boolean hasDelaySlot()
           
 boolean isCall()
           
 void letHaveDelaySlot()
           
(package private)  void mark()
          Mark the DependNodes on which this node depends directly or indirectly
(package private)  int pathLength()
          Returns the maximum path length from this node.
(package private)  int scheduleTimeDcr()
          return scheduleTime and post-devrement it
(package private)  void setLatency(int cost)
           
(package private)  void setMachineCodeSize(int size)
           
(package private)  DependNode setScheduleTime(int n)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LAST_TIME

static final int LAST_TIME
See Also:
Constant Field Values

counter

static int counter

number

int number

trueDependOn

BiList trueDependOn

falseDependOn

BiList falseDependOn

dependOn

BiList dependOn

beDepended

BiList beDepended

instr

LirNode instr

lirInf

LirNodeInf lirInf

input

BiList input

output

BiList output

latency

int latency

scheduleTime

int scheduleTime

visited

boolean visited

dependMark

boolean dependMark

pathLength

int pathLength

machineCodeSize

int machineCodeSize

hasDelaySlot

boolean hasDelaySlot
Flag indicates that this node has delayed-operation slot.

Constructor Detail

DependNode

public DependNode(LirNode ln,
                  Schedule schedule)
Method Detail

compareTo

public int compareTo(java.lang.Object dn)
Specified by:
compareTo in interface java.lang.Comparable

setMachineCodeSize

void setMachineCodeSize(int size)

setLatency

void setLatency(int cost)

letHaveDelaySlot

public void letHaveDelaySlot()

hasDelaySlot

public boolean hasDelaySlot()

setScheduleTime

DependNode setScheduleTime(int n)

scheduleTimeDcr

int scheduleTimeDcr()
return scheduleTime and post-devrement it


dependOn

boolean dependOn(DependNode dn)
Return true if this DependNode depends on dn, and add this to dn.beDepended. If it is true dependent add dn to trueDependOn. If it is false dependent add dn to falseDependOn.

Parameters:
dn -
Returns:
trueDepend || falseDepend

dependOn

BiList dependOn(BiList list)
Return the list of DependNodes on which this node depends directly or indirectly


mark

void mark()
Mark the DependNodes on which this node depends directly or indirectly


deleteDepend

public boolean deleteDepend(DependNode dn)
Delete dependent information from true/false-DependOn and set schedule time.

Parameters:
dn -
Returns:
true if this becomes independent

isCall

public boolean isCall()
Returns:
true if this is a call instruction

getCalleeReg

LirNode getCalleeReg()
Return callee register.


contains

boolean contains(BiList bl,
                 LirNode ln)
return true if bl contains ln.

Parameters:
bl - list of LirNode
ln - LirNode (register node or MEM)
Returns:
bl contains ln

pathLength

int pathLength()
Returns the maximum path length from this node. A path is a sequence of dependent nodes. A path length is the sum of the latencys of nodes of the path.

Returns:
this.pathLength

toString

public java.lang.String toString()