4 extern jmp_buf error_handler;
5 extern int instructioncount;
6 extern int failurecount;
8 #define TAGARRAYINTERVAL 10
9 #define OBJECTARRAYINTERVAL 10
11 #define ARRAYSET(array, type, index, value) \
12 ((type *)(&(& array->___length___)[1]))[index]=value
14 #define ARRAYGET(array, type, index) \
15 ((type *)(&(& array->___length___)[1]))[index]
19 void * allocate_new(void *, int type);
20 struct ArrayObject * allocate_newarray(void *, int type, int length);
21 struct ___String___ * NewString(void *, const char *str,int length);
23 void * allocate_new(int type);
24 struct ArrayObject * allocate_newarray(int type, int length);
25 struct ___String___ * NewString(const char *str,int length);
28 void initializeexithandler();
29 void failedboundschk();
32 void injectinstructionfailure();
33 void createstartupobject();
36 #define VAR(name) ___params___->name
37 #define CALL00(name) name(struct name ## _params * ___params___)
38 #define CALL01(name, alt) name(struct name ## _params * ___params___)
39 #define CALL02(name, alt1, alt2) name(struct name ## _params * ___params___)
40 #define CALL11(name,rest, alt) name(struct name ## _params * ___params___, rest)
41 #define CALL12(name,rest, alt1, alt2) name(struct name ## _params * ___params___, rest)
42 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(struct name ## _params * ___params___, rest, rest2)
43 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2)
45 #define VAR(name) name
46 #define CALL00(name) name()
47 #define CALL01(name, alt) name(alt)
48 #define CALL02(name, alt1, alt2) name(alt1, alt2)
49 #define CALL11(name,rest, alt) name(alt)
50 #define CALL12(name,rest, alt1, alt2) name(alt1, alt2)
51 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(alt1, alt2, alt3)
52 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
56 #include "SimpleHash.h"
58 #include "structdefs.h"
60 void flagorand(void * ptr, int ormask, int andmask);
61 void flagorandinit(void * ptr, int ormask, int andmask);
65 struct tagobjectiterator {
66 int istag; /* 0 if object iterator, 1 if tag iterator */
67 struct RuntimeIterator it; /* Object iterator */
68 struct RuntimeHash * objectset;
70 int tagobjindex; /* Index for tag or object depending on use */
71 /*if tag we have an object binding */
74 /*if object, we may have one or more tag bindings */
76 int tagbindings[MAXTASKPARAMS-1]; /* list slots */
79 struct parameterwrapper {
80 struct parameterwrapper *next;
81 struct RuntimeHash * objectset;
86 struct taskdescriptor * task;
88 struct tagobjectiterator iterators[MAXTASKPARAMS-1];
91 struct taskparamdescriptor {
92 struct taskdescriptor * task;
94 void ** parameterArray;
97 int hashCodetpd(struct taskparamdescriptor *);
98 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
100 void toiReset(struct tagobjectiterator * it);
101 int toiHasNext(struct tagobjectiterator *it, void ** objectarray);
102 void toiNext(struct tagobjectiterator *it , void ** objectarray);
103 void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
104 void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
105 void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
106 void enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr);