missing files
[IRC.git] / Robust / src / Analysis / Locality / GenerateConversions.java
index 41bcc0e140ae244d63d09ad2fcc34735ad41522d..34fa9428d16c3c432951b3a33539450f835226de 100644 (file)
@@ -89,7 +89,7 @@ public class GenerateConversions {
              TempNodePair tnp2=new TempNodePair(tnp.getTemp());
              tnp2.setNode(fn);
              tempset.add(tnp2);
-             nodetoconvs2.get(fn).add(tnp.getTemp());  //have to hide cached copies from gc
+             nodetoconvs2.get(fn).add(tnp.getTemp());  //have to hide cached copies from gc -- add unused converted temps
            } else
              tempset.add(tnp);
          } else
@@ -145,8 +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));
-         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.getPrev(0)));
+           locality.getNodeTempInfo(fixlb).put(fgcn, (Hashtable<TempDescriptor, Integer>)locality.getNodeTempInfo(fixlb).get(fn).clone());
+         }
+         
+         fgcn.setAtomicEnter(((FlatAtomicExitNode)fn).getAtomicEnter());
 
          FlatNode[] prevarray=new FlatNode[fn.numPrev()];
          for(int i=0; i<fn.numPrev(); i++) {
@@ -232,8 +239,13 @@ public class GenerateConversions {
        Set<TempDescriptor> tempset=nodetotranstemps.get(fn);
        for(Iterator<TempDescriptor> tempit=tempset.iterator(); tempit.hasNext();) {
          FlatGlobalConvNode fgcn=new FlatGlobalConvNode(tempit.next(), lb, true);
-         atomictab.put(fgcn, atomictab.get(fn));
-         temptab.put(fgcn, (Hashtable<TempDescriptor, Integer>)temptab.get(fn).clone());
+         fgcn.setAtomicEnter((FlatAtomicEnterNode)fn);
+         //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);
        }