@grain/binaryen.ml 0.8.1 → 0.11.0
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 +93 -0
- binaryen-archive/README.md +29 -11
- binaryen-archive/binaryen.opam +8 -8
- binaryen-archive/dune-project +1 -1
- binaryen-archive/dune-workspace +1 -1
- 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 +4 -6
- binaryen-archive/js/element_segment.ml +33 -0
- binaryen-archive/js/export.ml +37 -0
- binaryen-archive/js/expression.ml +935 -178
- 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 +40 -64
- binaryen-archive/js/op.ml +9 -78
- binaryen-archive/js/settings.ml +60 -0
- binaryen-archive/js/stubs.c +15 -0
- binaryen-archive/js/table.ml +29 -0
- binaryen-archive/js/type.ml +3 -0
- binaryen-archive/package.json +15 -21
- 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 +145 -0
- binaryen-archive/src/binaryen_stubs_types.c +18 -0
- binaryen-archive/src/dune +5 -43
- binaryen-archive/src/element_segment.ml +13 -0
- binaryen-archive/src/export.ml +33 -0
- binaryen-archive/src/expression.ml +808 -73
- 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 +62 -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 -0
- 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 +6 -9
- binaryen-archive/test/test.expected +76 -0
- binaryen-archive/test/test.ml +110 -8
- 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 -33
- 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 -0
- 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 -11
- 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 -17
- binaryen-archive/src/features.ml +0 -49
- binaryen-archive/src/function_table.ml +0 -4
- 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 -2
|
@@ -1,67 +1,423 @@
|
|
|
1
1
|
type t
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type kind =
|
|
4
|
+
| Invalid
|
|
5
|
+
| Nop
|
|
6
|
+
| Block
|
|
7
|
+
| If
|
|
8
|
+
| Loop
|
|
9
|
+
| Break
|
|
10
|
+
| Switch
|
|
11
|
+
| Call
|
|
12
|
+
| CallIndirect
|
|
13
|
+
| LocalGet
|
|
14
|
+
| LocalSet
|
|
15
|
+
| GlobalGet
|
|
16
|
+
| GlobalSet
|
|
17
|
+
| Load
|
|
18
|
+
| Store
|
|
19
|
+
| AtomicRMW
|
|
20
|
+
| AtomicCmpxchg
|
|
21
|
+
| AtomicWait
|
|
22
|
+
| AtomicNotify
|
|
23
|
+
| AtomicFence
|
|
24
|
+
| SIMDExtract
|
|
25
|
+
| SIMDReplace
|
|
26
|
+
| SIMDShuffle
|
|
27
|
+
| SIMDTernary
|
|
28
|
+
| SIMDShift
|
|
29
|
+
| SIMDLoad
|
|
30
|
+
| SIMDLoadStoreLane
|
|
31
|
+
| MemoryInit
|
|
32
|
+
| DataDrop
|
|
33
|
+
| MemoryCopy
|
|
34
|
+
| MemoryFill
|
|
35
|
+
| Const
|
|
36
|
+
| Unary
|
|
37
|
+
| Binary
|
|
38
|
+
| Select
|
|
39
|
+
| Drop
|
|
40
|
+
| Return
|
|
41
|
+
| MemorySize
|
|
42
|
+
| MemoryGrow
|
|
43
|
+
| Unreachable
|
|
44
|
+
| Pop
|
|
45
|
+
| RefNull
|
|
46
|
+
| RefIs
|
|
47
|
+
| RefFunc
|
|
48
|
+
| RefEq
|
|
49
|
+
| Try
|
|
50
|
+
| Throw
|
|
51
|
+
| Rethrow
|
|
52
|
+
| TupleMake
|
|
53
|
+
| TupleExtract
|
|
54
|
+
| I31New
|
|
55
|
+
| I31Get
|
|
56
|
+
| CallRef
|
|
57
|
+
| RefTest
|
|
58
|
+
| RefCast
|
|
59
|
+
| BrOn
|
|
60
|
+
| RttCanon
|
|
61
|
+
| RttSub
|
|
62
|
+
| StructNew
|
|
63
|
+
| StructGet
|
|
64
|
+
| StructSet
|
|
65
|
+
| ArrayNew
|
|
66
|
+
| ArrayGet
|
|
67
|
+
| ArraySet
|
|
68
|
+
| ArrayLen
|
|
69
|
+
| RefAs
|
|
70
|
+
|
|
71
|
+
val get_kind : t -> kind
|
|
4
72
|
|
|
5
|
-
val
|
|
73
|
+
val print : t -> unit
|
|
6
74
|
|
|
7
|
-
val
|
|
75
|
+
val finalize : t -> unit
|
|
8
76
|
|
|
9
|
-
val
|
|
77
|
+
val copy : t -> Module.t -> t
|
|
10
78
|
|
|
11
|
-
|
|
79
|
+
(* Expression operations *)
|
|
12
80
|
|
|
13
|
-
|
|
81
|
+
module Block : sig
|
|
82
|
+
val make : ?return_type:Type.t -> Module.t -> string -> t list -> t
|
|
14
83
|
|
|
15
|
-
val
|
|
84
|
+
val get_name : t -> string option
|
|
16
85
|
|
|
17
|
-
val
|
|
86
|
+
val set_name : t -> string -> unit
|
|
18
87
|
|
|
19
|
-
val
|
|
88
|
+
val get_num_children : t -> int
|
|
20
89
|
|
|
21
|
-
val
|
|
90
|
+
val get_child_at : t -> int -> t
|
|
22
91
|
|
|
23
|
-
val
|
|
92
|
+
val set_child_at : t -> int -> t -> unit
|
|
24
93
|
|
|
25
|
-
val
|
|
94
|
+
val append_child : t -> t -> int
|
|
26
95
|
|
|
27
|
-
val
|
|
96
|
+
val insert_child_at : t -> int -> t -> unit
|
|
28
97
|
|
|
29
|
-
val
|
|
98
|
+
val remove_child_at : t -> int -> t
|
|
99
|
+
end
|
|
30
100
|
|
|
31
|
-
|
|
101
|
+
module If : sig
|
|
102
|
+
val make : Module.t -> t -> t -> t -> t
|
|
32
103
|
|
|
33
|
-
val
|
|
104
|
+
val get_condition : t -> t
|
|
34
105
|
|
|
35
|
-
val
|
|
106
|
+
val set_condition : t -> t -> unit
|
|
36
107
|
|
|
37
|
-
val
|
|
108
|
+
val get_if_true : t -> t
|
|
38
109
|
|
|
39
|
-
val
|
|
110
|
+
val set_if_true : t -> t -> unit
|
|
40
111
|
|
|
41
|
-
val
|
|
112
|
+
val get_if_false : t -> t option
|
|
42
113
|
|
|
43
|
-
val
|
|
114
|
+
val set_if_false : t -> t -> unit
|
|
115
|
+
end
|
|
44
116
|
|
|
45
|
-
|
|
117
|
+
module Loop : sig
|
|
118
|
+
val make : Module.t -> string -> t -> t
|
|
46
119
|
|
|
47
|
-
val
|
|
120
|
+
val get_name : t -> string
|
|
48
121
|
|
|
49
|
-
val
|
|
122
|
+
val set_name : t -> string -> unit
|
|
50
123
|
|
|
51
|
-
val
|
|
124
|
+
val get_body : t -> t
|
|
52
125
|
|
|
53
|
-
val
|
|
126
|
+
val set_body : t -> t -> unit
|
|
127
|
+
end
|
|
54
128
|
|
|
55
|
-
|
|
129
|
+
module Break : sig
|
|
130
|
+
val make : Module.t -> string -> t -> t -> t
|
|
56
131
|
|
|
57
|
-
val
|
|
132
|
+
val get_name : t -> string
|
|
58
133
|
|
|
59
|
-
val
|
|
134
|
+
val set_name : t -> string -> unit
|
|
60
135
|
|
|
61
|
-
val
|
|
136
|
+
val get_condition : t -> t option
|
|
62
137
|
|
|
63
|
-
val
|
|
138
|
+
val set_condition : t -> t -> unit
|
|
64
139
|
|
|
65
|
-
val
|
|
140
|
+
val get_value : t -> t option
|
|
66
141
|
|
|
67
|
-
val
|
|
142
|
+
val set_value : t -> t -> unit
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
module Switch : sig
|
|
146
|
+
val make : Module.t -> string list -> string -> t -> t -> t
|
|
147
|
+
|
|
148
|
+
val get_num_names : t -> int
|
|
149
|
+
|
|
150
|
+
val get_name_at : t -> int -> string
|
|
151
|
+
|
|
152
|
+
val set_name_at : t -> int -> string -> unit
|
|
153
|
+
|
|
154
|
+
val append_name : t -> string -> int
|
|
155
|
+
|
|
156
|
+
val insert_name_at : t -> int -> string -> unit
|
|
157
|
+
|
|
158
|
+
val remove_name_at : t -> int -> string
|
|
159
|
+
|
|
160
|
+
val get_default_name : t -> string option
|
|
161
|
+
|
|
162
|
+
val set_default_name : t -> string -> unit
|
|
163
|
+
|
|
164
|
+
val get_condition : t -> t
|
|
165
|
+
|
|
166
|
+
val set_condition : t -> t -> unit
|
|
167
|
+
|
|
168
|
+
val get_value : t -> t option
|
|
169
|
+
|
|
170
|
+
val set_value : t -> t -> unit
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
module Call : sig
|
|
174
|
+
val make : Module.t -> string -> t list -> Type.t -> t
|
|
175
|
+
|
|
176
|
+
val make_return : Module.t -> string -> t list -> Type.t -> t
|
|
177
|
+
|
|
178
|
+
val get_target : t -> string
|
|
179
|
+
|
|
180
|
+
val set_target : t -> string -> unit
|
|
181
|
+
|
|
182
|
+
val get_num_operands : t -> int
|
|
183
|
+
|
|
184
|
+
val get_operand_at : t -> int -> t
|
|
185
|
+
|
|
186
|
+
val set_operand_at : t -> int -> t -> unit
|
|
187
|
+
|
|
188
|
+
val append_operand : t -> t -> int
|
|
189
|
+
|
|
190
|
+
val insert_operand_at : t -> int -> t -> unit
|
|
191
|
+
|
|
192
|
+
val remove_operand_at : t -> int -> t
|
|
193
|
+
|
|
194
|
+
val is_return : t -> bool
|
|
195
|
+
|
|
196
|
+
val set_return : t -> bool -> unit
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
module Call_indirect : sig
|
|
200
|
+
val make : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
|
|
201
|
+
|
|
202
|
+
val make_return : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
|
|
203
|
+
|
|
204
|
+
val get_target : t -> t
|
|
205
|
+
|
|
206
|
+
val set_target : t -> t -> unit
|
|
207
|
+
|
|
208
|
+
val get_table : t -> string
|
|
209
|
+
|
|
210
|
+
val set_table : t -> string -> unit
|
|
211
|
+
|
|
212
|
+
val get_num_operands : t -> int
|
|
213
|
+
|
|
214
|
+
val get_operand_at : t -> int -> t
|
|
215
|
+
|
|
216
|
+
val set_operand_at : t -> int -> t -> unit
|
|
217
|
+
|
|
218
|
+
val append_operand : t -> t -> int
|
|
219
|
+
|
|
220
|
+
val insert_operand_at : t -> int -> t -> unit
|
|
221
|
+
|
|
222
|
+
val remove_operand_at : t -> int -> t
|
|
223
|
+
|
|
224
|
+
val is_return : t -> bool
|
|
225
|
+
|
|
226
|
+
val set_return : t -> bool -> unit
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
module Local_get : sig
|
|
230
|
+
val make : Module.t -> int -> Type.t -> t
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
module Local_set : sig
|
|
234
|
+
val make : Module.t -> int -> t -> t
|
|
235
|
+
|
|
236
|
+
val get_value : t -> t
|
|
237
|
+
|
|
238
|
+
val set_value : t -> t -> unit
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
module Local_tee : sig
|
|
242
|
+
val make : Module.t -> int -> t -> Type.t -> t
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
module Global_get : sig
|
|
246
|
+
val make : Module.t -> string -> Type.t -> t
|
|
247
|
+
|
|
248
|
+
val get_name : t -> string
|
|
249
|
+
|
|
250
|
+
val set_name : t -> string -> unit
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
module Global_set : sig
|
|
254
|
+
val make : Module.t -> string -> t -> t
|
|
255
|
+
|
|
256
|
+
val get_name : t -> string
|
|
257
|
+
|
|
258
|
+
val set_name : t -> string -> unit
|
|
259
|
+
|
|
260
|
+
val get_value : t -> t
|
|
261
|
+
|
|
262
|
+
val set_value : t -> t -> unit
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
module Load : sig
|
|
266
|
+
val make : Module.t -> int -> ?signed:bool -> int -> int -> Type.t -> t -> t
|
|
267
|
+
|
|
268
|
+
val get_ptr : t -> t
|
|
269
|
+
|
|
270
|
+
val set_ptr : t -> t -> unit
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
module Store : sig
|
|
274
|
+
val make : Module.t -> int -> int -> int -> t -> t -> Type.t -> t
|
|
275
|
+
|
|
276
|
+
val get_ptr : t -> t
|
|
277
|
+
|
|
278
|
+
val set_ptr : t -> t -> unit
|
|
279
|
+
|
|
280
|
+
val get_value : t -> t
|
|
281
|
+
|
|
282
|
+
val set_value : t -> t -> unit
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
module Const : sig
|
|
286
|
+
val make : Module.t -> Literal.t -> t
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
module Unary : sig
|
|
290
|
+
val make : Module.t -> Op.t -> t -> t
|
|
291
|
+
|
|
292
|
+
val get_value : t -> t
|
|
293
|
+
|
|
294
|
+
val set_value : t -> t -> unit
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
module Binary : sig
|
|
298
|
+
val make : Module.t -> Op.t -> t -> t -> t
|
|
299
|
+
|
|
300
|
+
val get_left : t -> t
|
|
301
|
+
|
|
302
|
+
val set_left : t -> t -> unit
|
|
303
|
+
|
|
304
|
+
val get_right : t -> t
|
|
305
|
+
|
|
306
|
+
val set_right : t -> t -> unit
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
module Select : sig
|
|
310
|
+
val make : Module.t -> t -> t -> t -> t
|
|
311
|
+
|
|
312
|
+
val get_if_true : t -> t
|
|
313
|
+
|
|
314
|
+
val set_if_true : t -> t -> unit
|
|
315
|
+
|
|
316
|
+
val get_if_false : t -> t
|
|
317
|
+
|
|
318
|
+
val set_if_false : t -> t -> unit
|
|
319
|
+
|
|
320
|
+
val get_condition : t -> t
|
|
321
|
+
|
|
322
|
+
val set_condition : t -> t -> unit
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
module Drop : sig
|
|
326
|
+
val make : Module.t -> t -> t
|
|
327
|
+
|
|
328
|
+
val get_value : t -> t
|
|
329
|
+
|
|
330
|
+
val set_value : t -> t -> unit
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
module Return : sig
|
|
334
|
+
val make : Module.t -> t -> t
|
|
335
|
+
|
|
336
|
+
val get_value : t -> t
|
|
337
|
+
|
|
338
|
+
val set_value : t -> t -> unit
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
module Memory_size : sig
|
|
342
|
+
val make : Module.t -> t
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
module Memory_grow : sig
|
|
346
|
+
val make : Module.t -> t -> t
|
|
347
|
+
|
|
348
|
+
val get_delta : t -> t
|
|
349
|
+
|
|
350
|
+
val set_delta : t -> t -> unit
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
module Memory_copy : sig
|
|
354
|
+
val make : Module.t -> t -> t -> t -> t
|
|
355
|
+
|
|
356
|
+
val get_dest : t -> t
|
|
357
|
+
|
|
358
|
+
val set_dest : t -> t -> unit
|
|
359
|
+
|
|
360
|
+
val get_source : t -> t
|
|
361
|
+
|
|
362
|
+
val set_source : t -> t -> unit
|
|
363
|
+
|
|
364
|
+
val get_size : t -> t
|
|
365
|
+
|
|
366
|
+
val set_size : t -> t -> unit
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
module Memory_fill : sig
|
|
370
|
+
val make : Module.t -> t -> t -> t -> t
|
|
371
|
+
|
|
372
|
+
val get_dest : t -> t
|
|
373
|
+
|
|
374
|
+
val set_dest : t -> t -> unit
|
|
375
|
+
|
|
376
|
+
val get_value : t -> t
|
|
377
|
+
|
|
378
|
+
val set_value : t -> t -> unit
|
|
379
|
+
|
|
380
|
+
val get_size : t -> t
|
|
381
|
+
|
|
382
|
+
val set_size : t -> t -> unit
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
module Tuple_make : sig
|
|
386
|
+
val make : Module.t -> t list -> t
|
|
387
|
+
|
|
388
|
+
val get_num_operands : t -> int
|
|
389
|
+
|
|
390
|
+
val get_operand_at : t -> int -> t
|
|
391
|
+
|
|
392
|
+
val set_operand_at : t -> int -> t -> unit
|
|
393
|
+
|
|
394
|
+
val append_operand : t -> t -> int
|
|
395
|
+
|
|
396
|
+
val insert_operand_at : t -> int -> t -> unit
|
|
397
|
+
|
|
398
|
+
val remove_operand_at : t -> int -> t
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
module Tuple_extract : sig
|
|
402
|
+
val make : Module.t -> t -> int -> t
|
|
403
|
+
|
|
404
|
+
val get_tuple : t -> t
|
|
405
|
+
|
|
406
|
+
val set_tuple : t -> t -> unit
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
module Nop : sig
|
|
410
|
+
val make : Module.t -> t
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
module Unreachable : sig
|
|
414
|
+
val make : Module.t -> t
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
module Pop : sig
|
|
418
|
+
val make : Module.t -> Type.t -> t
|
|
419
|
+
end
|
|
420
|
+
|
|
421
|
+
module Null : sig
|
|
422
|
+
val make : unit -> t
|
|
423
|
+
end
|
|
@@ -9,6 +9,22 @@ val set_debug_location : t -> Expression.t -> int -> int -> int -> unit
|
|
|
9
9
|
|
|
10
10
|
val get_function : Module.t -> string -> t
|
|
11
11
|
|
|
12
|
+
val get_function_by_index : Module.t -> int -> t
|
|
13
|
+
|
|
12
14
|
val remove_function : Module.t -> string -> unit
|
|
13
15
|
|
|
14
16
|
val get_num_functions : Module.t -> int
|
|
17
|
+
|
|
18
|
+
val get_name : t -> string
|
|
19
|
+
|
|
20
|
+
val get_params : t -> Type.t
|
|
21
|
+
|
|
22
|
+
val get_results : t -> Type.t
|
|
23
|
+
|
|
24
|
+
val get_num_vars : t -> int
|
|
25
|
+
|
|
26
|
+
val get_var : t -> int -> Type.t
|
|
27
|
+
|
|
28
|
+
val get_body : t -> Expression.t
|
|
29
|
+
|
|
30
|
+
val set_body : t -> Expression.t -> unit
|
|
@@ -5,3 +5,15 @@ val add_global : Module.t -> string -> Type.t -> bool -> Expression.t -> t
|
|
|
5
5
|
val get_global : Module.t -> string -> t
|
|
6
6
|
|
|
7
7
|
val remove_global : Module.t -> string -> unit
|
|
8
|
+
|
|
9
|
+
val get_num_globals : Module.t -> int
|
|
10
|
+
|
|
11
|
+
val get_global_by_index : Module.t -> int -> t
|
|
12
|
+
|
|
13
|
+
val get_name : t -> string
|
|
14
|
+
|
|
15
|
+
val get_type : t -> Type.t
|
|
16
|
+
|
|
17
|
+
val is_mutable : t -> bool
|
|
18
|
+
|
|
19
|
+
val get_init_expr : t -> Expression.t
|
|
@@ -7,3 +7,11 @@ val add_memory_import : Module.t -> string -> string -> string -> bool -> unit
|
|
|
7
7
|
|
|
8
8
|
val add_global_import :
|
|
9
9
|
Module.t -> string -> string -> string -> Type.t -> bool -> unit
|
|
10
|
+
|
|
11
|
+
val function_import_get_module : Function.t -> string
|
|
12
|
+
|
|
13
|
+
val global_import_get_module : Global.t -> string
|
|
14
|
+
|
|
15
|
+
val function_import_get_base : Function.t -> string
|
|
16
|
+
|
|
17
|
+
val global_import_get_base : Global.t -> string
|
|
@@ -15,9 +15,9 @@ val float64 : float -> t
|
|
|
15
15
|
(* Hacks for Binaryen.js stack allocations *)
|
|
16
16
|
type jsoo =
|
|
17
17
|
| Int32 of int32
|
|
18
|
-
| Int64 of
|
|
18
|
+
| Int64 of int32 * int32
|
|
19
19
|
| Float32Bits of int32
|
|
20
|
-
| Float64Bits of
|
|
20
|
+
| Float64Bits of int32 * int32
|
|
21
21
|
| Float32 of float
|
|
22
22
|
| Float64 of float
|
|
23
23
|
|
|
@@ -1,54 +1,52 @@
|
|
|
1
1
|
type t
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
module Feature : sig
|
|
4
|
+
type t
|
|
4
5
|
|
|
5
|
-
val
|
|
6
|
+
val mvp : t
|
|
6
7
|
|
|
7
|
-
val
|
|
8
|
+
val atomics : t
|
|
8
9
|
|
|
9
|
-
val
|
|
10
|
+
val bulk_memory : t
|
|
10
11
|
|
|
11
|
-
val
|
|
12
|
-
|
|
13
|
-
val print_asmjs : t -> unit
|
|
14
|
-
|
|
15
|
-
val validate : t -> int
|
|
12
|
+
val mutable_globals : t
|
|
16
13
|
|
|
17
|
-
val
|
|
14
|
+
val nontrapping_fp_to_int : t
|
|
18
15
|
|
|
19
|
-
val
|
|
16
|
+
val sign_ext : t
|
|
20
17
|
|
|
21
|
-
val
|
|
18
|
+
val simd128 : t
|
|
22
19
|
|
|
23
|
-
val
|
|
20
|
+
val exception_handling : t
|
|
24
21
|
|
|
25
|
-
val
|
|
22
|
+
val tail_call : t
|
|
26
23
|
|
|
27
|
-
val
|
|
24
|
+
val reference_types : t
|
|
28
25
|
|
|
29
|
-
val
|
|
26
|
+
val multivalue : t
|
|
30
27
|
|
|
31
|
-
val
|
|
28
|
+
val all : t
|
|
29
|
+
end
|
|
32
30
|
|
|
33
|
-
val
|
|
31
|
+
val create : unit -> t
|
|
34
32
|
|
|
35
|
-
val
|
|
33
|
+
val dispose : t -> unit
|
|
36
34
|
|
|
37
|
-
val
|
|
35
|
+
val add_custom_section : t -> string -> string -> unit
|
|
38
36
|
|
|
39
|
-
val
|
|
37
|
+
val parse : string -> t
|
|
40
38
|
|
|
41
|
-
val
|
|
39
|
+
val print : t -> unit
|
|
42
40
|
|
|
43
|
-
val
|
|
41
|
+
val print_asmjs : t -> unit
|
|
44
42
|
|
|
45
|
-
val
|
|
43
|
+
val validate : t -> int
|
|
46
44
|
|
|
47
|
-
val
|
|
45
|
+
val optimize : t -> unit
|
|
48
46
|
|
|
49
|
-
val
|
|
47
|
+
val get_features : t -> Feature.t list
|
|
50
48
|
|
|
51
|
-
val
|
|
49
|
+
val set_features : t -> Feature.t list -> unit
|
|
52
50
|
|
|
53
51
|
val run_passes : t -> string list -> unit
|
|
54
52
|
|