typo
[IRC.git] / Robust / src / Runtime / runtime.h
1 #ifndef RUNTIME
2 #define RUNTIME
3 #include <setjmp.h>
4 extern jmp_buf error_handler;
5 extern int instructioncount;
6
7 #ifdef PRECISE_GC
8 #include "garbage.h"
9 void * allocate_new(void *, int type);
10 struct ArrayObject * allocate_newarray(void *, int type, int length);
11 struct ___String___ * NewString(void *, const char *str,int length);
12 #else
13 void * allocate_new(int type);
14 struct ArrayObject * allocate_newarray(int type, int length);
15 struct ___String___ * NewString(const char *str,int length);
16 #endif
17
18 void failedboundschk();
19 void failednullptr();
20 void abort_task();
21 void injectinstructionfailure();
22 void createstartupobject();
23
24 #ifdef PRECISE_GC
25 #define VAR(name) ___params___->name
26 #define CALL01(name, alt) name(struct name ## _params * ___params___)
27 #define CALL02(name, alt1, alt2) name(struct name ## _params * ___params___)
28 #define CALL11(name,rest, alt) name(struct name ## _params * ___params___, rest)
29 #define CALL12(name,rest, alt1, alt2) name(struct name ## _params * ___params___, rest)
30 #define CALL21(name,rest, rest2, alt) name(struct name ## _params * ___params___, rest, rest2)
31 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(struct name ## _params * ___params___, rest, rest2)
32 #else
33 #define VAR(name) name
34 #define CALL01(name, alt) name(alt)
35 #define CALL02(name, alt1, alt2) name(alt1, alt2)
36 #define CALL11(name,rest, alt) name(alt)
37 #define CALL12(name,rest, alt1, alt2) name(alt1, alt2)
38 #define CALL21(name,rest, rest2, alt) name(alt)
39 #define CALL23(name, rest, rest2, alt1, alt2, alt3) name(alt1, alt2, alt3)
40 #endif
41
42 #ifdef TASK
43 #include "SimpleHash.h"
44 #include "task.h"
45 void flagorand(void * ptr, int ormask, int andmask);
46 void executetasks();
47 void processtasks();
48
49 struct parameterwrapper {
50   struct parameterwrapper *next;
51   struct RuntimeHash * objectset;
52   int numberofterms;
53   int * intarray;
54   struct taskdescriptor * task;
55 };
56
57 struct taskparamdescriptor {
58   struct taskdescriptor * task;
59   int numParameters;
60   void ** parameterArray;
61 };
62
63 struct tpdlist {
64   struct taskparamdescriptor * task;
65   struct tpdlist * next;
66 };
67
68 int hashCodetpd(struct taskparamdescriptor *);
69 int comparetpd(struct taskparamdescriptor *, struct taskparamdescriptor *);
70 #endif
71
72 #endif