|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopt.Optimizer
public class Optimizer
The Optimizer class optimizes the program. It first converts the AST into a control flow graph of basic blocks containing three address code. It then performs data-flow analyses on the CFG and uses these analyses to transform the CFG. Finally, it converts the CFG to assembly code. This class is incomplete and will need to be implemented by the student.
| Constructor Summary | |
|---|---|
Optimizer(ClassTreeNode root,
int optLevel,
boolean debug)
Optimizer constructor |
|
| Method Summary | |
|---|---|
void |
optimize()
Optimize the program In particular, will need to do the following: 0 - build any data structures needed like an ordered class list (which is needed by print) 1 - build the control flow graph (cfg) (a) if opt level > 1 then perform high-level transformations as building cfg 2 - if opt level > 2 then perform low-level opt. |
void |
print()
Print out program |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Optimizer(ClassTreeNode root,
int optLevel,
boolean debug)
root - root of the class hierarchy treeoptLevel - level of optimizationdebug - boolean indicating whether debugging is enabled| Method Detail |
|---|
public void optimize()
public void print()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||