-MAINCLASS=JGFMolDynBenchSizeC
+MAINCLASS=JGFMolDynBenchSizeB
SRC=${MAINCLASS}.java \
JGFInstrumentor.java \
JGFTimer.java \
GridCell.java \
LeeThread.java \
WorkQueue.java
-FLAGS=-singleTM -nooptimize -profile -mainclass ${MAINCLASS} -joptimize -debug -garbagestats -transstats
+FLAGS=-singleTM -optimize -mainclass ${MAINCLASS} -joptimize -debug -garbagestats -transstats
default:
../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC}
Node.java \
AStarPathFinder.java
-FLAGS=-singleTM -optimize -mainclass ${MAINCLASS} -debug -transstats -joptimize
+FLAGS=-singleTM -optimize -mainclass ${MAINCLASS} -debug -transstats -joptimize -profile
default:
cpp ${MAINCLASS}.java > tmp1${MAINCLASS}.java
outstructs.println("#ifndef STRUCTDEFS_H");
outstructs.println("#define STRUCTDEFS_H");
outstructs.println("#include \"classdefs.h\"");
+ outstructs.println("#ifndef INTPTR");
+ outstructs.println("#ifdef BIT64");
+ outstructs.println("#define INTPTR long");
+ outstructs.println("#else");
+ outstructs.println("#define INTPTR int");
+ outstructs.println("#endif");
+ outstructs.println("#endif");
/* Output #defines that the runtime uses to determine type
* numbers for various objects it needs */
protected void outputClassDeclarations(PrintWriter outclassdefs) {
if (state.THREAD||state.DSM||state.SINGLETM)
outclassdefs.println("#include <pthread.h>");
+ outclassdefs.println("#ifndef INTPTR");
+ outclassdefs.println("#ifdef BIT64");
+ outclassdefs.println("#define INTPTR long");
+ outclassdefs.println("#else");
+ outclassdefs.println("#define INTPTR int");
+ outclassdefs.println("#endif");
+ outclassdefs.println("#endif");
if(state.OPTIONAL)
outclassdefs.println("#include \"optionalstruct.h\"");
outclassdefs.println("struct "+arraytype+";");
outclassdefs.println("};\n");
outclassdefs.println("extern int classsize[];");
outclassdefs.println("extern int hasflags[];");
- outclassdefs.println("extern unsigned int * pointerarray[];");
+ outclassdefs.println("extern unsigned INTPTR * pointerarray[];");
outclassdefs.println("extern int supertypes[];");
}
Iterator it=state.getClassSymbolTable().getDescriptorsIterator();
while(it.hasNext()) {
ClassDescriptor cn=(ClassDescriptor)it.next();
- output.println("unsigned int "+cn.getSafeSymbol()+"_pointers[]={");
+ output.println("unsigned INTPTR "+cn.getSafeSymbol()+"_pointers[]={");
Iterator allit=cn.getFieldTable().getAllDescriptorsIterator();
int count=0;
while(allit.hasNext()) {
continue;
if (type.isPtr()) {
output.println(",");
- output.print("((unsigned int)&(((struct "+cn.getSafeSymbol() +" *)0)->"+fd.getSafeSymbol()+"))");
+ output.print("((unsigned INTPTR)&(((struct "+cn.getSafeSymbol() +" *)0)->"+fd.getSafeSymbol()+"))");
}
}
output.println("};");
}
- output.println("unsigned int * pointerarray[]={");
+ output.println("unsigned INTPTR * pointerarray[]={");
boolean needcomma=false;
for(int i=0; i<state.numClasses(); i++) {
ClassDescriptor cn=cdarray[i];
output.println(", ");
TypeDescriptor tdelement=arraytable[i].dereference();
if (tdelement.isArray()||tdelement.isClass())
- output.print("((unsigned int *)1)");
+ output.print("((unsigned INTPTR *)1)");
else
output.print("0");
needcomma=true;
output.println("struct "+cn.getSafeSymbol()+lb.getSignature()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params {");
else
output.println("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params {");
- output.println(" int size;");
+ output.println(" INTPTR size;");
output.println(" void * next;");
for(int i=0; i<objectparams.numPointers(); i++) {
TempDescriptor temp=objectparams.getPointer(i);
output.println("struct "+cn.getSafeSymbol()+lb.getSignature()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_locals {");
else
output.println("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_locals {");
- output.println(" int size;");
+ output.println(" INTPTR size;");
output.println(" void * next;");
for(int i=0; i<objecttemps.numPointers(); i++) {
TempDescriptor temp=objecttemps.getPointer(i);
if (GENERATEPRECISEGC) {
output.println("struct "+task.getSafeSymbol()+"_params {");
- output.println(" int size;");
+ output.println(" INTPTR size;");
output.println(" void * next;");
for(int i=0; i<objectparams.numPointers(); i++) {
TempDescriptor temp=objectparams.getPointer(i);
/* Output temp structure */
if (GENERATEPRECISEGC) {
output.println("struct "+task.getSafeSymbol()+"_locals {");
- output.println(" int size;");
+ output.println(" INTPTR size;");
output.println(" void * next;");
for(int i=0; i<objecttemps.numPointers(); i++) {
TempDescriptor temp=objecttemps.getPointer(i);
public void generateFlatOffsetNode(FlatMethod fm, LocalityBinding lb, FlatOffsetNode fofn, PrintWriter output) {
output.println("/* FlatOffsetNode */");
FieldDescriptor fd=fofn.getField();
- output.println(generateTemp(fm, fofn.getDst(),lb)+ " = (short) (&((struct "+fofn.getClassType().getSafeSymbol() +" *)0)->"+ fd.getSafeSymbol()+");");
+ output.println(generateTemp(fm, fofn.getDst(),lb)+ " = (short)(int) (&((struct "+fofn.getClassType().getSafeSymbol() +" *)0)->"+ fd.getSafeSymbol()+");");
output.println("/* offset */");
}
String dst=generateTemp(fm,fsfn.getDst(),lb);
if (srcptr&&!fsfn.getSrc().getType().isNull()) {
output.println("{");
- output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);");
+ output.println("INTPTR srcoid=("+src+"!=NULL?((INTPTR)"+src+"->"+oidstr+"):0);");
}
if (wb.needBarrier(fsfn))
output.println("*((unsigned int *)&("+dst+"->___objstatus___))|=DIRTY;");
if (srcptr&!fsfn.getSrc().getType().isNull()) {
- output.println("*((unsigned int *)&("+dst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;");
+ output.println("*((unsigned INTPTR *)&("+dst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;");
output.println("}");
} else {
output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";");
String dst=generateTemp(fm,fsfn.getDst(),lb);
if (srcglobal) {
output.println("{");
- output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);");
+ output.println("INTPTR srcoid=("+src+"!=NULL?((INTPTR)"+src+"->"+oidstr+"):0);");
}
if (statusdst.equals(LocalityAnalysis.GLOBAL)) {
String glbdst=dst;
if (wb.needBarrier(fsfn))
output.println("*((unsigned int *)&("+dst+"->___localcopy___))|=DIRTY;");
if (srcglobal) {
- output.println("*((unsigned int *)&("+glbdst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;");
+ output.println("*((unsigned INTPTR *)&("+glbdst+"->"+ fsfn.getField().getSafeSymbol()+"))=srcoid;");
} else
output.println(glbdst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";");
} else if (statusdst.equals(LocalityAnalysis.LOCAL)) {
output.println("revertlist=(struct ___Object___ *)"+dst+";");
output.println("}");
if (srcglobal)
- output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=srcoid;");
+ output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=(void *) srcoid;");
else
output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";");
} else if (statusdst.equals(LocalityAnalysis.EITHER)) {
output.println("if ("+dst+") {");
output.println("printf(\"BIG ERROR 2\\n\");exit(-1);}");
if (srcglobal)
- output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=srcoid;");
+ output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"=(void *) srcoid;");
else
output.println(dst+"->"+ fsfn.getField().getSafeSymbol()+"="+ src+";");
}
if (fsen.getSrc().getType().isPtr()&&!fsen.getSrc().getType().isNull()) {
output.println("{");
String src=generateTemp(fm, fsen.getSrc(), lb);
- output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);");
- output.println("((int*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]=srcoid;");
+ output.println("INTPTR srcoid=("+src+"!=NULL?((INTPTR)"+src+"->"+oidstr+"):0);");
+ output.println("((INTPTR*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]=srcoid;");
output.println("}");
} else {
output.println("(("+type +"*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]="+generateTemp(fm,fsen.getSrc(),lb)+";");
if (srcglobal) {
output.println("{");
String src=generateTemp(fm, fsen.getSrc(), lb);
- output.println("int srcoid=("+src+"!=NULL?((int)"+src+"->"+oidstr+"):0);");
- output.println("((int*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]=srcoid;");
+ output.println("INTPTR srcoid=("+src+"!=NULL?((INTPTR)"+src+"->"+oidstr+"):0);");
+ output.println("((INTPTR*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]=srcoid;");
output.println("}");
} else {
output.println("(("+type +"*)(((char *) &("+ generateTemp(fm,fsen.getDst(),lb)+"->___length___))+sizeof(int)))["+generateTemp(fm, fsen.getIndex(),lb)+"]="+generateTemp(fm,fsen.getSrc(),lb)+";");
* =============================================================
*/
__attribute__((pure)) void *transRead(void * oid) {
- unsigned int machinenumber;
objheader_t *tmp, *objheader;
objheader_t *objcopy;
int size;
memcpy(objcopy, header, size);
/* Insert into cache's lookup table */
STATUS(objcopy)=0;
- t_chashInsert((unsigned int)oid, &objcopy[1]);
+ t_chashInsert(oid, &objcopy[1]);
return &objcopy[1];
}
/* Create info to keep track of objects that can be locked */
int numoidrdlocked=0;
int numoidwrlocked=0;
- unsigned int oidrdlocked[c_numelements];
- unsigned int oidwrlocked[c_numelements];
+ void * oidrdlocked[c_numelements];
+ void * oidwrlocked[c_numelements];
int softabort=0;
int i;
chashlistnode_t *ptr = c_table;
/* Inner loop to traverse the linked list of the cache lookupTable */
while(curr != NULL) {
//if the first bin in hash table is empty
- if(curr->key == 0)
+ if(curr->key == NULL)
break;
objheader_t * headeraddr=&((objheader_t *) curr->val)[-1];
}
}
-/* ===========================================================================
- * decideResponse
- * - increments counters that keep track of objects read, modified or locked
- * - updates the oids locked and oids newly created
- * ===========================================================================
- */
-
/* ==================================
* transAbortProcess
*
* =================================
*/
-int transAbortProcess(unsigned int *oidrdlocked, int *numoidrdlocked, unsigned int *oidwrlocked, int *numoidwrlocked) {
+int transAbortProcess(void **oidrdlocked, int *numoidrdlocked, void **oidwrlocked, int *numoidwrlocked) {
int i;
objheader_t *header;
/* Release read locks */
*
* =================================
*/
-int transCommitProcess(unsigned int *oidrdlocked, int *numoidrdlocked,
- unsigned int *oidwrlocked, int *numoidwrlocked) {
+int transCommitProcess(void ** oidrdlocked, int *numoidrdlocked,
+ void ** oidwrlocked, int *numoidwrlocked) {
objheader_t *header;
void *ptrcreate;
int i;
__thread chashlistnode_t *c_table;
__thread unsigned int c_size;
-__thread unsigned int c_mask;
+__thread unsigned INTPTR c_mask;
__thread unsigned int c_numelements;
__thread unsigned int c_threshold;
__thread double c_loadfactor;
}
//Finds the right bin in the hash table
-static INLINE unsigned int chashFunction(chashtable_t *table, unsigned int key) {
- return ( key & (table->mask))>>3; //throw away low order bit
+static INLINE unsigned int chashFunction(chashtable_t *table, void * key) {
+ return (((unsigned INTPTR) key) & (table->mask))>>3; //throw away low order bit
}
//Store objects and their pointers into hash
-void chashInsert(chashtable_t *table, unsigned int key, void *val) {
+void chashInsert(chashtable_t *table, void * key, void *val) {
chashlistnode_t *ptr;
if(table->numelements > (table->threshold)) {
chashResize(table,newsize);
}
- ptr = &table->table[(key&table->mask)>>3];
+ ptr = &table->table[(((unsigned INTPTR)key)&table->mask)>>3];
table->numelements++;
if(ptr->key==0) {
}
// Search for an address for a given oid
-INLINE void * chashSearch(chashtable_t *table, unsigned int key) {
+INLINE void * chashSearch(chashtable_t *table, void * key) {
//REMOVE HASH FUNCTION CALL TO MAKE SURE IT IS INLINED HERE
- chashlistnode_t *node = &table->table[(key & table->mask)>>3];
+ chashlistnode_t *node = &table->table[(((unsigned INTPTR)key) & table->mask)>>3];
do {
if(node->key == key) {
}
//Store objects and their pointers into hash
-void t_chashInsert(unsigned int key, void *val) {
+void t_chashInsert(void * key, void *val) {
chashlistnode_t *ptr;
t_chashResize(newsize);
}
- ptr = &c_table[(key&c_mask)>>3];
+ ptr = &c_table[(((unsigned INTPTR)key)&c_mask)>>3];
c_numelements++;
if(ptr->key==0) {
}
// Search for an address for a given oid
-INLINE void * t_chashSearch(unsigned int key) {
+INLINE void * t_chashSearch(void * key) {
//REMOVE HASH FUNCTION CALL TO MAKE SURE IT IS INLINED HERE
- chashlistnode_t *node = &c_table[(key & c_mask)>>3];
+ chashlistnode_t *node = &c_table[(((unsigned INTPTR)key) & c_mask)>>3];
do {
if(node->key == key) {
return NULL;
}
-unsigned int chashRemove(chashtable_t *table, unsigned int key) {
+unsigned int chashRemove(chashtable_t *table, void * key) {
return chashRemove2(table, key)==NULL;
}
-void * chashRemove2(chashtable_t *table, unsigned int key) {
+void * chashRemove2(chashtable_t *table, void * key) {
int index;
chashlistnode_t *curr, *prev;
chashlistnode_t *ptr, *node;
curr = &ptr[i];
isfirst = 1;
do { //Inner loop to go through linked lists
- unsigned int key;
+ void * key;
chashlistnode_t *tmp,*next;
if ((key=curr->key) == 0) { //Exit inner loop if there the first element is 0
break; //key = val =0 for element if not present within the hash table
}
next = curr->next;
- index = (key & mask) >>3;
+ index = (((unsigned INTPTR)key) & mask) >>3;
tmp=&node[index];
// Insert into the new table
if(tmp->key == 0) {
curr = &ptr[i];
isfirst = 1;
do { //Inner loop to go through linked lists
- unsigned int key;
+ void * key;
chashlistnode_t *tmp,*next;
if ((key=curr->key) == 0) { //Exit inner loop if there the first element is 0
break; //key = val =0 for element if not present within the hash table
}
next = curr->next;
- index = (key & mask) >>3;
+ index = (((unsigned INTPTR)key) & mask) >>3;
tmp=&node[index];
// Insert into the new table
if(tmp->key == 0) {
#include <stdlib.h>
#include <stdio.h>
+#ifndef INTPTR
+#ifdef BIT64
+#define INTPTR long
+#else
+#define INTPTR int
+#endif
+#endif
+
#define CLOADFACTOR 0.25
#define CHASH_SIZE 1024
typedef struct chashlistnode {
- unsigned int key;
- void *val; //this can be cast to another type or used to point to a larger structure
+ void * key;
+ void * val; //this can be cast to another type or used to point to a larger structure
struct chashlistnode *next;
} chashlistnode_t;
void t_chashCreate(unsigned int size, double loadfactor);
-void t_chashInsert(unsigned int key, void *val);
-void * t_chashSearch(unsigned int key);
+void t_chashInsert(void * key, void *val);
+void * t_chashSearch(void * key);
unsigned int t_chashResize(unsigned int newsize);
void t_chashDelete();
/* Prototypes for hash*/
chashtable_t *chashCreate(unsigned int size, double loadfactor);
-static unsigned int chashFunction(chashtable_t *table, unsigned int key);
-void chashInsert(chashtable_t *table, unsigned int key, void *val);
-void *chashSearch(chashtable_t *table, unsigned int key); //returns val, NULL if not found
-unsigned int chashRemove(chashtable_t *table, unsigned int key); //returns -1 if not found
-void * chashRemove2(chashtable_t *table, unsigned int key); //returns -1 if not found
+void chashInsert(chashtable_t *table, void * key, void *val);
+void *chashSearch(chashtable_t *table, void * key); //returns val, NULL if not found
+unsigned int chashRemove(chashtable_t *table, void * key); //returns -1 if not found
+void * chashRemove2(chashtable_t *table, void * key); //returns -1 if not found
unsigned int chashResize(chashtable_t *table, unsigned int newsize);
void chashDelete(chashtable_t *table);
/* end hash */
extern __thread chashlistnode_t *c_table;
extern __thread unsigned int c_size;
-extern __thread unsigned int c_mask;
+extern __thread unsigned INTPTR c_mask;
extern __thread unsigned int c_numelements;
extern __thread unsigned int c_threshold;
extern __thread double c_loadfactor;
#ifndef _TM_H_
#define _TM_H_
-
+#include "runtime.h"
/* ==================
* Control Messages
* ==================
} objheader_t;
#define OID(x) \
- (*((unsigned int *)&((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->___objlocation___))
+ (*((void **)&((struct ___Object___ *)(((char *) x) + sizeof(objheader_t)))->___objlocation___))
#define COMPOID(x) \
- ((void*)((((void *) x )!=NULL) ? (*((unsigned int *)&((struct ___Object___ *) x)->___objlocation___)) : 0))
+ ((((void *) x )!=NULL) ? (*((void **)&((struct ___Object___ *) x)->___objlocation___)) : NULL)
#define STATUS(x) \
*((unsigned int *) &(((struct ___Object___ *)(((char *) x) + sizeof(objheader_t)))->___objstatus___))
((unsigned int *) &(((struct ___Object___ *)(((char *) x) + sizeof(objheader_t)))->___objstatus___))
#define TYPE(x) \
- ((struct ___Object___ *)((unsigned int) x + sizeof(objheader_t)))->type
+ ((struct ___Object___ *)((char *) x + sizeof(objheader_t)))->type
#define GETSIZE(size, x) { \
int type=TYPE(x); \
* ================================
*/
#define DEFAULT_OBJ_STORE_SIZE 1048510 //1MB
-#define OSUSED(x) (((unsigned int)(x)->top)-((unsigned int) (x+1)))
+#define OSUSED(x) (((unsigned INTPTR)(x)->top)-((unsigned INTPTR) (x+1)))
#define OSFREE(x) ((x)->size-OSUSED(x))
#define TRANSREAD(x,y) { \
- unsigned int inputvalue;\
-if ((inputvalue=(unsigned int)y)==0) x=NULL;\
+ void * inputvalue;\
+if ((inputvalue=y)==NULL) x=NULL;\
else { \
-chashlistnode_t * cnodetmp=&c_table[(inputvalue&c_mask)>>3]; \
+chashlistnode_t * cnodetmp=&c_table[(((unsigned INTPTR)inputvalue)&c_mask)>>3]; \
do { \
- if (cnodetmp->key==inputvalue) {x=(void *)cnodetmp->val;break;} \
+ if (cnodetmp->key==inputvalue) {x=cnodetmp->val;break;} \
cnodetmp=cnodetmp->next;\
- if (cnodetmp==NULL) {x=transRead((void *)inputvalue); asm volatile("":"=m"(c_table),"=m"(c_mask));break;} \
+ if (cnodetmp==NULL) {x=transRead(inputvalue); asm volatile("":"=m"(c_table),"=m"(c_mask));break;} \
} while(1);\
}}
extern __thread struct objlist * newobjs;
-typedef struct newObjCreated {
- unsigned int numcreated;
- unsigned int *oidcreated;
-} newObjCreated_t;
-
-
#ifdef TRANSSTATS
/***********************************
* Global Variables for statistics
__attribute__((pure)) void *transRead(void * oid);
int transCommit();
int traverseCache();
-int decideResponse(objheader_t *, unsigned int *, int *, unsigned int*, int *);
-int transAbortProcess(unsigned int *, int *, unsigned int *, int *);
-int transCommmitProcess(unsigned int *, int *, unsigned int *, int *);
+int transAbortProcess(void **, int *, void **, int *);
+int transCommmitProcess(void **, int *, void **, int *);
void randomdelay();
#endif
//rewrite transaction cache entry
void *vptr=curr->val;
int type=((int *)vptr)[0];
- unsigned int *pointer=pointerarray[type];
+ unsigned INTPTR *pointer=pointerarray[type];
if (pointer==0) {
//array of primitives - do nothing
struct ArrayObject *ao=(struct ArrayObject *) vptr;
SENQUEUE((void *)ao->___objlocation___, *((void **)&ao->___objlocation___));
- } else if (((int)pointer)==1) {
+ } else if (((INTPTR)pointer)==1) {
//array of pointers
struct ArrayObject *ao=(struct ArrayObject *) vptr;
int length=ao->___length___;
SENQUEUE(objptr, ((void **)(((char *)&ao->___length___)+sizeof(int)))[i]);
}
} else {
- int size=pointer[0];
+ INTPTR size=pointer[0];
int i;
for(i=1; i<=size; i++) {
unsigned int offset=pointer[i];
- void * objptr=*((void **)(((int)vptr)+offset));
- SENQUEUE(objptr, *((void **)(((int)vptr)+offset)));
+ void * objptr=*((void **)(((char *)vptr)+offset));
+ SENQUEUE(objptr, *((void **)(((char *)vptr)+offset)));
}
}
}
next = curr->next;
- index = (((unsigned int)key) & mask) >>3;
+ index = (((unsigned INTPTR)key) & mask) >>3;
- curr->key=(unsigned int)key;
+ curr->key=key;
tmp=&node[index];
// Insert into the new table
if(tmp->key == 0) {
void * ptr=dequeue();
void *cpy=((void **)ptr)[1];
int type=((int *)cpy)[0];
- unsigned int * pointer;
+ unsigned INTPTR * pointer;
#ifdef TASK
if(type==TAGTYPE) {
/* Enqueue Tag */
struct ArrayObject *ao_cpy=(struct ArrayObject *) cpy;
SENQUEUE((void *)ao->___objlocation___, *((void **)&ao_cpy->___objlocation___));
#endif
- } else if (((int)pointer)==1) {
+ } else if (((INTPTR)pointer)==1) {
/* Array of pointers */
struct ArrayObject *ao=(struct ArrayObject *) ptr;
struct ArrayObject *ao_cpy=(struct ArrayObject *) cpy;
ENQUEUE(objptr, ((void **)(((char *)&ao_cpy->___length___)+sizeof(int)))[i]);
}
} else {
- int size=pointer[0];
+ INTPTR size=pointer[0];
int i;
for(i=1; i<=size; i++) {
unsigned int offset=pointer[i];
- void * objptr=*((void **)(((int)ptr)+offset));
- ENQUEUE(objptr, *((void **)(((int)cpy)+offset)));
+ void * objptr=*((void **)(((char *)ptr)+offset));
+ ENQUEUE(objptr, *((void **)(((char *)cpy)+offset)));
}
}
}
#ifndef GARBAGE_H
#define GARBAGE_H
#ifdef STM
-#include "clookup.h"
+#include "stmlookup.h"
#endif
struct garbagelist {
int size;
#endif
int CALL01(___Object______nativehashCode____, struct ___Object___ * ___this___) {
- return (int) VAR(___this___);
+ return (int)((INTPTR) VAR(___this___));
}
int CALL01(___Object______getType____, struct ___Object___ * ___this___) {
int i;
#ifdef PRECISE_GC
struct ArrayObject * chararray=allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length);
- int ptrarray[]={1, (int) ptr, (int) chararray};
+ INTPTR ptrarray[]={1, (INTPTR) ptr, (INTPTR) chararray};
struct ___String___ * strobj=allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
chararray=(struct ArrayObject *) ptrarray[2];
#else
#include "dstm.h"
#endif
+#ifndef INTPTR
+#ifdef BIT64
+#define INTPTR long
+#else
+#define INTPTR int
+#endif
+#endif
+
extern void * curr_heapbase;
extern void * curr_heaptop;
struct ArrayObject *bytearray;
#ifdef PRECISE_GC
{
- int ptrarray[]={1, (int) ___params___, (int)arraybytearray};
+ INTPTR ptrarray[]={1, (INTPTR) ___params___, (INTPTR)arraybytearray};
bytearray=allocate_newarray(&ptrarray,BYTEARRAYTYPE,h->h_length);
arraybytearray=(struct ArrayObject *) ptrarray[2];
}
#if defined(THREADS)||defined(STM)
void initthread(struct ___Thread___ * ___this___) {
#ifdef PRECISE_GC
- int p[]={1, (int) NULL, (int) ___this___};
+ INTPTR p[]={1, (INTPTR) NULL, (INTPTR) ___this___};
#ifdef THREADS
___Thread______staticStart____L___Thread___((struct ___Thread______staticStart____L___Thread____params *)p);
#else
echo -mac distributed shared memory mac support
echo -check generate check code
echo -dmalloc link in dmalloc
+echo -64bit compile for 64 bit machine
echo -recover compile task code
echo -fastcheck fast checkpointing for Bristlecone
echo -specdir directory
elif [[ $1 = '-garbagestats' ]]
then
EXTRAOPTIONS="$EXTRAOPTIONS -DGARBAGESTATS"
+elif [[ $1 = '-64bit' ]]
+then
+EXTRAOPTIONS="$EXTRAOPTIONS -DBIT64"
elif [[ $1 = '-fastcheck' ]]
then
EXTRAOPTIONS="$EXTRAOPTIONS -DFASTCHECK"