real fix for the bug...not just the symptom
authorbdemsky <bdemsky>
Tue, 25 May 2010 22:11:03 +0000 (22:11 +0000)
committerbdemsky <bdemsky>
Tue, 25 May 2010 22:11:03 +0000 (22:11 +0000)
Robust/src/Analysis/Locality/GenerateConversions.java
Robust/src/Analysis/Locality/LocalityAnalysis.java
Robust/src/Analysis/Loops/WriteBarrier.java

index 00c9dd78c6dc97001cb41accd10ff51fb7480d46..34fa9428d16c3c432951b3a33539450f835226de 100644 (file)
@@ -145,9 +145,15 @@ public class GenerateConversions {
        for(Iterator<TempDescriptor> tempit=tempset.iterator(); tempit.hasNext();) {
          TempDescriptor tmpd=tempit.next();
          FlatGlobalConvNode fgcn=new FlatGlobalConvNode(tmpd, lb, false, nodetoconvs.get(fn).contains(tmpd));
+
+         //This loop makes sure that we have accurate atomic information for the new node
+         for(Iterator<LocalityBinding> lbit=locality.getMethodBindings(lb.getMethod()).iterator();lbit.hasNext();) {
+           LocalityBinding fixlb=lbit.next();
+           locality.getAtomic(fixlb).put(fgcn, locality.getAtomic(fixlb).get(fn.getPrev(0)));
+           locality.getNodeTempInfo(fixlb).put(fgcn, (Hashtable<TempDescriptor, Integer>)locality.getNodeTempInfo(fixlb).get(fn).clone());
+         }
+         
          fgcn.setAtomicEnter(((FlatAtomicExitNode)fn).getAtomicEnter());
-         atomictab.put(fgcn, new Integer(1));
-         temptab.put(fgcn, (Hashtable<TempDescriptor, Integer>)temptab.get(fn).clone());
 
          FlatNode[] prevarray=new FlatNode[fn.numPrev()];
          for(int i=0; i<fn.numPrev(); i++) {
@@ -234,8 +240,12 @@ public class GenerateConversions {
        for(Iterator<TempDescriptor> tempit=tempset.iterator(); tempit.hasNext();) {
          FlatGlobalConvNode fgcn=new FlatGlobalConvNode(tempit.next(), lb, true);
          fgcn.setAtomicEnter((FlatAtomicEnterNode)fn);
-         atomictab.put(fgcn, atomictab.get(fn));
-         temptab.put(fgcn, (Hashtable<TempDescriptor, Integer>)temptab.get(fn).clone());
+         //This loop makes sure that we have accurate atomic information for the new node
+         for(Iterator<LocalityBinding> lbit=locality.getMethodBindings(lb.getMethod()).iterator();lbit.hasNext();) {
+           LocalityBinding fixlb=lbit.next();
+           locality.getAtomic(fixlb).put(fgcn, locality.getAtomic(fixlb).get(fn));
+           locality.getNodeTempInfo(fixlb).put(fgcn, (Hashtable<TempDescriptor, Integer>)locality.getNodeTempInfo(fixlb).get(fn).clone());
+         }
          fgcn.addNext(fn.getNext(0));
          fn.setNext(0, fgcn);
        }
index 265fce7578f6785578ef11969f2b9fe9c30681cd..7dac06097190a868df3f5f4c5197d912077b8b9b 100644 (file)
@@ -1209,6 +1209,7 @@ public class LocalityAnalysis {
   private void computeTempstoSave(LocalityBinding lb) {
     if (lb.isAtomic())
       return;
+    System.out.println(lb);
     Hashtable<FlatNode, Integer> atomictab=getAtomic(lb);
     Hashtable<FlatNode, Hashtable<TempDescriptor, Integer>> temptab=getNodeTempInfo(lb);
     MethodDescriptor md=lb.getMethod();
@@ -1227,7 +1228,7 @@ public class LocalityAnalysis {
       boolean isatomic=atomictab.get(fn).intValue()>0;
       if (isatomic&&
           atomictab.get(fn.getPrev(0)).intValue()==0) {
-       assert(fn.getPrev(0).kind()==FKind.FlatAtomicEnterNode);
+       assert(fn.kind()==FKind.FlatAtomicEnterNode);
        nodemap.put(fn, (FlatAtomicEnterNode)fn);
        nodetosavetemps.put((FlatAtomicEnterNode)fn, new HashSet<TempDescriptor>());
       } else if (isatomic) {
index 4dbd5149d3f7c715408fa0bd877e9664f5f18ef5..144674aee0f78786cb050b623d69c2eaab085f98 100644 (file)
@@ -111,9 +111,6 @@ public class WriteBarrier {
          nb.add(fnew.getDst());
          break;
        }
-      case FKind.FlatGlobalConvNode:
-       //These nodes don't have atomic information for all localities...just skip them
-       break;
       default:
        //If we enter a transaction toss everything
        if (atomic.get(fn).intValue()>0&&