String localsprefix="___locals___";
String fcrevert="___fcrevert___";
String paramsprefix="___params___";
- String oidstr="___nextobject___";
+ String oidstr=state.DSM?"___nextobject___":"___objlocation___";
String nextobjstr="___nextobject___";
String localcopystr="___localcopy___";
public static boolean GENERATEPRECISEGC=false;
output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);");
}
if (wb.needBarrier(fsfn))
- output.println("*((unsigned int *)&("+dst+"->___localcopy___))|=DIRTY;");
+ output.println("*((unsigned int *)&("+dst+"->___objstatus___))|=DIRTY;");
if (srcptr) {
output.println("*((unsigned int *)&("+dst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;");
output.println("}");
if (state.SINGLETM && locality.getAtomic(lb).get(fsen).intValue()>0) {
//Transaction set element case
if (wb.needBarrier(fsen))
- output.println("*((unsigned int *)&("+generateTemp(fm,fsen.getDst(),lb)+"->___localcopy___))|=DIRTY;");
+ output.println("*((unsigned int *)&("+generateTemp(fm,fsen.getDst(),lb)+"->___objstatus___))|=DIRTY;");
if (fsen.getSrc().getType().isPtr()) {
output.println("{");
String src=generateTemp(fm, fsen.getSrc(), lb);
#define NEW 0x02
#define LOCK 0x04
+#ifdef COMPILER
+#include "structdefs.h"
+typedef struct objheader {
+ threadlist_t *notifylist;
+ unsigned int version;
+} objheader_t;
+
+#define OID(x) \
+ (*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___objlocation___))
+
+#define COMPOID(x) \
+ ((void*)((((void *) x )!=NULL) ? (*((unsigned int *)&((struct ___Object___ *) x)->___objlocation___)) : 0))
+
+#define STATUS(x) \
+ *((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___objstatus___))
+
+#define STATUSPTR(x) \
+ ((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___objstatus___))
+
+#define TYPE(x) \
+ ((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->type
+
+#define GETSIZE(size, x) { \
+ int type=TYPE(x); \
+ if (type<NUMCLASSES) { \
+ size=classsize[type]; \
+ } else { \
+ size=classsize[type]*((struct ArrayObject *)&((objheader_t *)x)[1])->___length___+sizeof(struct ArrayObject); \
+ } \
+}
+
+#else
+#define OID(x) x->oid
+#define TYPE(x) x->type
+#define STATUS(x) x->status
+#define STATUSPTR(x) &x->status
+#define GETSIZE(size, x) size=classsize[TYPE(x)]
+#endif
+
+
/* ================================
* Constants
* ================================
unsigned int *oidcreated;
} newObjCreated_t;
-#ifdef COMPILER
-typedef struct objheader {
- threadlist_t *notifylist;
- unsigned short version;
- unsigned short rcount;
-} objheader_t;
-
-#define OID(x) \
- (*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___nextobject___))
-
-#define COMPOID(x) \
- ((void*)((((void *) x )!=NULL) ? (*((unsigned int *)&((struct ___Object___ *) x)->___nextobject___)) : 0))
-
-#define STATUS(x) \
- *((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___localcopy___))
-
-#define STATUSPTR(x) \
- ((unsigned int *) &(((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___localcopy___))
-
-#define TYPE(x) \
- ((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->type
-
-#define GETSIZE(size, x) { \
- int type=TYPE(x); \
- if (type<NUMCLASSES) { \
- size=classsize[type]; \
- } else { \
- size=classsize[type]*((struct ArrayObject *)&((objheader_t *)x)[1])->___length___+sizeof(struct ArrayObject); \
- } \
-}
-
-#else
-#define OID(x) x->oid
-#define TYPE(x) x->type
-#define STATUS(x) x->status
-#define STATUSPTR(x) &x->status
-#define GETSIZE(size, x) size=classsize[TYPE(x)]
-#endif
/* ================================
* Functions used