changes
authorbdemsky <bdemsky>
Wed, 12 Sep 2007 09:17:39 +0000 (09:17 +0000)
committerbdemsky <bdemsky>
Wed, 12 Sep 2007 09:17:39 +0000 (09:17 +0000)
Robust/src/Runtime/DSTM/interface/trans.c
Robust/src/Runtime/garbage.c
Robust/src/Tests/Atomic.java
Robust/src/buildscript

index 487b3cb3c40357e0a0bf664ca52eae0d7af2cf81..b08440e828effe5134b464a5956789e1cb8756f7 100644 (file)
@@ -855,7 +855,7 @@ void *handleLocalReq(void *threadarg) {
                        } else {/* If Obj is not locked then lock object */
                                STATUS(((objheader_t *)mobj)) |= LOCK;
                                //TODO Remove this for Testing
-                               randomdelay();
+                               //randomdelay(); -- Why is this here.  BCD
 
                                /* Save all object oids that are locked on this machine during this transaction request call */
                                oidlocked[objlocked] = OID(((objheader_t *)mobj));
@@ -1629,7 +1629,11 @@ int processConfigFile()
                printf("error in %s: no IP Adresses found\n", CONFIG_FILENAME);
                return -1;
        }
+#ifdef MAC
+       myIpAddr = getMyIpAddr("en1");
+#else
        myIpAddr = getMyIpAddr("eth0");
+#endif
        myIndexInHostArray = findHost(myIpAddr);
        if (myIndexInHostArray == -1)
        {
index 1e7a63f75401dcef8be1925af02fc1248a226127..474444a6e096ec40d0063020813e59cbdc99bed9 100644 (file)
@@ -36,11 +36,41 @@ struct listitem * list=NULL;
 int listcount=0;
 #endif
 
+#ifdef DSTM
+#define ENQUEUE(orig, dst) \
+if ((!(((unsigned int)orig)&0x1))) {\
+if (orig>to_heapbase&&orig<to_heaptop) {\
+dst=NULL;\
+} else if (orig>curr_heapbase&&orig<curr_heaptop) {\
+void *copy;\
+if (gc_createcopy(orig,&copy))\
+enqueue(orig);\
+dst=copy;\
+}\
+}
+#else
+#define ENQUEUE(orig, dst) \
+void *copy; \
+if (gc_createcopy(orig,&copy))\
+enqueue(orig);\
+dst=copy
+#endif
+
 struct pointerblock {
   void * ptrs[NUMPTRS];
   struct pointerblock *next;
 };
 
+void * curr_heapbase=0;
+void * curr_heapptr=0;
+void * curr_heapgcpoint=0;
+void * curr_heaptop=0;
+
+void * to_heapbase=0;
+void * to_heapptr=0;
+void * to_heaptop=0;
+long lastgcsize=0;
+
 struct pointerblock *head=NULL;
 int headindex=0;
 struct pointerblock *tail=NULL;
@@ -134,10 +164,7 @@ void collect(struct garbagelist * stackptr) {
     int i;
     for(i=0;i<stackptr->size;i++) {
       void * orig=stackptr->array[i];
-      void * copy;
-      if (gc_createcopy(orig,&copy))
-       enqueue(orig);
-      stackptr->array[i]=copy;
+      ENQUEUE(orig, stackptr->array[i]);
     }
     stackptr=stackptr->next;
   }
@@ -145,10 +172,7 @@ void collect(struct garbagelist * stackptr) {
   /* Go to next thread */
   if (listptr!=NULL) {
     void * orig=listptr->locklist;
-    void * copy;
-    if (gc_createcopy(orig,&copy))
-      enqueue(orig);
-    listptr->locklist=copy;
+    ENQUEUE(orig, listptr->locklist);
     stackptr=listptr->stackptr;
     listptr=listptr->next;
   } else
@@ -168,11 +192,7 @@ void collect(struct garbagelist * stackptr) {
        struct ObjectNode * ptr=set->listhead;
        while(ptr!=NULL) {
          void *orig=(void *)ptr->key;
-         void *copy;
-         if (gc_createcopy(orig, &copy))
-           enqueue(orig);
-         ptr->key=(int)copy;
-         
+         ENQUEUE(orig, *((void **)(&ptr->key)));
          ptr=ptr->lnext;
        }
        ObjectHashrehash(set); /* Rehash the table */
@@ -185,11 +205,7 @@ void collect(struct garbagelist * stackptr) {
     struct RuntimeNode * ptr=forward->listhead;
     while(ptr!=NULL) {
       void * orig=(void *)ptr->key;
-      void *copy;
-      if (gc_createcopy(orig, &copy))
-       enqueue(orig);
-      ptr->key=(int)copy;
-
+      ENQUEUE(orig, *((void **)(&ptr->key)));
       ptr=ptr->lnext;
     }
     RuntimeHashrehash(forward); /* Rehash the table */
@@ -199,11 +215,7 @@ void collect(struct garbagelist * stackptr) {
     struct RuntimeNode * ptr=reverse->listhead;
     while(ptr!=NULL) {
       void *orig=(void *)ptr->data;
-      void *copy;
-      if (gc_createcopy(orig, &copy))
-       enqueue(orig);
-      ptr->data=(int)copy;
-
+      ENQUEUE(orig, *((void**)(&ptr->data)));
       ptr=ptr->lnext;
     }
   }
@@ -212,11 +224,7 @@ void collect(struct garbagelist * stackptr) {
     struct RuntimeNode * ptr=fdtoobject->listhead;
     while(ptr!=NULL) {
       void *orig=(void *)ptr->data;
-      void *copy;
-      if (gc_createcopy(orig, &copy))
-       enqueue(orig);
-      ptr->data=(int)copy;
-
+      ENQUEUE(orig, *((void**)(&ptr->data)));
       ptr=ptr->lnext;
     }
   }
@@ -226,10 +234,7 @@ void collect(struct garbagelist * stackptr) {
     int i;
     for(i=0;i<currtpd->numParameters;i++) {
       void *orig=currtpd->parameterArray[i];
-      void *copy;
-      if (gc_createcopy(orig, &copy))
-       enqueue(orig);
-      currtpd->parameterArray[i]=copy;
+      ENQUEUE(orig, currtpd->parameterArray[i]);
     }
 
   }
@@ -242,10 +247,7 @@ void collect(struct garbagelist * stackptr) {
       int i;
       for(i=0;i<tpd->numParameters;i++) {
        void * orig=tpd->parameterArray[i];
-       void * copy;
-       if (gc_createcopy(orig, &copy))
-         enqueue(orig);
-       tpd->parameterArray[i]=copy;
+       ENQUEUE(orig, tpd->parameterArray[i]);
       }
       ptr=ptr->inext;
     }
@@ -260,10 +262,7 @@ void collect(struct garbagelist * stackptr) {
       int i;
       for(i=0;i<tpd->numParameters;i++) {
        void * orig=tpd->parameterArray[i];
-       void * copy;
-       if (gc_createcopy(orig, &copy))
-         enqueue(orig);
-       tpd->parameterArray[i]=copy;
+       ENQUEUE(orig, tpd->parameterArray[i]);
       }
       ptr=ptr->inext;
     }
@@ -296,10 +295,7 @@ void collect(struct garbagelist * stackptr) {
       int i;
       for(i=0;i<length;i++) {
        void *objptr=((void **)(((char *)& ao->___length___)+sizeof(int)))[i];
-       void * copy;
-       if (gc_createcopy(objptr, &copy))
-         enqueue(objptr);
-       ((void **)(((char *)& ao_cpy->___length___)+sizeof(int)))[i]=copy;
+       ENQUEUE(objptr, ((void **)(((char *)& ao_cpy->___length___)+sizeof(int)))[i]);
       }
     } else {
       int size=pointer[0];
@@ -307,10 +303,7 @@ void collect(struct garbagelist * stackptr) {
       for(i=1;i<=size;i++) {
        unsigned int offset=pointer[i];
        void * objptr=*((void **)(((int)ptr)+offset));
-       void * copy;
-       if (gc_createcopy(objptr, &copy))
-         enqueue(objptr);
-       *((void **) (((int)cpy)+offset))=copy;
+       ENQUEUE(objptr, *((void **) (((int)cpy)+offset)));
       }
     }
   }
@@ -377,16 +370,6 @@ void fixtags() {
 }
 #endif
 
-void * curr_heapbase=0;
-void * curr_heapptr=0;
-void * curr_heapgcpoint=0;
-void * curr_heaptop=0;
-
-void * to_heapbase=0;
-void * to_heapptr=0;
-void * to_heaptop=0;
-long lastgcsize=0;
-
 void * tomalloc(int size) {
   void * ptr=to_heapptr;
   if ((size%4)!=0)
index d51bde754823795183908768542c763fb40c9aae..36cb6ce144174d716090c4488d9f0c1ee5ea038d 100644 (file)
@@ -1,20 +1,14 @@
-public class Array {
+public class Atomic {
     int a;
     public static void main(String[] st) {
-       int a[]=new int[10];
        Integer z;
        atomic {
            z=global new Integer(3);
        }
-       int i=2;
        int q=test(z);
        System.printInt(q);
     }
     public static atomic int test(Integer y) {
-       int x=3;
-       int z;
-       z=y.intValue();
-       return z;
+       return y.intValue();
     }
-
 }
index 5c9ebbf011de1ae3110e0fa9565348dd6d671144..6b9e0f049479b9e200fb7ab84688bbe3b94a3052 100755 (executable)
@@ -19,6 +19,7 @@ echo -curdir directory
 echo -mainclass class with main method
 echo -o binary
 echo -instructionfailures inject code for instructionfailures
+echo -profile build with profile options
 echo -help help
 }
 
@@ -65,6 +66,9 @@ DSMFLAG=true
 elif [[ $1 = '-mac' ]]
 then
 EXTRAOPTIONS="$EXTRAOPTIONS -DMAC"
+elif [[ $1 = '-profile' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -pg"
 elif [[ $1 = '-taskstate' ]]
 then
 JAVAOPTS="$JAVAOPTS -taskstate"