package wasm_of_ocaml-compiler

  1. Overview
  2. Docs
type constant_global
type context = {
  1. constants : (Js_of_ocaml_compiler.Code.Var.t, Wasm_ast.expression) Hashtbl.t;
  2. mutable data_segments : string Js_of_ocaml_compiler.Code.Var.Map.t;
  3. mutable constant_globals : constant_global Js_of_ocaml_compiler.Code.Var.Map.t;
  4. mutable other_fields : Wasm_ast.module_field list;
  5. mutable imports : (Js_of_ocaml_compiler.Code.Var.t * Wasm_ast.import_desc) Js_of_ocaml_compiler.Stdlib.StringMap.t Js_of_ocaml_compiler.Stdlib.StringMap.t;
  6. type_names : (string, Js_of_ocaml_compiler.Code.Var.t) Hashtbl.t;
  7. types : (Js_of_ocaml_compiler.Code.Var.t, Wasm_ast.type_field) Hashtbl.t;
  8. mutable closure_envs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Code.Var.Map.t;
    (*

    GC: mapping of recursive functions to their shared environment

    *)
  9. mutable apply_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  10. mutable cps_apply_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  11. mutable curry_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  12. mutable cps_curry_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  13. mutable dummy_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  14. mutable cps_dummy_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;
  15. mutable init_code : Wasm_ast.instruction list;
  16. mutable string_count : int;
  17. mutable strings : string list;
  18. mutable string_index : int Js_of_ocaml_compiler.Stdlib.StringMap.t;
  19. mutable fragments : Js_of_ocaml_compiler.Javascript.expression Js_of_ocaml_compiler.Stdlib.StringMap.t;
  20. mutable globalized_variables : Js_of_ocaml_compiler.Code.Var.Set.t;
  21. value_type : Wasm_ast.value_type;
  22. mutable unit_name : string option;
}
val make_context : value_type:Wasm_ast.value_type -> context
type 'a t
type expression = Wasm_ast.expression t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val return : 'a -> 'a t
val instr : Wasm_ast.instruction -> unit t
val seq : unit t -> expression -> expression
val expression_list : ('a -> expression) -> 'a list -> Wasm_ast.expression list t
module Arith : sig ... end
val cast : ?nullable:bool -> Wasm_ast.heap_type -> expression -> expression
val load : Wasm_ast.var -> expression
val store : ?always:bool -> ?typ:Wasm_ast.value_type -> Wasm_ast.var -> expression -> unit t
val assign : Wasm_ast.var -> expression -> unit t
val drop : expression -> unit t
val push : expression -> unit t
val loop : Wasm_ast.func_type -> unit t -> unit t
val block : Wasm_ast.func_type -> unit t -> unit t
val block_expr : Wasm_ast.func_type -> unit t -> expression
val if_ : Wasm_ast.func_type -> expression -> unit t -> unit t -> unit t
val define_var : Wasm_ast.var -> expression -> unit t
val is_small_constant : Wasm_ast.expression -> bool t
val get_i31_value : Wasm_ast.var -> Wasm_ast.var option t
val no_event : unit t
val hidden_location : Js_of_ocaml_compiler.Parse_info.t
type type_def = {
  1. supertype : Wasm_ast.var option;
  2. final : bool;
  3. typ : Wasm_ast.str_type;
}
val register_type : string -> (unit -> type_def t) -> Wasm_ast.var t
val heap_type_sub : Wasm_ast.heap_type -> Wasm_ast.heap_type -> bool t
val register_import : ?import_module:string -> name:string -> Wasm_ast.import_desc -> Wasm_ast.var t
val register_global : Wasm_ast.var -> ?exported_name:string -> ?constant:bool -> Wasm_ast.global_type -> Wasm_ast.expression -> unit t
val register_data_segment : Js_of_ocaml_compiler.Code.Var.t -> string -> unit t
val register_init_code : unit t -> unit t
val init_code : context -> unit t
val register_string : string -> int t
val register_fragment : string -> (unit -> Js_of_ocaml_compiler.Javascript.expression) -> unit t
val get_context : context t
val is_closure : Js_of_ocaml_compiler.Code.Var.t -> bool t
val unit_name : string option t
val need_apply_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
val need_curry_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
val need_dummy_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
val function_body : context:context -> param_names:Js_of_ocaml_compiler.Code.Var.t list -> body:unit t -> (Wasm_ast.var * Wasm_ast.value_type) list * Wasm_ast.instruction list
OCaml

Innovation. Community. Security.