coins.flow
Class FlowImpl

java.lang.Object
  extended bycoins.flow.FlowImpl
All Implemented Interfaces:
Flow

public class FlowImpl
extends java.lang.Object
implements Flow

FlowImpl class Flow analysis class.


Field Summary
 ControlFlow fControlFlow
           
 DataFlow fDataFlow
           
 int fDbgLevel
           
protected  FlagBox fFlowAnalState
           
protected  int fFlowAnalStateLevel
           
 FlowRoot flowRoot
           
 Subp fSubp
           
 SubpFlow fSubpFlow
           
 java.lang.Object fSubpFlowCurrent
           
 HirRoot hirRoot
           
 IoRoot ioRoot
           
 java.util.Map staticVariableMapOfSubp
          Map a map of static variable and corresponding temporal variable.
 SymRoot symRoot
           
 
Fields inherited from interface coins.flow.Flow
STATE_CFG_AVAILABLE, STATE_CFG_RESTRUCTURING, STATE_DATA_FLOW_AVAILABLE, STATE_DATA_UNAVAILABLE, STATE_HIR_FLOW_AVAILABLE, STATE_LIR_FLOW_AVAILABLE
 
Constructor Summary
FlowImpl()
           
FlowImpl(FlowRoot pFlowRoot)
           
 
Method Summary
 ControlFlow controlFlow()
           
 ControlFlow controlFlowAnal(SubpFlow pSubpFlow)
          controlFlowAnal Do control flow analysis of the subprogram specified by pSubpFlow, i.e.
 DataFlow dataFlow()
           
 DataFlow dataFlowAnal()
           
 DataFlow dataFlowAnal(SubpDefinition pSubpDef)
          dataFlowAnal // REFINE comment.
 void dbg(int level, java.lang.Object pObject)
           
 void dbg(int level, java.lang.String pHeader, java.lang.Object pObject)
           
 void doHir()
          Do control flow analysis and data flow analysis.
 void doHir0(SubpDefinition pSubpDef, SubpFlow pSubpFlow)
           
 boolean getFlowAnalState(int pFlagId)
           
 int getFlowAnalStateLevel()
           
 SubpFlow getSubpFlow()
           
 Subp getSubpUnderAnalysis()
          getSubpFlow Get currently effective SubpFlow information.
 void resetAllFlowInf(Subp pSubp)
           
 void setFlowAnalState(int pFlagId, boolean pYesNo)
           
 void setFlowAnalStateLevel(int pStateLevel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flowRoot

public final FlowRoot flowRoot

ioRoot

public final IoRoot ioRoot

symRoot

public final SymRoot symRoot

hirRoot

public final HirRoot hirRoot

fSubpFlow

public SubpFlow fSubpFlow

fSubpFlowCurrent

public java.lang.Object fSubpFlowCurrent

fSubp

public Subp fSubp

fControlFlow

public ControlFlow fControlFlow

fDataFlow

public DataFlow fDataFlow

fFlowAnalState

protected FlagBox fFlowAnalState

fFlowAnalStateLevel

protected int fFlowAnalStateLevel

staticVariableMapOfSubp

public java.util.Map staticVariableMapOfSubp
Map a map of static variable and corresponding temporal variable. For each subprogram to be expanded inline, a map showing the correspondence between local static variable and temporal variable to be used in replacement is created. staticVariableMapOfSubp maps such map to the subprogram to be inlined.


fDbgLevel

public final int fDbgLevel
Constructor Detail

FlowImpl

public FlowImpl()

FlowImpl

public FlowImpl(FlowRoot pFlowRoot)
Method Detail

controlFlowAnal

public ControlFlow controlFlowAnal(SubpFlow pSubpFlow)
Description copied from interface: Flow
controlFlowAnal Do control flow analysis of the subprogram specified by pSubpFlow, i.e. do initiation by initiateHirControlFlowAnalysis or initiateLirControlFlowAnalisis; invoke control flow analyzer (makeControlFlowGraph); show the result by showAll.

Specified by:
controlFlowAnal in interface Flow
Returns:
control flow information block.

dataFlowAnal

public DataFlow dataFlowAnal(SubpDefinition pSubpDef)
Description copied from interface: Flow
dataFlowAnal // REFINE comment. Do data flow analysis of the subprogram defined by pSubpDef. It is expected that the control flow analysis has already been done. If it is not yet done, initiateHirControlFlowAnayisis or initiateLirControlFlowAnayisis is invoked before the actual data flow analysis takes place. Thus, before the actual data flow analysis, the subprogram is already devided into basic blocks, every executable nodes are indexed, and symbols actually used in the subprogram are recorded.

Specified by:
dataFlowAnal in interface Flow
Returns:
DataFlow information showing the result of analysis.

resetAllFlowInf

public void resetAllFlowInf(Subp pSubp)
Specified by:
resetAllFlowInf in interface Flow

getSubpFlow

public SubpFlow getSubpFlow()
Specified by:
getSubpFlow in interface Flow

getSubpUnderAnalysis

public Subp getSubpUnderAnalysis()
Description copied from interface: Flow
getSubpFlow Get currently effective SubpFlow information.

Specified by:
getSubpUnderAnalysis in interface Flow

controlFlow

public ControlFlow controlFlow()
Specified by:
controlFlow in interface Flow

dataFlow

public DataFlow dataFlow()
Specified by:
dataFlow in interface Flow

dataFlowAnal

public DataFlow dataFlowAnal()
Specified by:
dataFlowAnal in interface Flow

getFlowAnalState

public boolean getFlowAnalState(int pFlagId)

setFlowAnalState

public void setFlowAnalState(int pFlagId,
                             boolean pYesNo)

getFlowAnalStateLevel

public int getFlowAnalStateLevel()
Specified by:
getFlowAnalStateLevel in interface Flow

setFlowAnalStateLevel

public void setFlowAnalStateLevel(int pStateLevel)
Specified by:
setFlowAnalStateLevel in interface Flow

dbg

public void dbg(int level,
                java.lang.String pHeader,
                java.lang.Object pObject)
Specified by:
dbg in interface Flow

dbg

public void dbg(int level,
                java.lang.Object pObject)
Specified by:
dbg in interface Flow

doHir

public void doHir()
Description copied from interface: Flow
Do control flow analysis and data flow analysis. This may be invoked from Driver by flow analysis option in command.

Specified by:
doHir in interface Flow

doHir0

public void doHir0(SubpDefinition pSubpDef,
                   SubpFlow pSubpFlow)