From: bdemsky Date: Wed, 6 Apr 2011 03:24:48 +0000 (+0000) Subject: bug fix and other change X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=349137e25d94b4ef386597fb79e48425feb2d40f;p=IRC.git bug fix and other change --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 3aa67c79..62bbac40 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -2542,6 +2542,13 @@ public class BuildCode { output.print(generateTemp(fm,fc.getReturnTemp())+"="); /* Do we need to do virtual dispatch? */ + if (!md.isStatic()&&md.getReturnType()!=null&&fc.getThis().getType().getClassDesc()==null) { + System.out.println(fm); + System.out.println(md); + System.out.println(fc); + System.out.println(fm.printMethod()); + } + if (md.isStatic()||md.getReturnType()==null||singleCall(fc.getThis().getType().getClassDesc(),md)||fc.getSuper()) { //no output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+mdstring); diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index 03d78172..7b446681 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -251,6 +251,10 @@ public class RuntimeConflictResolver { } public void addChecker(Alloc a, FlatNode fn, TempDescriptor tmp, SMFEState state, EffectsTable et, String prefix, int depth, int weakID) { + if (depth>30) { + System.out.println(fn+" "+state+" "+state.toStringDOT()); + } + insertEntriesIntoHashStructureNew(fn, tmp, et, a, prefix, depth, weakID); int pdepth = depth+1; @@ -322,13 +326,13 @@ public class RuntimeConflictResolver { if(et.hasWriteConflict(a)) { cFile.append(" int tmpkey" + depth + " = rcr_generateKey(" + prefix + ");\n"); - if (et.leadsToConflict(a)) + if (et.conflictDereference(a)) cFile.append(" int tmpvar" + depth + " = rcr_WTWRITEBINCASE(allHashStructures[" + weakID + "], tmpkey" + depth + ", " + tasksrc + strrcr + index + ");\n"); else cFile.append(" int tmpvar" + depth + " = rcr_WRITEBINCASE(allHashStructures["+ weakID + "], tmpkey" + depth + ", " + tasksrc + strrcr + index + ");\n"); } else if(et.hasReadConflict(a)) { cFile.append(" int tmpkey" + depth + " = rcr_generateKey(" + prefix + ");\n"); - if (et.leadsToConflict(a)) + if (et.conflictDereference(a)) cFile.append(" int tmpvar" + depth + " = rcr_WTREADBINCASE(allHashStructures[" + weakID + "], tmpkey" + depth + ", " + tasksrc + strrcr + index + ");\n"); else cFile.append(" int tmpvar" + depth + " = rcr_READBINCASE(allHashStructures["+ weakID + "], tmpkey" + depth + ", " + tasksrc + strrcr + index + ");\n"); @@ -531,9 +535,9 @@ public class RuntimeConflictResolver { } } - public boolean leadsToConflict(Alloc a) { + public boolean conflictDereference(Alloc a) { for(Effect e:getEffects(a)) { - if (!state.transitionsTo(e).isEmpty()) + if (!state.transitionsTo(e).isEmpty()&&state.getConflicts().contains(e)) return true; } return false;