From 427c68c188c59a34ce00b56ae0b85fa13a5dd55d Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 8 Jul 2009 00:29:15 +0000 Subject: [PATCH] check in my changes --- Robust/src/Runtime/STM/delaycomp.h | 13 ++++++++++--- Robust/src/Runtime/STM/stm.c | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Robust/src/Runtime/STM/delaycomp.h b/Robust/src/Runtime/STM/delaycomp.h index 92926219..48af9933 100644 --- a/Robust/src/Runtime/STM/delaycomp.h +++ b/Robust/src/Runtime/STM/delaycomp.h @@ -6,7 +6,8 @@ //page after...then default to something simpler #define MAXPOINTERS 1024*1024*1 -#define MAXVALUES 1024*1024*1 +#define MAXVALUES 1024*1024*2 +#define MAXBRANCHES 1024*1024*4 struct pointerlist { int count; @@ -19,8 +20,14 @@ struct primitivelist { int array[MAXVALUES]; }; +struct branchlist { + int count; + char array[MAXBRANCHES]; +}; + extern __thread struct pointerlist ptrstack; extern __thread struct primitivelist primstack; +extern __thread struct branchlist branchstack; //Pointers @@ -36,9 +43,9 @@ extern __thread struct primitivelist primstack; //Branches -#define RESTOREANDBRANCH(loc) if (primstack.array[primstack.count++]) goto loc +#define RESTOREANDBRANCH(loc) if (branchstack.array[branchstack.count++]) goto loc -#define STOREANDBRANCH(cond, loc) if (primstack.array[primstack.count++]=cond) goto loc +#define STOREANDBRANCH(cond, loc) if (branchstack.array[branchstack.count++]=cond) goto loc //Integers diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index ef5db71d..57610e21 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -22,6 +22,10 @@ __thread struct objlist * newobjs; #include "delaycomp.h" __thread struct pointerlist ptrstack; __thread struct primitivelist primstack; +__thread struct branchlist branchstack; +struct pointerlist *c_ptrstack; +struct primitivelist *c_primstack; +struct branchlist *c_branchstack; #endif #ifdef TRANSSTATS @@ -151,6 +155,11 @@ void objstrDelete(objstr_t *store) { */ void transStart() { //Transaction start is currently free...commit and aborting is not +#ifdef DELAYCOMP + c_ptrstack=&ptrstack; + c_primstack=&primstack; + c_branchstack=&branchstack; +#endif } /* ======================================================= @@ -246,7 +255,7 @@ void *objstrAlloc(unsigned int size) { * -copies the object into the transaction cache * ============================================================= */ -__attribute__((pure)) void *transRead(void * oid, void *gl) { +__attribute__ ((pure)) void *transRead(void * oid, void *gl) { objheader_t *tmp, *objheader; objheader_t *objcopy; int size; @@ -340,6 +349,7 @@ int transCommit() { dc_t_chashreset(); ptrstack.count=0; primstack.count=0; + branchstack.count=0; #endif return TRANS_ABORT; } @@ -360,6 +370,7 @@ int transCommit() { dc_t_chashreset(); ptrstack.count=0; primstack.count=0; + branchstack.count=0; #endif return 0; } @@ -385,6 +396,7 @@ int transCommit() { dc_t_chashreset(); ptrstack.count=0; primstack.count=0; + branchstack.count=0; #endif return TRANS_ABORT; } @@ -958,6 +970,7 @@ void transAbortProcess(void **oidwrlocked, int numoidwrlocked) { // call commit method ptrstack.count=0; primstack.count=0; + branchstack.count=0; commitmethod(params, locals, primitives); #endif -- 2.34.1