Class StackOptimizer
java.lang.Object
EDU.purdue.cs.bloat.tree.StackOptimizer
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintvoidinfoDisplay(LocalExpr expr) booleanvoidoptimize()Optimize runs the algorithm for analyzing the tree, looking for opportunities to replaces stores and loads with dups and swaps.static voidoptimizeCFG(FlowGraph cfg) booleanshouldStore(LocalExpr expr) Various methods used by CodeGenerator, used as an interface into the information in defInfoMap and useInfoMapbooleanshouldSwap(LocalExpr expr)
-
Constructor Details
-
StackOptimizer
-
-
Method Details
-
optimizeCFG
-
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
Various methods used by CodeGenerator, used as an interface into the information in defInfoMap and useInfoMap -
dups
-
dup_x1s
-
dup_x2s
-
onStack
-
shouldSwap
-
infoDisplay
-