collects live-in var's allocation sites when it references to parameter heap region.
[IRC.git] / Robust / src / Analysis / MLP / MLPAnalysis.java
index be46e945f252c7f6564ce5cd797a318700bf3635..e646ec6bf82b47b2d94e8790150521103c1641a8 100644 (file)
@@ -48,6 +48,8 @@ public class MLPAnalysis {
   private Hashtable< FlatNode, CodePlan                 > codePlans;
 
   private Hashtable< FlatEdge, FlatWriteDynamicVarNode  > wdvNodesToSpliceIn;
+  
+  private Hashtable< MethodContext, HashSet<AllocationSite>> mapMethodContextToLiveInAllocationSiteSet;
 
   public static int maxSESEage = -1;
 
@@ -101,6 +103,8 @@ public class MLPAnalysis {
     codePlans            = new Hashtable< FlatNode, CodePlan                 >();
     wdvNodesToSpliceIn   = new Hashtable< FlatEdge, FlatWriteDynamicVarNode  >();
     
+    mapMethodContextToLiveInAllocationSiteSet = new Hashtable< MethodContext, HashSet<AllocationSite>>();
+    
 
     FlatMethod fmMain = state.getMethodFlat( typeUtil.getMain() );
 
@@ -186,11 +190,32 @@ public class MLPAnalysis {
     
     // new pass
     methItr = ownAnalysis.descriptorsToAnalyze.iterator();
+       JavaCallGraph javaCallGraph = new JavaCallGraph(state,tu);
     while( methItr.hasNext() ) {
       Descriptor d  = methItr.next();      
       FlatMethod fm = state.getMethodFlat( d );
-      methodEffects(fm);
+      methodEffects(fm,javaCallGraph);
     }
+    
+    // disjoint analysis with a set of flagged allocation sites of live-in variable
+       try {
+               OwnershipAnalysis oa2 = new OwnershipAnalysis(state, tu, callGraph,
+                               state.OWNERSHIPALLOCDEPTH, false,
+                               false, state.OWNERSHIPALIASFILE,
+                               state.METHODEFFECTS,
+                               mapMethodContextToLiveInAllocationSiteSet);
+               // debug
+               methItr = oa2.descriptorsToAnalyze.iterator();
+               while (methItr.hasNext()) {
+                       Descriptor d = methItr.next();
+                       FlatMethod fm = state.getMethodFlat(d);
+                       debugFunction(oa2, fm);
+               }
+               //
+       } catch (IOException e) {
+               System.err.println(e);
+       }
+    
 
 
     // 7th pass
@@ -789,7 +814,35 @@ public class MLPAnalysis {
     } // end switch
   }
   
-       private void methodEffects(FlatMethod fm) {
+  private void debugFunction(OwnershipAnalysis oa2, FlatMethod fm) {
+         
+         String methodName="doSomeWork";
+         
+         MethodDescriptor md=fm.getMethod();
+               HashSet<MethodContext> mcSet=oa2.getAllMethodContextSetByDescriptor(md);
+               Iterator<MethodContext> mcIter=mcSet.iterator();
+               
+               while(mcIter.hasNext()){
+                       MethodContext mc=mcIter.next();
+                       
+                       OwnershipGraph og=oa2.getOwnvershipGraphByMethodContext(mc);
+                       
+                       if(fm.toString().indexOf(methodName)>0){
+                                try {
+                                og.writeGraph(methodName + "SECONDGRAPH", true, true, true, true, false);
+                                } catch (IOException e) {
+                                System.out.println("Error writing debug capture.");
+                                System.exit(0);
+                                }
+                       }
+                       
+
+
+               }
+         
+  }
+  
+       private void methodEffects(FlatMethod fm, CallGraph callGraph) {
 
                MethodDescriptor md=fm.getMethod();
                HashSet<MethodContext> mcSet=ownAnalysis.getAllMethodContextSetByDescriptor(md);
@@ -811,7 +864,7 @@ public class MLPAnalysis {
                                assert seseStack != null;
 
                                if (!seseStack.empty()) {
-                                       effects_nodeActions(mc, fn, seseStack.peek());
+                                       effects_nodeActions(mc, fn, seseStack.peek(), callGraph);
                                }
 
                                flatNodesToVisit.remove(fn);
@@ -830,9 +883,143 @@ public class MLPAnalysis {
                }
                
        }
+       
+       private void analyzeRelatedAllocationSite(MethodDescriptor callerMD,
+                       MethodContext calleeMC, HashSet<Integer> paramIndexSet) {
+
+               HashSet<MethodContext> mcSet = ownAnalysis
+                               .getAllMethodContextSetByDescriptor(callerMD);
+               Iterator<MethodContext> mcIter = mcSet.iterator();
+
+               FlatMethod callerFM = state.getMethodFlat(callerMD);
+
+               while (mcIter.hasNext()) {
+                       MethodContext mc = mcIter.next();
+
+                       Set<FlatNode> visited = new HashSet<FlatNode>();
+                       Set<FlatNode> flatNodesToVisit = new HashSet<FlatNode>();
+                       flatNodesToVisit.add(callerFM);
+
+                       while (!flatNodesToVisit.isEmpty()) {
+                               FlatNode fn = (FlatNode) flatNodesToVisit.iterator().next();
+                               flatNodesToVisit.remove(fn);
+
+                               analyzeRelatedAllocationSite_NodeAction(fn, mc, calleeMC, paramIndexSet);
+
+                               flatNodesToVisit.remove(fn);
+                               visited.add(fn);
+
+                               for (int i = 0; i < fn.numNext(); i++) {
+                                       FlatNode nn = fn.getNext(i);
+                                       if (!visited.contains(nn)) {
+                                               flatNodesToVisit.add(nn);
+                                       }
+                               }
+                       }
+
+               }
+
+       }
+       
+       private void analyzeRelatedAllocationSite_NodeAction(FlatNode fn, MethodContext callerMC,
+                       MethodContext calleeMC, HashSet<Integer> paramIndexSet) {
+
+               OwnershipGraph og = ownAnalysis
+                               .getOwnvershipGraphByMethodContext(callerMC);
+
+               switch (fn.kind()) {
+
+               case FKind.FlatCall: {
+
+                       FlatCall fc = (FlatCall) fn;
+
+                       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;
+                               }
+                               
+                               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()){
+                                                                       setupRelatedAllocSiteAnalysis(og,callerMC,dstHRN);
+                                                               }else{
+                                                                       addLiveInAllocationSite(callerMC, dstHRN
+                                                                                       .getAllocationSite());
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+               }
+                       break;
+
+               }
+       }
+       
+       private void setupRelatedAllocSiteAnalysis(OwnershipGraph og,
+                       MethodContext mc, HeapRegionNode dstHRN) {
+
+               HashSet<Integer> paramIndexSet = new HashSet<Integer>();
+
+               // collect corresponding param index
+               Set<Integer> pIndexSet = og.idPrimary2paramIndexSet.get(dstHRN.getID());
+               if (pIndexSet != null) {
+                       for (Iterator iterator = pIndexSet.iterator(); iterator.hasNext();) {
+                               Integer integer = (Integer) iterator.next();
+                               paramIndexSet.add(integer);
+                       }
+               }
+
+               Set<Integer> sIndexSet = og.idSecondary2paramIndexSet.get(dstHRN
+                               .getID());
+               if (sIndexSet != null) {
+                       for (Iterator iterator = sIndexSet.iterator(); iterator.hasNext();) {
+                               Integer integer = (Integer) iterator.next();
+                               paramIndexSet.add(integer);
+                       }
+               }
+
+               if (mc.getDescriptor() instanceof MethodDescriptor) {
+                       Set callerSet = callGraph.getCallerSet((MethodDescriptor) mc
+                                       .getDescriptor());
+                       for (Iterator iterator = callerSet.iterator(); iterator.hasNext();) {
+                               Object obj = (Object) iterator.next();
+                               if (obj instanceof MethodDescriptor) {
+                                       MethodDescriptor callerMD = (MethodDescriptor) obj;
+
+                                       analyzeRelatedAllocationSite(callerMD, mc, paramIndexSet);
+
+                               }
+                       }
+               }
+       }
   
        private void effects_nodeActions(MethodContext mc, FlatNode fn,
-                       FlatSESEEnterNode currentSESE) {
+                       FlatSESEEnterNode currentSESE, CallGraph callGraph) {
 
                OwnershipGraph og = ownAnalysis.getOwnvershipGraphByMethodContext(mc);
 
@@ -853,7 +1040,26 @@ public class MLPAnalysis {
                                if (ln != null) {
                                        int taint = (int) Math.pow(2, idx);
                                        taintLabelNode(ln, taint);
+
+                                       // collects related allocation sites
+                                       Iterator<ReferenceEdge> referenceeIter = ln
+                                                       .iteratorToReferencees();
+                                       while (referenceeIter.hasNext()) {
+                                               ReferenceEdge referenceEdge = (ReferenceEdge) referenceeIter
+                                                               .next();
+                                               HeapRegionNode dstHRN = referenceEdge.getDst();
+                                               if (dstHRN.isParameter()) {
+                                                       
+                                                       setupRelatedAllocSiteAnalysis(og,mc,dstHRN);
+
+                                               } else {
+                                                       addLiveInAllocationSite(mc, dstHRN
+                                                                       .getAllocationSite());
+                                               }
+                                       }
+
                                }
+
                                idx++;
                        }
 
@@ -882,14 +1088,16 @@ public class MLPAnalysis {
                                        if (parentEffectsSet == null) {
                                                parentEffectsSet = new HashSet<SESEEffectsKey>();
                                        }
-                                       
+
                                        for (Iterator iterator = effectsSet.iterator(); iterator
                                                        .hasNext();) {
                                                SESEEffectsKey seseKey = (SESEEffectsKey) iterator
                                                                .next();
-                                               parentEffectsSet.add(new SESEEffectsKey(seseKey.getFieldDescriptor(), seseKey.getTypeDescriptor(), seseKey.getHRNId()));
+                                               parentEffectsSet.add(new SESEEffectsKey(seseKey
+                                                               .getFieldDescriptor(), seseKey
+                                                               .getTypeDescriptor(), seseKey.getHRNId()));
                                        }
-                                       
+
                                        parentReadTable.put(td, parentEffectsSet);
                                }
 
@@ -907,7 +1115,7 @@ public class MLPAnalysis {
                                        if (parentEffectsSet == null) {
                                                parentEffectsSet = new HashSet<SESEEffectsKey>();
                                        }
-                                       
+
                                        for (Iterator iterator = effectsSet.iterator(); iterator
                                                        .hasNext();) {
                                                SESEEffectsKey seseKey = (SESEEffectsKey) iterator
@@ -916,10 +1124,10 @@ public class MLPAnalysis {
                                                                .getFieldDescriptor(), seseKey
                                                                .getTypeDescriptor(), seseKey.getHRNId()));
                                        }
-                                       
+
                                        parentWriteTable.put(td, parentEffectsSet);
                                }
-                               
+
                                Hashtable<TempDescriptor, HashSet<SESEEffectsKey>> strongUpdateTable = set
                                                .getStrongUpdateTable();
                                Hashtable<TempDescriptor, HashSet<SESEEffectsKey>> parentstrongUpdateTable = parent
@@ -928,7 +1136,8 @@ public class MLPAnalysis {
                                keyIter = keys.iterator();
                                while (keyIter.hasNext()) {
                                        TempDescriptor td = (TempDescriptor) keyIter.next();
-                                       HashSet<SESEEffectsKey> effectsSet = strongUpdateTable.get(td);
+                                       HashSet<SESEEffectsKey> effectsSet = strongUpdateTable
+                                                       .get(td);
                                        HashSet<SESEEffectsKey> parentEffectsSet = parentstrongUpdateTable
                                                        .get(td);
                                        if (parentEffectsSet == null) {
@@ -965,6 +1174,7 @@ public class MLPAnalysis {
                                                .iterator();
                                while (affectedIter.hasNext()) {
                                        TempDescriptor affectedTD = affectedIter.next();
+
                                        if (currentSESE.getInVarSet().contains(affectedTD)) {
 
                                                HashSet<HeapRegionNode> hrnSet = getReferenceHeapIDSet(
@@ -989,41 +1199,48 @@ public class MLPAnalysis {
                                                }
                                        }
                                }
-                               
-                               //  handle tainted case
-                               
+
+                               // handle tainted case
+
                                Iterator<ReferenceEdge> edgeIter = srcLN
                                                .iteratorToReferencees();
                                while (edgeIter.hasNext()) {
                                        ReferenceEdge edge = edgeIter.next();
-                                       
-                                       if(edge.getTaintIdentifier()>0){                                                
-                                               HeapRegionNode accessHRN = edge.getDst();
-                                               /// follow the chain of reference to identify possible accesses
-                                               Iterator<ReferenceEdge> referIter=accessHRN.iteratorToReferencers();
-                                               while (referIter.hasNext()) {
-                                                       ReferenceEdge referEdge = (ReferenceEdge) referIter.next();
-                                                       
-                                                       if (referEdge.getTaintIdentifier() > 0) {
-                                                               HashSet<TempDescriptor> referSet = new HashSet<TempDescriptor>();
-                                                               followReference(accessHRN, referSet, new HashSet<HeapRegionNode>(),
-                                                                               currentSESE);
-                                                               
-                                                               Iterator<TempDescriptor> referSetIter=referSet.iterator();
-                                                               while (referSetIter.hasNext()) {
-                                                                       TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
-                                                                                       .next();
-                                                                       currentSESE.readEffects(tempDescriptor, field
-                                                                                       .getSymbol(), src.getType(), accessHRN
-                                                                                       .getID());
-                                                               }
-                                                       }
+                                       HeapRegionNode accessHRN = edge.getDst();
+                                       // / follow the chain of reference to identify possible
+                                       // accesses
+                                       Iterator<ReferenceEdge> referIter = accessHRN
+                                                       .iteratorToReferencers();
+                                       while (referIter.hasNext()) {
+                                               ReferenceEdge referEdge = (ReferenceEdge) referIter
+                                                               .next();
+
+                                               // if (referEdge.getTaintIdentifier() >0 ||
+                                               // referEdge.getSESETaintIdentifier()>0 ) {
+                                               HashSet<TempDescriptor> referSet = new HashSet<TempDescriptor>();
+                                               followReference(accessHRN, referSet,
+                                                               new HashSet<HeapRegionNode>(), currentSESE);
+
+                                               Iterator<TempDescriptor> referSetIter = referSet
+                                                               .iterator();
+                                               while (referSetIter.hasNext()) {
+                                                       TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
+                                                                       .next();
+                                                       currentSESE.readEffects(tempDescriptor, field
+                                                                       .getSymbol(), src.getType(), accessHRN
+                                                                       .getID());
                                                }
-                                               ///
+                                               // }
+                                       }
+                                       // /
+                                       if (edge.getTaintIdentifier() > 0
+                                                       || edge.getSESETaintIdentifier() > 0) {
+
                                                affectedTDSet = getReferenceNodeSet(accessHRN);
                                                affectedIter = affectedTDSet.iterator();
                                                while (affectedIter.hasNext()) {
                                                        TempDescriptor affectedTD = affectedIter.next();
+
                                                        if (currentSESE.getInVarSet().contains(affectedTD)) {
 
                                                                HashSet<HeapRegionNode> hrnSet = getReferenceHeapIDSet(
@@ -1056,26 +1273,29 @@ public class MLPAnalysis {
                        LabelNode dstLN = og.td2ln.get(dst);
                        if (dstLN != null) {
                                // check possible strong updates
-                           boolean strongUpdate = false;
-
-                           if( !field.getType().isImmutable() || field.getType().isArray() ) {
-                               Iterator<ReferenceEdge> itrXhrn = dstLN.iteratorToReferencees();
-                                   while( itrXhrn.hasNext() ) {
-                                     ReferenceEdge edgeX = itrXhrn.next();
-                                     HeapRegionNode hrnX = edgeX.getDst();
-
-                                     // we can do a strong update here if one of two cases holds       
-                                     if( field != null &&
-                                                 field != OwnershipAnalysis.getArrayField( field.getType() ) &&            
-                                         (   (hrnX.getNumReferencers()                         == 1) || // case 1
-                                             (hrnX.isSingleObject() && dstLN.getNumReferencees() == 1)    // case 2
-                                             )
-                                         ) {
-                                       strongUpdate = true;
-                                     }
-                                   }
-                           }
-                               
+                               boolean strongUpdate = false;
+
+                               if (!field.getType().isImmutable() || field.getType().isArray()) {
+                                       Iterator<ReferenceEdge> itrXhrn = dstLN
+                                                       .iteratorToReferencees();
+                                       while (itrXhrn.hasNext()) {
+                                               ReferenceEdge edgeX = itrXhrn.next();
+                                               HeapRegionNode hrnX = edgeX.getDst();
+
+                                               // we can do a strong update here if one of two cases
+                                               // holds
+                                               if (field != null
+                                                               && field != OwnershipAnalysis
+                                                                               .getArrayField(field.getType())
+                                                               && ((hrnX.getNumReferencers() == 1) || // case 1
+                                                               (hrnX.isSingleObject() && dstLN
+                                                                               .getNumReferencees() == 1) // case 2
+                                                               )) {
+                                                       strongUpdate = true;
+                                               }
+                                       }
+                               }
+
                                HashSet<TempDescriptor> affectedTDSet = getAccessedTaintNodeSet(dstLN);
 
                                Iterator<TempDescriptor> affectedIter = affectedTDSet
@@ -1091,60 +1311,58 @@ public class MLPAnalysis {
                                                while (hrnIter.hasNext()) {
                                                        HeapRegionNode hrn = hrnIter.next();
 
-                                                       if (field.getType().isImmutable()) {
-                                                               currentSESE.writeEffects(affectedTD, field
-                                                                               .getSymbol(), dst.getType(), hrn
-                                                                               .getID(),strongUpdate);
-                                                               
-                                                       } else {
-                                                               Iterator<ReferenceEdge> referencers = hrn
-                                                                               .iteratorToReferencers();
-                                                               while (referencers.hasNext()) {
-                                                                       ReferenceEdge referenceEdge = (ReferenceEdge) referencers
-                                                                                       .next();
-                                                                       if (field.getSymbol().equals(
-                                                                                       referenceEdge.getField())) {
-                                                                               currentSESE.writeEffects(affectedTD,
-                                                                                               field.getSymbol(), dst
-                                                                                                               .getType(),
-                                                                                               referenceEdge.getDst().getID(),strongUpdate);
-                                                                       }
+                                                       Iterator<ReferenceEdge> referencers = hrn
+                                                                       .iteratorToReferencers();
+                                                       while (referencers.hasNext()) {
+                                                               ReferenceEdge referenceEdge = (ReferenceEdge) referencers
+                                                                               .next();
+                                                               if (field.getSymbol().equals(
+                                                                               referenceEdge.getField())) {
+                                                                       currentSESE.writeEffects(affectedTD, field
+                                                                                       .getSymbol(), dst.getType(),
+                                                                                       referenceEdge.getDst().getID(),
+                                                                                       strongUpdate);
                                                                }
                                                        }
 
                                                }
                                        }
                                }
-                               
+
                                // handle tainted case
                                Iterator<ReferenceEdge> edgeIter = dstLN
                                                .iteratorToReferencees();
                                while (edgeIter.hasNext()) {
                                        ReferenceEdge edge = edgeIter.next();
-                                       if (edge.getTaintIdentifier() > 0) {
-                                               HeapRegionNode accessHRN = edge.getDst();
-                                               /// follow the chain of reference to identify possible accesses
-                                               Iterator<ReferenceEdge> referIter=accessHRN.iteratorToReferencers();
-                                               while (referIter.hasNext()) {
-                                                       ReferenceEdge referEdge = (ReferenceEdge) referIter.next();
-                                                       
-                                                       if (referEdge.getTaintIdentifier() > 0) {
-                                                               HashSet<TempDescriptor> referSet = new HashSet<TempDescriptor>();
-                                                               followReference(accessHRN, referSet, new HashSet<HeapRegionNode>(),
-                                                                               currentSESE);
-                                                               Iterator<TempDescriptor> referSetIter=referSet.iterator();
-                                                               while (referSetIter.hasNext()) {
-                                                                       TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
-                                                                                       .next();
-                                                                       currentSESE.writeEffects(tempDescriptor, field
-                                                                                       .getSymbol(), dst.getType(), accessHRN
-                                                                                       .getID(),strongUpdate);
-                                                               }
 
-                                                       }
-                                                       
+                                       HeapRegionNode accessHRN = edge.getDst();
+                                       // / follow the chain of reference to identify possible
+                                       // accesses
+                                       Iterator<ReferenceEdge> referIter = accessHRN
+                                                       .iteratorToReferencers();
+                                       while (referIter.hasNext()) {
+                                               ReferenceEdge referEdge = (ReferenceEdge) referIter
+                                                               .next();
+
+                                               // if (referEdge.getTaintIdentifier() > 0 ||
+                                               // referEdge.getSESETaintIdentifier() > 0 ) {
+                                               HashSet<TempDescriptor> referSet = new HashSet<TempDescriptor>();
+                                               followReference(accessHRN, referSet,
+                                                               new HashSet<HeapRegionNode>(), currentSESE);
+                                               Iterator<TempDescriptor> referSetIter = referSet
+                                                               .iterator();
+                                               while (referSetIter.hasNext()) {
+                                                       TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
+                                                                       .next();
+                                                       currentSESE.writeEffects(tempDescriptor, field
+                                                                       .getSymbol(), dst.getType(), accessHRN
+                                                                       .getID(), strongUpdate);
                                                }
-                                               ///
+                                               // }
+                                       }
+                                       // /
+                                       if (edge.getTaintIdentifier() > 0
+                                                       || edge.getSESETaintIdentifier() > 0) {
                                                affectedTDSet = getReferenceNodeSet(accessHRN);
                                                affectedIter = affectedTDSet.iterator();
                                                while (affectedIter.hasNext()) {
@@ -1159,8 +1377,8 @@ public class MLPAnalysis {
                                                                        HeapRegionNode hrn = hrnIter.next();
                                                                        currentSESE.writeEffects(affectedTD, field
                                                                                        .getSymbol(), dst.getType(), hrn
-                                                                                       .getID(),strongUpdate);
-                                                                       
+                                                                                       .getID(), strongUpdate);
+
                                                                }
 
                                                        }
@@ -1203,9 +1421,9 @@ public class MLPAnalysis {
                                                i + base);
                                Set<EffectsKey> writeSet = me.getEffects().getWritingSet(
                                                i + base);
-                               
-                               Set<EffectsKey> strongUpdateSet = me.getEffects().getStrongUpdateSet(
-                                               i + base);
+
+                               Set<EffectsKey> strongUpdateSet = me.getEffects()
+                                               .getStrongUpdateSet(i + base);
 
                                LabelNode argLN = og.td2ln.get(arg);
                                if (argLN != null) {
@@ -1255,12 +1473,12 @@ public class MLPAnalysis {
                                                                                currentSESE.writeEffects(affectedTD,
                                                                                                key.getFieldDescriptor(), key
                                                                                                                .getTypeDescriptor(),
-                                                                                               hrnID,false);
+                                                                                               hrnID, false);
                                                                        }
 
                                                                }
                                                        }
-                                                       
+
                                                        if (strongUpdateSet != null) {
                                                                Iterator<EffectsKey> strongUpdateIter = strongUpdateSet
                                                                                .iterator();
@@ -1278,12 +1496,11 @@ public class MLPAnalysis {
                                                                                currentSESE.writeEffects(affectedTD,
                                                                                                key.getFieldDescriptor(), key
                                                                                                                .getTypeDescriptor(),
-                                                                                               hrnID,true);
+                                                                                               hrnID, true);
                                                                        }
 
                                                                }
                                                        }
-                                                       
 
                                                }
 
@@ -1299,6 +1516,15 @@ public class MLPAnalysis {
                }
        }
        
+       private void addLiveInAllocationSite(MethodContext mc, AllocationSite ac){
+               HashSet<AllocationSite> set=mapMethodContextToLiveInAllocationSiteSet.get(mc);
+               if(set==null){
+                       set=new HashSet<AllocationSite>();                      
+               }
+               set.add(ac);
+               mapMethodContextToLiveInAllocationSiteSet.put(mc, set);
+       }
+       
        private void followReference(HeapRegionNode hrn,HashSet<TempDescriptor> tdSet, HashSet<HeapRegionNode> visited, FlatSESEEnterNode currentSESE){
                
                Iterator<ReferenceEdge> referIter=hrn.iteratorToReferencers();
@@ -1354,6 +1580,8 @@ public class MLPAnalysis {
                                OwnershipNode node = referencerEdge.getSrc();
                                if (node instanceof LabelNode) {
                                        referencerEdge.unionSESETaintIdentifier(identifier);
+                               }else if(node instanceof HeapRegionNode){
+                                       referencerEdge.unionSESETaintIdentifier(identifier);
                                }
                        }