From: bdemsky Date: Wed, 20 Oct 2010 23:15:30 +0000 (+0000) Subject: changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3f249224899418b36f441cf2567e251ee77867ec;p=IRC.git changes --- diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index b142a5db..83b216b9 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -729,11 +729,12 @@ public class RuntimeConflictResolver { objConfRead|=effect.hasReadConflict; objConfWrite|=effect.hasWriteConflict; } - + currCase.append(" int tmpvar;"); + if (objConfRead) { currCase.append(" if("); checkWaitingQueue(currCase, taint, node); - currCase.append("||"); + currCase.append("||!"); } int index=-1; @@ -749,17 +750,17 @@ public class RuntimeConflictResolver { assert heaprootNum != -1; int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(node); int traverserID = doneTaints.get(taint); - currCase.append(" rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+")"); + currCase.append(" (tmpvar=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+"))"); } 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); - currCase.append(" rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+")"); + currCase.append(" (tmpvar=rcr_READBINCASE(allHashStructures["+heaprootNum+"],"+prefix+", (SESEcommon *) record, "+index+"))"); } if(objConfRead) { - currCase.append(") {\n"); + currCase.append("&READYMASK) {\n"); putIntoWaitingQueue(currCase, taint, node, prefix); currCase.append(" break;\n"); currCase.append(" }\n"); diff --git a/Robust/src/Runtime/oooJava/hashStructure.c b/Robust/src/Runtime/oooJava/hashStructure.c index fee25943..02970aab 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.c +++ b/Robust/src/Runtime/oooJava/hashStructure.c @@ -46,6 +46,8 @@ inline int rcr_generateKey(void * ptr){ return (((struct ___Object___ *) ptr)->oid)&RH_MASK; } +//consider SPEC flag + int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index) { //chain of bins exists => tail is valid //if there is something in front of us, then we are not ready @@ -88,9 +90,9 @@ int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index) { if (!(bit & td->bitindexwr)) { td->bitindexwr|=bit; td->bitindexrd|=bit; - return (bintail->status==READY)?READY:SPECNOTREADY; + return (bintail->status==READY)?SPECREADY:SPECNOTREADY; } else - return READY; + return SPECREADY; } } else { TraverserData * td = &((ReadBinItem_rcr *)bintail)->array[((ReadBinItem_rcr *)bintail)->index - 1]; diff --git a/Robust/src/Runtime/oooJava/hashStructure.h b/Robust/src/Runtime/oooJava/hashStructure.h index 5df558ff..6932bd00 100644 --- a/Robust/src/Runtime/oooJava/hashStructure.h +++ b/Robust/src/Runtime/oooJava/hashStructure.h @@ -19,9 +19,11 @@ #define BINMASK 1 #define PARENTBIN 1 +#define SPECREADY 3 #define SPECNOTREADY 2 #define READY 1 #define NOTREADY 0 +#define READYMASK 1 #define TRUE 1 #define FALSE 0 diff --git a/Robust/src/Runtime/oooJava/rcr_runtime.h b/Robust/src/Runtime/oooJava/rcr_runtime.h index afca69dc..e7c188d6 100644 --- a/Robust/src/Runtime/oooJava/rcr_runtime.h +++ b/Robust/src/Runtime/oooJava/rcr_runtime.h @@ -12,5 +12,6 @@ struct rcrRecord { int index; int flag; int array[RCRSIZE]; + struct rcrRecord *next; }; #endif