From a64b749473751b0243d74b35d6350fa8043b80a6 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 12 Sep 2007 09:17:39 +0000 Subject: [PATCH] changes --- Robust/src/Runtime/DSTM/interface/trans.c | 6 +- Robust/src/Runtime/garbage.c | 99 ++++++++++------------- Robust/src/Tests/Atomic.java | 10 +-- Robust/src/buildscript | 4 + 4 files changed, 52 insertions(+), 67 deletions(-) diff --git a/Robust/src/Runtime/DSTM/interface/trans.c b/Robust/src/Runtime/DSTM/interface/trans.c index 487b3cb3..b08440e8 100644 --- a/Robust/src/Runtime/DSTM/interface/trans.c +++ b/Robust/src/Runtime/DSTM/interface/trans.c @@ -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) { diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 1e7a63f7..474444a6 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -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&&origcurr_heapbase&&origsize;i++) { void * orig=stackptr->array[i]; - void * copy; - if (gc_createcopy(orig,©)) - 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,©)) - 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, ©)) - 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, ©)) - 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, ©)) - 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, ©)) - 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;inumParameters;i++) { void *orig=currtpd->parameterArray[i]; - void *copy; - if (gc_createcopy(orig, ©)) - 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;inumParameters;i++) { void * orig=tpd->parameterArray[i]; - void * copy; - if (gc_createcopy(orig, ©)) - 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;inumParameters;i++) { void * orig=tpd->parameterArray[i]; - void * copy; - if (gc_createcopy(orig, ©)) - 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___)+sizeof(int)))[i]; - void * copy; - if (gc_createcopy(objptr, ©)) - 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, ©)) - 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) diff --git a/Robust/src/Tests/Atomic.java b/Robust/src/Tests/Atomic.java index d51bde75..36cb6ce1 100644 --- a/Robust/src/Tests/Atomic.java +++ b/Robust/src/Tests/Atomic.java @@ -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(); } - } diff --git a/Robust/src/buildscript b/Robust/src/buildscript index 5c9ebbf0..6b9e0f04 100755 --- a/Robust/src/buildscript +++ b/Robust/src/buildscript @@ -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" -- 2.34.1