1(* The type of the instructions of the abstract machine *)
2
3(* 1996.07.05 -- e *)
4
5open Config Const Prim;
6
7datatype ZamInstruction =
8    Kquote of StructConstant
9  | Kget_global of QualifiedIdent * int
10  | Kset_global of QualifiedIdent * int
11  | Kaccess of int
12  | Kenvacc of int                  (* new *)
13  | Kassign of int                  (* newer *)
14  | Kgetfield of int                (* new *)
15  | Ksetfield of int                (* new *)
16  | Kpush
17  | Kpop of int                     (* added arg *)
18  | Krestart                        (* new *)
19  | Kgrab of int                    (* added arg *)
20  | Kapply of int                   (* added arg *)
21  | Kappterm of int * int           (* added args and renamed *)
22  | Kpush_retaddr of int            (* new *)
23  | Kcheck_signals
24  | Kreturn of int                  (* added arg *)
25  | Kclosure    of int * int           (* added arg *)
26  | Kclosurerec of int * int        (* new *)
27  | Kraise                          (* new *)
28  | Kmakeblock of BlockTag * int
29  | Kprim of primitive
30  | Kpushtrap of int
31  | Kpoptrap
32  | Klabel of int
33  | Kbranch of int
34  | Kbranchif of int
35  | Kbranchifnot of int
36  | Kstrictbranchif of int
37  | Kstrictbranchifnot of int
38  | Ktest of bool_test * int
39  | Kbranchinterval of int * int * int * int
40  | Kswitch of int Array.array
41
42  (* C-- additions *)
43  | Kname         of int       (* function label            *)
44  | Kcontinuation of int       (* handle label              *)
45  | Knewgrab      of int * int (* (restart label, req args) *)
46  | Knewrestart   of int       (* grap label                *)
47;
48
49type ZamPhrase =
50{
51  kph_funcs:   ZamInstruction list list,     (* code for functions *)
52  kph_inits:   ZamInstruction list,     (* initialization code *)
53  kph_is_pure: bool                     (* pure = no side effects *)
54};
55
56val Nolabel = ~1;
57