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
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++) {
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);
}