@grain/binaryen.ml 0.9.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binaryen-archive/.gitignore +1 -0
- binaryen-archive/CHANGELOG.md +73 -0
- binaryen-archive/README.md +27 -3
- binaryen-archive/binaryen.opam +8 -8
- binaryen-archive/esy.lock/index.json +537 -460
- binaryen-archive/esy.lock/opam/{base.v0.14.1 → base.v0.14.2}/opam +4 -4
- binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +1 -1
- binaryen-archive/esy.lock/opam/{cppo.1.6.7 → cppo.1.6.8}/opam +4 -6
- binaryen-archive/esy.lock/opam/{csexp.1.4.0 → csexp.1.5.1}/opam +11 -9
- binaryen-archive/esy.lock/opam/{dune-build-info.2.8.2 → dune-build-info.2.9.1}/opam +5 -5
- binaryen-archive/esy.lock/opam/{dune-configurator.2.8.2 → dune-configurator.2.9.1}/opam +5 -5
- binaryen-archive/esy.lock/opam/{dune.2.8.2 → dune.2.9.1}/opam +4 -4
- binaryen-archive/esy.lock/opam/easy-format.1.3.2/opam +1 -1
- binaryen-archive/esy.lock/opam/{fix.20201120 → fix.20211231}/opam +7 -5
- binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam +54 -0
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +44 -0
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +45 -0
- binaryen-archive/esy.lock/opam/{menhir.20201216 → menhir.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/{menhirLib.20201216 → menhirLib.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/{menhirSdk.20201216 → menhirSdk.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam +39 -0
- binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.4.0 → ocaml-lsp-server.1.9.0}/opam +15 -12
- binaryen-archive/esy.lock/opam/{ocaml-migrate-parsetree.2.1.0 → ocaml-migrate-parsetree.2.3.0}/opam +13 -10
- binaryen-archive/esy.lock/opam/ocaml-version.3.4.0/opam +49 -0
- binaryen-archive/esy.lock/opam/ocamlbuild.0.14.0/opam +1 -1
- binaryen-archive/esy.lock/opam/{ocamlfind.1.8.1 → ocamlfind.1.9.1}/opam +19 -39
- binaryen-archive/esy.lock/opam/ocamlformat-rpc-lib.0.19.0/opam +40 -0
- binaryen-archive/esy.lock/opam/ocamlformat.0.18.0/opam +56 -0
- binaryen-archive/esy.lock/opam/{odoc.1.5.2 → odoc.1.5.3}/opam +12 -12
- binaryen-archive/esy.lock/opam/pp.1.1.2/opam +58 -0
- binaryen-archive/esy.lock/opam/ppx_derivers.1.2.1/opam +1 -1
- binaryen-archive/esy.lock/opam/ppx_yojson_conv_lib.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/{ppxlib.0.21.0 → ppxlib.0.22.2}/opam +40 -32
- binaryen-archive/esy.lock/opam/{re.1.9.0 → re.1.10.3}/opam +8 -4
- binaryen-archive/esy.lock/opam/result.1.5/opam +2 -2
- binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/spawn.v0.15.0/opam +56 -0
- binaryen-archive/esy.lock/opam/stdio.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/{topkg.1.0.3 → topkg.1.0.4}/opam +18 -22
- binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +42 -0
- binaryen-archive/esy.lock/opam/uucp.14.0.0/opam +41 -0
- binaryen-archive/esy.lock/opam/{uuseg.13.0.0 → uuseg.14.0.0}/opam +22 -28
- binaryen-archive/esy.lock/opam/yojson.1.7.0/opam +1 -1
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override/files/findlib-1.8.1.patch → opam__s__ocamlfind_opam__c__1.9.1_opam_override/files/findlib-1.9.1.patch} +0 -0
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override → opam__s__ocamlfind_opam__c__1.9.1_opam_override}/package.json +1 -1
- binaryen-archive/js/binaryen.es5.js +5 -0
- binaryen-archive/js/dune +1 -6
- binaryen-archive/js/element_segment.ml +33 -0
- binaryen-archive/js/export.ml +37 -0
- binaryen-archive/js/expression.ml +935 -177
- binaryen-archive/js/function.ml +31 -0
- binaryen-archive/js/global.ml +29 -0
- binaryen-archive/js/import.ml +24 -0
- binaryen-archive/js/literal.ml +8 -4
- binaryen-archive/js/module.ml +42 -46
- binaryen-archive/js/op.ml +9 -78
- binaryen-archive/js/settings.ml +60 -0
- binaryen-archive/js/table.ml +20 -3
- binaryen-archive/js/type.ml +3 -0
- binaryen-archive/package.json +14 -20
- binaryen-archive/src/binaryen_stubs_exports.c +78 -0
- binaryen-archive/src/binaryen_stubs_expressions.c +1300 -0
- binaryen-archive/src/binaryen_stubs_features.c +7 -0
- binaryen-archive/src/binaryen_stubs_functions.c +78 -0
- binaryen-archive/src/binaryen_stubs_globals.c +63 -0
- binaryen-archive/src/binaryen_stubs_imports.c +29 -0
- binaryen-archive/src/binaryen_stubs_memory.c +1 -1
- binaryen-archive/src/binaryen_stubs_modules.c +0 -122
- binaryen-archive/src/binaryen_stubs_ops.c +19 -173
- binaryen-archive/src/binaryen_stubs_settings.c +145 -0
- binaryen-archive/src/binaryen_stubs_tables.c +121 -7
- binaryen-archive/src/binaryen_stubs_types.c +18 -0
- binaryen-archive/src/dune +5 -44
- binaryen-archive/src/element_segment.ml +13 -0
- binaryen-archive/src/export.ml +33 -0
- binaryen-archive/src/expression.ml +805 -76
- binaryen-archive/src/function.ml +18 -0
- binaryen-archive/src/global.ml +14 -0
- binaryen-archive/src/import.ml +12 -0
- binaryen-archive/src/literal.ml +2 -2
- binaryen-archive/src/module.ml +64 -38
- binaryen-archive/src/ocaml_helpers.c +0 -8
- binaryen-archive/src/ocaml_helpers.h +2 -3
- binaryen-archive/src/op.ml +18 -131
- binaryen-archive/src/settings.ml +45 -0
- binaryen-archive/src/table.ml +26 -4
- binaryen-archive/src/type.ml +2 -0
- binaryen-archive/test/config/dune +8 -0
- binaryen-archive/test/config/ocamlopt_flags.ml +16 -0
- binaryen-archive/test/dune +4 -0
- binaryen-archive/test/test.expected +38 -3
- binaryen-archive/test/test.ml +90 -18
- binaryen-archive/virtual/dune +2 -2
- binaryen-archive/virtual/element_segment.mli +11 -0
- binaryen-archive/virtual/export.mli +22 -0
- binaryen-archive/virtual/expression.mli +389 -34
- binaryen-archive/virtual/function.mli +16 -0
- binaryen-archive/virtual/global.mli +12 -0
- binaryen-archive/virtual/import.mli +8 -0
- binaryen-archive/virtual/literal.mli +2 -2
- binaryen-archive/virtual/module.mli +25 -27
- binaryen-archive/virtual/op.mli +9 -53
- binaryen-archive/virtual/settings.mli +35 -0
- binaryen-archive/virtual/table.mli +19 -2
- binaryen-archive/virtual/type.mli +2 -0
- binaryen-archive/esy.lock/opam/conf-m4.1/opam +0 -22
- binaryen-archive/esy.lock/opam/dot-merlin-reader.4.1/opam +0 -30
- binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.9.1/opam +0 -40
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.9.0/opam +0 -30
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.9.0/opam +0 -31
- binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.3/opam +0 -29
- binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocaml-stub +0 -4
- binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocamlfind.install +0 -6
- binaryen-archive/esy.lock/opam/ocamlformat.0.15.1/opam +0 -41
- binaryen-archive/esy.lock/opam/tyxml.4.4.0/opam +0 -47
- binaryen-archive/esy.lock/opam/uucp.13.0.0/opam +0 -44
- binaryen-archive/esy.lock/overrides/opam__s__conf_m4_opam__c__1_opam_override/package.json +0 -6
- binaryen-archive/js/features.ml +0 -27
- binaryen-archive/js/function_table.ml +0 -13
- binaryen-archive/src/binaryen_stubs_function_tables.c +0 -25
- binaryen-archive/src/config/dune +0 -8
- binaryen-archive/src/config/library_flags.ml +0 -16
- binaryen-archive/src/features.ml +0 -49
- binaryen-archive/src/function_table.ml +0 -6
- binaryen-archive/vendor/binaryen-c.h +0 -2647
- binaryen-archive/vendor/js/index.es5.js +0 -5
- binaryen-archive/vendor/linux/libbinaryen.a +0 -0
- binaryen-archive/vendor/linux/libbinaryen.so +0 -0
- binaryen-archive/vendor/macosx/libbinaryen.a +0 -0
- binaryen-archive/vendor/macosx/libbinaryen.dylib +0 -0
- binaryen-archive/vendor/mingw64/libbinaryen.a +0 -0
- binaryen-archive/vendor/mingw64/libbinaryen.dll +0 -0
- binaryen-archive/vendor/wasm-delegations.h +0 -85
- binaryen-archive/virtual/features.mli +0 -23
- binaryen-archive/virtual/function_table.mli +0 -4
binaryen-archive/js/function.ml
CHANGED
|
@@ -23,7 +23,38 @@ let set_debug_location func expr file line column =
|
|
|
23
23
|
let get_function wasm_mod name =
|
|
24
24
|
meth_call wasm_mod "getFunction" [| inject (string name) |]
|
|
25
25
|
|
|
26
|
+
let get_function_by_index wasm_mod index =
|
|
27
|
+
meth_call wasm_mod "getFunctionByIndex" [| inject index |]
|
|
28
|
+
|
|
26
29
|
let remove_function wasm_mod name =
|
|
27
30
|
meth_call wasm_mod "removeFunction" [| inject (string name) |]
|
|
28
31
|
|
|
29
32
|
let get_num_functions wasm_mod = meth_call wasm_mod "getNumFunctions" [||]
|
|
33
|
+
|
|
34
|
+
let get_name func =
|
|
35
|
+
to_string
|
|
36
|
+
(meth_call global ##. binaryen ##. Function "getName" [| inject func |])
|
|
37
|
+
|
|
38
|
+
let get_params func =
|
|
39
|
+
meth_call global ##. binaryen ##. Function "getParams" [| inject func |]
|
|
40
|
+
|
|
41
|
+
let get_results func =
|
|
42
|
+
meth_call global ##. binaryen ##. Function "getResults" [| inject func |]
|
|
43
|
+
|
|
44
|
+
let get_num_vars func =
|
|
45
|
+
meth_call global ##. binaryen ##. Function "getNumVars" [| inject func |]
|
|
46
|
+
|
|
47
|
+
let get_var func index =
|
|
48
|
+
meth_call
|
|
49
|
+
global ##. binaryen ##. Function
|
|
50
|
+
"getVar"
|
|
51
|
+
[| inject func; inject index |]
|
|
52
|
+
|
|
53
|
+
let get_body func =
|
|
54
|
+
meth_call global ##. binaryen ##. Function "getBody" [| inject func |]
|
|
55
|
+
|
|
56
|
+
let set_body func body =
|
|
57
|
+
meth_call
|
|
58
|
+
global ##. binaryen ##. Function
|
|
59
|
+
"setBody"
|
|
60
|
+
[| inject func; inject body |]
|
binaryen-archive/js/global.ml
CHANGED
|
@@ -17,3 +17,32 @@ let get_global wasm_mod name =
|
|
|
17
17
|
|
|
18
18
|
let remove_global wasm_mod name =
|
|
19
19
|
meth_call wasm_mod "removeGlobal" [| inject (string name) |]
|
|
20
|
+
|
|
21
|
+
let get_num_globals wasm_mod = meth_call wasm_mod "getNumGlobals" [||]
|
|
22
|
+
|
|
23
|
+
let get_global_by_index wasm_mod index =
|
|
24
|
+
meth_call wasm_mod "getGlobalByIndex" [| inject index |]
|
|
25
|
+
|
|
26
|
+
let get_name global_ =
|
|
27
|
+
let global_info =
|
|
28
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
29
|
+
in
|
|
30
|
+
to_string (get global_info "name")
|
|
31
|
+
|
|
32
|
+
let get_type global_ =
|
|
33
|
+
let global_info =
|
|
34
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
35
|
+
in
|
|
36
|
+
get global_info "type"
|
|
37
|
+
|
|
38
|
+
let is_mutable global_ =
|
|
39
|
+
let global_info =
|
|
40
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
41
|
+
in
|
|
42
|
+
to_bool (get global_info "mutable")
|
|
43
|
+
|
|
44
|
+
let get_init_expr global_ =
|
|
45
|
+
let global_info =
|
|
46
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
47
|
+
in
|
|
48
|
+
get global_info "init"
|
binaryen-archive/js/import.ml
CHANGED
|
@@ -43,3 +43,27 @@ let add_global_import wasm_mod internal_name external_module_name
|
|
|
43
43
|
inject typ;
|
|
44
44
|
inject (if is_mut then 1 else 0);
|
|
45
45
|
|]
|
|
46
|
+
|
|
47
|
+
let function_import_get_module func =
|
|
48
|
+
let func_info =
|
|
49
|
+
meth_call global##.binaryen "getFunctionInfo" [| inject func |]
|
|
50
|
+
in
|
|
51
|
+
to_string (get func_info "module")
|
|
52
|
+
|
|
53
|
+
let global_import_get_module global_ =
|
|
54
|
+
let global_info =
|
|
55
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
56
|
+
in
|
|
57
|
+
to_string (get global_info "module")
|
|
58
|
+
|
|
59
|
+
let function_import_get_base func =
|
|
60
|
+
let func_info =
|
|
61
|
+
meth_call global##.binaryen "getFunctionInfo" [| inject func |]
|
|
62
|
+
in
|
|
63
|
+
to_string (get func_info "base")
|
|
64
|
+
|
|
65
|
+
let global_import_get_base global_ =
|
|
66
|
+
let global_info =
|
|
67
|
+
meth_call global##.binaryen "getGlobalInfo" [| inject global_ |]
|
|
68
|
+
in
|
|
69
|
+
to_string (get global_info "base")
|
binaryen-archive/js/literal.ml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(* This is a hack around Binaryen's stack allocations *)
|
|
2
2
|
type jsoo =
|
|
3
3
|
| Int32 of int32
|
|
4
|
-
| Int64 of
|
|
4
|
+
| Int64 of int32 * int32
|
|
5
5
|
| Float32Bits of int32
|
|
6
|
-
| Float64Bits of
|
|
6
|
+
| Float64Bits of int32 * int32
|
|
7
7
|
| Float32 of float
|
|
8
8
|
| Float64 of float
|
|
9
9
|
|
|
@@ -11,11 +11,15 @@ type t = jsoo
|
|
|
11
11
|
|
|
12
12
|
let int32 value = Int32 value
|
|
13
13
|
|
|
14
|
-
let int64 value =
|
|
14
|
+
let int64 value =
|
|
15
|
+
Int64
|
|
16
|
+
(Int64.to_int32 value, Int64.to_int32 (Int64.shift_right_logical value 32))
|
|
15
17
|
|
|
16
18
|
let float32_bits value = Float32Bits value
|
|
17
19
|
|
|
18
|
-
let float64_bits value =
|
|
20
|
+
let float64_bits value =
|
|
21
|
+
Float64Bits
|
|
22
|
+
(Int64.to_int32 value, Int64.to_int32 (Int64.shift_right_logical value 32))
|
|
19
23
|
|
|
20
24
|
let float32 value = Float32 value
|
|
21
25
|
|
binaryen-archive/js/module.ml
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
open Js_of_ocaml.Js
|
|
2
2
|
open Js_of_ocaml.Js.Unsafe
|
|
3
3
|
|
|
4
|
+
module Feature = struct
|
|
5
|
+
type t = int
|
|
6
|
+
|
|
7
|
+
let mvp : t = global ##. binaryen ##. Features ##. MVP
|
|
8
|
+
|
|
9
|
+
let atomics : t = global ##. binaryen ##. Features ##. Atomics
|
|
10
|
+
|
|
11
|
+
let bulk_memory : t = global ##. binaryen ##. Features ##. BulkMemory
|
|
12
|
+
|
|
13
|
+
let mutable_globals : t = global ##. binaryen ##. Features ##. MutableGlobals
|
|
14
|
+
|
|
15
|
+
let nontrapping_fp_to_int : t =
|
|
16
|
+
global ##. binaryen ##. Features ##. NontrappingFPToInt
|
|
17
|
+
|
|
18
|
+
let sign_ext : t = global ##. binaryen ##. Features ##. SignExt
|
|
19
|
+
|
|
20
|
+
let simd128 : t = global ##. binaryen ##. Features ##. SIMD128
|
|
21
|
+
|
|
22
|
+
let exception_handling : t =
|
|
23
|
+
global ##. binaryen ##. Features ##. ExceptionHandling
|
|
24
|
+
|
|
25
|
+
let tail_call : t = global ##. binaryen ##. Features ##. TailCall
|
|
26
|
+
|
|
27
|
+
let reference_types : t = global ##. binaryen ##. Features ##. ReferenceTypes
|
|
28
|
+
|
|
29
|
+
let multivalue : t = global ##. binaryen ##. Features ##. Multivalue
|
|
30
|
+
|
|
31
|
+
let all : t = global ##. binaryen ##. Features ##. All
|
|
32
|
+
end
|
|
33
|
+
|
|
4
34
|
external u8a_to_bytes : 'a -> bytes = "caml_bytes_of_array"
|
|
5
35
|
|
|
6
36
|
(* TODO: Verify this converts to bytes correctly? *)
|
|
@@ -36,56 +66,22 @@ let validate wasm_mod = meth_call wasm_mod "validate" [||]
|
|
|
36
66
|
|
|
37
67
|
let optimize wasm_mod = meth_call wasm_mod "optimize" [||]
|
|
38
68
|
|
|
69
|
+
let get_features wasm_mod =
|
|
70
|
+
let features_int = meth_call wasm_mod "getFeatures" [||] in
|
|
71
|
+
let rec split_features = function
|
|
72
|
+
| 0 -> []
|
|
73
|
+
| feature when features_int land feature > 0 ->
|
|
74
|
+
feature :: split_features (feature lsr 1)
|
|
75
|
+
| feature -> split_features (feature lsr 1)
|
|
76
|
+
in
|
|
77
|
+
(* Support 32-bit OCaml where integers are 31 bits *)
|
|
78
|
+
(* This supports up to 31 Binaryen features *)
|
|
79
|
+
split_features 0x40000000
|
|
80
|
+
|
|
39
81
|
let set_features wasm_mod features =
|
|
40
82
|
meth_call wasm_mod "setFeatures"
|
|
41
83
|
[| inject (List.fold_left ( lor ) 0 features) |]
|
|
42
84
|
|
|
43
|
-
let get_optimize_level () = meth_call global##.binaryen "getOptimizeLevel" [||]
|
|
44
|
-
|
|
45
|
-
let set_optimize_level level =
|
|
46
|
-
meth_call global##.binaryen "setOptimizeLevel" [| inject level |]
|
|
47
|
-
|
|
48
|
-
let get_shrink_level () = meth_call global##.binaryen "getShrinkLevel" [||]
|
|
49
|
-
|
|
50
|
-
let set_shrink_level level =
|
|
51
|
-
meth_call global##.binaryen "setShrinkLevel" [| inject level |]
|
|
52
|
-
|
|
53
|
-
let get_debug_info () = meth_call global##.binaryen "getDebugInfo" [||]
|
|
54
|
-
|
|
55
|
-
let set_debug_info on =
|
|
56
|
-
meth_call global##.binaryen "setDebugInfo" [| inject on |]
|
|
57
|
-
|
|
58
|
-
let get_low_memory_unused () =
|
|
59
|
-
meth_call global##.binaryen "getLowMemoryUnused" [||]
|
|
60
|
-
|
|
61
|
-
let set_low_memory_unused on =
|
|
62
|
-
meth_call global##.binaryen "setLowMemoryUnused" [| inject on |]
|
|
63
|
-
|
|
64
|
-
let get_pass_argument key =
|
|
65
|
-
meth_call global##.binaryen "getPassArgument" [| inject (string key) |]
|
|
66
|
-
|
|
67
|
-
let set_pass_argument key value =
|
|
68
|
-
meth_call global##.binaryen "setPassArgument"
|
|
69
|
-
[| inject (string key); inject (string value) |]
|
|
70
|
-
|
|
71
|
-
let get_always_inline_max_size () =
|
|
72
|
-
meth_call global##.binaryen "getAlwaysInlineMaxSize" [||]
|
|
73
|
-
|
|
74
|
-
let set_always_inline_max_size size =
|
|
75
|
-
meth_call global##.binaryen "setAlwaysInlineMaxSize" [| inject size |]
|
|
76
|
-
|
|
77
|
-
let get_flexible_inline_max_size () =
|
|
78
|
-
meth_call global##.binaryen "getFlexibleInlineMaxSize" [||]
|
|
79
|
-
|
|
80
|
-
let set_flexible_inline_max_size size =
|
|
81
|
-
meth_call global##.binaryen "setFlexibleInlineMaxSize" [| inject size |]
|
|
82
|
-
|
|
83
|
-
let get_one_caller_inline_max_size () =
|
|
84
|
-
meth_call global##.binaryen "getOneCallerInlineMaxSize" [||]
|
|
85
|
-
|
|
86
|
-
let set_one_caller_inline_max_size size =
|
|
87
|
-
meth_call global##.binaryen "setOneCallerInlineMaxSize" [| inject size |]
|
|
88
|
-
|
|
89
85
|
let run_passes wasm_mod passes =
|
|
90
86
|
meth_call wasm_mod "runPasses"
|
|
91
87
|
[| inject (array (Array.of_list (List.map string passes))) |]
|
binaryen-archive/js/op.ml
CHANGED
|
@@ -471,9 +471,6 @@ let abs_vec_i8x16 : t = global ##. binaryen ##. Operations ##. AbsVecI8x16
|
|
|
471
471
|
|
|
472
472
|
let neg_vec_i8x16 : t = global ##. binaryen ##. Operations ##. NegVecI8x16
|
|
473
473
|
|
|
474
|
-
let any_true_vec_i8x16 : t =
|
|
475
|
-
global ##. binaryen ##. Operations ##. AnyTrueVecI8x16
|
|
476
|
-
|
|
477
474
|
let all_true_vec_i8x16 : t =
|
|
478
475
|
global ##. binaryen ##. Operations ##. AllTrueVecI8x16
|
|
479
476
|
|
|
@@ -502,8 +499,6 @@ let sub_sat_s_vec_i8x16 : t =
|
|
|
502
499
|
let sub_sat_u_vec_i8x16 : t =
|
|
503
500
|
global ##. binaryen ##. Operations ##. SubSatUVecI8x16
|
|
504
501
|
|
|
505
|
-
let mul_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MulVecI8x16
|
|
506
|
-
|
|
507
502
|
let min_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MinSVecI8x16
|
|
508
503
|
|
|
509
504
|
let min_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MinUVecI8x16
|
|
@@ -518,9 +513,6 @@ let abs_vec_i16x8 : t = global ##. binaryen ##. Operations ##. AbsVecI16x8
|
|
|
518
513
|
|
|
519
514
|
let neg_vec_i16x8 : t = global ##. binaryen ##. Operations ##. NegVecI16x8
|
|
520
515
|
|
|
521
|
-
let any_true_vec_i16x8 : t =
|
|
522
|
-
global ##. binaryen ##. Operations ##. AnyTrueVecI16x8
|
|
523
|
-
|
|
524
516
|
let all_true_vec_i16x8 : t =
|
|
525
517
|
global ##. binaryen ##. Operations ##. AllTrueVecI16x8
|
|
526
518
|
|
|
@@ -565,9 +557,6 @@ let abs_vec_i32x4 : t = global ##. binaryen ##. Operations ##. AbsVecI32x4
|
|
|
565
557
|
|
|
566
558
|
let neg_vec_i32x4 : t = global ##. binaryen ##. Operations ##. NegVecI32x4
|
|
567
559
|
|
|
568
|
-
let any_true_vec_i32x4 : t =
|
|
569
|
-
global ##. binaryen ##. Operations ##. AnyTrueVecI32x4
|
|
570
|
-
|
|
571
560
|
let all_true_vec_i32x4 : t =
|
|
572
561
|
global ##. binaryen ##. Operations ##. AllTrueVecI32x4
|
|
573
562
|
|
|
@@ -617,10 +606,6 @@ let neg_vec_f32x4 : t = global ##. binaryen ##. Operations ##. NegVecF32x4
|
|
|
617
606
|
|
|
618
607
|
let sqrt_vec_f32x4 : t = global ##. binaryen ##. Operations ##. SqrtVecF32x4
|
|
619
608
|
|
|
620
|
-
let qfma_vec_f32x4 : t = global ##. binaryen ##. Operations ##. QFMAVecF32x4
|
|
621
|
-
|
|
622
|
-
let qfms_vec_f32x4 : t = global ##. binaryen ##. Operations ##. QFMSVecF32x4
|
|
623
|
-
|
|
624
609
|
let add_vec_f32x4 : t = global ##. binaryen ##. Operations ##. AddVecF32x4
|
|
625
610
|
|
|
626
611
|
let sub_vec_f32x4 : t = global ##. binaryen ##. Operations ##. SubVecF32x4
|
|
@@ -652,10 +637,6 @@ let neg_vec_f64x2 : t = global ##. binaryen ##. Operations ##. NegVecF64x2
|
|
|
652
637
|
|
|
653
638
|
let sqrt_vec_f64x2 : t = global ##. binaryen ##. Operations ##. SqrtVecF64x2
|
|
654
639
|
|
|
655
|
-
let qfma_vec_f64x2 : t = global ##. binaryen ##. Operations ##. QFMAVecF64x2
|
|
656
|
-
|
|
657
|
-
let qfms_vec_f64x2 : t = global ##. binaryen ##. Operations ##. QFMSVecF64x2
|
|
658
|
-
|
|
659
640
|
let add_vec_f64x2 : t = global ##. binaryen ##. Operations ##. AddVecF64x2
|
|
660
641
|
|
|
661
642
|
let sub_vec_f64x2 : t = global ##. binaryen ##. Operations ##. SubVecF64x2
|
|
@@ -687,54 +668,12 @@ let trunc_sat_s_vec_f32x4_to_vec_i32x4 : t =
|
|
|
687
668
|
let trunc_sat_u_vec_f32x4_to_vec_i32x4 : t =
|
|
688
669
|
global ##. binaryen ##. Operations ##. TruncSatUVecF32x4ToVecI32x4
|
|
689
670
|
|
|
690
|
-
let trunc_sat_s_vec_f64x2_to_vec_i64x2 : t =
|
|
691
|
-
global ##. binaryen ##. Operations ##. TruncSatSVecF64x2ToVecI64x2
|
|
692
|
-
|
|
693
|
-
let trunc_sat_u_vec_f64x2_to_vec_i64x2 : t =
|
|
694
|
-
global ##. binaryen ##. Operations ##. TruncSatUVecF64x2ToVecI64x2
|
|
695
|
-
|
|
696
671
|
let convert_s_vec_i32x4_to_vec_f32x4 : t =
|
|
697
672
|
global ##. binaryen ##. Operations ##. ConvertSVecI32x4ToVecF32x4
|
|
698
673
|
|
|
699
674
|
let convert_u_vec_i32x4_to_vec_f32x4 : t =
|
|
700
675
|
global ##. binaryen ##. Operations ##. ConvertUVecI32x4ToVecF32x4
|
|
701
676
|
|
|
702
|
-
let convert_s_vec_i64x2_to_vec_f64x2 : t =
|
|
703
|
-
global ##. binaryen ##. Operations ##. ConvertSVecI64x2ToVecF64x2
|
|
704
|
-
|
|
705
|
-
let convert_u_vec_i64x2_to_vec_f64x2 : t =
|
|
706
|
-
global ##. binaryen ##. Operations ##. ConvertUVecI64x2ToVecF64x2
|
|
707
|
-
|
|
708
|
-
let load_splat_vec8x16 : t =
|
|
709
|
-
global ##. binaryen ##. Operations ##. LoadSplatVec8x16
|
|
710
|
-
|
|
711
|
-
let load_splat_vec16x8 : t =
|
|
712
|
-
global ##. binaryen ##. Operations ##. LoadSplatVec16x8
|
|
713
|
-
|
|
714
|
-
let load_splat_vec32x4 : t =
|
|
715
|
-
global ##. binaryen ##. Operations ##. LoadSplatVec32x4
|
|
716
|
-
|
|
717
|
-
let load_splat_vec64x2 : t =
|
|
718
|
-
global ##. binaryen ##. Operations ##. LoadSplatVec64x2
|
|
719
|
-
|
|
720
|
-
let load_ext_s_vec8x8_to_vec_i16x8 : t =
|
|
721
|
-
global ##. binaryen ##. Operations ##. LoadExtSVec8x8ToVecI16x8
|
|
722
|
-
|
|
723
|
-
let load_ext_u_vec8x8_to_vec_i16x8 : t =
|
|
724
|
-
global ##. binaryen ##. Operations ##. LoadExtUVec8x8ToVecI16x8
|
|
725
|
-
|
|
726
|
-
let load_ext_s_vec16x4_to_vec_i32x4 : t =
|
|
727
|
-
global ##. binaryen ##. Operations ##. LoadExtSVec16x4ToVecI32x4
|
|
728
|
-
|
|
729
|
-
let load_ext_u_vec16x4_to_vec_i32x4 : t =
|
|
730
|
-
global ##. binaryen ##. Operations ##. LoadExtUVec16x4ToVecI32x4
|
|
731
|
-
|
|
732
|
-
let load_ext_s_vec32x2_to_vec_i64x2 : t =
|
|
733
|
-
global ##. binaryen ##. Operations ##. LoadExtSVec32x2ToVecI64x2
|
|
734
|
-
|
|
735
|
-
let load_ext_u_vec32x2_to_vec_i64x2 : t =
|
|
736
|
-
global ##. binaryen ##. Operations ##. LoadExtUVec32x2ToVecI64x2
|
|
737
|
-
|
|
738
677
|
let narrow_s_vec_i16x8_to_vec_i8x16 : t =
|
|
739
678
|
global ##. binaryen ##. Operations ##. NarrowSVecI16x8ToVecI8x16
|
|
740
679
|
|
|
@@ -747,28 +686,20 @@ let narrow_s_vec_i32x4_to_vec_i16x8 : t =
|
|
|
747
686
|
let narrow_u_vec_i32x4_to_vec_i16x8 : t =
|
|
748
687
|
global ##. binaryen ##. Operations ##. NarrowUVecI32x4ToVecI16x8
|
|
749
688
|
|
|
750
|
-
let
|
|
751
|
-
global ##. binaryen ##. Operations ##. WidenLowSVecI8x16ToVecI16x8
|
|
689
|
+
let swizzle_vec8x16 : t = global ##. binaryen ##. Operations ##. SwizzleVec8x16
|
|
752
690
|
|
|
753
|
-
let
|
|
754
|
-
global ##. binaryen ##. Operations ##. WidenHighSVecI8x16ToVecI16x8
|
|
691
|
+
let ref_is_null : t = global ##. binaryen ##. Operations ##. RefIsNull
|
|
755
692
|
|
|
756
|
-
let
|
|
757
|
-
global ##. binaryen ##. Operations ##. WidenLowUVecI8x16ToVecI16x8
|
|
693
|
+
let ref_is_func : t = global ##. binaryen ##. Operations ##. RefIsFunc
|
|
758
694
|
|
|
759
|
-
let
|
|
760
|
-
global ##. binaryen ##. Operations ##. WidenHighUVecI8x16ToVecI16x8
|
|
695
|
+
let ref_is_data : t = global ##. binaryen ##. Operations ##. RefIsData
|
|
761
696
|
|
|
762
|
-
let
|
|
763
|
-
global ##. binaryen ##. Operations ##. WidenLowSVecI16x8ToVecI32x4
|
|
697
|
+
let ref_is_i31 : t = global ##. binaryen ##. Operations ##. RefIsI31
|
|
764
698
|
|
|
765
|
-
let
|
|
766
|
-
global ##. binaryen ##. Operations ##. WidenHighSVecI16x8ToVecI32x4
|
|
699
|
+
let ref_as_non_null : t = global ##. binaryen ##. Operations ##. RefAsNonNull
|
|
767
700
|
|
|
768
|
-
let
|
|
769
|
-
global ##. binaryen ##. Operations ##. WidenLowUVecI16x8ToVecI32x4
|
|
701
|
+
let ref_as_func : t = global ##. binaryen ##. Operations ##. RefAsFunc
|
|
770
702
|
|
|
771
|
-
let
|
|
772
|
-
global ##. binaryen ##. Operations ##. WidenHighUVecI16x8ToVecI32x4
|
|
703
|
+
let ref_as_data : t = global ##. binaryen ##. Operations ##. RefAsData
|
|
773
704
|
|
|
774
|
-
let
|
|
705
|
+
let ref_as_i31 : t = global ##. binaryen ##. Operations ##. RefAsI31
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
open Js_of_ocaml.Js
|
|
2
|
+
open Js_of_ocaml.Js.Unsafe
|
|
3
|
+
|
|
4
|
+
let get_optimize_level () = meth_call global##.binaryen "getOptimizeLevel" [||]
|
|
5
|
+
|
|
6
|
+
let set_optimize_level level =
|
|
7
|
+
meth_call global##.binaryen "setOptimizeLevel" [| inject level |]
|
|
8
|
+
|
|
9
|
+
let get_shrink_level () = meth_call global##.binaryen "getShrinkLevel" [||]
|
|
10
|
+
|
|
11
|
+
let set_shrink_level level =
|
|
12
|
+
meth_call global##.binaryen "setShrinkLevel" [| inject level |]
|
|
13
|
+
|
|
14
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
15
|
+
let get_debug_info () = meth_call global##.binaryen "_BinaryenGetDebugInfo" [||]
|
|
16
|
+
|
|
17
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
18
|
+
let set_debug_info on =
|
|
19
|
+
meth_call global##.binaryen "_BinaryenSetDebugInfo" [| inject on |]
|
|
20
|
+
|
|
21
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
22
|
+
let get_low_memory_unused () =
|
|
23
|
+
meth_call global##.binaryen "_BinaryenGetLowMemoryUnused" [||]
|
|
24
|
+
|
|
25
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
26
|
+
let set_low_memory_unused on =
|
|
27
|
+
meth_call global##.binaryen "_BinaryenSetLowMemoryUnused" [| inject on |]
|
|
28
|
+
|
|
29
|
+
let get_pass_argument key =
|
|
30
|
+
meth_call global##.binaryen "getPassArgument" [| inject (string key) |]
|
|
31
|
+
|
|
32
|
+
let set_pass_argument key value =
|
|
33
|
+
meth_call global##.binaryen "setPassArgument"
|
|
34
|
+
[| inject (string key); inject (string value) |]
|
|
35
|
+
|
|
36
|
+
let get_always_inline_max_size () =
|
|
37
|
+
meth_call global##.binaryen "getAlwaysInlineMaxSize" [||]
|
|
38
|
+
|
|
39
|
+
let set_always_inline_max_size size =
|
|
40
|
+
meth_call global##.binaryen "setAlwaysInlineMaxSize" [| inject size |]
|
|
41
|
+
|
|
42
|
+
let get_flexible_inline_max_size () =
|
|
43
|
+
meth_call global##.binaryen "getFlexibleInlineMaxSize" [||]
|
|
44
|
+
|
|
45
|
+
let set_flexible_inline_max_size size =
|
|
46
|
+
meth_call global##.binaryen "setFlexibleInlineMaxSize" [| inject size |]
|
|
47
|
+
|
|
48
|
+
let get_one_caller_inline_max_size () =
|
|
49
|
+
meth_call global##.binaryen "getOneCallerInlineMaxSize" [||]
|
|
50
|
+
|
|
51
|
+
let set_one_caller_inline_max_size size =
|
|
52
|
+
meth_call global##.binaryen "setOneCallerInlineMaxSize" [| inject size |]
|
|
53
|
+
|
|
54
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
55
|
+
let set_colors_enabled enabled =
|
|
56
|
+
meth_call global##.binaryen "_BinaryenSetColorsEnabled" [| inject enabled |]
|
|
57
|
+
|
|
58
|
+
(* Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO *)
|
|
59
|
+
let are_colors_enabled () =
|
|
60
|
+
meth_call global##.binaryen "_BinaryenAreColorsEnabled" [||]
|
binaryen-archive/js/table.ml
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
open Js_of_ocaml.Js
|
|
2
2
|
open Js_of_ocaml.Js.Unsafe
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type t = int
|
|
5
|
+
|
|
6
|
+
let add_table wasm_mod name initial maximum =
|
|
5
7
|
meth_call wasm_mod "addTable"
|
|
8
|
+
[| inject (string name); inject initial; inject maximum |]
|
|
9
|
+
|
|
10
|
+
let add_active_element_segment wasm_mod table name funcnames offset =
|
|
11
|
+
meth_call wasm_mod "addActiveElementSegment"
|
|
6
12
|
[|
|
|
13
|
+
inject (string table);
|
|
7
14
|
inject (string name);
|
|
8
|
-
inject initial;
|
|
9
|
-
inject maximum;
|
|
10
15
|
inject (array (Array.of_list (List.map string funcnames)));
|
|
11
16
|
inject offset;
|
|
12
17
|
|]
|
|
18
|
+
|
|
19
|
+
let remove_element_segment wasm_mod name =
|
|
20
|
+
meth_call wasm_mod "removeElementSegment" [| inject (string name) |]
|
|
21
|
+
|
|
22
|
+
let get_num_element_segments wasm_mod =
|
|
23
|
+
meth_call wasm_mod "getNumElementSegments" [||]
|
|
24
|
+
|
|
25
|
+
let get_element_segment wasm_mod name =
|
|
26
|
+
meth_call wasm_mod "getElementSegment" [| inject (string name) |]
|
|
27
|
+
|
|
28
|
+
let get_element_segment_by_index wasm_mod index =
|
|
29
|
+
meth_call wasm_mod "getElementSegmentByIndex" [| inject index |]
|
binaryen-archive/js/type.ml
CHANGED
binaryen-archive/package.json
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grain/binaryen.ml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "OCaml bindings for Binaryen.",
|
|
5
5
|
"author": "Oscar Spencer <oscar@grain-lang.org>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"ocaml": ">= 4.
|
|
9
|
-
"@
|
|
10
|
-
"@opam/dune
|
|
11
|
-
"@opam/
|
|
12
|
-
"@opam/js_of_ocaml
|
|
8
|
+
"ocaml": ">= 4.12.0 < 4.13.0",
|
|
9
|
+
"@grain/libbinaryen": "^101.0.1",
|
|
10
|
+
"@opam/dune": "^2.9.1",
|
|
11
|
+
"@opam/dune-configurator": "^2.9.1",
|
|
12
|
+
"@opam/js_of_ocaml": "^3.10.0",
|
|
13
|
+
"@opam/js_of_ocaml-ppx": "^3.10.0"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
|
-
"@opam/js_of_ocaml-compiler": "^3.
|
|
16
|
-
"@opam/ocamlformat": "
|
|
17
|
-
"@opam/ocaml-lsp-server": "^1.
|
|
16
|
+
"@opam/js_of_ocaml-compiler": "^3.10.0",
|
|
17
|
+
"@opam/ocamlformat": "0.18.0",
|
|
18
|
+
"@opam/ocaml-lsp-server": "^1.8.2"
|
|
18
19
|
},
|
|
19
20
|
"esy": {
|
|
20
|
-
"build": "dune build -p binaryen"
|
|
21
|
-
"buildEnv": {
|
|
22
|
-
"DUNE_BUILD_DIR": "#{self.target_dir}",
|
|
23
|
-
"PATH": "#{os == 'windows' ? '/usr/x86_64-w64-mingw32/sys-root/mingw/bin' : '' : $PATH }"
|
|
24
|
-
},
|
|
25
|
-
"exportedEnv": {
|
|
26
|
-
"PATH": {
|
|
27
|
-
"val": "#{os == 'windows' ? '/usr/x86_64-w64-mingw32/sys-root/mingw/bin' : '' : $PATH }",
|
|
28
|
-
"scope": "global"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
21
|
+
"build": "dune build -p binaryen"
|
|
31
22
|
},
|
|
32
23
|
"scripts": {
|
|
33
24
|
"test": "esy b dune runtest",
|
|
@@ -36,6 +27,9 @@
|
|
|
36
27
|
"installConfig": {
|
|
37
28
|
"pnp": false
|
|
38
29
|
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
39
33
|
"keywords": [
|
|
40
34
|
"binaryen",
|
|
41
35
|
"ocaml"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#include <caml/mlvalues.h>
|
|
3
3
|
#include <caml/fail.h>
|
|
4
4
|
#include <caml/memory.h>
|
|
5
|
+
#include <caml/alloc.h>
|
|
5
6
|
|
|
6
7
|
#include "binaryen-c.h"
|
|
7
8
|
#include "ocaml_helpers.h"
|
|
@@ -55,6 +56,15 @@ caml_binaryen_add_global_export(value _module, value _internalName, value _exter
|
|
|
55
56
|
CAMLreturn(alloc_BinaryenExportRef(exp));
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
CAMLprim value
|
|
60
|
+
caml_binaryen_get_export(value _module, value _externalName) {
|
|
61
|
+
CAMLparam2(_module, _externalName);
|
|
62
|
+
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
|
|
63
|
+
char* externalName = Safe_String_val(_externalName);
|
|
64
|
+
BinaryenExportRef exp = BinaryenGetExport(module, externalName);
|
|
65
|
+
CAMLreturn(alloc_BinaryenExportRef(exp));
|
|
66
|
+
}
|
|
67
|
+
|
|
58
68
|
CAMLprim value
|
|
59
69
|
caml_binaryen_remove_export(value _module, value _externalName) {
|
|
60
70
|
CAMLparam2(_module, _externalName);
|
|
@@ -63,3 +73,71 @@ caml_binaryen_remove_export(value _module, value _externalName) {
|
|
|
63
73
|
BinaryenRemoveExport(module, externalName);
|
|
64
74
|
CAMLreturn(Val_unit);
|
|
65
75
|
}
|
|
76
|
+
|
|
77
|
+
CAMLprim value
|
|
78
|
+
caml_binaryen_get_num_exports(value _module) {
|
|
79
|
+
CAMLparam1(_module);
|
|
80
|
+
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
|
|
81
|
+
BinaryenIndex num = BinaryenGetNumExports(module);
|
|
82
|
+
CAMLreturn(Val_int(num));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
CAMLprim value
|
|
86
|
+
caml_binaryen_get_export_by_index(value _module, value _index) {
|
|
87
|
+
CAMLparam2(_module, _index);
|
|
88
|
+
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
|
|
89
|
+
BinaryenIndex index = Int_val(_index);
|
|
90
|
+
BinaryenExportRef exp = BinaryenGetExportByIndex(module, index);
|
|
91
|
+
CAMLreturn(alloc_BinaryenExportRef(exp));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
CAMLprim value
|
|
95
|
+
caml_binaryen_export_get_name(value _exp) {
|
|
96
|
+
CAMLparam1(_exp);
|
|
97
|
+
BinaryenExportRef exp = BinaryenExportRef_val(_exp);
|
|
98
|
+
CAMLreturn(caml_copy_string(BinaryenExportGetName(exp)));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
CAMLprim value
|
|
102
|
+
caml_binaryen_export_get_value(value _exp) {
|
|
103
|
+
CAMLparam1(_exp);
|
|
104
|
+
BinaryenExportRef exp = BinaryenExportRef_val(_exp);
|
|
105
|
+
CAMLreturn(caml_copy_string(BinaryenExportGetValue(exp)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
CAMLprim value
|
|
109
|
+
caml_binaryen_external_function(value _unit) {
|
|
110
|
+
CAMLparam1(_unit);
|
|
111
|
+
CAMLreturn(Val_int(BinaryenExternalFunction()));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
CAMLprim value
|
|
115
|
+
caml_binaryen_external_table(value _unit) {
|
|
116
|
+
CAMLparam1(_unit);
|
|
117
|
+
CAMLreturn(Val_int(BinaryenExternalTable()));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
CAMLprim value
|
|
121
|
+
caml_binaryen_external_memory(value _unit) {
|
|
122
|
+
CAMLparam1(_unit);
|
|
123
|
+
CAMLreturn(Val_int(BinaryenExternalMemory()));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
CAMLprim value
|
|
127
|
+
caml_binaryen_external_global(value _unit) {
|
|
128
|
+
CAMLparam1(_unit);
|
|
129
|
+
CAMLreturn(Val_int(BinaryenExternalGlobal()));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
CAMLprim value
|
|
133
|
+
caml_binaryen_external_event(value _unit) {
|
|
134
|
+
CAMLparam1(_unit);
|
|
135
|
+
CAMLreturn(Val_int(BinaryenExternalEvent()));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
CAMLprim value
|
|
139
|
+
caml_binaryen_export_get_kind(value _exp) {
|
|
140
|
+
CAMLparam1(_exp);
|
|
141
|
+
BinaryenExportRef exp = BinaryenExportRef_val(_exp);
|
|
142
|
+
CAMLreturn(Val_int(BinaryenExportGetKind(exp)));
|
|
143
|
+
}
|