4 //There is probably a better way for these...but we'll just hardcode
5 //them for now..probably a real implementation would page protect the
6 //page after...then default to something simpler
8 #define MAXPOINTERS 1024*1024*1
9 #define MAXVALUES 1024*1024*2
10 #define MAXBRANCHES 1024*1024*4
15 void * array[MAXPOINTERS+1024];
18 struct primitivelist {
20 int array[MAXVALUES+1024];
25 char array[MAXBRANCHES+4096];
28 extern __thread struct pointerlist ptrstack;
29 extern __thread struct primitivelist primstack;
30 extern __thread struct branchlist branchstack;
34 #define RESTOREPTR(x) x=ptrstack.array[ptrstack.count++];
36 #define STOREPTR(x) {void * y=COMPOID(x); ptrstack.array[ptrstack.count++]=y; dc_t_chashInsertOnce(y,y);}
38 #define STOREPTRNOLOCK(x) {void * y=COMPOID(x); ptrstack.array[ptrstack.count++]=y; }
40 #define STOREPTRNOTRANS(x) {void * y=x; ptrstack.array[ptrstack.count++]=y; dc_t_chashInsertOnce(y,y);}
42 #define STOREPTRNOLOCKNOTRANS(x) {void * y=x; ptrstack.array[ptrstack.count++]=y; }
46 #define RESTOREANDBRANCH(loc) if (branchstack.array[branchstack.count++]) goto loc
48 #define STOREANDBRANCH(cond, loc) if (branchstack.array[branchstack.count++]=cond) goto loc
52 #define RESTOREI(x) x=primstack.array[primstack.count++]
54 #define STOREI(x) primstack.array[primstack.count++]=x
58 #define RESTOREF(x) x=*((float *)&primstack.array[primstack.count++])
60 #define STOREF(x) *((float *)&primstack.array[primstack.count++])=x
64 #define RESTORED(x) x=*((double *)&primstack.array[primstack.count]); primstack.count+=2
66 #define STORED(x) *((double *)&primstack.array[primstack.count])=x; primstack.count+=2
70 #define RESTOREB(x) x=*((char *)&primstack.array[primstack.count++])
72 #define STOREB(x) *((char *)&primstack.array[primstack.count++])=x
76 #define RESTOREC(x) x=*((short *)&primstack.array[primstack.count++])
78 #define STOREC(x) *((short *)&primstack.array[primstack.count++])=x
82 #define RESTOREJ(x) x=*((long long *)&primstack.array[primstack.count]); primstack.count+=2
84 #define STOREJ(x) *((long long *)&primstack.array[primstack.count])=x; primstack.count+=2
88 #define RESTOREZ(x) x=primstack.array[primstack.count++]
90 #define STOREZ(x) primstack.array[primstack.count++]=x