Module Js_of_ocaml_compiler.Code
module Addr : sig ... endmodule Var : sig ... endtype cont =
Js_of_ocaml_compiler.Code.Addr.t * Js_of_ocaml_compiler.Code.Var.t listmodule Native_string : sig ... endtype constant = | String of string| NativeString of Js_of_ocaml_compiler.Code.Native_string.t| Float of Js_of_ocaml_compiler.Stdlib.Int64.t| Float_array of Js_of_ocaml_compiler.Stdlib.Int64.t array| Int of Js_of_ocaml_compiler.Targetint.t| Int32 of Js_of_ocaml_compiler.Stdlib.Int32.t(*Only produced when compiling to WebAssembly.
*)| Int64 of Js_of_ocaml_compiler.Stdlib.Int64.t| NativeInt of Js_of_ocaml_compiler.Stdlib.Int32.t(*Only produced when compiling to WebAssembly.
*)| Tuple of int * Js_of_ocaml_compiler.Code.constant array * Js_of_ocaml_compiler.Code.array_or_not
module Constant : sig ... endtype loc = | No| Before of Js_of_ocaml_compiler.Code.Addr.t| After of Js_of_ocaml_compiler.Code.Addr.t
val noloc : Js_of_ocaml_compiler.Code.locval location_of_pc : int -> Js_of_ocaml_compiler.Code.loctype expr = | Apply of {f : Js_of_ocaml_compiler.Code.Var.t;args : Js_of_ocaml_compiler.Code.Var.t list;exact : bool;
}| Block of int * Js_of_ocaml_compiler.Code.Var.t array * Js_of_ocaml_compiler.Code.array_or_not * Js_of_ocaml_compiler.Code.mutability| Field of Js_of_ocaml_compiler.Code.Var.t * int * Js_of_ocaml_compiler.Code.field_type| Closure of Js_of_ocaml_compiler.Code.Var.t list * Js_of_ocaml_compiler.Code.cont * Js_of_ocaml_compiler.Parse_info.t option| Constant of Js_of_ocaml_compiler.Code.constant| Prim of Js_of_ocaml_compiler.Code.prim * Js_of_ocaml_compiler.Code.prim_arg list| Special of Js_of_ocaml_compiler.Code.special
type instr = | Let of Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.expr| Assign of Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.Var.t| Set_field of Js_of_ocaml_compiler.Code.Var.t * int * Js_of_ocaml_compiler.Code.field_type * Js_of_ocaml_compiler.Code.Var.t| Offset_ref of Js_of_ocaml_compiler.Code.Var.t * int| Array_set of Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.Var.t| Event of Js_of_ocaml_compiler.Parse_info.t
type last = | Return of Js_of_ocaml_compiler.Code.Var.t| Raise of Js_of_ocaml_compiler.Code.Var.t * [ `Normal | `Notrace | `Reraise ]| Stop| Branch of Js_of_ocaml_compiler.Code.cont| Cond of Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.cont * Js_of_ocaml_compiler.Code.cont| Switch of Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.cont array| Pushtrap of Js_of_ocaml_compiler.Code.cont * Js_of_ocaml_compiler.Code.Var.t * Js_of_ocaml_compiler.Code.cont| Poptrap of Js_of_ocaml_compiler.Code.cont
type block = {params : Js_of_ocaml_compiler.Code.Var.t list;body : Js_of_ocaml_compiler.Code.instr list;branch : Js_of_ocaml_compiler.Code.last;
}type program = {start : Js_of_ocaml_compiler.Code.Addr.t;blocks : Js_of_ocaml_compiler.Code.block Js_of_ocaml_compiler.Code.Addr.Map.t;free_pc : Js_of_ocaml_compiler.Code.Addr.t;
}module Print : sig ... endtype 'c fold_blocs =
Js_of_ocaml_compiler.Code.block Js_of_ocaml_compiler.Code.Addr.Map.t ->
Js_of_ocaml_compiler.Code.Addr.t ->
(Js_of_ocaml_compiler.Code.Addr.t -> 'c -> 'c) ->
'c ->
'cval fold_closures :
Js_of_ocaml_compiler.Code.program ->
(Js_of_ocaml_compiler.Code.Var.t option ->
Js_of_ocaml_compiler.Code.Var.t list ->
Js_of_ocaml_compiler.Code.cont ->
Js_of_ocaml_compiler.Parse_info.t option ->
'd ->
'd) ->
'd ->
'dfold_closures p f init folds f over all closures in the program p, starting from the initial value init. For each closure, f is called with the following arguments: the closure name (enclosed in Stdlib.Some), its parameter list, the address and parameter instantiation of its first block, the optional closure location and the current accumulator. In addition, f is called on the initial block p.start, with None as the closure name. All closures in all blocks of p are included in the fold, not only the ones reachable from p.start.
val fold_closures_innermost_first :
Js_of_ocaml_compiler.Code.program ->
(Js_of_ocaml_compiler.Code.Var.t option ->
Js_of_ocaml_compiler.Code.Var.t list ->
Js_of_ocaml_compiler.Code.cont ->
Js_of_ocaml_compiler.Parse_info.t option ->
'd ->
'd) ->
'd ->
'dSimilar to fold_closures, but applies the fold function to the innermost closures first. Unlike with fold_closures, only the closures reachable from p.start are considered.
val fold_closures_outermost_first :
Js_of_ocaml_compiler.Code.program ->
(Js_of_ocaml_compiler.Code.Var.t option ->
Js_of_ocaml_compiler.Code.Var.t list ->
Js_of_ocaml_compiler.Code.cont ->
Js_of_ocaml_compiler.Parse_info.t option ->
'd ->
'd) ->
'd ->
'dSimilar to fold_closures, but applies the fold function to the outermost closures first. Unlike with fold_closures, only the closures reachable from p.start are considered.
val fold_children : 'c Js_of_ocaml_compiler.Code.fold_blocsval fold_children_skip_try_body : 'c Js_of_ocaml_compiler.Code.fold_blocsval traverse :
Js_of_ocaml_compiler.Code.fold_blocs_poly ->
(Js_of_ocaml_compiler.Code.Addr.t -> 'c -> 'c) ->
Js_of_ocaml_compiler.Code.Addr.t ->
Js_of_ocaml_compiler.Code.block Js_of_ocaml_compiler.Code.Addr.Map.t ->
'c ->
'cval preorder_traverse :
Js_of_ocaml_compiler.Code.fold_blocs_poly ->
(Js_of_ocaml_compiler.Code.Addr.t -> 'c -> 'c) ->
Js_of_ocaml_compiler.Code.Addr.t ->
Js_of_ocaml_compiler.Code.block Js_of_ocaml_compiler.Code.Addr.Map.t ->
'c ->
'cval last_instr :
Js_of_ocaml_compiler.Code.instr list ->
Js_of_ocaml_compiler.Code.instr optionLast instruction of a block body, ignoring events
val used_blocks :
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Stdlib.BitSet.tval prepend :
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Code.instr list ->
Js_of_ocaml_compiler.Code.programval empty : Js_of_ocaml_compiler.Code.programval compact :
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Code.programval is_empty : Js_of_ocaml_compiler.Code.program -> boolval equal :
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Code.program ->
boolval print_diff :
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Code.program ->
unitval check_updates :
name:string ->
Js_of_ocaml_compiler.Code.program ->
Js_of_ocaml_compiler.Code.program ->
updates:int ->
unitval invariant : Js_of_ocaml_compiler.Code.program -> unitval cont_equal :
Js_of_ocaml_compiler.Code.cont ->
Js_of_ocaml_compiler.Code.cont ->
boolval cont_compare :
Js_of_ocaml_compiler.Code.cont ->
Js_of_ocaml_compiler.Code.cont ->
int