package wasm_of_ocaml-compiler
Module Wasm_of_ocaml_compiler.Code_generationSource
Source
type context = {constants : (Js_of_ocaml_compiler.Code.Var.t, Wasm_ast.expression) Hashtbl.t;mutable data_segments : string Js_of_ocaml_compiler.Code.Var.Map.t;mutable constant_globals : constant_global Js_of_ocaml_compiler.Code.Var.Map.t;mutable other_fields : Wasm_ast.module_field list;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;type_names : (string, Js_of_ocaml_compiler.Code.Var.t) Hashtbl.t;types : (Js_of_ocaml_compiler.Code.Var.t, Wasm_ast.type_field) Hashtbl.t;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
*)mutable apply_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable cps_apply_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable curry_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable cps_curry_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable dummy_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable cps_dummy_funs : Js_of_ocaml_compiler.Code.Var.t Js_of_ocaml_compiler.Stdlib.IntMap.t;mutable init_code : Wasm_ast.instruction list;mutable string_count : int;mutable strings : string list;mutable string_index : int Js_of_ocaml_compiler.Stdlib.StringMap.t;mutable fragments : Js_of_ocaml_compiler.Javascript.expression Js_of_ocaml_compiler.Stdlib.StringMap.t;mutable globalized_variables : Js_of_ocaml_compiler.Code.Var.Set.t;value_type : Wasm_ast.value_type;mutable unit_name : string option;
}Source
val try_expr :
Wasm_ast.func_type ->
unit t ->
(Js_of_ocaml_compiler.Code.Var.t * int * Wasm_ast.value_type) list ->
expressionSource
val register_import :
?import_module:string ->
name:string ->
Wasm_ast.import_desc ->
Wasm_ast.var tSource
val register_global :
Wasm_ast.var ->
?exported_name:string ->
?constant:bool ->
Wasm_ast.global_type ->
Wasm_ast.expression ->
unit tSource
val register_fragment :
string ->
(unit -> Js_of_ocaml_compiler.Javascript.expression) ->
unit tSource
val set_closure_env :
Js_of_ocaml_compiler.Code.Var.t ->
Js_of_ocaml_compiler.Code.Var.t ->
unit tSource
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