Bug fixes and add some code for easy debugging
authorjzhou <jzhou>
Sat, 2 Apr 2011 03:39:06 +0000 (03:39 +0000)
committerjzhou <jzhou>
Sat, 2 Apr 2011 03:39:06 +0000 (03:39 +0000)
Robust/src/ClassLibrary/MGC/HashMap.java
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoremem.c
Robust/src/Runtime/bamboo/multicoremem.h
Robust/src/Runtime/bamboo/multicoreruntime.c
Robust/src/Runtime/bamboo/multicoreruntime.h
Robust/src/buildscript

index 780159d9527fc3ffa1eb06a33006806912d06f90..9ec53db3a82af8dba146480ef3b39a4a31f8866d 100644 (file)
@@ -2,6 +2,7 @@ public class HashMap implements Map {
   HashEntry[] table;
   float loadFactor;
   int numItems;
+  int threshold;
 
   public HashMap() {
     init(16, 0.75f);
@@ -16,36 +17,49 @@ public class HashMap implements Map {
   }
 
   private void init(int initialCapacity, float loadFactor) {
-    table=new HashEntry[initialCapacity];
+    table=new HashEntry[computeCapacity(initialCapacity)];
     this.loadFactor=loadFactor;
     this.numItems=0;
+    this.threshold=(int)(loadFactor*table.length);
+  }
+  
+  private static int computeCapacity(int capacity) {
+    int x=16;
+    while(x<capacity)
+      x=x<<1;
+    return x;
   }
 
   private static int hash(Object o, int length) {
-    if (o==null)
-      return 0;
-    int value=o.hashCode()%length;
-    if (value<0)
-      return -value;
-    return value;
+    int orig=o.hashCode();
+    orig=orig^(orig>>>22)^(orig>>>10);
+    orig=orig^(orig>>>8)^(orig>>4);
+    return orig&(length-1);
   }
 
   void resize() {
-    int newCapacity=2*table.length+1;
+    int newCapacity=table.length<<1;
     HashEntry[] oldtable=table;
     this.table=new HashEntry[newCapacity];
+    this.threshold=(int) (newCapacity*loadFactor);
 
     for(int i=0; i<oldtable.length; i++) {
       HashEntry e=oldtable[i];
       while(e!=null) {
-       HashEntry next=e.next;
-       int bin=hash(e.key, newCapacity);
-       e.next=table[bin];
-       table[bin]=e;
-       e=next;
+    HashEntry next=e.next;
+    int bin=hash(e.key, newCapacity);
+    e.next=table[bin];
+    table[bin]=e;
+    e=next;
       }
     }
   }
+  
+  public void clear() {
+    for(int i=0;i<table.length;i++)
+      table[i]=null;
+    numItems=0;
+  }
 
   public boolean isEmpty() {
     return numItems==0;
@@ -108,7 +122,7 @@ public class HashMap implements Map {
 
   Object put(Object key, Object value) {
     numItems++;
-    if (numItems>(loadFactor*table.length)) {
+    if (numItems>threshold) {
       //Resize the table
       resize();
     }
index 3c2015d47d00cea2c04949d768a8f6fb51360798..f5e99038bce2aacb38e6da5fa2692bbe78cc9175 100644 (file)
@@ -1810,6 +1810,9 @@ public class BuildCode {
         else
           headersout.print(temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol());
       }
+      if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+        headersout.print(", int linenum");
+      }
       headersout.println(");\n");
     }
 
@@ -1863,6 +1866,9 @@ public class BuildCode {
       else
        headersout.print(temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol());
     }
+    if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+      headersout.print(", int linenum");
+    }
     headersout.println(");\n");
   }
 
@@ -2474,11 +2480,18 @@ public class BuildCode {
     }
     if((md.getSymbol().equals("MonitorEnter") || md.getSymbol().equals("MonitorExit")) && fc.getThis().getSymbol().equals("classobj")) {
       output.println("{");
+      if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+        output.println("int monitorenterline = __LINE__;");
+      }
       // call MonitorEnter/MonitorExit on a class obj
       if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
         output.print("       struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params __parameterlist__={");
         output.println("1," + localsprefixaddr + ", global_defs_p->"+ fc.getThis().getType().getClassDesc().getSafeSymbol() +"classobj};");
+        if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+          output.println("     "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"(& __parameterlist__, monitorenterline);");
+        } else {
         output.println("     "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"(& __parameterlist__);");
+        }
       } else {
       output.println("       " + cn.getSafeSymbol()+md.getSafeSymbol()+"_"
                     + md.getSafeMethodDescriptor() + "((struct ___Object___*)(global_defs_p->"
@@ -2489,6 +2502,9 @@ public class BuildCode {
     }
     
     output.println("{");
+    if(md.getSymbol().equals("MonitorEnter")) {
+      output.println("int monitorenterline = __LINE__;");
+    }
     if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
       output.print("       struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+mdstring+"_params __parameterlist__={");
       output.print(objectparams.numPointers());
@@ -2558,7 +2574,9 @@ public class BuildCode {
          output.print(temp.getType().getSafeSymbol());
       }
 
-
+      if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+        output.print(", int");
+      }
       output.print("))virtualtable["+generateTemp(fm,fc.getThis())+"->type*"+maxcount+"+"+virtualcalls.getMethodNumber(md)+"])");
     }
 
@@ -2605,7 +2623,11 @@ public class BuildCode {
        needcomma=true;
       }
     }
+    if(md.getSymbol().equals("MonitorEnter") && state.OBJECTLOCKDEBUG) {
+      output.println(", monitorenterline);");
+    } else {
     output.println(");");
+    }
     output.println("   }");
   }
 
index 50dc88e63ac1c17d055f45ae28c09bfc23aeddbe..d340669bbc7748c8c616aba71bc463bc3946f65c 100644 (file)
@@ -182,6 +182,7 @@ public class State {
   public String outputdir = "/scratch/";
   // MGC options
   public boolean MGC=false;
+  public boolean OBJECTLOCKDEBUG=false;
   
   //Other options
   public String structfile;
index 9b0c93364ba04959bb2c17608c877eb1cf25a546..29e6a5b212bc44227150906d6906bcf7ca622adb 100644 (file)
@@ -155,6 +155,8 @@ public class Main {
         state.MULTICOREGC=true;
       else if (option.equals("-mgc")) {
         state.MGC = true;
+      } else if (option.equals("-objectlockdebug")) {
+        state.OBJECTLOCKDEBUG = true;
       } else if (option.equals("-ownership"))
        state.OWNERSHIP=true;
       else if (option.equals("-ownallocdepth")) {
index 73d145c5dca6446d01f5575af42ce19b336fdc2e..f037402104fcf811900a50e0a0628f60e4827dbe 100644 (file)
@@ -27,7 +27,7 @@ extern unsigned int gcmem_mixed_usedmem;
 #endif
 
 #ifdef MGC
-extern INTPTR bamboo_threadlocks;
+extern unsigned int bamboo_threadlocks;
 #endif
 
 struct pointerblock {
@@ -2238,7 +2238,7 @@ inline void flushRuntimeObj(struct garbagelist * stackptr) {
 #ifdef MGC
   // flush the bamboo_threadlocks
   if(bamboo_threadlocks != 0) {
-       bamboo_threadlocks = (INTPTR)(flushObj((void *)bamboo_threadlocks));
+       bamboo_threadlocks = (unsigned int)(flushObj((void *)bamboo_threadlocks));
   }
 
   // flush global thread queue
@@ -3043,8 +3043,8 @@ inline void gc_collect(struct garbagelist * stackptr) {
     }
   }
 
-  gcflag = false;
-  gcprocessing = false;
+  //gcflag = false;
+  //gcprocessing = false;
 #ifdef RAWPATH // TODO GC_DEBUG
   printf("(%x,%x) Finish gc! \n", udn_tile_coord_x(), udn_tile_coord_y());
 #endif
@@ -3151,8 +3151,8 @@ inline void gc_nocollect(struct garbagelist * stackptr) {
       break;
     }
   }
-  gcflag = false;
-  gcprocessing = false;
+  //gcflag = false;
+  //gcprocessing = false;
 #ifdef RAWPATH // TODO GC_DEBUG
   printf("(%x,%x) Finish gc! \n", udn_tile_coord_x(), udn_tile_coord_y());
 #endif
@@ -3548,9 +3548,6 @@ inline bool gc(struct garbagelist * stackptr) {
          BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
          // some of the cores are still executing the mutator and did not reach
          // some gc safe point, therefore it is not ready to do gc
-         // in case that there are some pregc information msg lost, send a confirm
-         // msg to the 'busy' core
-         send_msg_1(ti, GCSTARTPRE, false);
          gcflag = true;
          return false;
        } else {
index d225683e488378986880b928cc6914ff4b9108d0..638bd07c6ac40f7aefcd80e8ff11e6af011922c2 100644 (file)
@@ -63,134 +63,134 @@ int core2test[62][NUM_CORES2TEST] = {
 #elif defined SMEMM
 unsigned int gcmem_mixed_threshold = 0;
 unsigned int gcmem_mixed_usedmem = 0;
-#define NUM_CORES2TEST 9
+#define NUM_CORES2TEST 13
 #ifdef GC_1
 int core2test[1][NUM_CORES2TEST] = {
   {0, -1, -1, -1, -1, -1, -1, -1, -1}
 };
 #elif defined GC_56
 int core2test[56][NUM_CORES2TEST] = {
-  { 0, -1,  7, -1,  1, -1, 14, -1,  2}, 
-  { 1, -1,  8,  0,  2, -1, 15, -1,  3}, 
-  { 2, -1,  9,  1,  3, -1, 16,  0,  4}, 
-  { 3, -1, 10,  2,  4, -1, 17,  1,  5}, 
-  { 4, -1, 11,  3,  5, -1, 18,  2,  6}, 
-  { 5, -1, 12,  4,  6, -1, 19,  3, -1},
-  { 6, -1, 13,  5, -1, -1, 20,  4, -1}, 
-  { 7,  0, 14, -1,  8, -1, 21, -1,  9}, 
-  { 8,  1, 15,  7,  9, -1, 22, -1, 10}, 
-  { 9,  2, 16,  8, 10, -1, 23,  7, 11}, 
-  {10,  3, 17,  9, 11, -1, 24,  8, 12}, 
-  {11,  4, 18, 10, 12, -1, 25,  9, 13},
-  {12,  5, 19, 11, 13, -1, 26, 10, -1}, 
-  {13,  6, 20, 12, -1, -1, 27, 11, -1}, 
-  {14,  7, 21, -1, 15,  0, 28, -1, 16}, 
-  {15,  8, 22, 14, 16,  1, 29, -1, 17}, 
-  {16,  9, 23, 15, 17,  2, 30, 14, 18}, 
-  {17, 10, 24, 16, 18,  3, 31, 15, 19},
-  {18, 11, 25, 17, 19,  4, 32, 16, 20}, 
-  {19, 12, 26, 18, 20,  5, 33, 17, -1}, 
-  {20, 13, 27, 19, -1,  6, 34, 18, -1}, 
-  {21, 14, 28, -1, 22,  7, 35, -1, 23}, 
-  {22, 15, 29, 21, 23,  8, 36, -1, 24}, 
-  {23, 16, 30, 22, 24,  9, 37, 21, 25},
-  {24, 17, 31, 23, 25, 10, 38, 22, 26}, 
-  {25, 18, 32, 24, 26, 11, 39, 23, 27}, 
-  {26, 19, 33, 25, 27, 12, 40, 24, -1}, 
-  {27, 20, 34, 26, -1, 13, 41, 25, -1}, 
-  {28, 21, 35, -1, 29, 14, 42, -1, 30}, 
-  {29, 22, 36, 28, 30, 15, 43, -1, 31},
-  {30, 23, 37, 29, 31, 16, 44, 28, 32}, 
-  {31, 24, 38, 30, 32, 17, 45, 29, 33}, 
-  {32, 25, 39, 31, 33, 18, 46, 30, 34}, 
-  {33, 26, 40, 32, 34, 19, 47, 31, -1}, 
-  {34, 27, 41, 33, -1, 20, 48, 32, -1}, 
-  {35, 28, 42, -1, 36, 21, 49, -1, 37},
-  {36, 29, 43, 35, 37, 22, 50, -1, 38}, 
-  {37, 30, 44, 36, 38, 23, 51, 35, 39}, 
-  {38, 31, 45, 37, 39, 24, 52, 36, 40}, 
-  {39, 32, 46, 38, 40, 25, 53, 37, 41}, 
-  {40, 33, 47, 39, 41, 26, 54, 38, -1}, 
-  {41, 34, 48, 40, -1, 27, 55, 39, -1},
-  {42, 35, 49, -1, 43, 28, -1, -1, 44}, 
-  {43, 36, 50, 42, 44, 29, -1, -1, 45}, 
-  {44, 37, 51, 43, 45, 30, -1, 42, 46}, 
-  {45, 38, 52, 44, 46, 31, -1, 43, 47}, 
-  {46, 39, 53, 45, 47, 32, -1, 44, 48}, 
-  {47, 40, 54, 46, 48, 33, -1, 45, -1},
-  {48, 41, 55, 47, -1, 34, -1, 46, -1}, 
-  {49, 42, -1, -1, 50, 35, -1, -1, 51}, 
-  {50, 43, -1, 49, 51, 36, -1, -1, 52}, 
-  {51, 44, -1, 50, 52, 37, -1, 49, 53}, 
-  {52, 45, -1, 51, 53, 38, -1, 50, 54}, 
-  {53, 46, -1, 52, 54, 39, -1, 51, 55},
-  {54, 47, -1, 53, 55, 40, -1, 52, -1}, 
-  {55, 48, -1, 54, -1, 41, -1, 53, -1}
+  { 0, -1, -1,  7,  1, -1, -1, -1, -1, 14,  8,  2, -1}, 
+  { 1, -1,  0,  8,  2, -1, -1, -1,  7, 15,  9,  3, -1}, 
+  { 2, -1,  1,  9,  3, -1, -1,  0,  8, 16, 10,  4, -1}, 
+  { 3, -1,  2, 10,  4, -1, -1,  1,  9, 17, 11,  5, -1}, 
+  { 4, -1,  3, 11,  5, -1, -1,  2, 10, 18, 12,  6, -1}, 
+  { 5, -1,  4, 12,  6, -1, -1,  3, 11, 19, 13, -1, -1},
+  { 6, -1,  5, 13, -1, -1, -1,  4, 12, 20, -1, -1, -1}, 
+  { 7,  0, -1, 14,  8, -1, -1, -1, -1, 21, 15,  9,  1}, 
+  { 8,  1,  7, 15,  9, -1,  0, -1, 14, 22, 16, 10,  2}, 
+  { 9,  2,  8, 16, 10, -1,  1,  7, 15, 23, 17, 11,  3}, 
+  {10,  3,  9, 17, 11, -1,  2,  8, 16, 24, 18, 12,  4}, 
+  {11,  4, 10, 18, 12, -1,  3,  9, 17, 25, 19, 13,  5},
+  {12,  5, 11, 19, 13, -1,  4, 10, 18, 26, 20, -1,  6}, 
+  {13,  6, 12, 20, -1, -1,  5, 11, 19, 27, -1, -1, -1}, 
+  {14,  7, -1, 21, 15,  0, -1, -1, -1, 28, 22, 16,  8}, 
+  {15,  8, 14, 22, 16,  1,  7, -1, 21, 29, 23, 17,  9}, 
+  {16,  9, 15, 23, 17,  2,  8, 14, 22, 30, 24, 18, 10}, 
+  {17, 10, 16, 24, 18,  3,  9, 15, 23, 31, 25, 19, 11},
+  {18, 11, 17, 25, 19,  4, 10, 16, 24, 32, 26, 20, 12}, 
+  {19, 12, 18, 26, 20,  5, 11, 17, 25, 33, 27, -1, 13}, 
+  {20, 13, 19, 27, -1,  6, 12, 18, 26, 34, -1, -1, -1}, 
+  {21, 14, -1, 28, 22,  7, -1, -1, -1, 35, 29, 23, 15}, 
+  {22, 15, 21, 29, 23,  8, 14, -1, 28, 36, 30, 24, 16}, 
+  {23, 16, 22, 30, 24,  9, 15, 21, 29, 37, 31, 25, 17},
+  {24, 17, 23, 31, 25, 10, 16, 22, 40, 38, 32, 26, 18}, 
+  {25, 18, 24, 32, 26, 11, 17, 23, 31, 39, 33, 27, 19}, 
+  {26, 19, 25, 33, 27, 12, 18, 24, 32, 40, 34, -1, 20}, 
+  {27, 20, 26, 34, -1, 13, 19, 25, 33, 41, -1, -1, -1}, 
+  {28, 21, -1, 35, 29, 14, -1, -1, -1, 42, 36, 30, 22}, 
+  {29, 22, 28, 36, 30, 15, 21, -1, 35, 43, 37, 31, 23},
+  {30, 23, 29, 37, 31, 16, 22, 28, 36, 44, 38, 32, 24}, 
+  {31, 24, 30, 38, 32, 17, 23, 29, 37, 45, 39, 33, 25}, 
+  {32, 25, 31, 39, 33, 18, 24, 30, 38, 46, 40, 34, 26}, 
+  {33, 26, 32, 40, 34, 19, 25, 31, 39, 47, 41, -1, 27}, 
+  {34, 27, 33, 41, -1, 20, 26, 32, 40, 48, -1, -1, -1}, 
+  {35, 28, -1, 42, 36, 21, -1, -1, -1, 49, 43, 37, 29},
+  {36, 29, 35, 43, 37, 22, 28, -1, 42, 50, 44, 38, 30}, 
+  {37, 30, 36, 44, 38, 23, 29, 35, 43, 51, 45, 39, 31}, 
+  {38, 31, 37, 45, 39, 24, 30, 36, 44, 52, 46, 40, 32}, 
+  {39, 32, 38, 46, 40, 25, 31, 37, 45, 53, 47, 41, 33}, 
+  {40, 33, 39, 47, 41, 26, 32, 38, 46, 54, 48, -1, 34}, 
+  {41, 34, 40, 48, -1, 27, 33, 39, 47, 55, -1, -1, -1},
+  {42, 35, -1, 49, 43, 28, -1, -1, -1, -1, 50, 44, 36}, 
+  {43, 36, 42, 50, 44, 29, 35, -1, 49, -1, 51, 45, 37}, 
+  {44, 37, 43, 51, 45, 30, 36, 42, 50, -1, 52, 46, 38}, 
+  {45, 38, 44, 52, 46, 31, 37, 43, 51, -1, 53, 47, 39}, 
+  {46, 39, 45, 53, 47, 32, 38, 44, 52, -1, 54, 48, 40}, 
+  {47, 40, 46, 54, 48, 33, 39, 45, 53, -1, 55, -1, 41},
+  {48, 41, 47, 55, -1, 34, 40, 46, 54, -1, -1, -1, -1}, 
+  {49, 42, -1, -1, 50, 35, -1, -1, -1, -1, -1, 51, 43}, 
+  {50, 43, 49, -1, 51, 36, 42, -1, -1, -1, -1, 52, 44}, 
+  {51, 44, 50, -1, 52, 37, 43, 49, -1, -1, -1, 53, 45}, 
+  {52, 45, 51, -1, 53, 38, 44, 50, -1, -1, -1, 54, 46}, 
+  {53, 46, 52, -1, 54, 39, 45, 51, -1, -1, -1, 55, 47},
+  {54, 47, 53, -1, 55, 40, 46, 52, -1, -1, -1, -1, 48}, 
+  {55, 48, 54, -1, -1, 41, 47, 53, -1, -1, -1, -1, -1}
 };
 #elif defined GC_62
 int core2test[62][NUM_CORES2TEST] = {
-  { 0, -1,  6, -1,  1, -1, 14, -1,  2}, 
-  { 1, -1,  7,  0,  2, -1, 15, -1,  3}, 
-  { 2, -1,  8,  1,  3, -1, 16,  0,  4}, 
-  { 3, -1,  9,  2,  4, -1, 17,  1,  5}, 
-  { 4, -1, 10,  3,  5, -1, 18,  2, -1}, 
-  { 5, -1, 11,  4, -1, -1, 19,  3, -1},
-  { 6,  0, 14, -1,  7, -1, 22, -1,  8}, 
-  { 7,  1, 15,  6,  8, -1, 23, -1,  9}, 
-  { 8,  2, 16,  7,  9, -1, 24,  6, 10}, 
-  { 9,  3, 17,  8, 10, -1, 25,  7, 11}, 
-  {10,  4, 18,  9, 11, -1, 26,  8, 12}, 
-  {11,  5, 19, 10, 12, -1, 27,  9, 13},
-  {12, -1, 20, 11, 13, -1, 28, 10, -1}, 
-  {13, -1, 21, 12, -1, -1, 29, 11, -1}, 
-  {14,  6, 22, -1, 15,  0, 30, -1, 16}, 
-  {15,  7, 23, 14, 16,  1, 31, -1, 17}, 
-  {16,  8, 24, 15, 17,  2, 32, 14, 18}, 
-  {17,  9, 25, 16, 18,  3, 33, 15, 19},
-  {18, 10, 26, 17, 19,  4, 34, 16, 20}, 
-  {19, 11, 27, 18, 20,  5, 35, 17, 21}, 
-  {20, 12, 28, 19, 21, -1, 36, 18, -1}, 
-  {21, 13, 29, 28, -1, -1, 37, 19, -1}, 
-  {22, 14, 30, -1, 23,  6, 38, -1, 24}, 
-  {23, 15, 31, 22, 24,  7, 39, -1, 25},
-  {24, 16, 32, 23, 25,  8, 40, 22, 26}, 
-  {25, 17, 33, 24, 26,  9, 41, 23, 27}, 
-  {26, 18, 34, 25, 27, 10, 42, 24, 28}, 
-  {27, 19, 35, 26, 28, 11, 43, 25, 29}, 
-  {28, 20, 36, 27, 29, 12, 44, 26, -1}, 
-  {29, 21, 37, 28, -1, 13, 45, 27, -1},
-  {30, 22, 38, -1, 31, 22, 46, -1, 32}, 
-  {31, 23, 39, 30, 32, 15, 47, -1, 33}, 
-  {32, 24, 40, 31, 33, 16, 48, 30, 34}, 
-  {33, 25, 41, 32, 34, 17, 49, 31, 35}, 
-  {34, 26, 42, 33, 35, 18, 50, 32, 36}, 
-  {35, 27, 43, 34, 36, 19, 51, 33, 37},
-  {36, 28, 44, 35, 37, 20, 52, 34, -1}, 
-  {37, 29, 45, 36, -1, 21, 53, 35, -1}, 
-  {38, 30, 46, -1, 39, 22, 54, -1, 40}, 
-  {39, 31, 47, 38, 40, 23, 55, -1, 41}, 
-  {40, 32, 48, 39, 41, 24, 56, 38, 42}, 
-  {41, 33, 49, 40, 42, 25, 57, 39, 43},
-  {42, 34, 50, 41, 43, 26, 58, 40, 44}, 
-  {43, 35, 51, 42, 44, 27, 59, 41, 45}, 
-  {44, 36, 52, 43, 45, 28, 60, 42, -1}, 
-  {45, 37, 53, 44, -1, 29, 61, 43, -1}, 
-  {46, 38, 54, -1, 47, 30, -1, -1, 48}, 
-  {47, 39, 55, 46, 48, 31, -1, -1, 49},
-  {48, 40, 56, 47, 49, 32, -1, 46, 50}, 
-  {49, 41, 57, 48, 50, 33, -1, 47, 51}, 
-  {50, 42, 58, 49, 51, 34, -1, 48, 52}, 
-  {51, 43, 59, 50, 52, 35, -1, 49, 53}, 
-  {52, 44, 60, 51, 53, 36, -1, 50, -1}, 
-  {53, 45, 61, 52, -1, 37, -1, 51, -1},
-  {54, 46, -1, -1, 55, 38, -1, -1, 56}, 
-  {55, 47, -1, 54, 56, 39, -1, -1, 57}, 
-  {56, 48, -1, 55, 57, 40, -1, 54, 58}, 
-  {57, 49, -1, 56, 59, 41, -1, 55, 59}, 
-  {58, 50, -1, 57, 59, 42, -1, 56, 60}, 
-  {59, 51, -1, 58, 60, 43, -1, 57, 61},
-  {60, 52, -1, 59, 61, 44, -1, 58, -1}, 
-  {61, 53, -1, 60, -1, 45, -1, 59, -1}
+  { 0, -1, -1,  6,  1, -1, -1, -1, -1, 14,  7,  2, -1}, 
+  { 1, -1,  0,  7,  2, -1, -1, -1,  6, 15,  8,  3, -1}, 
+  { 2, -1,  1,  8,  3, -1, -1,  0,  7, 16,  9,  4, -1}, 
+  { 3, -1,  2,  9,  4, -1, -1,  1,  8, 17, 10,  5, -1}, 
+  { 4, -1,  3, 10,  5, -1, -1,  2,  9, 18,  11, -1, -1}, 
+  { 5, -1,  4, 11, -1, -1, -1,  3, 10, 19, 12, -1, -1},
+  { 6,  0, -1, 14,  7, -1, -1, -1, -1, 22, 15,  8,  1}, 
+  { 7,  1,  6, 15,  8, -1,  0, -1, 14, 23, 16,  9,  2}, 
+  { 8,  2,  7, 16,  9, -1,  1,  6, 15, 24, 17, 10,  3}, 
+  { 9,  3,  8, 17, 10, -1,  2,  7, 16, 25, 18, 11,  4}, 
+  {10,  4,  9, 18, 11, -1,  3,  8, 17, 26, 19, 12,  5}, 
+  {11,  5, 10, 19, 12, -1,  4,  9, 18, 27, 20, 13, -1},
+  {12, -1, 11, 20, 13, -1,  5, 10, 19, 28, 21, -1, -1}, 
+  {13, -1,  12, 21, -1, -1, -1, 11, 20, 29, -1, -1, -1}, 
+  {14,  6, -1, 22, 15,  0, -1, -1, -1, 30, 23, 16,  7}, 
+  {15,  7, 14, 23, 16,  1,  6, -1, 22, 31, 24, 17,  8}, 
+  {16,  8, 15, 24, 17,  2,  7, 14, 23, 32, 25, 18,  9}, 
+  {17,  9, 16, 25, 18,  3,  8, 15, 24, 33, 26, 19, 10},
+  {18, 10, 17, 26, 19,  4,   9, 16, 25, 34, 27, 20, 11}, 
+  {19, 11, 18, 27, 20,  5, 10, 17, 26, 35, 28, 21, 12}, 
+  {20, 12, 19, 28, 21, -1, 11, 18, 27, 36, 29, -1, 13}, 
+  {21, 13, 28, 29, -1, -1, 12, 19, 28, 37, -1, -1, -1}, 
+  {22, 14, -1, 30, 23,  6, -1, -1, -1, 38, 31, 24, 15}, 
+  {23, 15, 22, 31, 24,  7, 14, -1, 30, 39, 32, 25, 16},
+  {24, 16, 23, 32, 25,  8, 15, 22, 31, 40, 33, 26, 17}, 
+  {25, 17, 24, 33, 26,  9, 16, 23, 32, 41, 34, 27, 18}, 
+  {26, 18, 25, 34, 27, 10, 17, 24, 33, 42, 35, 28, 19}, 
+  {27, 19, 26, 35, 28, 11, 18, 25, 34, 43, 36, 29, 20}, 
+  {28, 20, 27, 36, 29, 12, 19, 26, 35, 44, 37, -1, 21}, 
+  {29, 21, 28, 37, -1, 13, 20, 27, 36, 45, -1, -1, -1},
+  {30, 22, -1, 38, 31, 14, -1, -1, -1, 46, 39, 32, 23}, 
+  {31, 23, 30, 39, 32, 15, 22, -1, 38, 47, 40, 33, 24}, 
+  {32, 24, 31, 40, 33, 16, 23, 30, 39, 48, 41, 34, 25}, 
+  {33, 25, 32, 41, 34, 17, 24, 31, 40, 49, 42, 35, 26}, 
+  {34, 26, 33, 42, 35, 18, 25, 32, 41, 50, 43, 36, 27}, 
+  {35, 27, 34, 43, 36, 19, 26, 33, 42, 51, 44, 37, 28},
+  {36, 28, 35, 44, 37, 20, 27, 34, 43, 52, 45, -1, 29}, 
+  {37, 29, 36, 45, -1, 21, 28, 35, 44, 53, -1, -1, -1}, 
+  {38, 30, -1, 46, 39, 22, -1, -1, -1, 54, 47, 40, 31}, 
+  {39, 31, 38, 47, 40, 23, 30, -1, 46, 55, 48, 41, 32}, 
+  {40, 32, 39, 48, 41, 24, 31, 38, 47, 56, 49, 42, 33}, 
+  {41, 33, 40, 49, 42, 25, 32, 39, 48, 57, 50, 43, 34},
+  {42, 34, 41, 50, 43, 26, 33, 40, 49, 58, 51, 44, 35}, 
+  {43, 35, 42, 51, 44, 27, 34, 41, 50, 59, 52, 45, 36}, 
+  {44, 36, 43, 52, 45, 28, 35, 42, 51, 60, 53, -1, 37}, 
+  {45, 37, 44, 53, -1, 29, 36, 43, 52, 61, -1, -1}, 
+  {46, 38, -1, 54, 47, 30, -1, -1, -1, -1, 55, 48, 39}, 
+  {47, 39, 46, 55, 48, 31, 38, -1, 54, -1, 56, 49, 40},
+  {48, 40, 47, 56, 49, 32, 39, 46, 55 -1, 57, 50, 41}, 
+  {49, 41, 48, 57, 50, 33, 40, 47, 56, -1, 58, 51, 42}, 
+  {50, 42, 49, 58, 51, 34, 41, 48, 57, -1, 59, 52, 43}, 
+  {51, 43, 50, 59, 52, 35, 42, 49, 58, -1, 60, 53, 44}, 
+  {52, 44, 51, 60, 53, 36, 43, 50, 59, -1, 61, -1, 45}, 
+  {53, 45, 52, 61, -1, 37, 44, 51, 60, -1, -1, -1, -1},
+  {54, 46, -1, -1, 55, 38, -1, -1, -1, -1, -1, 56, 47}, 
+  {55, 47, 54, -1, 56, 39, 46, -1, -1, -1, -1, 57, 48}, 
+  {56, 48, 55, -1, 57, 40, 47, 54, -1, -1, -1, 58, 49}, 
+  {57, 49, 56, -1, 58, 41, 48, 55, -1, -1, -1, 59, 50}, 
+  {58, 50, 57, -1, 59, 42, 49, 56, -1, -1, -1, 60, 51}, 
+  {59, 51, 58, -1, 60, 43, 50, 57, -1, -1, -1, 61, 52},
+  {60, 52, 59, -1, 61, 44, 51, 58, -1, -1, -1, -1, 53}, 
+  {61, 53, 60, -1, -1, 45, 52, 59, -1, -1, -1, -1, -1}
 };
 #endif // GC_1
 #endif // SMEMF
index 92ecd6a0b7b6cd15c1fb75ffb467d0c13141c47a..c6974bd1b6a525597740f44db57063fcb4d50400 100644 (file)
 
 // data structures for shared memory allocation
 #ifdef TILERA_BME
-#define BAMBOO_BASE_VA 0xd000000
+#define BAMBOO_BASE_VA 0x600000  //0xd000000
 #elif defined TILERA_ZLINUX
 #ifdef MULTICORE_GC
-#define BAMBOO_BASE_VA 0xd000000
+#define BAMBOO_BASE_VA 0x1000000 //0xd000000
 #endif // MULTICORE_GC
 #endif // TILERA_BME
 
@@ -60,7 +60,7 @@
 #elif defined GC_LARGESHAREDHEAP2
 #define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+2)))
 #else
-#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+54/*3*/))) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5)  3G
+#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+57/*3*/))) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5)  3G
 #endif
 #ifdef GC_LARGEPAGESIZE
 #define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 1024 * 1024))  // (4096)
index 862b2962ce67be06ac983b93ed03eaab1b310c32..cff64cc88091052059241a02d37d2e1bbae4f2af 100644 (file)
@@ -1202,13 +1202,13 @@ INLINE void processmsg_gcstartpre_I() {
   if(gcprocessing) {
        // already stall for gc
        // send a update pregc information msg to the master core
-       if(BAMBOO_CHECK_SEND_MODE()) {
+       /*if(BAMBOO_CHECK_SEND_MODE()) {
          cache_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE, 
                  self_numsendobjs, self_numreceiveobjs);
        } else {
          send_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE, 
                  self_numsendobjs, self_numreceiveobjs, true);
-       }
+       }*/
   } else {
        // the first time to be informed to start gc
        gcflag = true;
@@ -1750,6 +1750,8 @@ processmsg:
     case GCFINISH: {
       // received a GC finish msg
       gcphase = FINISHPHASE;
+         gcflag = false;
+         gcprocessing = false;
       break;
     }   // case GCFINISH
 
index 4a44092c9c39d80ab67a23b3648aa4afb42862b3..c6d562a7c8ac5635c3516a626d811330f79b52a5 100644 (file)
@@ -52,9 +52,9 @@ bool reside;
 #define BAMBOO_THREAD_QUEUE_SIZE (BAMBOO_SMEM_SIZE) // (45 * 16 * 1024)
 #endif
 // data structures for threads
-INTPTR * bamboo_thread_queue;
+unsigned int * bamboo_thread_queue;
 unsigned int bamboo_max_thread_num_mask;
-INTPTR bamboo_current_thread;
+unsigned int bamboo_current_thread;
 
 extern int corenum;
 #endif // MGC
index b4ff4f7029da81061d186a920734e0a745a474e4..5d30411841b64abe24103d606c18223ac9fba7dc 100755 (executable)
@@ -100,6 +100,8 @@ echo "-gclargesharedheap(2) set the gc shared memory as large (should be used to
 echo "-gccacheadapt setup as cacheadaptable mode (should be used together with -multicoregc)"
 echo -gcprofile build with gcprofile options
 echo -mgc generate Multicore GC binary without task stuff
+echo -objectlockdebug generate OBJECT_LOCK_DEBUG code
+echo -mappinttbldebug generate MAPPINGTBL_DEBUG code
 echo
 echo SSJava options
 echo -ssjava enables SSJava
@@ -218,6 +220,8 @@ GCCACHEADAPTPOLICYFLAG=false
 GCCACHEADAPTPOLICY=''
 GCCACHESAMPLINGFLAG=false
 MGCFLAG=false
+OBJECTLOCKDEBUGFLAG=false
+MAPPINGTBLDEBUGFLAG=false
 USEDMALLOC=false
 THREADFLAG=false
 FASTCHECK=false
@@ -530,6 +534,13 @@ elif [[ $1 = '-mgc' ]]
 then
 MGCFLAG=true
 JAVAOPTS="$JAVAOPTS -mgc"
+elif [[ $1 = '-objectlockdebug' ]]
+then
+OBJECTLOCKDEBUGFLAG=true
+JAVAOPTS="$JAVAOPTS -objectlockdebug"
+elif [[ $1 = '-mappingtbldebug' ]]
+then
+MAPPINGTBLDEBUGFLAG=true
 elif [[ $1 = '-dmalloc' ]]
 then
 USEDMALLOC=true
@@ -947,6 +958,16 @@ else
 export TILERACFLAGS="-DTASK -DMULTICORE -DCLOSE_PRINT -DTILERA"
 fi
 
+if $MAPPINGTBLDEBUGFLAG
+then
+TILERACFLAGS="${TILERACFLAGS} -DMAPPINGTBL_DEBUG"
+fi
+
+if $OBJECTLOCKDEBUGFLAG
+then
+TILERACFLAGS="${TILERACFLAGS} -DOBJECT_LOCK_DEBUG"
+fi
+
 if $TILERAMEMPROFFLAG
 then # not only with 1 core
   PCIHVC="$PCIHVC.memprof"