From 5f9b9f750153ecbdb50971aa9a90350822a351f0 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 25 Feb 2011 01:00:44 +0000 Subject: [PATCH] changes --- Robust/src/IR/Flat/BuildCode.java | 25 +++++++++++++------------ Robust/src/IR/Flat/FieldShadow.java | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 938f43a2..3ee3349f 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -3406,11 +3406,11 @@ public class BuildCode { } if (srcptr&!fsfn.getSrc().getType().isNull()) { output.println("*((unsigned INTPTR *)&("+dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"))=srcoid;"); + fsfn.getField().getSafeSymbol()+"))=srcoid;"); output.println("}"); } else { output.println(dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); + fsfn.getField().getSafeSymbol()+"="+ src+";"); } } else if (state.DSM && locality.getAtomic(lb).get(fsfn).intValue()>0) { Integer statussrc=locality.getNodePreTempInfo(lb,fsfn).get(fsfn.getSrc()); @@ -3430,10 +3430,10 @@ public class BuildCode { output.println("*((unsigned int *)&("+dst+"->___localcopy___))|=DIRTY;"); if (srcglobal) { output.println("*((unsigned INTPTR *)&("+glbdst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"))=srcoid;"); + fsfn.getField().getSafeSymbol()+"))=srcoid;"); } else output.println(glbdst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); + fsfn.getField().getSafeSymbol()+"="+ src+";"); } else if (statusdst.equals(LocalityAnalysis.LOCAL)) { /** Check if we need to copy */ output.println("if(!"+dst+"->"+localcopystr+") {"); @@ -3449,20 +3449,20 @@ public class BuildCode { output.println("}"); if (srcglobal) output.println(dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); else output.println(dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); + fsfn.getField().getSafeSymbol()+"="+ src+";"); } else if (statusdst.equals(LocalityAnalysis.EITHER)) { //writing to a null...bad output.println("if ("+dst+") {"); output.println("printf(\"BIG ERROR 2\\n\");exit(-1);}"); if (srcglobal) output.println(dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); + fsfn.getField().getSafeSymbol()+"=(void *) srcoid;"); else output.println(dst+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ src+";"); + fsfn.getField().getSafeSymbol()+"="+ src+";"); } if (srcglobal) { output.println("}"); @@ -3518,18 +3518,19 @@ public class BuildCode { // redirect to the global_defs_p structure if(fsfn.getDst().getType().isClassNameRef()) { // reference to the static field with Class name - output.println("global_defs_p->" + fsfn.getField().getClassDescriptor().getSafeSymbol() + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + output.println("global_defs_p->" + + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } else { output.println("*"+generateTemp(fm, fsfn.getDst(),lb)+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } else { output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } else { output.println(generateTemp(fm, fsfn.getDst(),lb)+"->"+ - (fsfn.getField().getClassDescriptor()==null?"":fsfn.getField().getClassDescriptor().getSafeSymbol()) + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); + fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc(),lb)+";"); } } } diff --git a/Robust/src/IR/Flat/FieldShadow.java b/Robust/src/IR/Flat/FieldShadow.java index 956fc927..993bc5af 100644 --- a/Robust/src/IR/Flat/FieldShadow.java +++ b/Robust/src/IR/Flat/FieldShadow.java @@ -25,10 +25,10 @@ public class FieldShadow { if (supermap.containsKey(fd.getSymbol())) { Integer oldint=supermap.get(fd.getSymbol()); int newint=oldint.intValue()+1; - supermap.put(fd.getSymbol(), new Integer(newint)); + namemap.put(fd.getSymbol(), new Integer(newint)); fd.changeSafeSymbol(newint); } else { - supermap.put(fd.getSymbol(), new Integer(0)); + namemap.put(fd.getSymbol(), new Integer(0)); } } } -- 2.34.1