@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
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
(module
|
|
2
2
|
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
|
|
3
3
|
(type $none_=>_none (func))
|
|
4
|
+
(type $externref_=>_i32 (func (param externref) (result i32)))
|
|
5
|
+
(type $externref_i32_i32_=>_i32 (func (param externref i32 i32) (result i32)))
|
|
6
|
+
(import "future-wasi" "write" (func $write (param externref i32 i32) (result i32)))
|
|
7
|
+
(global $max_int64 i64 (i64.const 9223372036854775807))
|
|
8
|
+
(global $test_float64_bits f64 (f64.const 1.23))
|
|
4
9
|
(memory $0 1)
|
|
5
10
|
(table $table 1 1 funcref)
|
|
6
|
-
(elem (i32.const 0) $adder)
|
|
11
|
+
(elem $elem (i32.const 0) $adder)
|
|
7
12
|
(export "adder" (func $adder))
|
|
8
13
|
(export "memory" (memory $0))
|
|
14
|
+
(export "hello" (func $hello))
|
|
9
15
|
(start $start)
|
|
10
16
|
(func $adder (param $0 i32) (param $1 i32) (result i32)
|
|
11
17
|
(block $add (result i32)
|
|
@@ -27,22 +33,33 @@
|
|
|
27
33
|
)
|
|
28
34
|
(func $start
|
|
29
35
|
(drop
|
|
30
|
-
(call_indirect (type $i32_i32_=>_i32)
|
|
36
|
+
(call_indirect $table (type $i32_i32_=>_i32)
|
|
31
37
|
(i32.const 3)
|
|
32
38
|
(i32.const 5)
|
|
33
39
|
(i32.const 0)
|
|
34
40
|
)
|
|
35
41
|
)
|
|
36
42
|
)
|
|
43
|
+
(func $hello (param $0 externref) (result i32)
|
|
44
|
+
(call $write
|
|
45
|
+
(local.get $0)
|
|
46
|
+
(i32.const 0)
|
|
47
|
+
(i32.const 1)
|
|
48
|
+
)
|
|
49
|
+
)
|
|
37
50
|
)
|
|
38
51
|
(module
|
|
39
52
|
(type $none_=>_none (func))
|
|
53
|
+
(type $externref_=>_i32 (func (param externref) (result i32)))
|
|
40
54
|
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
|
|
55
|
+
(type $externref_i32_i32_=>_i32 (func (param externref i32 i32) (result i32)))
|
|
56
|
+
(import "future-wasi" "write" (func $write (param externref i32 i32) (result i32)))
|
|
41
57
|
(memory $0 1)
|
|
42
58
|
(table $table 1 1 funcref)
|
|
43
|
-
(elem (i32.const 0) $adder)
|
|
59
|
+
(elem $elem (i32.const 0) $adder)
|
|
44
60
|
(export "adder" (func $adder))
|
|
45
61
|
(export "memory" (memory $0))
|
|
62
|
+
(export "hello" (func $hello))
|
|
46
63
|
(start $start)
|
|
47
64
|
(func $adder (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32)
|
|
48
65
|
(i32.add
|
|
@@ -64,15 +81,26 @@
|
|
|
64
81
|
)
|
|
65
82
|
)
|
|
66
83
|
)
|
|
84
|
+
(func $hello (; has Stack IR ;) (param $0 externref) (result i32)
|
|
85
|
+
(call $write
|
|
86
|
+
(local.get $0)
|
|
87
|
+
(i32.const 0)
|
|
88
|
+
(i32.const 1)
|
|
89
|
+
)
|
|
90
|
+
)
|
|
67
91
|
)
|
|
68
92
|
(module
|
|
69
93
|
(type $none_=>_none (func))
|
|
94
|
+
(type $externref_=>_i32 (func (param externref) (result i32)))
|
|
70
95
|
(type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
|
|
96
|
+
(type $externref_i32_i32_=>_i32 (func (param externref i32 i32) (result i32)))
|
|
97
|
+
(import "future-wasi" "write" (func $fimport$0 (param externref i32 i32) (result i32)))
|
|
71
98
|
(memory $0 1)
|
|
72
99
|
(table $0 1 1 funcref)
|
|
73
100
|
(elem (i32.const 0) $0)
|
|
74
101
|
(export "adder" (func $0))
|
|
75
102
|
(export "memory" (memory $0))
|
|
103
|
+
(export "hello" (func $2))
|
|
76
104
|
(start $1)
|
|
77
105
|
(func $0 (param $0 i32) (param $1 i32) (result i32)
|
|
78
106
|
(i32.add
|
|
@@ -94,4 +122,11 @@
|
|
|
94
122
|
)
|
|
95
123
|
)
|
|
96
124
|
)
|
|
125
|
+
(func $2 (param $0 externref) (result i32)
|
|
126
|
+
(call $fimport$0
|
|
127
|
+
(local.get $0)
|
|
128
|
+
(i32.const 0)
|
|
129
|
+
(i32.const 1)
|
|
130
|
+
)
|
|
131
|
+
)
|
|
97
132
|
)
|
binaryen-archive/test/test.ml
CHANGED
|
@@ -1,32 +1,61 @@
|
|
|
1
1
|
open Binaryen
|
|
2
2
|
|
|
3
|
+
(* Testing colors enable *)
|
|
4
|
+
let _ = assert (Settings.are_colors_enabled () == true)
|
|
5
|
+
|
|
6
|
+
let _ = Settings.set_colors_enabled false
|
|
7
|
+
|
|
8
|
+
let _ = assert (Settings.are_colors_enabled () == false)
|
|
9
|
+
|
|
10
|
+
let _ = Settings.set_colors_enabled true
|
|
11
|
+
|
|
12
|
+
(* Testing debug_info enable *)
|
|
13
|
+
let _ = assert (Settings.get_debug_info () == false)
|
|
14
|
+
|
|
15
|
+
let _ = Settings.set_debug_info true
|
|
16
|
+
|
|
17
|
+
let _ = assert (Settings.get_debug_info () == true)
|
|
18
|
+
|
|
19
|
+
let _ = Settings.set_debug_info false
|
|
20
|
+
|
|
21
|
+
(* Testing low_memory_unused enable *)
|
|
22
|
+
let _ = assert (Settings.get_low_memory_unused () == false)
|
|
23
|
+
|
|
24
|
+
let _ = Settings.set_low_memory_unused true
|
|
25
|
+
|
|
26
|
+
let _ = assert (Settings.get_low_memory_unused () == true)
|
|
27
|
+
|
|
28
|
+
let _ = Settings.set_low_memory_unused false
|
|
29
|
+
|
|
3
30
|
let wasm_mod = Module.create ()
|
|
4
31
|
|
|
32
|
+
let _ = Module.set_features wasm_mod [ Module.Feature.all ]
|
|
33
|
+
|
|
5
34
|
(* Create function type for i32 (i32, i32) *)
|
|
6
35
|
let params () = Type.create [| Type.int32; Type.int32 |]
|
|
7
36
|
|
|
8
37
|
let results = Type.int32
|
|
9
38
|
|
|
10
|
-
let x () = Expression.
|
|
39
|
+
let x () = Expression.Local_get.make wasm_mod 0 Type.int32
|
|
11
40
|
|
|
12
|
-
let y () = Expression.
|
|
41
|
+
let y () = Expression.Local_get.make wasm_mod 1 Type.int32
|
|
13
42
|
|
|
14
|
-
let load = Expression.
|
|
43
|
+
let load = Expression.Load.make wasm_mod 1 ~signed:true 0 0 Type.int32 (y ())
|
|
15
44
|
|
|
16
45
|
let select =
|
|
17
|
-
Expression.
|
|
18
|
-
(Expression.
|
|
46
|
+
Expression.Select.make wasm_mod
|
|
47
|
+
(Expression.Const.make wasm_mod (Literal.int32 1l))
|
|
19
48
|
(x ()) load
|
|
20
49
|
|
|
21
|
-
let bin = Expression.
|
|
50
|
+
let bin = Expression.Binary.make wasm_mod Op.add_int32 select (y ())
|
|
22
51
|
|
|
23
52
|
let add =
|
|
24
|
-
Expression.
|
|
53
|
+
Expression.Block.make wasm_mod ~return_type:Type.int32 "add"
|
|
25
54
|
[
|
|
26
|
-
Expression.
|
|
27
|
-
(Expression.
|
|
28
|
-
(Expression.
|
|
29
|
-
(Expression.
|
|
55
|
+
Expression.If.make wasm_mod
|
|
56
|
+
(Expression.Const.make wasm_mod (Literal.int32 0l))
|
|
57
|
+
(Expression.Unreachable.make wasm_mod)
|
|
58
|
+
(Expression.Null.make ());
|
|
30
59
|
bin;
|
|
31
60
|
]
|
|
32
61
|
|
|
@@ -34,42 +63,85 @@ let add =
|
|
|
34
63
|
let adder = Function.add_function wasm_mod "adder" (params ()) results [||] add
|
|
35
64
|
|
|
36
65
|
let call_adder =
|
|
37
|
-
Expression.
|
|
38
|
-
(Expression.
|
|
66
|
+
Expression.Call_indirect.make wasm_mod "table"
|
|
67
|
+
(Expression.Const.make wasm_mod (Literal.int32 0l))
|
|
39
68
|
[
|
|
40
|
-
Expression.
|
|
41
|
-
Expression.
|
|
69
|
+
Expression.Const.make wasm_mod (Literal.int32 3l);
|
|
70
|
+
Expression.Const.make wasm_mod (Literal.int32 5l);
|
|
42
71
|
]
|
|
43
72
|
(params ()) Type.int32
|
|
44
73
|
|
|
45
74
|
let start =
|
|
46
75
|
Function.add_function wasm_mod "start" Type.none Type.none [||]
|
|
47
|
-
(Expression.
|
|
76
|
+
(Expression.Drop.make wasm_mod call_adder)
|
|
48
77
|
|
|
49
78
|
let _ = Export.add_function_export wasm_mod "adder" "adder"
|
|
50
79
|
|
|
80
|
+
let _ = Table.add_table wasm_mod "table" 1 1
|
|
81
|
+
|
|
82
|
+
let _ =
|
|
83
|
+
Global.add_global wasm_mod "max_int64" Type.int64 false
|
|
84
|
+
(Expression.Const.make wasm_mod (Literal.int64 Int64.max_int))
|
|
85
|
+
|
|
86
|
+
let _ =
|
|
87
|
+
Global.add_global wasm_mod "test_float64_bits" Type.float64 false
|
|
88
|
+
(Expression.Const.make wasm_mod (Literal.float64_bits 0x3FF3AE147AE147AEL))
|
|
89
|
+
|
|
51
90
|
let _ =
|
|
52
|
-
Table.
|
|
53
|
-
(Expression.
|
|
91
|
+
Table.add_active_element_segment wasm_mod "table" "elem" [ "adder" ]
|
|
92
|
+
(Expression.Const.make wasm_mod (Literal.int32 0l))
|
|
54
93
|
|
|
55
94
|
let _ = Function.set_start wasm_mod start
|
|
56
95
|
|
|
57
96
|
let _ = Memory.set_memory wasm_mod 1 Memory.unlimited "memory" [] false
|
|
58
97
|
|
|
98
|
+
(* Create an imported "write" function i32 (externref, i32, i32) *)
|
|
99
|
+
(* Similar to the example here: https://bytecodealliance.org/articles/reference-types-in-wasmtime *)
|
|
100
|
+
|
|
101
|
+
let _ =
|
|
102
|
+
Import.add_function_import wasm_mod "write" "future-wasi" "write"
|
|
103
|
+
(Type.create [| Type.externref; Type.int32; Type.int32 |])
|
|
104
|
+
Type.int32
|
|
105
|
+
|
|
106
|
+
(* Create a function that calls the imported write function *)
|
|
107
|
+
let _ =
|
|
108
|
+
Function.add_function wasm_mod "hello" Type.externref Type.int32 [||]
|
|
109
|
+
(Expression.Call.make wasm_mod "write"
|
|
110
|
+
[
|
|
111
|
+
Expression.Local_get.make wasm_mod 0 Type.externref;
|
|
112
|
+
Expression.Const.make wasm_mod (Literal.int32 0l);
|
|
113
|
+
Expression.Const.make wasm_mod (Literal.int32 1l);
|
|
114
|
+
]
|
|
115
|
+
Type.int32)
|
|
116
|
+
|
|
117
|
+
let _ = Export.add_function_export wasm_mod "hello" "hello"
|
|
118
|
+
|
|
119
|
+
(* Finally, we print 3 versions of the module to be checked against test.expected *)
|
|
120
|
+
|
|
121
|
+
(* 1. Print the the module as-is *)
|
|
122
|
+
|
|
59
123
|
let _ = Module.print wasm_mod
|
|
60
124
|
|
|
125
|
+
(* 2. Optimize, then print the module *)
|
|
126
|
+
|
|
61
127
|
let _ = Module.optimize wasm_mod
|
|
62
128
|
|
|
63
129
|
let _ = Module.print wasm_mod
|
|
64
130
|
|
|
131
|
+
(* 3. Copy previous module bytes into new module, validate, and print *)
|
|
132
|
+
|
|
65
133
|
let byts, _ = Module.write wasm_mod None
|
|
66
134
|
|
|
67
135
|
let new_mod = Module.read byts
|
|
68
136
|
|
|
137
|
+
let _ = Module.set_features new_mod [ Module.Feature.all ]
|
|
138
|
+
|
|
69
139
|
let _ = Module.validate new_mod
|
|
70
140
|
|
|
71
141
|
let _ = Module.print new_mod
|
|
72
142
|
|
|
143
|
+
(* Dispose the modules 👋 *)
|
|
144
|
+
|
|
73
145
|
let _ = Module.dispose wasm_mod
|
|
74
146
|
|
|
75
147
|
let _ = Module.dispose new_mod
|
binaryen-archive/virtual/dune
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(library
|
|
2
2
|
(name binaryen)
|
|
3
3
|
(public_name binaryen)
|
|
4
|
-
(virtual_modules export expression
|
|
5
|
-
|
|
4
|
+
(virtual_modules element_segment export expression function global import
|
|
5
|
+
literal memory module op settings table type)
|
|
6
6
|
(default_implementation binaryen.native))
|
|
@@ -8,4 +8,26 @@ val add_memory_export : Module.t -> string -> string -> t
|
|
|
8
8
|
|
|
9
9
|
val add_global_export : Module.t -> string -> string -> t
|
|
10
10
|
|
|
11
|
+
val get_export : Module.t -> string -> t
|
|
12
|
+
|
|
11
13
|
val remove_export : Module.t -> string -> unit
|
|
14
|
+
|
|
15
|
+
val get_num_exports : Module.t -> int
|
|
16
|
+
|
|
17
|
+
val get_export_by_index : Module.t -> int -> t
|
|
18
|
+
|
|
19
|
+
val get_name : t -> string
|
|
20
|
+
|
|
21
|
+
val get_value : t -> string
|
|
22
|
+
|
|
23
|
+
val external_function : int
|
|
24
|
+
|
|
25
|
+
val external_table : int
|
|
26
|
+
|
|
27
|
+
val external_memory : int
|
|
28
|
+
|
|
29
|
+
val external_global : int
|
|
30
|
+
|
|
31
|
+
val external_event : int
|
|
32
|
+
|
|
33
|
+
val export_get_kind : t -> int
|