From: bdemsky Date: Fri, 5 Nov 2010 16:29:21 +0000 (+0000) Subject: bug fixes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b65ae3092285ec19db549a1644aa7924fedaca4;p=IRC.git bug fixes --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 807d2ee3..6813b8e6 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -4475,8 +4475,8 @@ public class BuildCode { for(Iterator wtit=weset.iterator();wtit.hasNext();) { Analysis.OoOJava.WaitingElement waitingElement=wtit.next(); int queueID=waitingElement.getQueueID(); - if (queueID>queuetovar.size()) - queuetovar.setSize(queueID); + if (queueID>=queuetovar.size()) + queuetovar.setSize(queueID+1); Long l=queuetovar.get(queueID); long val=(l!=null)?l.longValue():0; val=val|(1<=ConflictNode.COARSE); long mask=queuetovar.get(queueID); - output.println(" rentry=mlpCreateREntry(runningSESE->memoryQueueArray["+ waitingElement.getQueueID()+ "]," + waitingElement.getStatus() + ", &(seseToIssue->common)"+mask+"LL);"); + output.println(" rentry=mlpCreateREntry(runningSESE->memoryQueueArray["+ waitingElement.getQueueID()+ "]," + waitingElement.getStatus() + ", &(seseToIssue->common), "+mask+"LL);"); output.println(" seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;"); output.println(" rentry->queue=runningSESE->memoryQueueArray[" + waitingElement.getQueueID()+"];"); diff --git a/Robust/src/Runtime/mlp_runtime.c b/Robust/src/Runtime/mlp_runtime.c index e769ed08..1696e698 100644 --- a/Robust/src/Runtime/mlp_runtime.c +++ b/Robust/src/Runtime/mlp_runtime.c @@ -429,7 +429,7 @@ int WRITEBINCASE(Hashtable *T, REntry *r, BinItem *val, int key, int inc) { return retval; } -void READBINCASE(Hashtable *T, REntry *r, BinItem *val, int key, int inc) { +int READBINCASE(Hashtable *T, REntry *r, BinItem *val, int key, int inc) { BinItem * bintail=T->array[key]->tail; if (isReadBinItem(bintail)) { return TAILREADCASE(T, r, val, bintail, key, inc); @@ -494,7 +494,7 @@ void TAILWRITECASE(Hashtable *T, REntry *r, BinItem *val, BinItem *bintail, int T->array[key]->head=val;//released lock } -void ADDVECTOR(MemoryQueue *Q, REntry *r) { +int ADDVECTOR(MemoryQueue *Q, REntry *r) { if(!isVector(Q->tail)) { //Fast Case if (isParentCoarse(r) && Q->tail->total==0 && Q->tail==Q->head) { @@ -558,7 +558,7 @@ void ADDVECTOR(MemoryQueue *Q, REntry *r) { //SCC's don't come in parent variety -void ADDSCC(MemoryQueue *Q, REntry *r) { +int ADDSCC(MemoryQueue *Q, REntry *r) { //added SCC SCC* S=createSCC(); S->item.total=1; @@ -708,11 +708,11 @@ void RESOLVECHAIN(MemoryQueue *Q) { //need to update status head->status=READY; if (isHashtable(head)) { - RESOLVEHASHTABLE(Q, head); + RESOLVEHASHTABLE(Q, (Hashtable *) head); } else if (isVector(head)) { - RESOLVEVECTOR(Q, head); + RESOLVEVECTOR(Q, (Vector *) head); } else if (isSingleItem(head)) { - RESOLVESCC(head); + RESOLVESCC((SCC *)head); } if (head->next==NULL) break; diff --git a/Robust/src/Runtime/mlp_runtime.h b/Robust/src/Runtime/mlp_runtime.h index ec0715b6..63365aa5 100644 --- a/Robust/src/Runtime/mlp_runtime.h +++ b/Robust/src/Runtime/mlp_runtime.h @@ -148,7 +148,7 @@ typedef struct REntry_t{ // parent write:3 coarse: 4, parent coarse:5, scc: 6 int type; int tag; - MemoryQueueItem *qitem; + struct MemoryQueueItem_t *qitem; struct BinItem_t* binitem; struct MemoryQueue_t* queue; SESEcommon* seseRec; @@ -267,6 +267,17 @@ REntry* mlpCreateREntry(MemoryQueue *q, int type, SESEcommon* seseToIssue); #endif MemoryQueue* createMemoryQueue(); void rehashMemoryQueue(SESEcommon* seseParent); +void TAILWRITECASE(Hashtable *T, REntry *r, BinItem *val, BinItem *bintail, int key, int inc); +void RETIRESCC(MemoryQueue *Q, REntry *r); +void RETIREHASHTABLE(MemoryQueue *q, REntry *r); +void RETIREBIN(Hashtable *T, REntry *r, BinItem *b); +void RETIREVECTOR(MemoryQueue *Q, REntry *r); +void RESOLVECHAIN(MemoryQueue *Q); +void RESOLVEHASHTABLE(MemoryQueue *Q, Hashtable *T); +void RESOLVEVECTOR(MemoryQueue *q, Vector *V); +void RESOLVESCC(SCC *S); +void resolveDependencies(REntry* rentry); + static inline void ADD_REFERENCE_TO( SESEcommon* seseRec ) { atomic_inc( &(seseRec->refCount) );