#ifdef DELAYCOMP
#include "delaycomp.h"
#endif
+#include "objtypes.h"
#ifndef INITIALHEAPSIZE_MB
int i;
//update table
for(i=0; i<jniptr->index; i++) {
- ENQUEUE((struct ___Object___ *)jniptr->array[i].ref, *((struct ___Object___**)&jniptr->array[i].ref));
+ ENQUEUE((ObjectPtr)jniptr->array[i].ref, *((ObjectPtr *)&jniptr->array[i].ref));
}
//go to next table
jniptr=jniptr->next;
struct lockvector * lvector=listptr->lvector;
int i;
for(i=0; i<lvector->index; i++) {
- struct ___Object___ *orig=lvector->locks[i].object;
+ ObjectPtr orig=lvector->locks[i].object;
ENQUEUE(orig, lvector->locks[i].object);
}
#endif
int ptrarray[]={1, (int)ptr, (int) revertlist};
stopforgc((struct garbagelist *)ptrarray);
restartaftergc();
- revertlist=(struct ___Object___*)ptrarray[2];
+ revertlist=(ObjectPtr)ptrarray[2];
}
#endif
#include "dmalloc.h"
#endif
-int instanceof(ObjectPtr *ptr, int type) {
+int instanceof(ObjectPtr ptr, int type) {
int i=ptr->type;
do {
if (i==type)
#else
__attribute__((malloc)) void * allocate_new(void * ptr, int type) {
#endif
- struct ObjectPtr * v=(struct ObjectPtr *) mygcmalloc((struct garbagelist *) ptr, classsize[type]);
+ ObjectPtr v=(ObjectPtr) mygcmalloc((struct garbagelist *) ptr, classsize[type]);
v->type=type;
v->hashcode=(int)(INTPTR)v;
#ifdef THREADS
#else
__attribute__((malloc)) void * allocate_new(int type) {
- struct ObjectPtr * v=FREEMALLOC(classsize[type]);
+ ObjectPtr v=FREEMALLOC(classsize[type]);
v->type=type;
v->hashcode=(int)(INTPTR)v;
#ifdef OPTIONAL
/* Converts C character arrays into Java strings */
#ifdef PRECISE_GC
-__attribute__((malloc)) struct ___String___ * NewStringShort(void * ptr, const short *str,int length) {
+__attribute__((malloc)) StringPtr NewStringShort(void * ptr, const short *str,int length) {
#else
-__attribute__((malloc)) struct ___String___ * NewStringShort(const short *str,int length) {
+__attribute__((malloc)) StringPtr NewStringShort(const short *str,int length) {
#endif
int i;
#ifdef PRECISE_GC
struct ArrayObject * chararray=allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length);
INTPTR ptrarray[]={1, (INTPTR) ptr, (INTPTR) chararray};
- struct ___String___ * strobj=allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
+ StringPtr strobj=allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
chararray=(struct ArrayObject *) ptrarray[2];
#else
struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length);
- struct ___String___ * strobj=allocate_new(STRINGTYPE);
+ StringPtr strobj=allocate_new(STRINGTYPE);
#endif
strobj->___value___=chararray;
strobj->___count___=length;
/* Converts C character arrays into Java strings */
#ifdef PRECISE_GC
-__attribute__((malloc)) struct ___String___ * NewString(void * ptr, const char *str,int length) {
+__attribute__((malloc)) StringPtr NewString(void * ptr, const char *str,int length) {
#else
-__attribute__((malloc)) struct ___String___ * NewString(const char *str,int length) {
+__attribute__((malloc)) StringPtr NewString(const char *str,int length) {
#endif
int i;
#ifdef PRECISE_GC
struct ArrayObject * chararray=allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length);
INTPTR ptrarray[]={1, (INTPTR) ptr, (INTPTR) chararray};
- struct ___String___ * strobj=allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
+ StringPtr strobj=allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
chararray=(struct ArrayObject *) ptrarray[2];
#else
struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length);
- struct ___String___ * strobj=allocate_new(STRINGTYPE);
+ StringPtr strobj=allocate_new(STRINGTYPE);
#endif
strobj->___value___=chararray;
strobj->___count___=length;
#ifndef RUNTIME
#define RUNTIME
#include <stdlib.h>
+#include "objtypes.h"
#ifndef MULTICORE
#include <setjmp.h>
extern jmp_buf error_handler;
__attribute__((malloc)) void * allocate_new(void *, int type);
__attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, int length);
#endif
-__attribute__((malloc)) struct ___String___ * NewString(void *, const char *str,int length);
-__attribute__((malloc)) struct ___String___ * NewStringShort(void *, const short *str,int length);
+__attribute__((malloc)) StringPtr NewString(void *, const char *str,int length);
+__attribute__((malloc)) StringPtr NewStringShort(void *, const short *str,int length);
__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
#elif defined MULTICORE_GC
__attribute__((malloc)) void * allocate_new(void *, int type);
__attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, int length);
-__attribute__((malloc)) struct ___String___ * NewString(void *, const char *str,int length);
-__attribute__((malloc)) struct ___String___ * NewStringShort(void *, const short *str,int length);
+__attribute__((malloc)) StringPtr NewString(void *, const char *str,int length);
+__attribute__((malloc)) StringPtr NewStringShort(void *, const short *str,int length);
__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
#else
__attribute__((malloc)) void * allocate_new(int type);
__attribute__((malloc)) struct ArrayObject * allocate_newarray(int type, int length);
-__attribute__((malloc)) struct ___String___ * NewString(const char *str,int length);
-__attribute__((malloc)) struct ___String___ * NewStringShort(const short *str,int length);
+__attribute__((malloc)) StringPtr NewString(const char *str,int length);
+__attribute__((malloc)) StringPtr NewStringShort(const short *str,int length);
__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(int index);
#endif
#define MAXLOCKS 256
struct lockpair {
- struct ___Object___ *object;
+ ObjectPtr object;
int islastlock;
};
#endif
#ifdef FASTCHECK
-extern struct ___Object___ * ___fcrevert___;
+extern ObjectPtr ___fcrevert___;
#endif
#ifdef MULTICORE
void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
-int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags);
+int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, ObjectPtr ptr, int * enterflags, int numenterflags);
#endif
return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
}
#endif
-
-#ifdef JNI
-typedef struct ___java___________lang___________Object___ * ObjectPtr
-#else
-typedef struct ___Object___ * ObjectPtr
-#endif
-
-
#endif
#endif
for(lptr->index--; lptr->index>=0; lptr->index--) {
if (lptr->locks[lptr->index].islastlock) {
- struct ___Object___ *ll=lptr->locks[lptr->index].object;
+ ObjectPtr ll=lptr->locks[lptr->index].object;
ll->tid=0;
}
}
{
transStart();
ptr = transRead(oidvalue);
- struct ___Thread___ *p = (struct ___Thread___ *) ptr;
+ ThreadPtr p = (ThreadPtr) ptr;
p->___threadDone___ = 1;
- *((unsigned int *)&((struct ___Object___ *) p)->___localcopy___) |=DIRTY;
+ *((unsigned int *)&((ObjectPtr) p)->___localcopy___) |=DIRTY;
if(transCommit() != 0) {
goto transstart;
}
int threadcounter=0;
#ifdef D___Thread______nativeCreate____
-void initthread(struct ___Thread___ * ___this___) {
+void initthread(ThreadPtr ___this___) {
#ifdef AFFINITY
set_affinity();
#endif
free(lockedobjs);
#endif
#endif
- ___this___=(struct ___Thread___ *) p[2];
+ ___this___=(ThreadPtr) p[2];
#else
___Thread______staticStart____L___Thread___(___this___);
#endif
#ifdef RECOVERY
// return if the machine is dead
#ifdef D___Thread______nativeGetStatus____I
-int CALL12(___Thread______nativeGetStatus____I, int ___mid___, struct ___Thread___ * ___this___, int ___mid___) {
+int CALL12(___Thread______nativeGetStatus____I, int ___mid___, ThreadPtr ___this___, int ___mid___) {
return getStatus(___mid___);
}
#endif
#else
#ifdef D___Thread______nativeGetStatus____I
-int CALL12(___Thread______nativeGetStatus____I, int ___mid___, struct ___Thread___ * ___this___, int ___mid___) {
+int CALL12(___Thread______nativeGetStatus____I, int ___mid___, ThreadPtr ___this___, int ___mid___) {
return 0;
}
#endif
#ifdef DSTM
/* Add thread join capability */
#ifdef D___Thread______join____
-void CALL01(___Thread______join____, struct ___Thread___ * ___this___) {
+void CALL01(___Thread______join____, ThreadPtr ___this___) {
unsigned int *oidarray;
unsigned short *versionarray, version;
objheader_t *ptr;
transstart:
transStart();
ptr = transRead((unsigned int) VAR(___this___));
- struct ___Thread___ *p = (struct ___Thread___ *) ptr;
+ ThreadPtr p = (ThreadPtr) ptr;
#ifdef THREADJOINDEBUG
printf("Start join process for Oid = %x\n", (unsigned int) VAR(___this___));
#endif
#if defined(THREADS)||defined(STM)
#ifdef D___Thread______nativeJoin____
-void CALL01(___Thread______nativeJoin____, struct ___Thread___ * ___this___) {
+void CALL01(___Thread______nativeJoin____, ThreadPtr ___this___) {
pthread_mutex_lock(&joinlock);
while(!VAR(___this___)->___finished___) {
#ifdef PRECISE_GC
#endif
#ifdef D___Thread______nativeCreate____
-void CALL01(___Thread______nativeCreate____, struct ___Thread___ * ___this___) {
+void CALL01(___Thread______nativeCreate____, ThreadPtr ___this___) {
pthread_t thread;
int retval;
pthread_attr_t nattr;
#ifdef DSTM
#ifdef D___Thread______start____I
-void CALL12(___Thread______start____I, int ___mid___, struct ___Thread___ * ___this___, int ___mid___) {
+void CALL12(___Thread______start____I, int ___mid___, ThreadPtr ___this___, int ___mid___) {
startRemoteThread((unsigned int)VAR(___this___), ___mid___);
}
#endif
{
transStart();
tmp = transRead((unsigned int) oid);
- ((struct ___Thread___ *)tmp)->___threadDone___ = 1;
+ ((ThreadPtr)tmp)->___threadDone___ = 1;
*((unsigned int *)&((struct ___Object___ *) tmp)->___localcopy___) |=DIRTY;
if(transCommit()!= 0) {
goto transstart;
#define THREAD_H
#include "methodheaders.h"
#include <pthread.h>
+#include "objtypes.h"
extern int threadcount;
extern pthread_mutex_t gclock;
#endif
#if defined(THREADS)||defined(STM)
-void initthread(struct ___Thread___ * ___this___);
+void initthread(ThreadPtr ___this___);
#endif
#ifdef DSTM
void initDSMthread(int *ptr);