coins.opt
クラス Inline

java.lang.Object
  |
  +--coins.opt.Inline

public class Inline
extends java.lang.Object

Inline class does inline expansion of small subprograms.


フィールドの概要
protected  int fDbgLevel
           
protected  FlowImpl fFlowImpl
           
protected  int fLimitOfExpansionDepth
           
protected  java.util.Map fOptionMap
           
protected  CoinsOptions fOptions
           
protected  java.util.List fPragmaInlineList
           
protected  int fUpperLimitOfNodeCount
           
protected  boolean fWithHirOpt
           
protected  HirRoot hirRoot
           
protected  IoRoot io
           
protected  java.util.Vector SubpBlackList
           
protected  SymRoot symRoot
           
protected  int VALUESUM
           
 
コンストラクタの概要
Inline(HirRoot pHirRoot, SymRoot pSymRoot, IoRoot pIoRoot, java.lang.String pOptionValue, java.util.List pPragmaInlineList, boolean pWithHirOpt, java.lang.String pInlineDepth)
           
 
メソッドの概要
 boolean changeSubp(SubpDefinition pSubpDef)
           
protected  boolean checkCallerSubp_B(SubpDefinition lSubpDef, HirRoot hirRoot, SymRoot symRoot, IoRoot io)
           
(パッケージプライベート)  Var getTempForStaticVar(Var pStaticVar, Subp pSubp)
          getTempForStaticVar get the temporal variable corresponding to the static variable lStaticVar.
protected  boolean inlineCond(HIR pxNode)
          inlineCond decides whether the subprogram called at pxNode should be expanded or not.
protected  void inlineExpansion(HIR pCallNode)
          Expand subprogram called at pCallNode
protected  boolean isLastStmtOfSubp(Stmt pStmt)
           
protected  void replaceLocalStaticVariables(SubpDefinition pSubpDef)
          replaceLocalStaticVariables replaces static variables declared locally in pSubpDef by temporal variable so that local static variables are trreated properly in both cases where the subprogram is expanded and not expanded.
protected  void replaceLocalStaticVariablesInSubtree(HIR pHir, Subp pSubp)
           
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

hirRoot

protected final HirRoot hirRoot

symRoot

protected final SymRoot symRoot

io

protected final IoRoot io

fDbgLevel

protected final int fDbgLevel

fLimitOfExpansionDepth

protected int fLimitOfExpansionDepth

fUpperLimitOfNodeCount

protected int fUpperLimitOfNodeCount

VALUESUM

protected int VALUESUM

fFlowImpl

protected final FlowImpl fFlowImpl

fOptionMap

protected java.util.Map fOptionMap

fOptions

protected CoinsOptions fOptions

SubpBlackList

protected java.util.Vector SubpBlackList

fPragmaInlineList

protected java.util.List fPragmaInlineList

fWithHirOpt

protected boolean fWithHirOpt
コンストラクタの詳細

Inline

public Inline(HirRoot pHirRoot,
              SymRoot pSymRoot,
              IoRoot pIoRoot,
              java.lang.String pOptionValue,
              java.util.List pPragmaInlineList,
              boolean pWithHirOpt,
              java.lang.String pInlineDepth)
メソッドの詳細

changeSubp

public boolean changeSubp(SubpDefinition pSubpDef)

checkCallerSubp_B

protected boolean checkCallerSubp_B(SubpDefinition lSubpDef,
                                    HirRoot hirRoot,
                                    SymRoot symRoot,
                                    IoRoot io)

inlineCond

protected boolean inlineCond(HIR pxNode)
inlineCond decides whether the subprogram called at pxNode should be expanded or not. false number of nodes > fUpperLimitOfNodeCount || external subprogram (subprogram body is not given) || contained in conditional expression (in IfStmt, LoopStmt)//##65 boolean expression //##65 contained in switch selection expression //##65 contained in HirList or IrList //##77 //64 not contained in loop body true number of nodes <= fUpperLimitOfNodeCount //##64 (called in loop body) and

パラメータ:
pxNode - node calling a subprogram.
戻り値:
true if inline expansion is to be done.

inlineExpansion

protected void inlineExpansion(HIR pCallNode)
Expand subprogram called at pCallNode

パラメータ:
pCallNode - call node

getTempForStaticVar

Var getTempForStaticVar(Var pStaticVar,
                        Subp pSubp)
getTempForStaticVar get the temporal variable corresponding to the static variable lStaticVar. For a local static variable declared in a subprogram, a global static temporal variable is generated and registered to a map showing the correspondence with the static variable. If the correspondence is already registered, then the registered temporal variable is returned. If the map is not yet prepared, then create the map. The map for a subprogram is created only once for the entire compile unit. When the map is created, fSubpWithStaticVar is set to pSubp in order to invoke renaming of local static variables in the body of pSubp.

パラメータ:
pSubp - subprogram to be expanded inline.
戻り値:
the temporal variable corresponding to the static variable lStaticVar.

replaceLocalStaticVariables

protected void replaceLocalStaticVariables(SubpDefinition pSubpDef)
replaceLocalStaticVariables replaces static variables declared locally in pSubpDef by temporal variable so that local static variables are trreated properly in both cases where the subprogram is expanded and not expanded. Local static variables are replaced by temporal variable declared as static global and not visible from other compile unit.

パラメータ:
pSubpDef - definition of subprogram to be inline expanded.

replaceLocalStaticVariablesInSubtree

protected void replaceLocalStaticVariablesInSubtree(HIR pHir,
                                                    Subp pSubp)

isLastStmtOfSubp

protected boolean isLastStmtOfSubp(Stmt pStmt)