package js_of_ocaml-compiler

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Js_of_ocaml_compiler.CodeSource

Sourcemodule Addr : sig ... end
Sourcemodule DebugAddr : sig ... end
Sourcemodule Var : sig ... end
Sourcetype cont = Addr.t * Var.t list
Sourcetype prim =
  1. | Vectlength
  2. | Array_get
  3. | Extern of string
  4. | Not
  5. | IsInt
  6. | Eq
  7. | Neq
  8. | Lt
  9. | Le
  10. | Ult
Sourcetype array_or_not =
  1. | Array
  2. | NotArray
  3. | Unknown
Sourcemodule Native_string : sig ... end
Sourcetype constant =
  1. | String of string
  2. | NativeString of Native_string.t
  3. | Float of float
  4. | Float_array of float array
  5. | Int64 of int64
  6. | Tuple of int * constant array * array_or_not
  7. | Int of int32
Sourceval constant_equal : constant -> constant -> bool option
Sourcetype loc =
  1. | No
  2. | Before of Addr.t
  3. | After of Addr.t
Sourceval noloc : loc
Sourceval location_of_pc : int -> loc
Sourcetype prim_arg =
  1. | Pv of Var.t
  2. | Pc of constant
Sourcetype expr =
  1. | Apply of {
    1. f : Var.t;
    2. args : Var.t list;
    3. exact : bool;
    }
  2. | Block of int * Var.t array * array_or_not
  3. | Field of Var.t * int
  4. | Closure of Var.t list * cont
  5. | Constant of constant
  6. | Prim of prim * prim_arg list
Sourcetype instr =
  1. | Let of Var.t * expr
  2. | Assign of Var.t * Var.t
  3. | Set_field of Var.t * int * Var.t
  4. | Offset_ref of Var.t * int
  5. | Array_set of Var.t * Var.t * Var.t
Sourcetype last =
  1. | Return of Var.t
  2. | Raise of Var.t * [ `Normal | `Notrace | `Reraise ]
  3. | Stop
  4. | Branch of cont
  5. | Cond of Var.t * cont * cont
  6. | Switch of Var.t * cont array * cont array
  7. | Pushtrap of cont * Var.t * cont * Addr.Set.t
  8. | Poptrap of cont
Sourcetype block = {
  1. params : Var.t list;
  2. body : (instr * loc) list;
  3. branch : last * loc;
}
Sourcetype program = {
  1. start : Addr.t;
  2. blocks : block Addr.Map.t;
  3. free_pc : Addr.t;
}
Sourcemodule Print : sig ... end
Sourcetype 'c fold_blocs = block Addr.Map.t -> Addr.t -> (Addr.t -> 'c -> 'c) -> 'c -> 'c
Sourcetype fold_blocs_poly = {
  1. fold : 'a. 'a fold_blocs;
}
Sourceval fold_closures : program -> (Var.t option -> Var.t list -> cont -> 'd -> 'd) -> 'd -> 'd

fold_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, 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.

Sourceval fold_closures_innermost_first : program -> (Var.t option -> Var.t list -> cont -> 'd -> 'd) -> 'd -> 'd

Similar 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.

Sourceval fold_children : 'c fold_blocs
Sourceval traverse : fold_blocs_poly -> (Addr.t -> 'c -> 'c) -> Addr.t -> block Addr.Map.t -> 'c -> 'c
Sourceval preorder_traverse : fold_blocs_poly -> (Addr.t -> 'c -> 'c) -> Addr.t -> block Addr.Map.t -> 'c -> 'c
Sourceval prepend : program -> (instr * loc) list -> program
Sourceval empty : program
Sourceval is_empty : program -> bool
Sourceval eq : program -> program -> bool
Sourceval invariant : program -> unit
OCaml

Innovation. Community. Security.