reflect changes of allocation site and heap region identifier.
authoryeom <yeom>
Wed, 18 Nov 2009 19:45:57 +0000 (19:45 +0000)
committeryeom <yeom>
Wed, 18 Nov 2009 19:45:57 +0000 (19:45 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java
Robust/src/Analysis/MLP/SESEEffectsKey.java
Robust/src/Analysis/OwnershipAnalysis/EffectsKey.java
Robust/src/Analysis/OwnershipAnalysis/MethodEffects.java
Robust/src/IR/Flat/FlatSESEEnterNode.java

index 37fe8dea4bbd6e0f4413dbd72d2031cb0cbbdc98..768685e3aab29ba07a8107f6473b7af2d4ae8cb3 100644 (file)
@@ -211,9 +211,18 @@ public class MLPAnalysis {
     // Parent/child memory conflicts analysis
     seseConflictsForward(javaCallGraph);
     
+    Set<MethodContext> keySet=mapMethodContextToLiveInAllocationSiteSet.keySet();
+    for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+               MethodContext methodContext = (MethodContext) iterator.next();
+               HashSet<AllocationSite> asSet=mapMethodContextToLiveInAllocationSiteSet.get(methodContext);
+               for (Iterator iterator2 = asSet.iterator(); iterator2.hasNext();) {
+                       AllocationSite allocationSite = (AllocationSite) iterator2.next();
+               }
+       }
+    
      // disjoint analysis with a set of flagged allocation sites of live-in variables & stall sites
        try {
-         OwnershipAnalysis oa2 = new OwnershipAnalysis(state, 
+         ownAnalysisForSESEConflicts = new OwnershipAnalysis(state, 
                                                         tu, 
                                                         callGraph, 
                                                         ownAnalysis.liveness,
@@ -1074,7 +1083,7 @@ public class MLPAnalysis {
 
                        FlatSESEEnterNode fsen = (FlatSESEEnterNode) fn;
                        assert fsen.equals(currentSESE);
-                       
+
                        if (!fsen.getIsCallerSESEplaceholder()) {
                                // uniquely taint each live-in variable
                                Set<TempDescriptor> set = fsen.getInVarSet();
@@ -1118,7 +1127,7 @@ public class MLPAnalysis {
 
                case FKind.FlatSESEExitNode: {
                        FlatSESEExitNode fsexit = (FlatSESEExitNode) fn;
-                       
+
                        if (!fsexit.getFlatEnter().getIsCallerSESEplaceholder()) {
 
                                FlatSESEEnterNode enterNode = fsexit.getFlatEnter();
@@ -1147,7 +1156,8 @@ public class MLPAnalysis {
                                                                        .next();
                                                        parentEffectsSet.add(new SESEEffectsKey(seseKey
                                                                        .getFieldDescriptor(), seseKey
-                                                                       .getTypeDescriptor(), seseKey.getHRNId()));
+                                                                       .getTypeDescriptor(), seseKey.getHRNId(),
+                                                                       seseKey.getHRNUniqueId()));
                                                }
 
                                                parentReadTable.put(td, parentEffectsSet);
@@ -1174,7 +1184,8 @@ public class MLPAnalysis {
                                                                        .next();
                                                        parentEffectsSet.add(new SESEEffectsKey(seseKey
                                                                        .getFieldDescriptor(), seseKey
-                                                                       .getTypeDescriptor(), seseKey.getHRNId()));
+                                                                       .getTypeDescriptor(), seseKey.getHRNId(),
+                                                                       seseKey.getHRNUniqueId()));
                                                }
 
                                                parentWriteTable.put(td, parentEffectsSet);
@@ -1202,7 +1213,8 @@ public class MLPAnalysis {
                                                                        .next();
                                                        parentEffectsSet.add(new SESEEffectsKey(seseKey
                                                                        .getFieldDescriptor(), seseKey
-                                                                       .getTypeDescriptor(), seseKey.getHRNId()));
+                                                                       .getTypeDescriptor(), seseKey.getHRNId(),
+                                                                       seseKey.getHRNUniqueId()));
                                                }
 
                                                parentstrongUpdateTable.put(td, parentEffectsSet);
@@ -1244,9 +1256,14 @@ public class MLPAnalysis {
                                                                                .next();
                                                                if (field.getSymbol().equals(
                                                                                referenceEdge.getField())) {
-                                                                       currentSESE.readEffects(affectedTD, field
-                                                                                       .getSymbol(), src.getType(),
-                                                                                       referenceEdge.getDst().getID());
+
+                                                                       HeapRegionNode refHRN = og.id2hrn
+                                                                                       .get(referenceEdge.getDst().getID());
+
+                                                                       currentSESE
+                                                                                       .readEffects(affectedTD, field
+                                                                                                       .getSymbol(),
+                                                                                                       src.getType(), refHRN);
                                                                }
                                                        }
 
@@ -1281,8 +1298,7 @@ public class MLPAnalysis {
                                                        TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
                                                                        .next();
                                                        currentSESE.readEffects(tempDescriptor, field
-                                                                       .getSymbol(), src.getType(), accessHRN
-                                                                       .getID());
+                                                                       .getSymbol(), src.getType(), accessHRN);
                                                }
                                                // }
                                        }
@@ -1304,8 +1320,7 @@ public class MLPAnalysis {
                                                                while (hrnIter.hasNext()) {
                                                                        HeapRegionNode hrn = hrnIter.next();
                                                                        currentSESE.readEffects(affectedTD, field
-                                                                                       .getSymbol(), src.getType(), hrn
-                                                                                       .getID());
+                                                                                       .getSymbol(), src.getType(), hrn);
                                                                }
 
                                                        }
@@ -1372,10 +1387,13 @@ public class MLPAnalysis {
                                                                                .next();
                                                                if (field.getSymbol().equals(
                                                                                referenceEdge.getField())) {
+
+                                                                       HeapRegionNode refHRN = og.id2hrn
+                                                                                       .get(referenceEdge.getDst().getID());
+
                                                                        currentSESE.writeEffects(affectedTD, field
                                                                                        .getSymbol(), dst.getType(),
-                                                                                       referenceEdge.getDst().getID(),
-                                                                                       strongUpdate);
+                                                                                       refHRN, strongUpdate);
                                                                }
                                                        }
 
@@ -1409,8 +1427,8 @@ public class MLPAnalysis {
                                                        TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
                                                                        .next();
                                                        currentSESE.writeEffects(tempDescriptor, field
-                                                                       .getSymbol(), dst.getType(), accessHRN
-                                                                       .getID(), strongUpdate);
+                                                                       .getSymbol(), dst.getType(), accessHRN,
+                                                                       strongUpdate);
                                                }
                                                // }
                                        }
@@ -1430,8 +1448,8 @@ public class MLPAnalysis {
                                                                while (hrnIter.hasNext()) {
                                                                        HeapRegionNode hrn = hrnIter.next();
                                                                        currentSESE.writeEffects(affectedTD, field
-                                                                                       .getSymbol(), dst.getType(), hrn
-                                                                                       .getID(), strongUpdate);
+                                                                                       .getSymbol(), dst.getType(), hrn,
+                                                                                       strongUpdate);
 
                                                                }
 
@@ -1503,9 +1521,13 @@ public class MLPAnalysis {
                                                                        while (hrnIter.hasNext()) {
                                                                                Integer hrnID = (Integer) hrnIter
                                                                                                .next();
+
+                                                                               HeapRegionNode refHRN = og.id2hrn
+                                                                                               .get(hrnID);
+
                                                                                currentSESE.readEffects(affectedTD, key
                                                                                                .getFieldDescriptor(), key
-                                                                                               .getTypeDescriptor(), hrnID);
+                                                                                               .getTypeDescriptor(), refHRN);
                                                                        }
                                                                }
                                                        }
@@ -1524,10 +1546,14 @@ public class MLPAnalysis {
                                                                        while (hrnIter.hasNext()) {
                                                                                Integer hrnID = (Integer) hrnIter
                                                                                                .next();
+
+                                                                               HeapRegionNode refHRN = og.id2hrn
+                                                                                               .get(hrnID);
+
                                                                                currentSESE.writeEffects(affectedTD,
                                                                                                key.getFieldDescriptor(), key
                                                                                                                .getTypeDescriptor(),
-                                                                                               hrnID, false);
+                                                                                               refHRN, false);
                                                                        }
 
                                                                }
@@ -1547,10 +1573,14 @@ public class MLPAnalysis {
                                                                        while (hrnIter.hasNext()) {
                                                                                Integer hrnID = (Integer) hrnIter
                                                                                                .next();
+
+                                                                               HeapRegionNode refHRN = og.id2hrn
+                                                                                               .get(hrnID);
+
                                                                                currentSESE.writeEffects(affectedTD,
                                                                                                key.getFieldDescriptor(), key
                                                                                                                .getTypeDescriptor(),
-                                                                                               hrnID, true);
+                                                                                               refHRN, true);
                                                                        }
 
                                                                }
@@ -1571,6 +1601,7 @@ public class MLPAnalysis {
        }
        
        private void flagAllocationSite(MethodContext mc, AllocationSite ac){
+               
                HashSet<AllocationSite> set=mapMethodContextToLiveInAllocationSiteSet.get(mc);
                if(set==null){
                        set=new HashSet<AllocationSite>();                      
index fbb58a2490257eec00019a15a0413abbe0ede9ce..4c5af54de4979d4c10bec2aa9d813908c4a5ba52 100644 (file)
@@ -7,11 +7,13 @@ public class SESEEffectsKey {
        private String fd;
        private TypeDescriptor td;
        private Integer hrnId;
+       private String hrnUniqueId;
 
-       public SESEEffectsKey(String fd, TypeDescriptor td, Integer hrnId) {
+       public SESEEffectsKey(String fd, TypeDescriptor td, Integer hrnId, String hrnUniqueId) {
                this.fd = fd;
                this.td = td;
                this.hrnId = hrnId;
+               this.hrnUniqueId=hrnUniqueId;
        }
 
        public String getFieldDescriptor() {
@@ -25,6 +27,10 @@ public class SESEEffectsKey {
        public Integer getHRNId() {
                return hrnId;
        }
+       
+       public String getHRNUniqueId(){
+               return hrnUniqueId;
+       }
 
        public String toString() {
                return "(" + td + ")" + fd + "#" + hrnId;
index 39d9c6c1c50a6a0e991d67f5476cd53a296e93b2..9a2b97ee63ae0f71a52de13af7f8cde76903dc95 100644 (file)
@@ -7,11 +7,13 @@ public class EffectsKey {
        private String fd;
        private TypeDescriptor td;
        private Integer hrnId;
+       private String hrnUniqueId;
 
-       public EffectsKey(String fd, TypeDescriptor td, Integer hrnId) {
+       public EffectsKey(String fd, TypeDescriptor td, Integer hrnId, String hrnUniqueId) {
                this.fd = fd;
                this.td = td;
                this.hrnId = hrnId;
+               this.hrnUniqueId=hrnUniqueId;
        }
 
        public String getFieldDescriptor() {
@@ -25,6 +27,10 @@ public class EffectsKey {
        public Integer getHRNId() {
                return hrnId;
        }
+       
+       public String getHRNUniqueId(){
+               return hrnUniqueId;
+       }
 
        public String toString() {
                return "(" + td + ")" + fd + "#" + hrnId;
index cacb40af02319ffa6cb15b4d95444c6928a1ee37..e84fc8c6bb5ea901764d76b2b5c4b1f6c30ac95f 100644 (file)
@@ -40,7 +40,9 @@ public class MethodEffects {
                                                while (paramIter.hasNext()) {
                                                        Integer paramID = paramIter.next();
                                                        effectsSet.addReadingVar(paramID, new EffectsKey(
-                                                                       fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID()));
+                                                       fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                     effectsSet.addReadingVar(paramID, new EffectsKey(
+//                                                                     fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID()));
 
                                                }
                                        }
@@ -55,7 +57,9 @@ public class MethodEffects {
                                                while (paramIter.hasNext()) {
                                                        Integer paramID = paramIter.next();
                                                        effectsSet.addReadingVar(paramID, new EffectsKey(
-                                                                       fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID()));
+                                                                       fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                     effectsSet.addReadingVar(paramID, new EffectsKey(
+//                                                                     fieldDesc.getSymbol(), srcDesc.getType(),hrn.getID()));
 
                                                }
                                        }
@@ -107,10 +111,14 @@ public class MethodEffects {
                                                while (paramIter.hasNext()) {
                                                        Integer paramID = paramIter.next();
                                                        effectsSet.addWritingVar(paramID, new EffectsKey(
-                                                                       fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
+                                                                       fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                     effectsSet.addWritingVar(paramID, new EffectsKey(
+//                                                                     fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
                                                        if(strongUpdate){
                                                                effectsSet.addStrongUpdateVar(paramID, new EffectsKey(
-                                                                               fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
+                                                                               fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                             effectsSet.addStrongUpdateVar(paramID, new EffectsKey(
+//                                                                             fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
                                                        }
 
                                                }
@@ -126,10 +134,14 @@ public class MethodEffects {
                                                while (paramIter.hasNext()) {
                                                        Integer paramID = paramIter.next();
                                                        effectsSet.addWritingVar(paramID, new EffectsKey(
-                                                                       fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
+                                                                       fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                     effectsSet.addWritingVar(paramID, new EffectsKey(
+//                                                                     fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
                                                        if(strongUpdate){
                                                                effectsSet.addStrongUpdateVar(paramID, new EffectsKey(
-                                                                               fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
+                                                                               fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID(),hrn.getGloballyUniqueIdentifier()));
+//                                                             effectsSet.addStrongUpdateVar(paramID, new EffectsKey(
+//                                                                             fieldDesc.getSymbol(), dstDesc.getType(),hrn.getID()));
                                                        }
 
                                                }
index b2de4d12783b78f8454eaab88fa3af69122f9b38..2e59a992dfce972581b40ac573b557eb31c63230 100644 (file)
@@ -8,6 +8,7 @@ import Analysis.MLP.SESEEffectsKey;
 import Analysis.MLP.SESEEffectsSet;
 import Analysis.MLP.SESEandAgePair;
 import Analysis.MLP.VariableSourceToken;
+import Analysis.OwnershipAnalysis.HeapRegionNode;
 import IR.ClassDescriptor;
 import IR.FieldDescriptor;
 import IR.MethodDescriptor;
@@ -337,15 +338,15 @@ public class FlatSESEEnterNode extends FlatNode {
     return 31*id;
   }
   
-  public void writeEffects(TempDescriptor td, String fd, TypeDescriptor type, Integer hrnId, boolean strongUpdate){
-         seseEffectsSet.addWritingVar(td, new SESEEffectsKey(fd, type, hrnId));
+  public void writeEffects(TempDescriptor td, String fd, TypeDescriptor type, HeapRegionNode hrn, boolean strongUpdate){
+         seseEffectsSet.addWritingVar(td, new SESEEffectsKey(fd, type, hrn.getID(), hrn.getGloballyUniqueIdentifier()));
          if(strongUpdate){
-                 seseEffectsSet.addStrongUpdateVar(td, new SESEEffectsKey(fd, type, hrnId));
+                 seseEffectsSet.addStrongUpdateVar(td, new SESEEffectsKey(fd, type, hrn.getID(), hrn.getGloballyUniqueIdentifier()));
          }
   }
   
-  public void readEffects(TempDescriptor td, String fd, TypeDescriptor type, Integer hrnId ){
-         seseEffectsSet.addReadingVar(td, new SESEEffectsKey(fd, type, hrnId));
+  public void readEffects(TempDescriptor td, String fd, TypeDescriptor type, HeapRegionNode hrn ){
+         seseEffectsSet.addReadingVar(td, new SESEEffectsKey(fd, type, hrn.getID(), hrn.getGloballyUniqueIdentifier()));
   }
   
   public SESEEffectsSet getSeseEffectsSet(){