GlobalArgs.java \
../../../ClassLibrary/JavaSTM/Barrier.java
FLAGS=-mainclass ${MAINCLASS} -singleTM -optimize -debug -dcopts -transstats -joptimize
+FLAGS2=-mainclass ${MAINCLASS} -optimize -debug -joptimize -thread
+
default:
../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC}
+ ../../../buildscript ${FLAGS2} -o NON${MAINCLASS} ${SRC}
clean:
rm -rf tmpbuilddirectory
#define DEBUGSTM(x...)
#endif
+#ifdef FASTMEMCPY
+void * A_memcpy (void * dest, const void * src, size_t count);
+#else
+#define A_memcpy memcpy
+#endif
+
#ifdef STMSTATS
/*** Global variables *****/
objlockstate_t *objlockscope;
needLock(header,gl);
}
#endif
- memcpy(objcopy, header, size);
+ A_memcpy(objcopy, header, size);
/* Insert into cache's lookup table */
STATUS(objcopy)=0;
t_chashInsert(oid, &objcopy[1]);
struct ___Object___ *src=t_chashSearch(oidwrlocked[i]);
dst->___cachedCode___=src->___cachedCode___;
dst->___cachedHash___=src->___cachedHash___;
- memcpy(&dst[1], &src[1], tmpsize-sizeof(struct ___Object___));
+ A_memcpy(&dst[1], &src[1], tmpsize-sizeof(struct ___Object___));
__asm__ __volatile__("": : :"memory");
header->version++;
}
#ifdef STM
#include "tm.h"
#include <pthread.h>
+#endif
+
+#if defined(THREADS)||defined(STM)
/* Global barrier for STM */
pthread_barrier_t barrier;
pthread_barrierattr_t attr;
#endif
+
#include <string.h>
extern int classsize[];
#endif
-#ifdef STM
/* STM Barrier constructs */
#ifdef D___Barrier______setBarrier____I
void CALL11(___Barrier______setBarrier____I, int nthreads, int nthreads) {
-#ifdef PRECISE_GC
- struct listitem *tmp=stopforgc((struct garbagelist *)___params___);
-#endif
// Barrier initialization
int ret;
if((ret = pthread_barrier_init(&barrier, NULL, nthreads)) != 0) {
printf("%s() Could not create a barrier: numthreads = 0 in %s\n", __func__, __FILE__);
exit(-1);
}
-#ifdef PRECISE_GC
- restartaftergc(tmp);
-#endif
}
#endif
void CALL00(___Barrier______enterBarrier____) {
// Synchronization point
int ret;
+#ifdef PRECISE_GC
+ struct listitem *tmp=stopforgc((struct garbagelist *)___params___);
+#endif
ret = pthread_barrier_wait(&barrier);
+#ifdef PRECISE_GC
+ restartaftergc(tmp);
+#endif
if(ret != 0 && ret != PTHREAD_BARRIER_SERIAL_THREAD) {
printf("%s() Could not wait on barrier: error %d in %s\n", __func__, errno, __FILE__);
exit(-1);
}
}
#endif
-#endif
/* Object allocation function */
echo -singleTM single machine committing transactions
echo -stmdebug STM debug
echo "-stmstats prints single machine commit (stm) statistics for the benchmark"
+echo -fastmemcpy use fast memcpy
echo -abortreaders abort readers immediately
echo -trueprob double - probabiltiy of true branch
echo -dsmcaching -enable caching in dsm runtime
REPAIRROOT=~/research/Repair/RepairCompiler/
CURDIR=`pwd`
DSMFLAG=false
+FASTMEMCPY=false
SINGLETM=false
NOJAVA=false
CHECKFLAG=false
then
JAVAOPTS="$JAVAOPTS -dsm"
DSMFLAG=true
+elif [[ $1 = '-fastmemcpy' ]]
+then
+FASTMEMCPY=true
+EXTRAOPTIONS="$EXTRAOPTIONS -DFASTMEMCPY"
elif [[ $1 = '-singleTM' ]]
then
JAVAOPTS="$JAVAOPTS -singleTM"
$ROBUSTROOT/Runtime/math.c \
$ROBUSTROOT/Runtime/GenericHashtable.c $ROBUSTROOT/Runtime/object.c"
+if $FASTMEMCPY
+then
+FILES="$FILES $ROBUSTROOT/Runtime/memcpy32.o $ROBUSTROOT/Runtime/instrset32.o"
+fi
+
if $DSMFLAG
then
EXTRAOPTIONS="$EXTRAOPTIONS -lpthread -DCOMPILER -DDSTM -I$DSMRUNTIME"