summaryrefslogtreecommitdiff
path: root/kernel/cbytecodes.mli
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <smimram@debian.org>2006-04-28 14:59:16 +0000
committerGravatar Samuel Mimram <smimram@debian.org>2006-04-28 14:59:16 +0000
commit3ef7797ef6fc605dfafb32523261fe1b023aeecb (patch)
treead89c6bb57ceee608fcba2bb3435b74e0f57919e /kernel/cbytecodes.mli
parent018ee3b0c2be79eb81b1f65c3f3fa142d24129c8 (diff)
Imported Upstream version 8.0pl3+8.1alphaupstream/8.0pl3+8.1alpha
Diffstat (limited to 'kernel/cbytecodes.mli')
-rw-r--r--kernel/cbytecodes.mli61
1 files changed, 61 insertions, 0 deletions
diff --git a/kernel/cbytecodes.mli b/kernel/cbytecodes.mli
new file mode 100644
index 00000000..a996f750
--- /dev/null
+++ b/kernel/cbytecodes.mli
@@ -0,0 +1,61 @@
+open Names
+open Term
+
+type tag = int
+
+type structured_constant =
+ | Const_sorts of sorts
+ | Const_ind of inductive
+ | Const_b0 of tag
+ | Const_bn of tag * structured_constant array
+
+type reloc_table = (tag * int) array
+
+type annot_switch =
+ {ci : case_info; rtbl : reloc_table; tailcall : bool}
+
+module Label :
+ sig
+ type t = int
+ val no : t
+ val create : unit -> t
+ val reset_label_counter : unit -> unit
+ end
+
+type instruction =
+ | Klabel of Label.t
+ | Kacc of int
+ | Kenvacc of int
+ | Koffsetclosure of int
+ | Kpush
+ | Kpop of int
+ | Kpush_retaddr of Label.t
+ | Kapply of int (* number of arguments *)
+ | Kappterm of int * int (* number of arguments, slot size *)
+ | Kreturn of int (* slot size *)
+ | Kjump
+ | Krestart
+ | Kgrab of int (* number of arguments *)
+ | Kgrabrec of int (* rec arg *)
+ | Kcograb of int (* number of arguments *)
+ | Kclosure of Label.t * int (* label, number of free variables *)
+ | Kclosurerec of int * int * Label.t array * Label.t array
+ (* nb fv, init, lbl types, lbl bodies *)
+ | Kgetglobal of constant
+ | Kconst of structured_constant
+ | Kmakeblock of int * tag (* size, tag *)
+ | Kmakeprod
+ | Kmakeswitchblock of Label.t * Label.t * annot_switch * int
+ | Kforce
+ | Kswitch of Label.t array * Label.t array (* consts,blocks *)
+ | Kpushfield of int
+ | Kstop
+ | Ksequence of bytecodes * bytecodes
+
+and bytecodes = instruction list
+
+type fv_elem = FVnamed of identifier | FVrel of int
+
+type fv = fv_elem array
+
+val draw_instr : bytecodes -> unit