sandmark.obfuscate.boolsplitter.dtree
Class StackOptimizer
java.lang.Object
|
+--sandmark.obfuscate.boolsplitter.dtree.StackOptimizer
- public class StackOptimizer
- extends java.lang.Object
StackOptimizer analyzes the relative distances of various uses of
the same definition of a local variable to add dups and swaps to the
bytecode and eliminate loads and stores.
- Author:
- Thomas VanDrunen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
static boolean DEBUG
defInfoMap
java.util.Hashtable defInfoMap
useInfoMap
java.util.Hashtable useInfoMap
owningBlock
Block owningBlock
StackOptimizer
public StackOptimizer(Block owningBlock)
optimizeCFG
public static void optimizeCFG(FlowGraph cfg)
optimize
public void optimize()
- Optimize runs the algorithm for analyzing the tree, looking
for opportunities to replaces stores and loads with dups and
swaps. It initiates several visitors, and information is sotred
in defInfoMap and useInfoMap
shouldStore
public boolean shouldStore(LocalExpr expr)
- Various methods used by CodeGenerator, used as an interface into
the information in defInfoMap and useInfoMap
dups
public int dups(LocalExpr expr)
dup_x1s
public int dup_x1s(LocalExpr expr)
dup_x2s
public int dup_x2s(LocalExpr expr)
onStack
public boolean onStack(LocalExpr expr)
shouldSwap
public boolean shouldSwap(LocalExpr expr)
infoDisplay
public void infoDisplay(LocalExpr expr)