import IR.TypeUtil;
import IR.Flat.BuildFlat;
import IR.Flat.FlatMethod;
+import IR.Flat.FlatNode;
import Util.Pair;
public class SSJavaAnalysis {
// points to method containing SSJAVA Loop
private MethodDescriptor methodContainingSSJavaLoop;
+ private FlatNode ssjavaLoopEntrance;
+
// keep the field ownership from the linear type checking
Hashtable<MethodDescriptor, Set<FieldDescriptor>> mapMethodToOwnedFieldSet;
+ Set<FlatNode> sameHeightWriteFlatNodeSet;
+
CallGraph callgraph;
LinearTypeCheck checker;
this.bf = bf;
this.trustWorthyMDSet = new HashSet<MethodDescriptor>();
this.mapMethodToOwnedFieldSet = new Hashtable<MethodDescriptor, Set<FieldDescriptor>>();
+ this.sameHeightWriteFlatNodeSet = new HashSet<FlatNode>();
}
public void doCheck() {
// if (state.SSJAVADEBUG) {
// debugPrint();
// }
- parseLocationAnnotation();
- // inference();
- doFlowDownCheck();
- doDefinitelyWrittenCheck();
- debugDoLoopCheck();
+ if (state.SSJAVAINFER) {
+ inference();
+ } else {
+ parseLocationAnnotation();
+ doFlowDownCheck();
+ doDefinitelyWrittenCheck();
+ doLoopCheck();
+ }
}
private void inference() {
- SSJavaInferenceEngine inferEngine = new SSJavaInferenceEngine(this, state);
+ LocationInference inferEngine = new LocationInference(this, state);
inferEngine.inference();
}
- private void debugDoLoopCheck() {
+ private void doLoopCheck() {
GlobalFieldType gft = new GlobalFieldType(callgraph, state, tu.getMain());
LoopOptimize lo = new LoopOptimize(gft, tu);
return false;
}
+ public FlatNode getSSJavaLoopEntrance() {
+ return ssjavaLoopEntrance;
+ }
+
+ public void setSSJavaLoopEntrance(FlatNode ssjavaLoopEntrance) {
+ this.ssjavaLoopEntrance = ssjavaLoopEntrance;
+ }
+
+ public void addSameHeightWriteFlatNode(FlatNode fn) {
+ this.sameHeightWriteFlatNodeSet.add(fn);
+ }
+
+ public boolean isSameHeightWrite(FlatNode fn) {
+ return this.sameHeightWriteFlatNodeSet.contains(fn);
+ }
+
}