From: bdemsky Date: Thu, 21 Oct 2010 05:00:18 +0000 (+0000) Subject: changes X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=db410846c9a74d7baa93fb5e6516243c5fae5d5c;p=IRC.git changes --- diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index cc839f2f..aa8334f0 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -674,6 +674,7 @@ public class RuntimeConflictResolver { //need to add this } else { cFile.println(" record->rcrRecords["+index+"].count=RUNBIAS;\n"); + cFile.println(" record->rcrRecords["+index+"].index=0;\n"); } if(cSideDebug) { @@ -701,7 +702,7 @@ public class RuntimeConflictResolver { //need to add this } else { cFile.println(" if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords["+index+"].count))) {"); - cFile.println(" int flag=LOCKXCHG(&(record->rcrRecords["+index+"].flag),0);"); + cFile.println(" int flag=LOCKXCHG32(&(record->rcrRecords["+index+"].flag),0);"); cFile.println(" if(flag) {"); //we have resolved a heap root...see if this was the last dependence cFile.println(" if(atomic_sub_and_test(1, &(record->common.unresolvedDependencies))) workScheduleSubmit((void *)record);"); @@ -767,24 +768,27 @@ public class RuntimeConflictResolver { int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(node); int traverserID = doneTaints.get(taint); if (objConfRead) - currCase.append(" int tmpvar=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); + currCase.append(" int tmpvar"+depth+"=rcr_WTWRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); else - currCase.append(" int tmpvar=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); + currCase.append(" int tmpvar"+depth+"=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); } else if (primConfRead||objConfRead) { int heaprootNum = connectedHRHash.get(taint).id; assert heaprootNum != -1; int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(node); int traverserID = doneTaints.get(taint); if (objConfRead) - currCase.append(" int tmpvar=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); + currCase.append(" int tmpvar"+depth+"=rcr_WTREADBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); else - currCase.append(" int tmpvar=rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); + currCase.append(" int tmpvar"+depth+"=rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+");\n"); } - currCase.append("if (!(tmpvar&READYMASK)) totalcount--;\n"); - currCase.append("if (!(tmpvar&SPEC)) ; //add record\n"); - - //Conflicts + if(primConfWrite||objConfWrite||primConfRead||objConfRead) { + currCase.append("if (!(tmpvar"+depth+"&READYMASK)) totalcount--;\n"); + currCase.append("if (!(tmpvar"+depth+"&SPEC)) {\n"); + currCase.append(" struct rcrRecord * rcrrec=&record->rcrRecords["+index+"];"); + currCase.append(" rcrrec->array[rcrrec->index++];"); + currCase.append("}\n"); + } //Array Case if(node.isObjectArray() && node.decendantsConflict()) { diff --git a/Robust/src/Runtime/oooJava/hashStructure.c b/Robust/src/Runtime/oooJava/hashStructure.c index 0eb089f8..2b31b2e1 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.c +++ b/Robust/src/Runtime/oooJava/hashStructure.c @@ -3,6 +3,7 @@ #include "mlp_lock.h" #include "mem.h" #include "classdefs.h" +#include "rcr_runtime.h" //NOTE: this is only temporary (for testing) and will be removed in favor of thread local variables //It's basically an array of hashStructures so we can simulate what would happen in a many-threaded version @@ -11,7 +12,6 @@ HashStructure ** allHashStructures; #define ISREADBIN(x) (!(x&BINMASK)) //#define POPCOUNT(x) __builtin_popcountll(x) //__builtin_popcountll -#define RESOLVE(x) //NOTE: only temporary @@ -288,7 +288,7 @@ void rcr_RETIREHASHTABLE(HashStructure *T, SESEcommon *task, int key) { if (ptr->status==NOTREADY) { ReadBinItem_rcr* rptr=(ReadBinItem_rcr*)ptr; for (i=0;iindex;i++) { - TaskDescriptor * td=&rptr->array[i]; + TraverserData * td=&rptr->array[i]; RESOLVE(td->task, td->bitindex); if (((INTPTR)rptr->array[i].task)&PARENTBIN) { //parents go immediately @@ -329,14 +329,14 @@ void rcr_RETIREHASHTABLE(HashStructure *T, SESEcommon *task, int key) { void RESOLVE(SESEcommon *record, bitvt mask) { int index=-1; - struct rcrRecord * array=(struct rcrRecord *)(((char *)record)+record->common.offsetToParamRecords); + struct rcrRecord * array=(struct rcrRecord *)(((char *)record)+record->offsetToParamRecords); while(mask!=0) { int shift=__builtin_ctzll(mask)+1; index+=shift; if (atomic_sub_and_test(1,&array[index].count)) { - inf flag=LOCKXCHG(&array[index].flag,0); + int flag=LOCKXCHG32(&array[index].flag,0); if (flag) { - if(atomic_sub_and_test(1, &(record->common.unresolvedDependencies))) + if(atomic_sub_and_test(1, &(record->unresolvedDependencies))) workScheduleSubmit((void *)record); } } diff --git a/Robust/src/Runtime/oooJava/hashStructure.h b/Robust/src/Runtime/oooJava/hashStructure.h index 479a6276..946945c6 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.h +++ b/Robust/src/Runtime/oooJava/hashStructure.h @@ -83,6 +83,7 @@ inline int rcr_generateKey(void * ptr); //Method signatures are not in their final form since I have still not decided what is the optimum amount of data //to store in each entry. +void RESOLVE(SESEcommon *record, bitvt mask); int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index); int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index); int rcr_TAILREADCASE(HashStructure *T, void * ptr, BinItem_rcr *val, BinItem_rcr *bintail, int key, SESEcommon * task, int index);