package wasm_of_ocaml-compiler

  1. Overview
  2. Docs

Module Wasm_of_ocaml_compiler.Code_generationSource

Sourcetype constant_global
Sourcetype 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;
}
Sourceval make_context : value_type:Wasm_ast.value_type -> context
Sourcetype 'a t
Sourcetype expression = Wasm_ast.expression t
Sourceval (let*) : 'a t -> ('a -> 'b t) -> 'b t
Sourceval return : 'a -> 'a t
Sourceval instr : Wasm_ast.instruction -> unit t
Sourceval seq : unit t -> expression -> expression
Sourceval expression_list : ('a -> expression) -> 'a list -> Wasm_ast.expression list t
Sourcemodule Arith : sig ... end
Sourceval cast : ?nullable:bool -> Wasm_ast.heap_type -> expression -> expression
Sourceval store : ?always:bool -> ?typ:Wasm_ast.value_type -> Wasm_ast.var -> expression -> unit t
Sourceval assign : Wasm_ast.var -> expression -> unit t
Sourceval drop : expression -> unit t
Sourceval push : expression -> unit t
Sourceval loop : Wasm_ast.func_type -> unit t -> unit t
Sourceval block : Wasm_ast.func_type -> unit t -> unit t
Sourceval block_expr : Wasm_ast.func_type -> unit t -> expression
Sourceval if_ : Wasm_ast.func_type -> expression -> unit t -> unit t -> unit t
Sourceval define_var : Wasm_ast.var -> expression -> unit t
Sourceval is_small_constant : Wasm_ast.expression -> bool t
Sourceval get_i31_value : Wasm_ast.var -> Wasm_ast.var option t
Sourceval no_event : unit t
Sourcetype type_def = {
  1. supertype : Wasm_ast.var option;
  2. final : bool;
  3. typ : Wasm_ast.str_type;
}
Sourceval register_type : string -> (unit -> type_def t) -> Wasm_ast.var t
Sourceval heap_type_sub : Wasm_ast.heap_type -> Wasm_ast.heap_type -> bool t
Sourceval register_import : ?import_module:string -> name:string -> Wasm_ast.import_desc -> Wasm_ast.var t
Sourceval register_global : Wasm_ast.var -> ?exported_name:string -> ?constant:bool -> Wasm_ast.global_type -> Wasm_ast.expression -> unit t
Sourceval register_data_segment : Js_of_ocaml_compiler.Code.Var.t -> string -> unit t
Sourceval register_init_code : unit t -> unit t
Sourceval init_code : context -> unit t
Sourceval register_string : string -> int t
Sourceval register_fragment : string -> (unit -> Js_of_ocaml_compiler.Javascript.expression) -> unit t
Sourceval get_context : context t
Sourceval is_closure : Js_of_ocaml_compiler.Code.Var.t -> bool t
Sourceval unit_name : string option t
Sourceval need_apply_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
Sourceval need_curry_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
Sourceval need_dummy_fun : cps:bool -> arity:int -> Js_of_ocaml_compiler.Code.Var.t t
Sourceval 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