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"
84 #include "ObjectHash.h"
85 #include "structdefs.h"
89 #include "optionalstruct.h"
93 struct failedtasklist {
94 struct taskdescriptor *task;
98 struct failedtasklist *next;
103 struct transObjInfo {
112 //struct RuntimeHash * ptbl = NULL;
116 void flagorand(void * ptr, int ormask, int andmask, struct parameterwrapper ** queues, int length);
117 void flagorandinit(void * ptr, int ormask, int andmask);
118 void enqueueObject(void * ptr, struct parameterwrapper ** queues, int length);
120 void enqueueObject_I(void * ptr, struct parameterwrapper ** queues, int length);
123 void flagorand(void * ptr, int ormask, int andmask);
124 void flagorandinit(void * ptr, int ormask, int andmask);
125 void enqueueObject(void * ptr);
131 void transferObject(struct transObjInfo * transObj);
135 struct tagobjectiterator {
136 int istag; /* 0 if object iterator, 1 if tag iterator */
137 struct ObjectIterator it; /* Object iterator */
138 struct ObjectHash * objectset;
143 int tagobjindex; /* Index for tag or object depending on use */
144 /*if tag we have an object binding */
147 /*if object, we may have one or more tag bindings */
149 int tagbindings[MAXTASKPARAMS-1]; /* list slots */
152 struct parameterwrapper {
153 struct parameterwrapper *next;
154 struct ObjectHash * objectset;
159 struct taskdescriptor * task;
161 struct tagobjectiterator iterators[MAXTASKPARAMS-1];
165 struct taskparamdescriptor {
166 struct taskdescriptor * task;
168 void ** parameterArray;
174 int hashCodetpd(struct taskparamdescriptor *);
175 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
177 void toiReset(struct tagobjectiterator * it);
178 int toiHasNext(struct tagobjectiterator *it, void ** objectarray OPTARG(int * failed));
179 void toiNext(struct tagobjectiterator *it, void ** objectarray OPTARG(int * failed));
180 void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
181 void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
182 void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
183 int enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags);
185 int enqueuetasks_I(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr, int * enterflags, int numenterflags);