+ MLPAnalysis mlpa=null;
+ if (state.INLINEATOMIC) {
+ Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
+ while(classit.hasNext()) {
+ ClassDescriptor cn=(ClassDescriptor)classit.next();
+ Iterator methodit=cn.getMethods();
+ while(methodit.hasNext()) {
+ // do inlining
+ MethodDescriptor md=(MethodDescriptor)methodit.next();
+ FlatMethod fm=state.getMethodFlat(md);
+ Inliner.inlineAtomic(state, tu, fm, state.inlineatomicdepth);
+ }
+ }
+ }
+
+
+ if (state.OPTIMIZE) {
+ CallGraph callgraph=new CallGraph(state);
+ CopyPropagation cp=new CopyPropagation();
+ DeadCode dc=new DeadCode();
+ GlobalFieldType gft=new GlobalFieldType(callgraph, state, tu.getMain());
+ CSE cse=new CSE(gft, tu);
+ localCSE lcse=new localCSE(gft, tu);
+ LoopOptimize lo=new LoopOptimize(gft, tu);
+ Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
+ while(classit.hasNext()) {
+ ClassDescriptor cn=(ClassDescriptor)classit.next();
+ Iterator methodit=cn.getMethods();
+ while(methodit.hasNext()) {
+ /* Classify parameters */
+ MethodDescriptor md=(MethodDescriptor)methodit.next();
+ FlatMethod fm=state.getMethodFlat(md);
+ cp.optimize(fm);
+ dc.optimize(fm);
+ lo.optimize(fm);
+ cp.optimize(fm);
+ dc.optimize(fm);
+ lcse.doAnalysis(fm);
+ cse.doAnalysis(fm);
+ cp.optimize(fm);
+ dc.optimize(fm);
+ cp.optimize(fm);
+ dc.optimize(fm);
+ }
+ }
+ }
+
+ if (state.FLATIRGRAPH) {
+ FlatIRGraph firg = new FlatIRGraph(state,
+ state.FLATIRGRAPHTASKS,
+ state.FLATIRGRAPHUSERMETHODS,
+ state.FLATIRGRAPHLIBMETHODS);
+ }
+
+ if (state.OWNERSHIP && !state.MLP) {
+ CallGraph callGraph = new CallGraph(state);
+ Liveness liveness = new Liveness();
+ ArrayReferencees ar = new ArrayReferencees(state);
+ OwnershipAnalysis oa = new OwnershipAnalysis(state,
+ tu,
+ callGraph,
+ liveness,
+ ar,
+ state.OWNERSHIPALLOCDEPTH,
+ state.OWNERSHIPWRITEDOTS,
+ state.OWNERSHIPWRITEALL,
+ state.OWNERSHIPALIASFILE,
+ state.METHODEFFECTS);
+ }
+
+ if (state.MLP) {
+ CallGraph callGraph = new CallGraph(state);
+ Liveness liveness = new Liveness();
+ ArrayReferencees ar = new ArrayReferencees(state);
+ OwnershipAnalysis oa = new OwnershipAnalysis(state,
+ tu,
+ callGraph,
+ liveness,
+ ar,
+ state.OWNERSHIPALLOCDEPTH,
+ state.OWNERSHIPWRITEDOTS,
+ state.OWNERSHIPWRITEALL,
+ state.OWNERSHIPALIASFILE,
+ state.METHODEFFECTS);
+ mlpa = new MLPAnalysis(state,
+ tu,
+ callGraph,
+ oa);
+ }
+
+ if (state.DISJOINT) {
+ CallGraph cg = new CallGraph(state);
+ Liveness l = new Liveness();
+ ArrayReferencees ar = new ArrayReferencees(state);
+ DisjointAnalysis oa = new DisjointAnalysis(state, tu, cg, l, ar);
+ }