4 extern jmp_buf error_handler;
5 extern int instructioncount;
6 extern int failurecount;
11 extern void * curr_heapbase;
12 extern void * curr_heaptop;
14 #define TAGARRAYINTERVAL 10
15 #define OBJECTARRAYINTERVAL 10
17 #define ARRAYSET(array, type, index, value) \
18 ((type *)(&(& array->___length___)[1]))[index]=value
20 #define ARRAYGET(array, type, index) \
21 ((type *)(&(& array->___length___)[1]))[index]
30 void * allocate_newglobal(transrecord_t *, int type);
31 struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
36 void * allocate_new(void *, int type);
37 struct ArrayObject * allocate_newarray(void *, int type, int length);
38 struct ___String___ * NewString(void *, const char *str,int length);
39 struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
41 void * allocate_new(int type);
42 struct ArrayObject * allocate_newarray(int type, int length);
43 struct ___String___ * NewString(const char *str,int length);
44 struct ___TagDescriptor___ * allocate_tag(int index);
49 void initializeexithandler();
50 void failedboundschk();
53 void injectinstructionfailure();
54 void createstartupobject();
57 #define VAR(name) ___params___->name
58 #define CALL00(name) name(struct name ## _params * ___params___)
59 #define CALL01(name, alt) name(struct name ## _params * ___params___)
60 #define CALL02(name, alt1, alt2) name(struct name ## _params * ___params___)
61 #define CALL11(name,rest, alt) name(struct name ## _params * ___params___, rest)
62 #define CALL12(name,rest, alt1, alt2) name(struct name ## _params * ___params___, rest)
63 #define CALL22(name, rest, rest2, alt1, alt2) name(struct name ## _params * ___params___, rest, rest2)
64 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(struct name ## _params * ___params___, rest, rest2)
65 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2)
66 #define CALL34(name, rest, rest2, rest3, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2, rest3)
68 #define VAR(name) name
69 #define CALL00(name) name()
70 #define CALL01(name, alt) name(alt)
71 #define CALL02(name, alt1, alt2) name(alt1, alt2)
72 #define CALL11(name,rest, alt) name(alt)
73 #define CALL12(name,rest, alt1, alt2) name(alt1, alt2)
74 #define CALL22(name, rest, rest2, alt1, alt2) name(alt1, alt2)
75 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(alt1, alt2, alt3)
76 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
77 #define CALL34(name, rest, rest2, rest3, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
81 #include "SimpleHash.h"
83 #include "ObjectHash.h"
84 #include "structdefs.h"
88 #include "optionalstruct.h"
92 struct failedtasklist {
93 struct taskdescriptor *task;
97 struct failedtasklist *next;
102 void flagorand(void * ptr, int ormask, int andmask, struct parameterwrapper ** queues, int length);
103 void flagorandinit(void * ptr, int ormask, int andmask);
104 void enqueueObject(void * ptr, struct parameterwrapper ** queues, int length);
106 void flagorand(void * ptr, int ormask, int andmask);
107 void flagorandinit(void * ptr, int ormask, int andmask);
108 void enqueueObject(void * ptr);
114 void transferObject(void * ptr, int targetcore);
118 struct tagobjectiterator {
119 int istag; /* 0 if object iterator, 1 if tag iterator */
120 struct ObjectIterator it; /* Object iterator */
121 struct ObjectHash * objectset;
126 int tagobjindex; /* Index for tag or object depending on use */
127 /*if tag we have an object binding */
130 /*if object, we may have one or more tag bindings */
132 int tagbindings[MAXTASKPARAMS-1]; /* list slots */
135 struct parameterwrapper {
136 struct parameterwrapper *next;
137 struct ObjectHash * objectset;
142 struct taskdescriptor * task;
144 struct tagobjectiterator iterators[MAXTASKPARAMS-1];
148 struct taskparamdescriptor {
149 struct taskdescriptor * task;
151 void ** parameterArray;
157 int hashCodetpd(struct taskparamdescriptor *);
158 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
160 void toiReset(struct tagobjectiterator * it);
161 int toiHasNext(struct tagobjectiterator *it, void ** objectarray OPTARG(int * failed));
162 void toiNext(struct tagobjectiterator *it , void ** objectarray OPTARG(int * failed));
163 void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
164 void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
165 void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
166 int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags);