@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.
Files changed (138) hide show
  1. binaryen-archive/.gitignore +1 -0
  2. binaryen-archive/CHANGELOG.md +93 -0
  3. binaryen-archive/README.md +29 -11
  4. binaryen-archive/binaryen.opam +8 -8
  5. binaryen-archive/dune-project +1 -1
  6. binaryen-archive/dune-workspace +1 -1
  7. binaryen-archive/esy.lock/index.json +537 -460
  8. binaryen-archive/esy.lock/opam/{base.v0.14.1 → base.v0.14.2}/opam +4 -4
  9. binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +1 -1
  10. binaryen-archive/esy.lock/opam/{cppo.1.6.7 → cppo.1.6.8}/opam +4 -6
  11. binaryen-archive/esy.lock/opam/{csexp.1.4.0 → csexp.1.5.1}/opam +11 -9
  12. binaryen-archive/esy.lock/opam/{dune-build-info.2.8.2 → dune-build-info.2.9.1}/opam +5 -5
  13. binaryen-archive/esy.lock/opam/{dune-configurator.2.8.2 → dune-configurator.2.9.1}/opam +5 -5
  14. binaryen-archive/esy.lock/opam/{dune.2.8.2 → dune.2.9.1}/opam +4 -4
  15. binaryen-archive/esy.lock/opam/easy-format.1.3.2/opam +1 -1
  16. binaryen-archive/esy.lock/opam/{fix.20201120 → fix.20211231}/opam +7 -5
  17. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam +54 -0
  18. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +44 -0
  19. binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +45 -0
  20. binaryen-archive/esy.lock/opam/{menhir.20201216 → menhir.20211128}/opam +8 -6
  21. binaryen-archive/esy.lock/opam/{menhirLib.20201216 → menhirLib.20211128}/opam +8 -6
  22. binaryen-archive/esy.lock/opam/{menhirSdk.20201216 → menhirSdk.20211128}/opam +8 -6
  23. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam +39 -0
  24. binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.4.0 → ocaml-lsp-server.1.9.0}/opam +15 -12
  25. binaryen-archive/esy.lock/opam/{ocaml-migrate-parsetree.2.1.0 → ocaml-migrate-parsetree.2.3.0}/opam +13 -10
  26. binaryen-archive/esy.lock/opam/ocaml-version.3.4.0/opam +49 -0
  27. binaryen-archive/esy.lock/opam/ocamlbuild.0.14.0/opam +1 -1
  28. binaryen-archive/esy.lock/opam/{ocamlfind.1.8.1 → ocamlfind.1.9.1}/opam +19 -39
  29. binaryen-archive/esy.lock/opam/ocamlformat-rpc-lib.0.19.0/opam +40 -0
  30. binaryen-archive/esy.lock/opam/ocamlformat.0.18.0/opam +56 -0
  31. binaryen-archive/esy.lock/opam/{odoc.1.5.2 → odoc.1.5.3}/opam +12 -12
  32. binaryen-archive/esy.lock/opam/pp.1.1.2/opam +58 -0
  33. binaryen-archive/esy.lock/opam/ppx_derivers.1.2.1/opam +1 -1
  34. binaryen-archive/esy.lock/opam/ppx_yojson_conv_lib.v0.14.0/opam +2 -2
  35. binaryen-archive/esy.lock/opam/{ppxlib.0.21.0 → ppxlib.0.22.2}/opam +40 -32
  36. binaryen-archive/esy.lock/opam/{re.1.9.0 → re.1.10.3}/opam +8 -4
  37. binaryen-archive/esy.lock/opam/result.1.5/opam +2 -2
  38. binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +2 -2
  39. binaryen-archive/esy.lock/opam/spawn.v0.15.0/opam +56 -0
  40. binaryen-archive/esy.lock/opam/stdio.v0.14.0/opam +2 -2
  41. binaryen-archive/esy.lock/opam/{topkg.1.0.3 → topkg.1.0.4}/opam +18 -22
  42. binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +42 -0
  43. binaryen-archive/esy.lock/opam/uucp.14.0.0/opam +41 -0
  44. binaryen-archive/esy.lock/opam/{uuseg.13.0.0 → uuseg.14.0.0}/opam +22 -28
  45. binaryen-archive/esy.lock/opam/yojson.1.7.0/opam +1 -1
  46. 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
  47. 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
  48. binaryen-archive/js/binaryen.es5.js +5 -0
  49. binaryen-archive/js/dune +4 -6
  50. binaryen-archive/js/element_segment.ml +33 -0
  51. binaryen-archive/js/export.ml +37 -0
  52. binaryen-archive/js/expression.ml +935 -178
  53. binaryen-archive/js/function.ml +31 -0
  54. binaryen-archive/js/global.ml +29 -0
  55. binaryen-archive/js/import.ml +24 -0
  56. binaryen-archive/js/literal.ml +8 -4
  57. binaryen-archive/js/module.ml +40 -64
  58. binaryen-archive/js/op.ml +9 -78
  59. binaryen-archive/js/settings.ml +60 -0
  60. binaryen-archive/js/stubs.c +15 -0
  61. binaryen-archive/js/table.ml +29 -0
  62. binaryen-archive/js/type.ml +3 -0
  63. binaryen-archive/package.json +15 -21
  64. binaryen-archive/src/binaryen_stubs_exports.c +78 -0
  65. binaryen-archive/src/binaryen_stubs_expressions.c +1300 -0
  66. binaryen-archive/src/binaryen_stubs_features.c +7 -0
  67. binaryen-archive/src/binaryen_stubs_functions.c +78 -0
  68. binaryen-archive/src/binaryen_stubs_globals.c +63 -0
  69. binaryen-archive/src/binaryen_stubs_imports.c +29 -0
  70. binaryen-archive/src/binaryen_stubs_memory.c +1 -1
  71. binaryen-archive/src/binaryen_stubs_modules.c +0 -122
  72. binaryen-archive/src/binaryen_stubs_ops.c +19 -173
  73. binaryen-archive/src/binaryen_stubs_settings.c +145 -0
  74. binaryen-archive/src/binaryen_stubs_tables.c +145 -0
  75. binaryen-archive/src/binaryen_stubs_types.c +18 -0
  76. binaryen-archive/src/dune +5 -43
  77. binaryen-archive/src/element_segment.ml +13 -0
  78. binaryen-archive/src/export.ml +33 -0
  79. binaryen-archive/src/expression.ml +808 -73
  80. binaryen-archive/src/function.ml +18 -0
  81. binaryen-archive/src/global.ml +14 -0
  82. binaryen-archive/src/import.ml +12 -0
  83. binaryen-archive/src/literal.ml +2 -2
  84. binaryen-archive/src/module.ml +62 -38
  85. binaryen-archive/src/ocaml_helpers.c +0 -8
  86. binaryen-archive/src/ocaml_helpers.h +2 -3
  87. binaryen-archive/src/op.ml +18 -131
  88. binaryen-archive/src/settings.ml +45 -0
  89. binaryen-archive/src/table.ml +26 -0
  90. binaryen-archive/src/type.ml +2 -0
  91. binaryen-archive/test/config/dune +8 -0
  92. binaryen-archive/test/config/ocamlopt_flags.ml +16 -0
  93. binaryen-archive/test/dune +6 -9
  94. binaryen-archive/test/test.expected +76 -0
  95. binaryen-archive/test/test.ml +110 -8
  96. binaryen-archive/virtual/dune +2 -2
  97. binaryen-archive/virtual/element_segment.mli +11 -0
  98. binaryen-archive/virtual/export.mli +22 -0
  99. binaryen-archive/virtual/expression.mli +389 -33
  100. binaryen-archive/virtual/function.mli +16 -0
  101. binaryen-archive/virtual/global.mli +12 -0
  102. binaryen-archive/virtual/import.mli +8 -0
  103. binaryen-archive/virtual/literal.mli +2 -2
  104. binaryen-archive/virtual/module.mli +25 -27
  105. binaryen-archive/virtual/op.mli +9 -53
  106. binaryen-archive/virtual/settings.mli +35 -0
  107. binaryen-archive/virtual/table.mli +19 -0
  108. binaryen-archive/virtual/type.mli +2 -0
  109. binaryen-archive/esy.lock/opam/conf-m4.1/opam +0 -22
  110. binaryen-archive/esy.lock/opam/dot-merlin-reader.4.1/opam +0 -30
  111. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.9.1/opam +0 -40
  112. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.9.0/opam +0 -30
  113. binaryen-archive/esy.lock/opam/js_of_ocaml.3.9.0/opam +0 -31
  114. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.3/opam +0 -29
  115. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocaml-stub +0 -4
  116. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocamlfind.install +0 -6
  117. binaryen-archive/esy.lock/opam/ocamlformat.0.15.1/opam +0 -41
  118. binaryen-archive/esy.lock/opam/tyxml.4.4.0/opam +0 -47
  119. binaryen-archive/esy.lock/opam/uucp.13.0.0/opam +0 -44
  120. binaryen-archive/esy.lock/overrides/opam__s__conf_m4_opam__c__1_opam_override/package.json +0 -6
  121. binaryen-archive/js/features.ml +0 -27
  122. binaryen-archive/js/function_table.ml +0 -11
  123. binaryen-archive/src/binaryen_stubs_function_tables.c +0 -25
  124. binaryen-archive/src/config/dune +0 -8
  125. binaryen-archive/src/config/library_flags.ml +0 -17
  126. binaryen-archive/src/features.ml +0 -49
  127. binaryen-archive/src/function_table.ml +0 -4
  128. binaryen-archive/vendor/binaryen-c.h +0 -2647
  129. binaryen-archive/vendor/js/index.es5.js +0 -5
  130. binaryen-archive/vendor/linux/libbinaryen.a +0 -0
  131. binaryen-archive/vendor/linux/libbinaryen.so +0 -0
  132. binaryen-archive/vendor/macosx/libbinaryen.a +0 -0
  133. binaryen-archive/vendor/macosx/libbinaryen.dylib +0 -0
  134. binaryen-archive/vendor/mingw64/libbinaryen.a +0 -0
  135. binaryen-archive/vendor/mingw64/libbinaryen.dll +0 -0
  136. binaryen-archive/vendor/wasm-delegations.h +0 -85
  137. binaryen-archive/virtual/features.mli +0 -23
  138. binaryen-archive/virtual/function_table.mli +0 -2
@@ -1,67 +1,423 @@
1
1
  type t
2
2
 
3
- val block : ?return_type:Type.t -> Module.t -> string -> t list -> t
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 if_ : Module.t -> t -> t -> t -> t
73
+ val print : t -> unit
6
74
 
7
- val loop : Module.t -> string -> t -> t
75
+ val finalize : t -> unit
8
76
 
9
- val break : Module.t -> string -> t -> t -> t
77
+ val copy : t -> Module.t -> t
10
78
 
11
- val switch : Module.t -> string list -> string -> t -> t -> t
79
+ (* Expression operations *)
12
80
 
13
- val call : Module.t -> string -> t list -> Type.t -> t
81
+ module Block : sig
82
+ val make : ?return_type:Type.t -> Module.t -> string -> t list -> t
14
83
 
15
- val call_indirect : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
84
+ val get_name : t -> string option
16
85
 
17
- val return_call : Module.t -> string -> t list -> Type.t -> t
86
+ val set_name : t -> string -> unit
18
87
 
19
- val return_call_indirect : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
88
+ val get_num_children : t -> int
20
89
 
21
- val local_get : Module.t -> int -> Type.t -> t
90
+ val get_child_at : t -> int -> t
22
91
 
23
- val local_set : Module.t -> int -> t -> t
92
+ val set_child_at : t -> int -> t -> unit
24
93
 
25
- val local_tee : Module.t -> int -> t -> Type.t -> t
94
+ val append_child : t -> t -> int
26
95
 
27
- val global_get : Module.t -> string -> Type.t -> t
96
+ val insert_child_at : t -> int -> t -> unit
28
97
 
29
- val global_set : Module.t -> string -> t -> t
98
+ val remove_child_at : t -> int -> t
99
+ end
30
100
 
31
- val load : Module.t -> int -> ?signed:bool -> int -> int -> Type.t -> t -> t
101
+ module If : sig
102
+ val make : Module.t -> t -> t -> t -> t
32
103
 
33
- val store : Module.t -> int -> int -> int -> t -> t -> Type.t -> t
104
+ val get_condition : t -> t
34
105
 
35
- val const : Module.t -> Literal.t -> t
106
+ val set_condition : t -> t -> unit
36
107
 
37
- val unary : Module.t -> Op.t -> t -> t
108
+ val get_if_true : t -> t
38
109
 
39
- val binary : Module.t -> Op.t -> t -> t -> t
110
+ val set_if_true : t -> t -> unit
40
111
 
41
- val select : Module.t -> t -> t -> t -> t
112
+ val get_if_false : t -> t option
42
113
 
43
- val drop : Module.t -> t -> t
114
+ val set_if_false : t -> t -> unit
115
+ end
44
116
 
45
- val return : Module.t -> t -> t
117
+ module Loop : sig
118
+ val make : Module.t -> string -> t -> t
46
119
 
47
- val memory_size : Module.t -> t
120
+ val get_name : t -> string
48
121
 
49
- val memory_grow : Module.t -> t -> t
122
+ val set_name : t -> string -> unit
50
123
 
51
- val nop : Module.t -> t
124
+ val get_body : t -> t
52
125
 
53
- val unreachable : Module.t -> t
126
+ val set_body : t -> t -> unit
127
+ end
54
128
 
55
- val memory_copy : Module.t -> t -> t -> t -> t
129
+ module Break : sig
130
+ val make : Module.t -> string -> t -> t -> t
56
131
 
57
- val memory_fill : Module.t -> t -> t -> t -> t
132
+ val get_name : t -> string
58
133
 
59
- val tuple_make : Module.t -> t list -> t
134
+ val set_name : t -> string -> unit
60
135
 
61
- val tuple_extract : Module.t -> t -> int -> t
136
+ val get_condition : t -> t option
62
137
 
63
- val pop : Module.t -> Type.t -> t
138
+ val set_condition : t -> t -> unit
64
139
 
65
- val null : unit -> t
140
+ val get_value : t -> t option
66
141
 
67
- val print : t -> unit
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 int64
18
+ | Int64 of int32 * int32
19
19
  | Float32Bits of int32
20
- | Float64Bits of int64
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
- val create : unit -> t
3
+ module Feature : sig
4
+ type t
4
5
 
5
- val dispose : t -> unit
6
+ val mvp : t
6
7
 
7
- val add_custom_section : t -> string -> string -> unit
8
+ val atomics : t
8
9
 
9
- val parse : string -> t
10
+ val bulk_memory : t
10
11
 
11
- val print : t -> unit
12
-
13
- val print_asmjs : t -> unit
14
-
15
- val validate : t -> int
12
+ val mutable_globals : t
16
13
 
17
- val optimize : t -> unit
14
+ val nontrapping_fp_to_int : t
18
15
 
19
- val set_features : t -> int list -> unit
16
+ val sign_ext : t
20
17
 
21
- val get_optimize_level : unit -> int
18
+ val simd128 : t
22
19
 
23
- val set_optimize_level : int -> unit
20
+ val exception_handling : t
24
21
 
25
- val get_shrink_level : unit -> int
22
+ val tail_call : t
26
23
 
27
- val set_shrink_level : int -> unit
24
+ val reference_types : t
28
25
 
29
- val get_debug_info : unit -> int
26
+ val multivalue : t
30
27
 
31
- val set_debug_info : int -> unit
28
+ val all : t
29
+ end
32
30
 
33
- val get_low_memory_unused : unit -> int
31
+ val create : unit -> t
34
32
 
35
- val set_low_memory_unused : int -> unit
33
+ val dispose : t -> unit
36
34
 
37
- val get_pass_argument : string -> string
35
+ val add_custom_section : t -> string -> string -> unit
38
36
 
39
- val set_pass_argument : string -> string -> unit
37
+ val parse : string -> t
40
38
 
41
- val get_always_inline_max_size : unit -> int
39
+ val print : t -> unit
42
40
 
43
- val set_always_inline_max_size : int -> unit
41
+ val print_asmjs : t -> unit
44
42
 
45
- val get_flexible_inline_max_size : unit -> int
43
+ val validate : t -> int
46
44
 
47
- val set_flexible_inline_max_size : int -> unit
45
+ val optimize : t -> unit
48
46
 
49
- val get_one_caller_inline_max_size : unit -> int
47
+ val get_features : t -> Feature.t list
50
48
 
51
- val set_one_caller_inline_max_size : int -> unit
49
+ val set_features : t -> Feature.t list -> unit
52
50
 
53
51
  val run_passes : t -> string list -> unit
54
52