// 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,
FlatSESEEnterNode fsen = (FlatSESEEnterNode) fn;
assert fsen.equals(currentSESE);
-
+
if (!fsen.getIsCallerSESEplaceholder()) {
// uniquely taint each live-in variable
Set<TempDescriptor> set = fsen.getInVarSet();
case FKind.FlatSESEExitNode: {
FlatSESEExitNode fsexit = (FlatSESEExitNode) fn;
-
+
if (!fsexit.getFlatEnter().getIsCallerSESEplaceholder()) {
FlatSESEEnterNode enterNode = fsexit.getFlatEnter();
.next();
parentEffectsSet.add(new SESEEffectsKey(seseKey
.getFieldDescriptor(), seseKey
- .getTypeDescriptor(), seseKey.getHRNId()));
+ .getTypeDescriptor(), seseKey.getHRNId(),
+ seseKey.getHRNUniqueId()));
}
parentReadTable.put(td, parentEffectsSet);
.next();
parentEffectsSet.add(new SESEEffectsKey(seseKey
.getFieldDescriptor(), seseKey
- .getTypeDescriptor(), seseKey.getHRNId()));
+ .getTypeDescriptor(), seseKey.getHRNId(),
+ seseKey.getHRNUniqueId()));
}
parentWriteTable.put(td, parentEffectsSet);
.next();
parentEffectsSet.add(new SESEEffectsKey(seseKey
.getFieldDescriptor(), seseKey
- .getTypeDescriptor(), seseKey.getHRNId()));
+ .getTypeDescriptor(), seseKey.getHRNId(),
+ seseKey.getHRNUniqueId()));
}
parentstrongUpdateTable.put(td, parentEffectsSet);
.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);
}
}
TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
.next();
currentSESE.readEffects(tempDescriptor, field
- .getSymbol(), src.getType(), accessHRN
- .getID());
+ .getSymbol(), src.getType(), accessHRN);
}
// }
}
while (hrnIter.hasNext()) {
HeapRegionNode hrn = hrnIter.next();
currentSESE.readEffects(affectedTD, field
- .getSymbol(), src.getType(), hrn
- .getID());
+ .getSymbol(), src.getType(), hrn);
}
}
.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);
}
}
TempDescriptor tempDescriptor = (TempDescriptor) referSetIter
.next();
currentSESE.writeEffects(tempDescriptor, field
- .getSymbol(), dst.getType(), accessHRN
- .getID(), strongUpdate);
+ .getSymbol(), dst.getType(), accessHRN,
+ strongUpdate);
}
// }
}
while (hrnIter.hasNext()) {
HeapRegionNode hrn = hrnIter.next();
currentSESE.writeEffects(affectedTD, field
- .getSymbol(), dst.getType(), hrn
- .getID(), strongUpdate);
+ .getSymbol(), dst.getType(), hrn,
+ strongUpdate);
}
while (hrnIter.hasNext()) {
Integer hrnID = (Integer) hrnIter
.next();
+
+ HeapRegionNode refHRN = og.id2hrn
+ .get(hrnID);
+
currentSESE.readEffects(affectedTD, key
.getFieldDescriptor(), key
- .getTypeDescriptor(), hrnID);
+ .getTypeDescriptor(), refHRN);
}
}
}
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);
}
}
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);
}
}
}
private void flagAllocationSite(MethodContext mc, AllocationSite ac){
+
HashSet<AllocationSite> set=mapMethodContextToLiveInAllocationSiteSet.get(mc);
if(set==null){
set=new HashSet<AllocationSite>();
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()));
}
}
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()));
}
}
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()));
}
}
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()));
}
}
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;
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(){