bug fixes for unflagged heap regions becoming flagged
authorjjenista <jjenista>
Fri, 2 Apr 2010 22:28:51 +0000 (22:28 +0000)
committerjjenista <jjenista>
Fri, 2 Apr 2010 22:28:51 +0000 (22:28 +0000)
Robust/src/Analysis/Disjoint/AllocSite.java
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/ReachGraph.java

index c0dcf3abf50f339a63f6799f0ab001147dd0395c..5d5fea81cf3ede027a0139d359d4866dea049ad2 100644 (file)
@@ -139,6 +139,10 @@ public class AllocSite extends Canonical {
     return flatNew.getType();
   }
 
+  public boolean isFlagged() {
+    return isFlagged;
+  }
+
   public int getAgeCategory( Integer id ) {
 
     if( id.equals( summary ) ) {
@@ -263,13 +267,5 @@ public class AllocSite extends Canonical {
 
   public int hashCodeSpecific() {
     return id;
-  }
-  
-  public void setFlag( boolean flag ) {
-    this.isFlagged = flag;
-  }
-  
-  public boolean getFlag() {
-    return isFlagged;
-  }
+  }  
 }
index 952d237736918eedc66ee9420cbd852fc1c3f6bf..b073e3ab5b4c7911c7fc4269e46cf618325d5cdb 100644 (file)
@@ -1253,12 +1253,10 @@ public class DisjointAnalysis {
   protected AllocSite getAllocSiteFromFlatNewPRIVATE( FlatNew fnew ) {
 
     if( !mapFlatNewToAllocSite.containsKey( fnew ) ) {
-      AllocSite as = 
-        (AllocSite) Canonical.makeCanonical( new AllocSite( allocationDepth, 
-                                                            fnew, 
-                                                            fnew.getDisjointId() 
-                                                            )
-                                             );
+      AllocSite as = AllocSite.factory( allocationDepth, 
+                                        fnew, 
+                                        fnew.getDisjointId() 
+                                        );
 
       // the newest nodes are single objects
       for( int i = 0; i < allocationDepth; ++i ) {
@@ -1512,7 +1510,10 @@ public class DisjointAnalysis {
                                    "param"+tempDesc    // disjoint site ID string
                                    );
     // create allocation site
-    AllocSite as = (AllocSite) Canonical.makeCanonical(new AllocSite( allocationDepth, flatNew, flatNew.getDisjointId()));
+    AllocSite as = AllocSite.factory( allocationDepth, 
+                                      flatNew, 
+                                      flatNew.getDisjointId()
+                                      );
     for (int i = 0; i < allocationDepth; ++i) {
        Integer id = generateUniqueHeapRegionNodeID();
        as.setIthOldest(i, id);
@@ -1566,7 +1567,6 @@ private Set<FieldDescriptor> getFieldSetTobeAnalyzed(TypeDescriptor typeDesc){
                                rg.createNewHeapRegionNode(as.getSummary(), // id or null to generate a new one
                                                           false, // single object?
                                                           true, // summary?
-                                                          false, // flagged?
                                                           false, // out-of-context?
                                                           as.getType(), // type
                                                           as, // allocation site
@@ -1624,7 +1624,6 @@ private Set<FieldDescriptor> getFieldSetTobeAnalyzed(TypeDescriptor typeDesc){
                                rg.createNewHeapRegionNode(as.getSummary(), // id or null to generate a new one
                                                           false, // single object?
                                                           true, // summary?
-                                                          false, // flagged?
                                                           false, // out-of-context?
                                                           typeDesc, // type
                                                           as, // allocation site
@@ -1748,7 +1747,6 @@ private ReachGraph createInitialTaskReachGraph(FlatMethod fm) {
                                        rg.createNewHeapRegionNode(allocSite.getSummary(), // id or null to generate a new one
                                                                   false, // single object?
                                                                   true, // summary?
-                                                                  false, // flagged?
                                                                   false, // out-of-context?
                                                                   allocSite.getType(), // type
                                                                   allocSite, // allocation site
index 2ff8e0c8376ac40fd8e54533c52167835578ff9c..e6b531fcd48107677d498caec16e3c152b7bdfe6 100644 (file)
@@ -92,7 +92,6 @@ public class ReachGraph {
     createNewHeapRegionNode( Integer        id,
                             boolean        isSingleObject,
                             boolean        isNewSummary,
-                            boolean        isFlagged,
                              boolean        isOutOfContext,
                             TypeDescriptor type,
                             AllocSite      allocSite,
@@ -102,8 +101,6 @@ public class ReachGraph {
                             String         description
                              ) {
 
-    boolean markForAnalysis = isFlagged;
-
     TypeDescriptor typeToUse = null;
     if( allocSite != null ) {
       typeToUse = allocSite.getType();
@@ -112,15 +109,15 @@ public class ReachGraph {
       typeToUse = type;
     }
 
-    if( allocSite != null && allocSite.getDisjointAnalysisId() != null ) {
+    boolean markForAnalysis = false;
+    if( allocSite != null && allocSite.isFlagged() ) {
       markForAnalysis = true;
     }
-
-
+    
     if( allocSite == null ) {
       assert !markForAnalysis;
 
-    } else if( markForAnalysis != allocSite.getFlag() ) {
+    } else if( markForAnalysis != allocSite.isFlagged() ) {
       assert false;
     }
 
@@ -798,22 +795,12 @@ public class ReachGraph {
 
     if( hrnSummary == null ) {
 
-      boolean hasFlags = false;
-      if( as.getType().isClass() ) {
-       hasFlags = as.getType().getClassDesc().hasFlags();
-      }
-      
-      if( as.getFlag() ){
-        hasFlags = true;
-      }
-
       String strDesc = as.toStringForDOT()+"\\nsummary";
 
       hrnSummary = 
         createNewHeapRegionNode( idSummary,    // id or null to generate a new one 
                                  false,        // single object?                
-                                 true,         // summary?      
-                                 hasFlags,     // flagged?
+                                 true,         // summary?                       
                                  false,        // out-of-context?
                                  as.getType(), // type                          
                                  as,           // allocation site                       
@@ -843,21 +830,11 @@ public class ReachGraph {
     
     if( hrnIth == null ) {
 
-      boolean hasFlags = false;
-      if( as.getType().isClass() ) {
-        hasFlags = as.getType().getClassDesc().hasFlags();
-      }
-      
-      if( as.getFlag() ){
-        hasFlags = true;
-      }
-
       String strDesc = as.toStringForDOT()+"\\n"+i+" oldest";
 
       hrnIth = createNewHeapRegionNode( idIth,        // id or null to generate a new one 
                                         true,        // single object?                  
                                         false,       // summary?                        
-                                        hasFlags,     // flagged?                       
                                         false,        // out-of-context?
                                         as.getType(), // type                           
                                         as,          // allocation site                         
@@ -1613,7 +1590,6 @@ public class ReachGraph {
       rg.createNewHeapRegionNode( hrnCaller.getID(),
                                   hrnCaller.isSingleObject(),
                                   hrnCaller.isNewSummary(),
-                                  hrnCaller.isFlagged(),
                                   false, // out-of-context?
                                   hrnCaller.getType(),
                                   hrnCaller.getAllocSite(),
@@ -1805,7 +1781,6 @@ public class ReachGraph {
             rg.createNewHeapRegionNode( null,  // ID
                                         false, // single object?
                                         false, // new summary?
-                                        false, // flagged?
                                         true,  // out-of-context?
                                         oocNodeType,
                                         null,  // alloc site, shouldn't be used
@@ -1834,7 +1809,6 @@ public class ReachGraph {
               rg.createNewHeapRegionNode( oocHrnID,  // ID
                                           false, // single object?
                                           false, // new summary?
-                                          false, // flagged?
                                           true,  // out-of-context?
                                           oocNodeType,
                                           null,  // alloc site, shouldn't be used
@@ -2225,7 +2199,6 @@ public class ReachGraph {
           createNewHeapRegionNode( hrnIDshadow,                // id or null to generate a new one 
                                    hrnCallee.isSingleObject(), // single object?                
                                    hrnCallee.isNewSummary(),   // summary?      
-                                   hrnCallee.isFlagged(),      // flagged?
                                    false,                      // out-of-context?
                                    hrnCallee.getType(),        // type                          
                                    hrnCallee.getAllocSite(),   // allocation site                       
@@ -2492,7 +2465,6 @@ public class ReachGraph {
             createNewHeapRegionNode( hrnIDDstShadow,                // id or null to generate a new one 
                                      hrnDstCallee.isSingleObject(), // single object?           
                                      hrnDstCallee.isNewSummary(),   // summary?         
-                                     hrnDstCallee.isFlagged(),      // flagged?
                                      false,                         // out-of-context?
                                      hrnDstCallee.getType(),        // type                             
                                      hrnDstCallee.getAllocSite(),   // allocation site