From: bdemsky Date: Mon, 6 Apr 2009 22:48:15 +0000 (+0000) Subject: closer to compiling X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cfe73d16bf2bf9c6f043ee72506ff5200da05fea;p=IRC.git closer to compiling --- diff --git a/Robust/src/Analysis/Locality/LocalityAnalysis.java b/Robust/src/Analysis/Locality/LocalityAnalysis.java index 6376922c..889116c4 100644 --- a/Robust/src/Analysis/Locality/LocalityAnalysis.java +++ b/Robust/src/Analysis/Locality/LocalityAnalysis.java @@ -332,9 +332,9 @@ public class LocalityAnalysis { assert(nodemd.getModifiers().isNative()); MethodDescriptor runmd=null; - for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("run").iterator(); methodit.hasNext();) { + for(Iterator methodit=nodemd.getClassDesc().getMethodTable().getSet("staticStart").iterator(); methodit.hasNext();) { MethodDescriptor md=(MethodDescriptor) methodit.next(); - if (md.numParameters()!=0||md.getModifiers().isStatic()) + if (md.numParameters()!=1||!md.getModifiers().isStatic()||!md.getParamType(0).getSymbol().equals(TypeUtil.ThreadClass)) continue; runmd=md; break; diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index 79f15a93..ae19d711 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -41,6 +41,17 @@ objstr_t *objstrCreate(unsigned int size) { return tmp; } +//free entire list, starting at store +void objstrDelete(objstr_t *store) { + objstr_t *tmp; + while (store != NULL) { + tmp = store->next; + free(store); + store = tmp; + } + return; +} + /* ================================================= * transStart * This function initializes things required in the @@ -352,7 +363,7 @@ int transAbortProcess(unsigned int *oidrdlocked, int *numoidrdlocked, unsigned i * * ================================= */ -int transCommmitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned int *oidrdlocked, int *numoidrdlocked, +int transCommitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned int *oidrdlocked, int *numoidrdlocked, unsigned int *oidwrlocked, int *numoidwrlocked) { objheader_t *header, *tcptr; void *ptrcreate; @@ -402,9 +413,6 @@ int transCommmitProcess(unsigned int *oidcreated, int *numoidcreated, unsigned i } header->version += 1; - if(header->notifylist != NULL) { - notifyAll(&header->notifylist, OID(header), header->version); - } } /* Release read locks */ diff --git a/Robust/src/Runtime/STM/tm.h b/Robust/src/Runtime/STM/tm.h index 86f80d79..65a2afeb 100644 --- a/Robust/src/Runtime/STM/tm.h +++ b/Robust/src/Runtime/STM/tm.h @@ -119,6 +119,7 @@ typedef struct newObjCreated { * ================================ */ int stmStartup(); +void objstrDelete(objstr_t *store); objstr_t *objstrCreate(unsigned int size); void transStart(); objheader_t *transCreateObj(unsigned int size); diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 081eec74..96335d00 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -420,7 +420,7 @@ void * tomalloc(int size) { return ptr; } -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) void checkcollect(void * ptr) { struct listitem * tmp=stopforgc((struct garbagelist *)ptr); pthread_mutex_lock(&gclock); // Wait for GC diff --git a/Robust/src/Runtime/thread.c b/Robust/src/Runtime/thread.c index c07d5d21..5fe7da5c 100644 --- a/Robust/src/Runtime/thread.c +++ b/Robust/src/Runtime/thread.c @@ -111,7 +111,11 @@ void initializethreads() { void initthread(struct ___Thread___ * ___this___) { #ifdef PRECISE_GC int p[]={1, (int) NULL, (int) ___this___}; +#ifdef THREADS ___Thread______staticStart____L___Thread___((struct ___Thread______staticStart____L___Thread____params *)p); +#else + ___Thread____NN____staticStart____L___Thread___((struct ___Thread____NN____staticStart____L___Thread____params *)p); +#endif ___this___=(struct ___Thread___ *) p[2]; #else ___Thread______staticStart____L___Thread___(___this___); diff --git a/Robust/src/Runtime/thread.h b/Robust/src/Runtime/thread.h index e5388ab5..26dd0e1c 100644 --- a/Robust/src/Runtime/thread.h +++ b/Robust/src/Runtime/thread.h @@ -10,7 +10,7 @@ extern pthread_cond_t gccond; extern pthread_mutex_t objlock; extern pthread_cond_t objcond; extern pthread_key_t threadlocks; -#ifdef THREADS +#if defined(THREADS)||defined(STM) void initthread(struct ___Thread___ * ___this___); #endif #ifdef DSTM diff --git a/Robust/src/buildscript b/Robust/src/buildscript index a1104d5f..f329e9bc 100755 --- a/Robust/src/buildscript +++ b/Robust/src/buildscript @@ -485,7 +485,7 @@ fi if $SINGLETM then EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -I$DSMRUNTIME" -FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c" +FILES="$FILES $DSMRUNTIME/dsmlock.c $DSMRUNTIME/singleTMCommit.c $DSMRUNTIME/clookup.c $ROBUSTROOT/Runtime/thread.c" fi if $ABORTREADERS