Module Js_of_ocaml_compiler.Code

module Addr : sig ... end
module DebugAddr : sig ... end
module Var : sig ... end
type cont = Addr.t * Var.t list
type prim =
| Vectlength
| Array_get
| Extern of string
| Not
| IsInt
| Eq
| Neq
| Lt
| Le
| Ult
type array_or_not =
| Array
| NotArray
| Unknown
type constant =
| String of string
| IString of string
| Float of float
| Float_array of float array
| Int64 of int64
| Tuple of int * constant array * array_or_not
| Int of int32
type prim_arg =
| Pv of Var.t
| Pc of constant
type expr =
| Const of int32
| Apply of Var.t * Var.t list * bool
| Block of int * Var.t array * array_or_not
| Field of Var.t * int
| Closure of Var.t list * cont
| Constant of constant
| Prim of prim * prim_arg list
type instr =
| Let of Var.t * expr
| Set_field of Var.t * int * Var.t
| Offset_ref of Var.t * int
| Array_set of Var.t * Var.t * Var.t
type cond =
| IsTrue
| CEq of int32
| CLt of int32
| CLe of int32
| CUlt of int32
type last =
| Return of Var.t
| Raise of Var.t * [ `Normal | `Notrace | `Reraise ]
| Stop
| Branch of cont
| Cond of cond * Var.t * cont * cont
| Switch of Var.t * cont array * cont array
| Pushtrap of cont * Var.t * cont * Addr.Set.t
| Poptrap of cont * Addr.t
type block = {
params : Var.t list;
handler : (Var.t * cont) option;
body : instr list;
branch : last;
}
type program = Addr.t * block Addr.Map.t * Addr.t
type xinstr =
| Instr of instr
| Last of last
val print_var_list : Stdlib.Format.formatter -> Var.t list -> unit
val print_instr : Stdlib.Format.formatter -> instr -> unit
val print_block : (Addr.Map.key -> xinstr -> string) -> int -> block -> unit
val print_program : (Addr.Map.key -> xinstr -> string) -> program -> unit
val print_last : Stdlib.Format.formatter -> last -> unit
val print_cont : Stdlib.Format.formatter -> cont -> unit
val fold_closures : program -> (Var.t option -> Var.t list -> cont -> 'd -> 'd) -> 'd -> 'd
val fold_children : block Addr.Map.t -> Addr.t -> (Addr.t -> 'c -> 'c) -> 'c -> 'c
val traverse : (block Addr.Map.t -> Addr.t -> (Addr.t -> (Addr.Set.t * 'c) -> Addr.Set.t * 'c) -> (Addr.Set.t * 'c) -> Addr.Set.t * 'c) -> (Addr.t -> 'c -> 'c) -> Addr.t -> block Addr.Map.t -> 'c -> 'c
val prepend : program -> instr list -> program
val empty : program
val eq : program -> program -> bool
val invariant : program -> unit