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
11 #define MAXARRAY 1024*1024
16 void * array[MAXPOINTERS];
21 struct primitivelist {
23 int array[MAXVALUES+1024];
28 char array[MAXBRANCHES+4096];
31 extern __thread struct pointerlist ptrstack;
32 extern __thread struct primitivelist primstack;
33 extern __thread struct branchlist branchstack;
38 void *array[MAXARRAY];
40 int index[MAXARRAY+1024];
43 extern __thread struct arraylist arraystack;
48 #define RESTOREARRAY(x,z) {x=arraystack.array[arraystack.maxcount];z=arraystack.index[arraystack.maxcount++];}
50 #define STOREARRAY(x,z) {void * y=COMPOID(x); arraystack.array[arraystack.count]=y; arraystack.index[arraystack.count++]=z; dc_t_chashInsertOnce(y,y,z);}
52 #define STOREARRAYNOLOCK(x,z) {void * y=COMPOID(x); arraystack.array[arraystack.count]=y; arraystack.index[arraystack.count++]=z;}
54 #define STOREARRAYNOTRANS(x,z) {void * y=x; arraystack.array[arraystack.count]=y; arraystack.index[arraystack.count++]=z; dc_t_chashInsertOnce(y,y,z);}
56 #define STOREARRAYNOLOCKNOTRANS(x,z) {void * y=x; arraystack.array[arraystack.count]=y; arraystack.index[arraystack.count++]=z; }
60 #define RESTOREPTR(x) x=ptrstack.array[ptrstack.maxcount++];
62 #define STOREPTR(x) {void * y=COMPOID(x); ptrstack.array[ptrstack.count++]=y; dc_t_chashInsertOnce(y,y);}
64 #define STOREPTRNOLOCK(x) {void * y=COMPOID(x); ptrstack.array[ptrstack.count++]=y; }
66 #define STOREPTRNOTRANS(x) {void * y=x; ptrstack.array[ptrstack.count++]=y; dc_t_chashInsertOnce(y,y);}
68 #define STOREPTRNOLOCKNOTRANS(x) {void * y=x; ptrstack.array[ptrstack.count++]=y; }
72 #define RESTOREANDBRANCH(loc) if (branchstack.array[branchstack.count++]) goto loc
74 #define STOREANDBRANCH(cond, loc) if (branchstack.array[branchstack.count++]=cond) goto loc
78 #define RESTOREI(x) x=primstack.array[primstack.count++]
80 #define STOREI(x) primstack.array[primstack.count++]=x
84 #define RESTOREF(x) x=*((float *)&primstack.array[primstack.count++])
86 #define STOREF(x) *((float *)&primstack.array[primstack.count++])=x
90 #define RESTORED(x) x=*((double *)&primstack.array[primstack.count]); primstack.count+=2
92 #define STORED(x) *((double *)&primstack.array[primstack.count])=x; primstack.count+=2
96 #define RESTOREB(x) x=*((char *)&primstack.array[primstack.count++])
98 #define STOREB(x) *((char *)&primstack.array[primstack.count++])=x
102 #define RESTOREC(x) x=*((short *)&primstack.array[primstack.count++])
104 #define STOREC(x) *((short *)&primstack.array[primstack.count++])=x
108 #define RESTOREJ(x) x=*((long long *)&primstack.array[primstack.count]); primstack.count+=2
110 #define STOREJ(x) *((long long *)&primstack.array[primstack.count])=x; primstack.count+=2
114 #define RESTOREZ(x) x=primstack.array[primstack.count++]
116 #define STOREZ(x) primstack.array[primstack.count++]=x