Reviewers: Lex, scottb, Description: Introduces new work-list/dataflow optimizations, with the following methodology:
1) Flatten AST 2) Construct basic blocks and approximate flow control for each method 3) Process dataflow info to do intra-procedural propagation of constants, temps, or expressions, as well as in-block DCE and folding 4) Unflatten AST The dataflow and unflattener parts use an extremely conservative approach currently, due to the fact that some other parts of the compiler may violate the flatteness conditions. Any side effect expressions or potentially aliased expressions short-circuit dataflow. Any variable which is re-defined (not SSA) is blocked from participating in optimizations. The unflattener propagates expressions under these conditions, and therefore runs iteratively, as the short-cirtcuiting expressions are usually pruned after each loop through the worklist permitting further unflattening. Running Flattener+Unflattener together yields 0.5% on Showcase in OBF mode for me. Running Flattener prior to the main compile loop produces much larger bloats due to the current MethodInliner not being very smart. Please review this at http://gwt-code-reviews.appspot.com/64814 Affected files: dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java dev/core/src/com/google/gwt/dev/jjs/impl/Flattener.java dev/core/src/com/google/gwt/dev/jjs/impl/Tracing.java dev/core/src/com/google/gwt/dev/jjs/impl/Unflattener.java dev/core/src/com/google/gwt/dev/jjs/impl/WorklistBasedOptimizer.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/BasicBlock.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/ControlFlow.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/ControlFlowGraph.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/DataFlow.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/UseDef.java dev/core/src/com/google/gwt/dev/jjs/impl/flow/UseDefInfo.java --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
