4 extern jmp_buf error_handler;
5 extern int instructioncount;
6 extern int failurecount;
11 #define TAGARRAYINTERVAL 10
12 #define OBJECTARRAYINTERVAL 10
14 #define ARRAYSET(array, type, index, value) \
15 ((type *)(&(& array->___length___)[1]))[index]=value
17 #define ARRAYGET(array, type, index) \
18 ((type *)(&(& array->___length___)[1]))[index]
21 void * allocate_newglobal(transrecord_t *, int type);
22 struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
27 void * allocate_new(void *, int type);
28 struct ArrayObject * allocate_newarray(void *, int type, int length);
29 struct ___String___ * NewString(void *, const char *str,int length);
30 struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
32 void * allocate_new(int type);
33 struct ArrayObject * allocate_newarray(int type, int length);
34 struct ___String___ * NewString(const char *str,int length);
35 struct ___TagDescriptor___ * allocate_tag(int index);
40 void initializeexithandler();
41 void failedboundschk();
44 void injectinstructionfailure();
45 void createstartupobject();
48 #define VAR(name) ___params___->name
49 #define CALL00(name) name(struct name ## _params * ___params___)
50 #define CALL01(name, alt) name(struct name ## _params * ___params___)
51 #define CALL02(name, alt1, alt2) name(struct name ## _params * ___params___)
52 #define CALL11(name,rest, alt) name(struct name ## _params * ___params___, rest)
53 #define CALL12(name,rest, alt1, alt2) name(struct name ## _params * ___params___, rest)
54 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(struct name ## _params * ___params___, rest, rest2)
55 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(struct name ## _params * ___params___, rest, rest2)
57 #define VAR(name) name
58 #define CALL00(name) name()
59 #define CALL01(name, alt) name(alt)
60 #define CALL02(name, alt1, alt2) name(alt1, alt2)
61 #define CALL11(name,rest, alt) name(alt)
62 #define CALL12(name,rest, alt1, alt2) name(alt1, alt2)
63 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(alt1, alt2, alt3)
64 #define CALL24(name, rest, rest2, alt1, alt2, alt3, alt4) name(alt1, alt2, alt3, alt4)
68 #include "SimpleHash.h"
69 #include "ObjectHash.h"
71 #include "structdefs.h"
73 #include "optionalstruct.h"
76 void flagorand(void * ptr, int ormask, int andmask);
77 void flagorandinit(void * ptr, int ormask, int andmask);
81 struct tagobjectiterator {
82 int istag; /* 0 if object iterator, 1 if tag iterator */
83 struct ObjectIterator it; /* Object iterator */
84 struct ObjectHash * objectset;
86 int tagobjindex; /* Index for tag or object depending on use */
87 /*if tag we have an object binding */
90 /*if object, we may have one or more tag bindings */
92 int tagbindings[MAXTASKPARAMS-1]; /* list slots */
95 struct parameterwrapper {
96 struct parameterwrapper *next;
97 struct ObjectHash * objectset;
102 struct taskdescriptor * task;
104 struct tagobjectiterator iterators[MAXTASKPARAMS-1];
107 struct taskparamdescriptor {
108 struct taskdescriptor * task;
110 void ** parameterArray;
113 int hashCodetpd(struct taskparamdescriptor *);
114 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
116 void toiReset(struct tagobjectiterator * it);
117 int toiHasNext(struct tagobjectiterator *it, void ** objectarray);
118 void toiNext(struct tagobjectiterator *it , void ** objectarray);
119 void processobject(struct parameterwrapper *parameter, int index, struct parameterdescriptor *pd, int *iteratorcount, int * statusarray, int numparams);
120 void processtags(struct parameterdescriptor *pd, int index, struct parameterwrapper *parameter, int * iteratorcount, int *statusarray, int numparams);
121 void builditerators(struct taskdescriptor * task, int index, struct parameterwrapper * parameter);
122 void enqueuetasks(struct parameterwrapper *parameter, struct parameterwrapper *prevptr, struct ___Object___ *ptr);