From: bdemsky Date: Tue, 11 Sep 2007 07:09:09 +0000 (+0000) Subject: more fixes X-Git-Tag: preEdgeChange~458 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5f117477b3d1bab3bc3150c2f2a5aa151f7da881;p=IRC.git more fixes --- diff --git a/Robust/src/Analysis/Locality/GenerateConversions.java b/Robust/src/Analysis/Locality/GenerateConversions.java index d31265e4..f9c59f77 100644 --- a/Robust/src/Analysis/Locality/GenerateConversions.java +++ b/Robust/src/Analysis/Locality/GenerateConversions.java @@ -167,10 +167,11 @@ public class GenerateConversions { //subtract out the ones we write to transtemps.removeAll(Arrays.asList(fn.writesTemps())); //add in the globals we read from + Hashtable pretemptab=locality.getNodePreTempInfo(lb, fn); TempDescriptor []readtemps=fn.readsTemps(); for(int i=0;i0; - Hashtable currtable=getNodeTempInfo(currlb).get(fc); + Hashtable currtable=getNodePreTempInfo(currlb,fc); MethodDescriptor md=fc.getMethod(); boolean isnative=md.getModifiers().isNative(); @@ -106,6 +106,28 @@ public class LocalityAnalysis { return temptab.get(lb); } + /** This method returns a hashtable for a given LocalityBinding + * that tells the current local/global status of temps at the + * beginning of each node in the flat representation. */ + + public Hashtable getNodePreTempInfo(LocalityBinding lb, FlatNode fn) { + Hashtable currtable=new Hashtable(); + Hashtable> temptable=getNodeTempInfo(lb); + + for(int i=0;i prevtable=temptable.get(prevnode); + for(Iterator tempit=prevtable.keySet().iterator();tempit.hasNext();) { + TempDescriptor temp=tempit.next(); + Integer tmpint=prevtable.get(temp); + Integer oldint=currtable.containsKey(temp)?currtable.get(temp):EITHER; + Integer newint=merge(tmpint, oldint); + currtable.put(temp, newint); + } + } + return currtable; + } + /** This method returns an hashtable for a given LocalitBinding * that tells whether a node in the flat represenation is in a * transaction or not. Integer values greater than 0 indicate diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index e636a025..0c92252c 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1416,7 +1416,7 @@ public class BuildCode { output.println(generateTemp(fm, fgcn.getSrc(),lb)+"=(void *)transRead(trans, (unsigned int) "+generateTemp(fm, fgcn.getSrc(),lb)+");"); } else { /* Need to convert to OID */ - output.println(generateTemp(fm, fgcn.getSrc(),lb)+"=OID("+generateTemp(fm, fgcn.getSrc(),lb)+");"); + output.println(generateTemp(fm, fgcn.getSrc(),lb)+"=(void *)OID("+generateTemp(fm, fgcn.getSrc(),lb)+");"); } } @@ -1649,7 +1649,7 @@ public class BuildCode { private void generateFlatFieldNode(FlatMethod fm, LocalityBinding lb, FlatFieldNode ffn, PrintWriter output) { if (state.DSM) { - Integer status=locality.getNodeTempInfo(lb).get(ffn).get(ffn.getSrc()); + Integer status=locality.getNodePreTempInfo(lb,ffn).get(ffn.getSrc()); if (status==LocalityAnalysis.GLOBAL) { String field=ffn.getField().getSafeSymbol(); String src="((struct "+ffn.getSrc().getType().getSafeSymbol()+" *)((unsigned int)"+generateTemp(fm, ffn.getSrc(),lb)+"+sizeof(objheader_t)))"; @@ -1696,7 +1696,7 @@ public class BuildCode { if (fsfn.getField().getSymbol().equals("length")&&fsfn.getDst().getType().isArray()) throw new Error("Can't set array length"); if (state.DSM && locality.getAtomic(lb).get(fsfn).intValue()>0) { - Integer statussrc=locality.getNodeTempInfo(lb).get(fsfn).get(fsfn.getSrc()); + Integer statussrc=locality.getNodePreTempInfo(lb,fsfn).get(fsfn.getSrc()); Integer statusdst=locality.getNodeTempInfo(lb).get(fsfn).get(fsfn.getDst()); boolean srcglobal=statussrc==LocalityAnalysis.GLOBAL; diff --git a/Robust/src/Runtime/DSTM/interface/dstm.h b/Robust/src/Runtime/DSTM/interface/dstm.h index 531cb736..ffa30361 100644 --- a/Robust/src/Runtime/DSTM/interface/dstm.h +++ b/Robust/src/Runtime/DSTM/interface/dstm.h @@ -70,7 +70,7 @@ typedef struct objheader { } objheader_t; #define OID(x)\ -*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___nextobject___) + (*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___nextobject___)) #define STATUS(x)\ *((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___localcopy___))