From 4d772450e1708b70ff4267d498e8533cd57a2df8 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 20 Aug 2008 00:57:29 +0000 Subject: [PATCH] change --- .../Locality/GenerateConversions.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Robust/src/Analysis/Locality/GenerateConversions.java b/Robust/src/Analysis/Locality/GenerateConversions.java index 952c6478..89e7665b 100644 --- a/Robust/src/Analysis/Locality/GenerateConversions.java +++ b/Robust/src/Analysis/Locality/GenerateConversions.java @@ -40,6 +40,7 @@ public class GenerateConversions { FlatMethod fm=state.getMethodFlat(md); Hashtable> nodetotnpair=new Hashtable>(); Hashtable> nodetoconvs=new Hashtable>(); + Hashtable> nodetoconvs2=new Hashtable>(); Set toprocess=fm.getNodeSet(); @@ -47,8 +48,6 @@ public class GenerateConversions { FlatNode fn=toprocess.iterator().next(); toprocess.remove(fn); boolean isatomic=atomictab.get(fn).intValue()>0; - if (!isatomic && fn.kind()!=FKind.FlatAtomicExitNode)//Don't process past the bounds of a transaction - continue; Hashtable nodetemptab=temptab.get(fn); @@ -56,8 +55,10 @@ public class GenerateConversions { List writes=Arrays.asList(fn.writesTemps()); if (!isatomic&&fn.kind()==FKind.FlatAtomicExitNode - &&!nodetoconvs.containsKey(fn)) + &&!nodetoconvs.containsKey(fn)) { nodetoconvs.put(fn, new HashSet()); + nodetoconvs2.put(fn, new HashSet()); + } HashSet tempset=new HashSet(); @@ -75,14 +76,23 @@ public class GenerateConversions { tempset.add(tnp); continue; } + if (reads.contains(tnp.getTemp())&&tnp.getNode()!=null) { + //Value actually is read... + nodetoconvs.get(tnp.getNode()).add(tnp.getTemp()); + } + if (writes.contains(tnp.getTemp())) //value overwritten continue; if (!isatomic&&fn.kind()==FKind.FlatAtomicExitNode) { //Create new node and tag it with this exit if (tnp.getNode()==null) { - nodetoconvs.get(fn).add(tnp.getTemp());//have to hide cached copies from gc + 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 } else - throw new Error(); + tempset.add(tnp); + throw new Error(); } else tempset.add(tnp); } @@ -126,9 +136,10 @@ public class GenerateConversions { //sanity check assert(fn.kind()==FKind.FlatAtomicExitNode); //insert calls here... - Set tempset=nodetoconvs.get(fn); + Set tempset=nodetoconvs2.get(fn); for(Iterator tempit=tempset.iterator(); tempit.hasNext();) { - FlatGlobalConvNode fgcn=new FlatGlobalConvNode(tempit.next(), lb, false); + TempDescriptor tmpd=tempit.next(); + FlatGlobalConvNode fgcn=new FlatGlobalConvNode(tmpd, lb, false, nodetoconvs.get(fn).containsKey(tmpd)); atomictab.put(fgcn, atomictab.get(fn)); temptab.put(fgcn, (Hashtable)temptab.get(fn).clone()); -- 2.34.1