coins.opt
Class ConstFolding

java.lang.Object
  extended bycoins.opt.ConstFolding
Direct Known Subclasses:
ConstFoldingHir

public class ConstFolding
extends java.lang.Object

Constant folding basic logic class.


Field Summary
 FlowRoot flowRoot
           
(package private)  FlowResults fResults
           
protected  SubpFlow fSubpFlow
           
(package private) static int JAVA_BYTE_SIZE
           
(package private) static int JAVA_CHAR_SIZE
           
(package private) static int JAVA_INT_SIZE
           
(package private) static int JAVA_LONG_SIZE
           
(package private) static int JAVA_SHORT_SIZE
           
 
Constructor Summary
ConstFolding(FlowResults pResults)
          ConstFolding Creates new ConstFolding
 
Method Summary
 boolean doBBlock(BBlock pBBlock)
          Performs constant folding for the given BBlock
 boolean doSubp(SubpFlow pSubpFlow)
          Performs constant folding for the subprogram that corresponds to the given SubpFlow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_BYTE_SIZE

static final int JAVA_BYTE_SIZE
See Also:
Constant Field Values

JAVA_CHAR_SIZE

static final int JAVA_CHAR_SIZE
See Also:
Constant Field Values

JAVA_SHORT_SIZE

static final int JAVA_SHORT_SIZE
See Also:
Constant Field Values

JAVA_INT_SIZE

static final int JAVA_INT_SIZE
See Also:
Constant Field Values

JAVA_LONG_SIZE

static final int JAVA_LONG_SIZE
See Also:
Constant Field Values

flowRoot

public final FlowRoot flowRoot

fResults

FlowResults fResults

fSubpFlow

protected SubpFlow fSubpFlow
Constructor Detail

ConstFolding

public ConstFolding(FlowResults pResults)
ConstFolding Creates new ConstFolding

Method Detail

doSubp

public boolean doSubp(SubpFlow pSubpFlow)
Performs constant folding for the subprogram that corresponds to the given SubpFlow.

Returns:
true if the subprogram changed (optimized).

doBBlock

public boolean doBBlock(BBlock pBBlock)
Performs constant folding for the given BBlock

Returns:
true if the underlying IR changed (optimized).