decompose parameter regions into caller regions without regarding method context.
authoryeom <yeom>
Mon, 12 Oct 2009 23:10:01 +0000 (23:10 +0000)
committeryeom <yeom>
Mon, 12 Oct 2009 23:10:01 +0000 (23:10 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java

index b41e3c4..8b79cd9 100644 (file)
@@ -942,47 +942,51 @@ public class MLPAnalysis {
                        MethodContext calleeMCfromOG = ownAnalysis.getCalleeMethodContext(
                                        callerMC, fc);
 
-                       if (calleeMC.equals(calleeMCfromOG)) {
-                               // in this case, this method context calls corresponding callee.
-                               int base;
-                               if (((MethodDescriptor) calleeMC.getDescriptor()).isStatic()) {
-                                       base = 0;
-                               } else {
-                                       base = 1;
-                               }
+                       // disable below condition. currently collect all possible
+                       // allocation sites without regarding method context
 
-                               for (Iterator iterator = paramIndexSet.iterator(); iterator
-                                               .hasNext();) {
-                                       Integer integer = (Integer) iterator.next();
-
-                                       int paramIdx = integer - base;
-                                       if (paramIdx >= 0) {
-                                               // if paramIdx is less than 0, assumes that it is
-                                               // related with wrong method contexts.
-                                               TempDescriptor arg = fc.getArg(paramIdx);
-                                               LabelNode argLN = og.td2ln.get(arg);
-                                               if (argLN != null) {
-                                                       Iterator<ReferenceEdge> iterEdge = argLN
-                                                                       .iteratorToReferencees();
-                                                       while (iterEdge.hasNext()) {
-                                                               ReferenceEdge referenceEdge = (ReferenceEdge) iterEdge
-                                                                               .next();
+                       // if (calleeMC.equals(calleeMCfromOG)) { // in this case, this
+                       // method context calls corresponding callee.
+
+                       int base;
+                       if (((MethodDescriptor) calleeMC.getDescriptor()).isStatic()) {
+                               base = 0;
+                       } else {
+                               base = 1;
+                       }
+
+                       for (Iterator iterator = paramIndexSet.iterator(); iterator
+                                       .hasNext();) {
+                               Integer integer = (Integer) iterator.next();
+
+                               int paramIdx = integer - base;
+                               if (paramIdx >= 0) {
+                                       // if paramIdx is less than 0, assumes that it is
+                                       // related with wrong method contexts.
+                                       TempDescriptor arg = fc.getArg(paramIdx);
+                                       LabelNode argLN = og.td2ln.get(arg);
+                                       if (argLN != null) {
+                                               Iterator<ReferenceEdge> iterEdge = argLN
+                                                               .iteratorToReferencees();
+                                               while (iterEdge.hasNext()) {
+                                                       ReferenceEdge referenceEdge = (ReferenceEdge) iterEdge
+                                                                       .next();
 
-                                                               HeapRegionNode dstHRN = referenceEdge.getDst();
-                                                               if (dstHRN.isParameter()) {
-                                                                       if(!visitedHRN.contains(dstHRN)){
-                                                                               setupRelatedAllocSiteAnalysis(og, callerMC,
-                                                                                               dstHRN, visitedHRN);
-                                                                       }                                                                       
-                                                               } else {
-                                                                       addLiveInAllocationSite(callerMC, dstHRN
-                                                                                       .getAllocationSite());
+                                                       HeapRegionNode dstHRN = referenceEdge.getDst();
+                                                       if (dstHRN.isParameter()) {
+                                                               if (!visitedHRN.contains(dstHRN)) {
+                                                                       setupRelatedAllocSiteAnalysis(og, callerMC,
+                                                                                       dstHRN, visitedHRN);
                                                                }
+                                                       } else {
+                                                               addLiveInAllocationSite(callerMC, dstHRN
+                                                                               .getAllocationSite());
                                                        }
                                                }
                                        }
                                }
                        }
+                       // }
 
                }
                        break;