bug fix and other change
authorbdemsky <bdemsky>
Wed, 6 Apr 2011 03:24:48 +0000 (03:24 +0000)
committerbdemsky <bdemsky>
Wed, 6 Apr 2011 03:24:48 +0000 (03:24 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/RuntimeConflictResolver.java

index 3aa67c791727325a1b5e424aae130d3eec36faf0..62bbac40cb247fe1c2b6266ba584e5e6a5781ccd 100644 (file)
@@ -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);
index 03d781728756e6192093c3e6df97c77f291f166d..7b446681bd93e226142b6dfb6052f5ca5c65c5f8 100644 (file)
@@ -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;