private GlobalFieldType gft;
private TypeUtil typeutil;
private Map<FlatMethod, LoopInvariant> fm2loopinv;
+ private LoopTerminate lt;
private Hashtable<FlatNode, FlatNode> ntoomap;
private Hashtable<FlatNode, FlatNode> clonemap;
this.typeutil = typeutil;
fm2loopinv = new HashMap<FlatMethod, LoopInvariant>();
}
-
- public void optimize(FlatMethod fm) {
+
+ public void analyze(FlatMethod fm){
loopinv = new LoopInvariant(typeutil, gft);
loopinv.analyze(fm);
fm2loopinv.put(fm, loopinv);
-
+ }
+
+ public void optimize(FlatMethod fm) {
ntoomap=new Hashtable<FlatNode, FlatNode>();
map=new Hashtable<FlatNode, FlatNode>();
clonemap=new Hashtable<FlatNode, FlatNode>();
}
public void definitelyWrittenCheck() {
- methodReadOverWriteAnalysis();
- writtenAnalyis();
+ if (!ssjava.getAnnotationRequireSet().isEmpty()) {
+ methodReadOverWriteAnalysis();
+ writtenAnalyis();
+ }
}
private void writtenAnalyis() {
return annotationRequireSet;
}
+ public void doLoopTerminationCheck(LoopOptimize lo, FlatMethod fm) {
+ LoopTerminate lt = new LoopTerminate();
+ lt.terminateAnalysis(fm, lo.getLoopInvariant(fm));
+ }
+
public void doLoopTerminationCheck(LoopOptimize lo) {
LoopTerminate lt = new LoopTerminate();
for (Iterator iterator = annotationRequireSet.iterator(); iterator.hasNext();) {
continue;
cp.optimize(fm);
dc.optimize(fm);
- if (!state.NOLOOP)
+ if (!state.NOLOOP){
+ lo.analyze(fm);
+ if(state.SSJAVA){
+ ssjava.doLoopTerminationCheck(lo,fm);
+ }
lo.optimize(fm);
+ }
+
+
cp.optimize(fm);
dc.optimize(fm);
lcse.doAnalysis(fm);
}
State.logEvent("Done Optimizing");
- if(state.SSJAVA) {
- ssjava.doLoopTerminationCheck(lo);
- }
}
if (state.FLATIRGRAPH) {