harpoon.Analysis.Tree
Class Simplification
java.lang.Object
harpoon.Analysis.Tree.Simplification
- Direct Known Subclasses:
- AlgebraicSimplification, Canonicalize, DeadCodeElimination, DynamicWBTreePass, GCTraceStore, HeapCheckAdder, InsertWriteBarrier, JumpOptimization, MakeGCThreadSafe, MemHoisting, WriteBarrierConstElim, WriteBarrierPostPass, WriteBarrierTreePass
public abstract class Simplification
- extends Object
Simplification
is a general-purpose simplification engine
for trees.
Warning: this performs modifications on the tree form in place.
- Version:
- $Id: Simplification.java,v 1.4 2002/04/10 03:02:06 cananian Exp $
- Author:
- Duncan Bryce <duncan@lcs.mit.edu>
Nested Class Summary |
static class |
Simplification.Rule
A simplification rule for use with the tree simplifier. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_CMPLT
protected static final int _CMPLT
- See Also:
- Constant Field Values
_CMPLE
protected static final int _CMPLE
- See Also:
- Constant Field Values
_CMPEQ
protected static final int _CMPEQ
- See Also:
- Constant Field Values
_CMPNE
protected static final int _CMPNE
- See Also:
- Constant Field Values
_CMPGE
protected static final int _CMPGE
- See Also:
- Constant Field Values
_CMPGT
protected static final int _CMPGT
- See Also:
- Constant Field Values
_ADD
protected static final int _ADD
- See Also:
- Constant Field Values
_MUL
protected static final int _MUL
- See Also:
- Constant Field Values
_DIV
protected static final int _DIV
- See Also:
- Constant Field Values
_REM
protected static final int _REM
- See Also:
- Constant Field Values
_SHL
protected static final int _SHL
- See Also:
- Constant Field Values
_SHR
protected static final int _SHR
- See Also:
- Constant Field Values
_USHR
protected static final int _USHR
- See Also:
- Constant Field Values
_AND
protected static final int _AND
- See Also:
- Constant Field Values
_OR
protected static final int _OR
- See Also:
- Constant Field Values
_XOR
protected static final int _XOR
- See Also:
- Constant Field Values
_ALIGN
protected static final int _ALIGN
- See Also:
- Constant Field Values
_BINOP
protected static final int _BINOP
- See Also:
- Constant Field Values
_CALL
protected static final int _CALL
- See Also:
- Constant Field Values
_CJUMP
protected static final int _CJUMP
- See Also:
- Constant Field Values
_CONST
protected static final int _CONST
- See Also:
- Constant Field Values
_DATUM
protected static final int _DATUM
- See Also:
- Constant Field Values
_ESEQ
protected static final int _ESEQ
- See Also:
- Constant Field Values
_EXPR
protected static final int _EXPR
- See Also:
- Constant Field Values
_JUMP
protected static final int _JUMP
- See Also:
- Constant Field Values
_LABEL
protected static final int _LABEL
- See Also:
- Constant Field Values
_MEM
protected static final int _MEM
- See Also:
- Constant Field Values
_METHOD
protected static final int _METHOD
- See Also:
- Constant Field Values
_MOVE
protected static final int _MOVE
- See Also:
- Constant Field Values
_NAME
protected static final int _NAME
- See Also:
- Constant Field Values
_NATIVECALL
protected static final int _NATIVECALL
- See Also:
- Constant Field Values
_RETURN
protected static final int _RETURN
- See Also:
- Constant Field Values
_SEGMENT
protected static final int _SEGMENT
- See Also:
- Constant Field Values
_SEQ
protected static final int _SEQ
- See Also:
- Constant Field Values
_TEMP
protected static final int _TEMP
- See Also:
- Constant Field Values
_THROW
protected static final int _THROW
- See Also:
- Constant Field Values
_UNOP
protected static final int _UNOP
- See Also:
- Constant Field Values
_CONSTNULL
protected static final int _CONSTNULL
- See Also:
- Constant Field Values
_CONSTm1
protected static final int _CONSTm1
- See Also:
- Constant Field Values
_CONST0
protected static final int _CONST0
- See Also:
- Constant Field Values
_CONST1
protected static final int _CONST1
- See Also:
- Constant Field Values
Simplification
protected Simplification()
codeFactory
public static HCodeFactory codeFactory(HCodeFactory parent,
List<Simplification.Rule> rules)
- Code factory for applying a set of simplification rules to
tree form. Clones the tree before simplifying it in-place.
simplify
public static void simplify(Tree root,
DerivationGenerator dg,
List<Simplification.Rule> rules)
- Performs simplification on
root
, using the
specified set of simplification rules.
Requires:
root
is a tree.
- Each element of
rules
is an implementation of the
Simplification.Rule
interface.
- The supplied set of rules monotonically reduces all possible
Tree
objects to some fixed point.
- Parameters:
root
- the tree to simplifydg
- a DerivationGenerator
for the tree,
or null
to generate no type information.rules
- the set of simplification rules to apply to the elements
of root
.
contains
protected static boolean contains(int val,
int mask)
- Convenience function to test whether any of the bits in
mask
are set in val
.
_KIND
protected static int _KIND(Tree t)
_OP
protected static int _OP(int op)