-
Notifications
You must be signed in to change notification settings - Fork 6
/
continue.h
98 lines (83 loc) · 1.72 KB
/
continue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef __CONTINUE_H__
#define __CONTINUE_H__
#include "struct.h"
enum {
done_type = 200,
right_of_bin_type,
finish_bin_type,
right_of_app_type,
finish_app_type,
finish_if0_type,
# if USE_JIT
right_jitted_type,
finish_jitted_type,
interp_type,
# endif
};
typedef struct cont {
int type;
} cont;
typedef struct right_of_bin {
cont c;
int op;
tagged *right;
env *env;
cont *rest;
} right_of_bin;
typedef struct finish_bin {
cont c;
int op;
tagged *left_val;
cont *rest;
} finish_bin;
typedef struct right_of_app {
cont c;
tagged *right;
env *env;
cont *rest;
} right_of_app;
typedef struct finish_app {
cont c;
tagged *left_val;
cont *rest;
} finish_app;
typedef struct finish_if0 {
cont c;
tagged *thn;
tagged *els;
env *env;
cont *rest;
} finish_if0;
#if USE_JIT
typedef struct jitted {
cont c;
jitted_proc code;
jitted_proc tail_code;
cont *rest;
} jitted;
typedef struct right_jitted {
jitted j;
env* env;
} right_jitted;
typedef struct finish_jitted {
jitted j;
tagged* val;
} finish_jitted;
typedef struct interp {
cont c;
tagged* expr;
cont *rest;
} interp;
#endif
cont *make_done();
cont *make_right_of_bin(int op, tagged *right, env *env, cont *rest);
cont *make_finish_bin(int op, tagged *left_val, cont *rest);
cont *make_right_of_app(tagged *right, env *env, cont *rest);
cont *make_finish_app(tagged *left_val, cont *rest);
cont *make_finish_if0(tagged *thn, tagged *els, env *env, cont *rest);
#if USE_JIT
cont *make_right_jitted(jitted_proc code, jitted_proc tail_code, cont *rest, env *env);
cont *make_finish_jitted(jitted_proc code, jitted_proc tail_code, cont *rest, tagged* val);
cont *make_interp(tagged*expr, cont *rest);
#endif
#endif