@grain/binaryen.ml 0.14.1 → 0.17.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 (78) hide show
  1. binaryen-archive/CHANGELOG.md +63 -0
  2. binaryen-archive/README.md +10 -24
  3. binaryen-archive/binaryen.opam +3 -5
  4. binaryen-archive/dune +1 -1
  5. binaryen-archive/esy.lock/index.json +77 -160
  6. binaryen-archive/esy.lock/opam/{cmdliner.1.1.0 → cmdliner.1.1.1}/opam +24 -18
  7. binaryen-archive/esy.lock/opam/{easy-format.1.3.2 → easy-format.1.3.3}/opam +30 -18
  8. binaryen-archive/esy.lock/opam/{ppx_yojson_conv_lib.v0.14.0 → ppx_yojson_conv_lib.v0.15.0}/opam +2 -2
  9. binaryen-archive/esy.lock/opam/{ppxlib.0.25.0 → ppxlib.0.26.0}/opam +5 -4
  10. binaryen-archive/esy.lock/opam/{re.1.10.3 → re.1.10.4}/opam +7 -7
  11. binaryen-archive/esy.lock/opam/{spawn.v0.15.0 → spawn.v0.15.1}/opam +4 -4
  12. binaryen-archive/esy.lock/overrides/opam__s__easy_format_opam__c__1.3.3_opam_override/package.json +3 -0
  13. binaryen-archive/package.json +4 -6
  14. binaryen-archive/src/binaryen_stubs_exports.js +110 -0
  15. binaryen-archive/src/binaryen_stubs_expressions.c +6 -1
  16. binaryen-archive/src/binaryen_stubs_expressions.js +1614 -0
  17. binaryen-archive/src/binaryen_stubs_features.c +6 -0
  18. binaryen-archive/src/binaryen_stubs_features.js +111 -0
  19. binaryen-archive/src/binaryen_stubs_functions.js +92 -0
  20. binaryen-archive/src/binaryen_stubs_globals.js +62 -0
  21. binaryen-archive/src/binaryen_stubs_imports.js +86 -0
  22. binaryen-archive/src/binaryen_stubs_literals.js +29 -0
  23. binaryen-archive/src/binaryen_stubs_memory.js +25 -0
  24. binaryen-archive/src/binaryen_stubs_modules.js +121 -0
  25. binaryen-archive/src/binaryen_stubs_ops.c +2 -2
  26. binaryen-archive/src/binaryen_stubs_ops.js +1895 -0
  27. binaryen-archive/src/binaryen_stubs_settings.js +120 -0
  28. binaryen-archive/src/binaryen_stubs_tables.c +2 -0
  29. binaryen-archive/src/binaryen_stubs_tables.js +84 -0
  30. binaryen-archive/src/binaryen_stubs_types.js +73 -0
  31. binaryen-archive/src/dune +11 -4
  32. binaryen-archive/{virtual → src}/element_segment.mli +0 -0
  33. binaryen-archive/{virtual → src}/export.mli +0 -0
  34. binaryen-archive/src/expression.ml +1 -1
  35. binaryen-archive/{virtual → src}/expression.mli +1 -1
  36. binaryen-archive/{virtual → src}/function.mli +0 -0
  37. binaryen-archive/{virtual → src}/global.mli +0 -0
  38. binaryen-archive/{virtual → src}/import.mli +0 -0
  39. binaryen-archive/src/literal.ml +0 -13
  40. binaryen-archive/src/literal.mli +8 -0
  41. binaryen-archive/src/memory.ml +6 -6
  42. binaryen-archive/{virtual → src}/memory.mli +1 -1
  43. binaryen-archive/src/module.ml +5 -1
  44. binaryen-archive/{virtual → src}/module.mli +2 -1
  45. binaryen-archive/{virtual → src}/op.mli +0 -0
  46. binaryen-archive/src/passes.ml +351 -0
  47. binaryen-archive/src/passes.mli +349 -0
  48. binaryen-archive/{virtual → src}/settings.mli +0 -0
  49. binaryen-archive/{virtual → src}/table.mli +0 -0
  50. binaryen-archive/{virtual → src}/type.mli +0 -0
  51. binaryen-archive/test/config/ocamlopt_flags.ml +1 -8
  52. binaryen-archive/test/dune +2 -22
  53. binaryen-archive/test/test.expected +8 -4
  54. binaryen-archive/test/test.ml +51 -10
  55. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +0 -44
  56. binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +0 -45
  57. binaryen-archive/esy.lock/opam/uchar.0.0.2/opam +0 -36
  58. binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch +0 -11
  59. binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json +0 -11
  60. binaryen-archive/js/binaryen.es5.js +0 -363
  61. binaryen-archive/js/dune +0 -13
  62. binaryen-archive/js/element_segment.ml +0 -33
  63. binaryen-archive/js/export.ml +0 -57
  64. binaryen-archive/js/expression.ml +0 -1105
  65. binaryen-archive/js/function.ml +0 -60
  66. binaryen-archive/js/global.ml +0 -48
  67. binaryen-archive/js/import.ml +0 -69
  68. binaryen-archive/js/literal.ml +0 -28
  69. binaryen-archive/js/memory.ml +0 -39
  70. binaryen-archive/js/module.ml +0 -116
  71. binaryen-archive/js/op.ml +0 -482
  72. binaryen-archive/js/prelude.js +0 -2
  73. binaryen-archive/js/settings.ml +0 -60
  74. binaryen-archive/js/stubs.c +0 -15
  75. binaryen-archive/js/table.ml +0 -29
  76. binaryen-archive/js/type.ml +0 -21
  77. binaryen-archive/virtual/dune +0 -6
  78. binaryen-archive/virtual/literal.mli +0 -19
@@ -0,0 +1,1614 @@
1
+ //Provides: to_option
2
+ function to_option(x) {
3
+ if (x) {
4
+ return [0, x];
5
+ } else {
6
+ return 0;
7
+ }
8
+ }
9
+
10
+ //Provides: caml_binaryen_expression_get_id
11
+ //Requires: binaryen
12
+ function caml_binaryen_expression_get_id(expr) {
13
+ return binaryen.getExpressionId(expr);
14
+ }
15
+
16
+ //Provides: caml_binaryen_null_expression
17
+ function caml_binaryen_null_expression() {
18
+ return null;
19
+ }
20
+
21
+ //Provides: caml_binaryen_block
22
+ //Requires: caml_jsstring_of_string
23
+ //Requires: caml_list_to_js_array
24
+ function caml_binaryen_block(wasm_mod, name, children, return_type) {
25
+ return wasm_mod.block(
26
+ caml_jsstring_of_string(name),
27
+ caml_list_to_js_array(children),
28
+ return_type
29
+ );
30
+ }
31
+
32
+ //Provides: caml_binaryen_if
33
+ function caml_binaryen_if(wasm_mod, cond, if_true, if_false) {
34
+ return wasm_mod.if(cond, if_true, if_false);
35
+ }
36
+
37
+ //Provides: caml_binaryen_loop
38
+ //Requires: caml_jsstring_of_string
39
+ function caml_binaryen_loop(wasm_mod, name, body) {
40
+ return wasm_mod.loop(
41
+ caml_jsstring_of_string(name),
42
+ body
43
+ );
44
+ }
45
+
46
+ //Provides: caml_binaryen_break
47
+ //Requires: caml_jsstring_of_string
48
+ function caml_binaryen_break(wasm_mod, name, cond, res) {
49
+ return wasm_mod.br(
50
+ caml_jsstring_of_string(name),
51
+ cond,
52
+ res
53
+ );
54
+ }
55
+
56
+ //Provides: caml_binaryen_switch
57
+ //Requires: caml_jsstring_of_string
58
+ //Requires: caml_list_to_js_array
59
+ function caml_binaryen_switch(wasm_mod, names, default_name, cond, value) {
60
+ return wasm_mod.switch(
61
+ caml_list_to_js_array(names).map(caml_jsstring_of_string),
62
+ caml_jsstring_of_string(default_name),
63
+ cond,
64
+ value
65
+ );
66
+ }
67
+
68
+ //Provides: caml_binaryen_call
69
+ //Requires: caml_jsstring_of_string
70
+ //Requires: caml_list_to_js_array
71
+ function caml_binaryen_call(wasm_mod, name, params, return_typ) {
72
+ return wasm_mod.call(
73
+ caml_jsstring_of_string(name),
74
+ caml_list_to_js_array(params),
75
+ return_typ
76
+ );
77
+ }
78
+
79
+ //Provides: caml_binaryen_call_indirect
80
+ //Requires: caml_jsstring_of_string
81
+ //Requires: caml_list_to_js_array
82
+ function caml_binaryen_call_indirect(wasm_mod, table, target, params, params_typ, return_typ) {
83
+ return wasm_mod.call_indirect(
84
+ caml_jsstring_of_string(table),
85
+ target,
86
+ caml_list_to_js_array(params),
87
+ params_typ,
88
+ return_typ
89
+ );
90
+ }
91
+ //Provides: caml_binaryen_call_indirect__bytecode
92
+ //Requires: caml_binaryen_call_indirect
93
+ function caml_binaryen_call_indirect__bytecode() {
94
+ return caml_binaryen_call_indirect(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
95
+ }
96
+
97
+ //Provides: caml_binaryen_return_call
98
+ //Requires: caml_jsstring_of_string
99
+ //Requires: caml_list_to_js_array
100
+ function caml_binaryen_return_call(wasm_mod, name, params, return_typ) {
101
+ return wasm_mod.return_call(
102
+ caml_jsstring_of_string(name),
103
+ caml_list_to_js_array(params),
104
+ return_typ
105
+ );
106
+ }
107
+
108
+ //Provides: caml_binaryen_return_call_indirect
109
+ //Requires: caml_jsstring_of_string
110
+ //Requires: caml_list_to_js_array
111
+ function caml_binaryen_return_call_indirect(wasm_mod, table, target, params, params_typ, return_typ) {
112
+ return wasm_mod.return_call_indirect(
113
+ caml_jsstring_of_string(table),
114
+ target,
115
+ caml_list_to_js_array(params),
116
+ params_typ,
117
+ return_typ
118
+ );
119
+ }
120
+ //Provides: caml_binaryen_return_call_indirect__bytecode
121
+ //Requires: caml_binaryen_return_call_indirect
122
+ function caml_binaryen_return_call_indirect__bytecode() {
123
+ return caml_binaryen_return_call_indirect(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
124
+ }
125
+
126
+ //Provides: caml_binaryen_local_get
127
+ function caml_binaryen_local_get(wasm_mod, slot, typ) {
128
+ return wasm_mod.local.get(slot, typ);
129
+ }
130
+
131
+ //Provides: caml_binaryen_local_set
132
+ function caml_binaryen_local_set(wasm_mod, slot, value) {
133
+ return wasm_mod.local.set(slot, value);
134
+ }
135
+
136
+ //Provides: caml_binaryen_local_tee
137
+ function caml_binaryen_local_tee(wasm_mod, slot, value, typ) {
138
+ return wasm_mod.local.tee(slot, value, typ);
139
+ }
140
+
141
+ //Provides: caml_binaryen_global_get
142
+ //Requires: caml_jsstring_of_string
143
+ function caml_binaryen_global_get(wasm_mod, name, typ) {
144
+ return wasm_mod.global.get(
145
+ caml_jsstring_of_string(name),
146
+ typ
147
+ );
148
+ }
149
+
150
+ //Provides: caml_binaryen_global_set
151
+ //Requires: caml_jsstring_of_string
152
+ function caml_binaryen_global_set(wasm_mod, name, value) {
153
+ return wasm_mod.global.set(
154
+ caml_jsstring_of_string(name),
155
+ value
156
+ );
157
+ }
158
+
159
+ //Provides: caml_binaryen_load
160
+ //Requires: binaryen
161
+ function caml_binaryen_load(wasm_mod, bytes, signed, offset, align, typ, ptr) {
162
+ return binaryen._BinaryenLoad(
163
+ wasm_mod,
164
+ bytes,
165
+ signed,
166
+ offset,
167
+ align,
168
+ typ,
169
+ ptr
170
+ );
171
+ }
172
+ //Provides: caml_binaryen_load__bytecode
173
+ //Requires: caml_binaryen_load
174
+ function caml_binaryen_load__bytecode() {
175
+ return caml_binaryen_load(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
176
+ }
177
+
178
+ //Provides: caml_binaryen_store
179
+ //Requires: binaryen
180
+ function caml_binaryen_store(wasm_mod, bytes, offset, align, ptr, value, typ) {
181
+ return binaryen._BinaryenStore(
182
+ wasm_mod,
183
+ bytes,
184
+ offset,
185
+ align,
186
+ ptr,
187
+ value,
188
+ typ
189
+ );
190
+ }
191
+ //Provides: caml_binaryen_store__bytecode
192
+ //Requires: caml_binaryen_store
193
+ function caml_binaryen_store__bytecode() {
194
+ return caml_binaryen_store(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
195
+ }
196
+
197
+ //Provides: caml_binaryen_const
198
+ //Requires: caml_int64_lo32, caml_int64_hi32
199
+ //Requires: caml_failwith
200
+ function caml_binaryen_const(wasm_mod, lit) {
201
+ if (lit.type === 'int32') {
202
+ return wasm_mod.i32.const(lit.value);
203
+ }
204
+
205
+ if (lit.type === 'int64') {
206
+ return wasm_mod.i64.const(
207
+ caml_int64_lo32(lit.value),
208
+ caml_int64_hi32(lit.value)
209
+ );
210
+ }
211
+
212
+ if (lit.type === 'float64') {
213
+ return wasm_mod.f64.const(lit.value);
214
+ }
215
+
216
+ if (lit.type === 'float32_bits') {
217
+ return wasm_mod.f32.const_bits(lit.value);
218
+ }
219
+
220
+ if (lit.type === 'float64_bits') {
221
+ return wasm_mod.f64.const_bits(
222
+ caml_int64_lo32(lit.value),
223
+ caml_int64_hi32(lit.value)
224
+ );
225
+ }
226
+
227
+ caml_failwith('invalid Literal for Binaryen.Const.make');
228
+ }
229
+
230
+ //Provides: caml_binaryen_unary
231
+ //Requires: binaryen
232
+ function caml_binaryen_unary(wasm_mod, op, p) {
233
+ return binaryen._BinaryenUnary(wasm_mod, op, p);
234
+ }
235
+
236
+ //Provides: caml_binaryen_binary
237
+ //Requires: binaryen
238
+ function caml_binaryen_binary(wasm_mod, op, p1, p2) {
239
+ return binaryen._BinaryenBinary(wasm_mod, op, p1, p2);
240
+ }
241
+
242
+ //Provides: caml_binaryen_select
243
+ function caml_binaryen_select(wasm_mod, cond, if_true, if_false, typ) {
244
+ return wasm_mod.select(cond, if_true, if_false, typ);
245
+ }
246
+
247
+ //Provides: caml_binaryen_drop
248
+ function caml_binaryen_drop(wasm_mod, value) {
249
+ return wasm_mod.drop(value);
250
+ }
251
+
252
+ //Provides: caml_binaryen_return
253
+ function caml_binaryen_return(wasm_mod, value) {
254
+ return wasm_mod.return(value);
255
+ }
256
+
257
+ //Provides: caml_binaryen_memory_size
258
+ function caml_binaryen_memory_size(wasm_mod) {
259
+ return wasm_mod.memory.size();
260
+ }
261
+
262
+ //Provides: caml_binaryen_memory_grow
263
+ function caml_binaryen_memory_grow(wasm_mod, value) {
264
+ return wasm_mod.memory.grow(value);
265
+ }
266
+
267
+ //Provides: caml_binaryen_nop
268
+ function caml_binaryen_nop(wasm_mod) {
269
+ return wasm_mod.nop();
270
+ }
271
+
272
+ //Provides: caml_binaryen_unreachable
273
+ function caml_binaryen_unreachable(wasm_mod) {
274
+ return wasm_mod.unreachable();
275
+ }
276
+
277
+ //Provides: caml_binaryen_memory_copy
278
+ function caml_binaryen_memory_copy(wasm_mod, dest, source, size) {
279
+ return wasm_mod.memory.copy(dest, source, size);
280
+ }
281
+
282
+ //Provides: caml_binaryen_memory_fill
283
+ function caml_binaryen_memory_fill(wasm_mod, dest, value, size) {
284
+ return wasm_mod.memory.fill(dest, value, size);
285
+ }
286
+
287
+ //Provides: caml_binaryen_tuple_make
288
+ //Requires: caml_list_to_js_array
289
+ function caml_binaryen_tuple_make(wasm_mod, operands) {
290
+ return wasm_mod.tuple.make(caml_list_to_js_array(operands));
291
+ }
292
+
293
+ //Provides: caml_binaryen_tuple_extract
294
+ function caml_binaryen_tuple_extract(wasm_mod, tuple, index) {
295
+ return wasm_mod.tuple.extract(tuple, index);
296
+ }
297
+
298
+ //Provides: caml_binaryen_pop
299
+ //Requires: binaryen
300
+ function caml_binaryen_pop(wasm_mod, typ) {
301
+ return binaryen._BinaryenPop(wasm_mod, typ);
302
+ }
303
+
304
+ //Provides: caml_binaryen_expression_id_invalid
305
+ //Requires: binaryen
306
+ function caml_binaryen_expression_id_invalid() {
307
+ return binaryen.InvalidId;
308
+ }
309
+
310
+ //Provides: caml_binaryen_expression_id_nop
311
+ //Requires: binaryen
312
+ function caml_binaryen_expression_id_nop() {
313
+ return binaryen.NopId;
314
+ }
315
+ //Provides: caml_binaryen_expression_id_block
316
+ //Requires: binaryen
317
+ function caml_binaryen_expression_id_block() {
318
+ return binaryen.BlockId;
319
+ }
320
+ //Provides: caml_binaryen_expression_id_if
321
+ //Requires: binaryen
322
+ function caml_binaryen_expression_id_if() {
323
+ return binaryen.IfId;
324
+ }
325
+ //Provides: caml_binaryen_expression_id_loop
326
+ //Requires: binaryen
327
+ function caml_binaryen_expression_id_loop() {
328
+ return binaryen.LoopId;
329
+ }
330
+ //Provides: caml_binaryen_expression_id_break
331
+ //Requires: binaryen
332
+ function caml_binaryen_expression_id_break() {
333
+ return binaryen.BreakId;
334
+ }
335
+ //Provides: caml_binaryen_expression_id_switch
336
+ //Requires: binaryen
337
+ function caml_binaryen_expression_id_switch() {
338
+ return binaryen.SwitchId;
339
+ }
340
+ //Provides: caml_binaryen_expression_id_call
341
+ //Requires: binaryen
342
+ function caml_binaryen_expression_id_call() {
343
+ return binaryen.CallId;
344
+ }
345
+ //Provides: caml_binaryen_expression_id_call_indirect
346
+ //Requires: binaryen
347
+ function caml_binaryen_expression_id_call_indirect() {
348
+ return binaryen.CallIndirectId;
349
+ }
350
+ //Provides: caml_binaryen_expression_id_local_get
351
+ //Requires: binaryen
352
+ function caml_binaryen_expression_id_local_get() {
353
+ return binaryen.LocalGetId;
354
+ }
355
+ //Provides: caml_binaryen_expression_id_local_set
356
+ //Requires: binaryen
357
+ function caml_binaryen_expression_id_local_set() {
358
+ return binaryen.LocalSetId;
359
+ }
360
+ //Provides: caml_binaryen_expression_id_global_get
361
+ //Requires: binaryen
362
+ function caml_binaryen_expression_id_global_get() {
363
+ return binaryen.GlobalGetId;
364
+ }
365
+ //Provides: caml_binaryen_expression_id_global_set
366
+ //Requires: binaryen
367
+ function caml_binaryen_expression_id_global_set() {
368
+ return binaryen.GlobalSetId;
369
+ }
370
+ //Provides: caml_binaryen_expression_id_load
371
+ //Requires: binaryen
372
+ function caml_binaryen_expression_id_load() {
373
+ return binaryen.LoadId;
374
+ }
375
+ //Provides: caml_binaryen_expression_id_store
376
+ //Requires: binaryen
377
+ function caml_binaryen_expression_id_store() {
378
+ return binaryen.StoreId;
379
+ }
380
+ //Provides: caml_binaryen_expression_id_atomic_rmw
381
+ //Requires: binaryen
382
+ function caml_binaryen_expression_id_atomic_rmw() {
383
+ return binaryen.AtomicRMWId;
384
+ }
385
+ //Provides: caml_binaryen_expression_id_atomic_cmpxchg
386
+ //Requires: binaryen
387
+ function caml_binaryen_expression_id_atomic_cmpxchg() {
388
+ return binaryen.AtomicCmpxchgId;
389
+ }
390
+ //Provides: caml_binaryen_expression_id_atomic_wait
391
+ //Requires: binaryen
392
+ function caml_binaryen_expression_id_atomic_wait() {
393
+ return binaryen.AtomicWaitId;
394
+ }
395
+ //Provides: caml_binaryen_expression_id_atomic_notify
396
+ //Requires: binaryen
397
+ function caml_binaryen_expression_id_atomic_notify() {
398
+ return binaryen.AtomicNotifyId;
399
+ }
400
+ //Provides: caml_binaryen_expression_id_atomic_fence
401
+ //Requires: binaryen
402
+ function caml_binaryen_expression_id_atomic_fence() {
403
+ return binaryen.AtomicFenceId;
404
+ }
405
+ //Provides: caml_binaryen_expression_id_simd_extract
406
+ //Requires: binaryen
407
+ function caml_binaryen_expression_id_simd_extract() {
408
+ return binaryen.SIMDExtractId;
409
+ }
410
+ //Provides: caml_binaryen_expression_id_simd_replace
411
+ //Requires: binaryen
412
+ function caml_binaryen_expression_id_simd_replace() {
413
+ return binaryen.SIMDReplaceId;
414
+ }
415
+ //Provides: caml_binaryen_expression_id_simd_shuffle
416
+ //Requires: binaryen
417
+ function caml_binaryen_expression_id_simd_shuffle() {
418
+ return binaryen.SIMDShuffleId;
419
+ }
420
+ //Provides: caml_binaryen_expression_id_simd_ternary
421
+ //Requires: binaryen
422
+ function caml_binaryen_expression_id_simd_ternary() {
423
+ return binaryen.SIMDTernaryId;
424
+ }
425
+ //Provides: caml_binaryen_expression_id_simd_shift
426
+ //Requires: binaryen
427
+ function caml_binaryen_expression_id_simd_shift() {
428
+ return binaryen.SIMDShiftId;
429
+ }
430
+ //Provides: caml_binaryen_expression_id_simd_load
431
+ //Requires: binaryen
432
+ function caml_binaryen_expression_id_simd_load() {
433
+ return binaryen.SIMDLoadId;
434
+ }
435
+ //Provides: caml_binaryen_expression_id_simd_load_store_lane
436
+ //Requires: binaryen
437
+ function caml_binaryen_expression_id_simd_load_store_lane() {
438
+ return binaryen.SIMDLoadStoreLaneId;
439
+ }
440
+ //Provides: caml_binaryen_expression_id_memory_init
441
+ //Requires: binaryen
442
+ function caml_binaryen_expression_id_memory_init() {
443
+ return binaryen.MemoryInitId;
444
+ }
445
+ //Provides: caml_binaryen_expression_id_data_drop
446
+ //Requires: binaryen
447
+ function caml_binaryen_expression_id_data_drop() {
448
+ return binaryen.DataDropId;
449
+ }
450
+ //Provides: caml_binaryen_expression_id_memory_copy
451
+ //Requires: binaryen
452
+ function caml_binaryen_expression_id_memory_copy() {
453
+ return binaryen.MemoryCopyId;
454
+ }
455
+ //Provides: caml_binaryen_expression_id_memory_fill
456
+ //Requires: binaryen
457
+ function caml_binaryen_expression_id_memory_fill() {
458
+ return binaryen.MemoryFillId;
459
+ }
460
+ //Provides: caml_binaryen_expression_id_const
461
+ //Requires: binaryen
462
+ function caml_binaryen_expression_id_const() {
463
+ return binaryen.ConstId;
464
+ }
465
+ //Provides: caml_binaryen_expression_id_unary
466
+ //Requires: binaryen
467
+ function caml_binaryen_expression_id_unary() {
468
+ return binaryen.UnaryId;
469
+ }
470
+ //Provides: caml_binaryen_expression_id_binary
471
+ //Requires: binaryen
472
+ function caml_binaryen_expression_id_binary() {
473
+ return binaryen.BinaryId;
474
+ }
475
+ //Provides: caml_binaryen_expression_id_select
476
+ //Requires: binaryen
477
+ function caml_binaryen_expression_id_select() {
478
+ return binaryen.SelectId;
479
+ }
480
+ //Provides: caml_binaryen_expression_id_drop
481
+ //Requires: binaryen
482
+ function caml_binaryen_expression_id_drop() {
483
+ return binaryen.DropId;
484
+ }
485
+ //Provides: caml_binaryen_expression_id_return
486
+ //Requires: binaryen
487
+ function caml_binaryen_expression_id_return() {
488
+ return binaryen.ReturnId;
489
+ }
490
+ //Provides: caml_binaryen_expression_id_memory_size
491
+ //Requires: binaryen
492
+ function caml_binaryen_expression_id_memory_size() {
493
+ return binaryen.MemorySizeId;
494
+ }
495
+ //Provides: caml_binaryen_expression_id_memory_grow
496
+ //Requires: binaryen
497
+ function caml_binaryen_expression_id_memory_grow() {
498
+ return binaryen.MemoryGrowId;
499
+ }
500
+ //Provides: caml_binaryen_expression_id_unreachable
501
+ //Requires: binaryen
502
+ function caml_binaryen_expression_id_unreachable() {
503
+ return binaryen.UnreachableId;
504
+ }
505
+ //Provides: caml_binaryen_expression_id_pop
506
+ //Requires: binaryen
507
+ function caml_binaryen_expression_id_pop() {
508
+ return binaryen.PopId;
509
+ }
510
+ //Provides: caml_binaryen_expression_id_ref_null
511
+ //Requires: binaryen
512
+ function caml_binaryen_expression_id_ref_null() {
513
+ return binaryen.RefNullId;
514
+ }
515
+ //Provides: caml_binaryen_expression_id_ref_is
516
+ //Requires: binaryen
517
+ function caml_binaryen_expression_id_ref_is() {
518
+ return binaryen.RefIsId;
519
+ }
520
+ //Provides: caml_binaryen_expression_id_ref_as
521
+ //Requires: binaryen
522
+ function caml_binaryen_expression_id_ref_as() {
523
+ return binaryen.RefAsId;
524
+ }
525
+ //Provides: caml_binaryen_expression_id_ref_func
526
+ //Requires: binaryen
527
+ function caml_binaryen_expression_id_ref_func() {
528
+ return binaryen.RefFuncId;
529
+ }
530
+ //Provides: caml_binaryen_expression_id_ref_eq
531
+ //Requires: binaryen
532
+ function caml_binaryen_expression_id_ref_eq() {
533
+ return binaryen.RefEqId;
534
+ }
535
+ //Provides: caml_binaryen_expression_id_try
536
+ //Requires: binaryen
537
+ function caml_binaryen_expression_id_try() {
538
+ return binaryen.TryId;
539
+ }
540
+ //Provides: caml_binaryen_expression_id_throw
541
+ //Requires: binaryen
542
+ function caml_binaryen_expression_id_throw() {
543
+ return binaryen.ThrowId;
544
+ }
545
+ //Provides: caml_binaryen_expression_id_rethrow
546
+ //Requires: binaryen
547
+ function caml_binaryen_expression_id_rethrow() {
548
+ return binaryen.RethrowId;
549
+ }
550
+ //Provides: caml_binaryen_expression_id_tuple_make
551
+ //Requires: binaryen
552
+ function caml_binaryen_expression_id_tuple_make() {
553
+ return binaryen.TupleMakeId;
554
+ }
555
+ //Provides: caml_binaryen_expression_id_tuple_extract
556
+ //Requires: binaryen
557
+ function caml_binaryen_expression_id_tuple_extract() {
558
+ return binaryen.TupleExtractId;
559
+ }
560
+ //Provides: caml_binaryen_expression_id_i31_new
561
+ //Requires: binaryen
562
+ function caml_binaryen_expression_id_i31_new() {
563
+ return binaryen.I31NewId;
564
+ }
565
+ //Provides: caml_binaryen_expression_id_i31_get
566
+ //Requires: binaryen
567
+ function caml_binaryen_expression_id_i31_get() {
568
+ return binaryen.I31GetId;
569
+ }
570
+ //Provides: caml_binaryen_expression_id_call_ref
571
+ //Requires: binaryen
572
+ function caml_binaryen_expression_id_call_ref() {
573
+ return binaryen.CallRefId;
574
+ }
575
+ //Provides: caml_binaryen_expression_id_ref_test
576
+ //Requires: binaryen
577
+ function caml_binaryen_expression_id_ref_test() {
578
+ return binaryen.RefTestId;
579
+ }
580
+ //Provides: caml_binaryen_expression_id_ref_cast
581
+ //Requires: binaryen
582
+ function caml_binaryen_expression_id_ref_cast() {
583
+ return binaryen.RefCastId;
584
+ }
585
+ //Provides: caml_binaryen_expression_id_br_on
586
+ //Requires: binaryen
587
+ function caml_binaryen_expression_id_br_on() {
588
+ return binaryen.BrOnId;
589
+ }
590
+ //Provides: caml_binaryen_expression_id_rtt_canon
591
+ //Requires: binaryen
592
+ function caml_binaryen_expression_id_rtt_canon() {
593
+ return binaryen.RttCanonId;
594
+ }
595
+ //Provides: caml_binaryen_expression_id_rtt_sub
596
+ //Requires: binaryen
597
+ function caml_binaryen_expression_id_rtt_sub() {
598
+ return binaryen.RttSubId;
599
+ }
600
+ //Provides: caml_binaryen_expression_id_struct_new
601
+ //Requires: binaryen
602
+ function caml_binaryen_expression_id_struct_new() {
603
+ return binaryen.StructNewId;
604
+ }
605
+ //Provides: caml_binaryen_expression_id_struct_get
606
+ //Requires: binaryen
607
+ function caml_binaryen_expression_id_struct_get() {
608
+ return binaryen.StructGetId;
609
+ }
610
+ //Provides: caml_binaryen_expression_id_struct_set
611
+ //Requires: binaryen
612
+ function caml_binaryen_expression_id_struct_set() {
613
+ return binaryen.StructSetId;
614
+ }
615
+ //Provides: caml_binaryen_expression_id_array_new
616
+ //Requires: binaryen
617
+ function caml_binaryen_expression_id_array_new() {
618
+ return binaryen.ArrayNewId;
619
+ }
620
+ //Provides: caml_binaryen_expression_id_array_get
621
+ //Requires: binaryen
622
+ function caml_binaryen_expression_id_array_get() {
623
+ return binaryen.ArrayGetId;
624
+ }
625
+ //Provides: caml_binaryen_expression_id_array_set
626
+ //Requires: binaryen
627
+ function caml_binaryen_expression_id_array_set() {
628
+ return binaryen.ArraySetId;
629
+ }
630
+ //Provides: caml_binaryen_expression_id_array_len
631
+ //Requires: binaryen
632
+ function caml_binaryen_expression_id_array_len() {
633
+ return binaryen.ArrayLenId;
634
+ }
635
+
636
+ // Expression operations
637
+
638
+ //Provides: caml_binaryen_expression_print
639
+ //Requires: binaryen
640
+ //Requires: caml_string_of_jsstring
641
+ //Requires: caml_ml_output, caml_ml_string_length
642
+ function caml_binaryen_expression_print(expr) {
643
+ var text = binaryen.emitText(expr);
644
+ var chanid = 1; // stdout
645
+ var s = caml_string_of_jsstring(text);
646
+ caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
647
+ }
648
+
649
+ //Provides: caml_binaryen_expression_finalize
650
+ //Requires: binaryen
651
+ function caml_binaryen_expression_finalize(exp) {
652
+ binaryen.Expression.finalize(exp);
653
+ }
654
+
655
+ //Provides: caml_binaryen_expression_copy
656
+ function caml_binaryen_expression_copy(exp, wasm_mod) {
657
+ return wasm_mod.copyExpression(exp);
658
+ }
659
+
660
+ // Block operations
661
+
662
+ //Provides: caml_binaryen_block_get_name
663
+ //Requires: binaryen
664
+ //Requires: to_option
665
+ //Requires: caml_string_of_jsstring
666
+ function caml_binaryen_block_get_name(exp) {
667
+ var name = binaryen.Block.getName(exp);
668
+ var str = name != null ? caml_string_of_jsstring(name) : null;
669
+ return to_option(str);
670
+ }
671
+
672
+ //Provides: caml_binaryen_block_set_name
673
+ //Requires: binaryen
674
+ //Requires: caml_jsstring_of_string
675
+ function caml_binaryen_block_set_name(exp, name) {
676
+ return binaryen.Block.setName(
677
+ exp,
678
+ caml_jsstring_of_string(name)
679
+ );
680
+ }
681
+
682
+ //Provides: caml_binaryen_block_get_num_children
683
+ //Requires: binaryen
684
+ function caml_binaryen_block_get_num_children(exp) {
685
+ return binaryen.Block.getNumChildren(exp);
686
+ }
687
+
688
+ //Provides: caml_binaryen_block_get_child_at
689
+ //Requires: binaryen
690
+ function caml_binaryen_block_get_child_at(exp, index) {
691
+ return binaryen.Block.getChildAt(exp, index);
692
+ }
693
+
694
+ //Provides: caml_binaryen_block_set_child_at
695
+ //Requires: binaryen
696
+ function caml_binaryen_block_set_child_at(exp, index, child) {
697
+ return binaryen.Block.setChildAt(exp, index, child);
698
+ }
699
+
700
+ //Provides: caml_binaryen_block_append_child
701
+ //Requires: binaryen
702
+ function caml_binaryen_block_append_child(exp, child) {
703
+ return binaryen.Block.appendChild(exp, child);
704
+ }
705
+
706
+ //Provides: caml_binaryen_block_insert_child_at
707
+ //Requires: binaryen
708
+ function caml_binaryen_block_insert_child_at(exp, index, child) {
709
+ return binaryen.Block.insertChildAt(exp, index, child);
710
+ }
711
+
712
+ //Provides: caml_binaryen_block_remove_child_at
713
+ //Requires: binaryen
714
+ function caml_binaryen_block_remove_child_at(exp, index) {
715
+ return binaryen.Block.removeChildAt(exp, index);
716
+ }
717
+
718
+ // If operations
719
+
720
+ //Provides: caml_binaryen_if_get_condition
721
+ //Requires: binaryen
722
+ function caml_binaryen_if_get_condition(exp) {
723
+ return binaryen.If.getCondition(exp);
724
+ }
725
+
726
+ //Provides: caml_binaryen_if_set_condition
727
+ //Requires: binaryen
728
+ function caml_binaryen_if_set_condition(exp, cond) {
729
+ return binaryen.If.setCondition(exp, cond);
730
+ }
731
+
732
+ //Provides: caml_binaryen_if_get_if_true
733
+ //Requires: binaryen
734
+ function caml_binaryen_if_get_if_true(exp) {
735
+ return binaryen.If.getIfTrue(exp);
736
+ }
737
+
738
+ //Provides: caml_binaryen_if_set_if_true
739
+ //Requires: binaryen
740
+ function caml_binaryen_if_set_if_true(exp, child) {
741
+ return binaryen.If.setIfTrue(exp, child);
742
+ }
743
+
744
+ //Provides: caml_binaryen_if_get_if_false
745
+ //Requires: binaryen
746
+ //Requires: to_option
747
+ function caml_binaryen_if_get_if_false(exp) {
748
+ return to_option(binaryen.If.getIfFalse(exp));
749
+ }
750
+
751
+ //Provides: caml_binaryen_if_set_if_false
752
+ //Requires: binaryen
753
+ function caml_binaryen_if_set_if_false(exp, child) {
754
+ return binaryen.If.setIfFalse(exp, child);
755
+ }
756
+
757
+ // Loop operations
758
+
759
+ //Provides: caml_binaryen_loop_get_name
760
+ //Requires: binaryen
761
+ //Requires: caml_string_of_jsstring
762
+ function caml_binaryen_loop_get_name(exp) {
763
+ return caml_string_of_jsstring(binaryen.Loop.getName(exp));
764
+ }
765
+
766
+ //Provides: caml_binaryen_loop_set_name
767
+ //Requires: binaryen
768
+ //Requires: caml_jsstring_of_string
769
+ function caml_binaryen_loop_set_name(exp, name) {
770
+ return binaryen.Loop.setName(
771
+ exp,
772
+ caml_jsstring_of_string(name)
773
+ );
774
+ }
775
+
776
+ //Provides: caml_binaryen_loop_get_body
777
+ //Requires: binaryen
778
+ function caml_binaryen_loop_get_body(exp) {
779
+ return binaryen.Loop.getBody(exp);
780
+ }
781
+
782
+ //Provides: caml_binaryen_loop_set_body
783
+ //Requires: binaryen
784
+ function caml_binaryen_loop_set_body(exp, child) {
785
+ return binaryen.Loop.setBody(exp, child);
786
+ }
787
+
788
+ // Break operations
789
+
790
+ //Provides: caml_binaryen_break_get_name
791
+ //Requires: binaryen
792
+ //Requires: caml_string_of_jsstring
793
+ function caml_binaryen_break_get_name(exp) {
794
+ return caml_string_of_jsstring(binaryen.Break.getName(exp));
795
+ }
796
+
797
+ //Provides: caml_binaryen_break_set_name
798
+ //Requires: binaryen
799
+ //Requires: caml_jsstring_of_string
800
+ function caml_binaryen_break_set_name(exp, name) {
801
+ return binaryen.Break.setName(
802
+ exp,
803
+ caml_jsstring_of_string(name)
804
+ );
805
+ }
806
+
807
+ //Provides: caml_binaryen_break_get_condition
808
+ //Requires: binaryen
809
+ //Requires: to_option
810
+ function caml_binaryen_break_get_condition(exp) {
811
+ return to_option(binaryen.Break.getCondition(exp))
812
+ }
813
+
814
+ //Provides: caml_binaryen_break_set_condition
815
+ //Requires: binaryen
816
+ function caml_binaryen_break_set_condition(exp, child) {
817
+ return binaryen.Break.setCondition(exp, child);
818
+ }
819
+
820
+ //Provides: caml_binaryen_break_get_value
821
+ //Requires: binaryen
822
+ //Requires: to_option
823
+ function caml_binaryen_break_get_value(exp) {
824
+ return to_option(binaryen.Break.getValue(exp));
825
+ }
826
+
827
+ //Provides: caml_binaryen_break_set_value
828
+ //Requires: binaryen
829
+ function caml_binaryen_break_set_value(exp, child) {
830
+ return binaryen.Break.setValue(exp, child);
831
+ }
832
+
833
+ // Switch operations
834
+
835
+ //Provides: caml_binaryen_switch_get_num_names
836
+ //Requires: binaryen
837
+ function caml_binaryen_switch_get_num_names(exp) {
838
+ return binaryen.Switch.getNumNames(exp);
839
+ }
840
+
841
+ //Provides: caml_binaryen_switch_get_name_at
842
+ //Requires: binaryen
843
+ //Requires: caml_string_of_jsstring
844
+ function caml_binaryen_switch_get_name_at(exp, index) {
845
+ return caml_string_of_jsstring(binaryen.Switch.getNameAt(exp, index));
846
+ }
847
+
848
+ //Provides: caml_binaryen_switch_set_name_at
849
+ //Requires: binaryen
850
+ //Requires: caml_jsstring_of_string
851
+ function caml_binaryen_switch_set_name_at(exp, index, name) {
852
+ return binaryen.Switch.setNameAt(
853
+ exp,
854
+ index,
855
+ caml_jsstring_of_string(name)
856
+ )
857
+ }
858
+
859
+ //Provides: caml_binaryen_switch_append_name
860
+ //Requires: binaryen
861
+ //Requires: caml_jsstring_of_string
862
+ function caml_binaryen_switch_append_name(exp, name) {
863
+ return binaryen.Switch.appendName(
864
+ exp,
865
+ caml_jsstring_of_string(name)
866
+ );
867
+ }
868
+
869
+ //Provides: caml_binaryen_switch_insert_name_at
870
+ //Requires: binaryen
871
+ //Requires: caml_jsstring_of_string
872
+ function caml_binaryen_switch_insert_name_at(exp, index, name) {
873
+ return binaryen.Switch.insertNameAt(
874
+ exp,
875
+ index,
876
+ caml_jsstring_of_string(name)
877
+ );
878
+ }
879
+
880
+ //Provides: caml_binaryen_switch_remove_name_at
881
+ //Requires: binaryen
882
+ //Requires: caml_string_of_jsstring
883
+ function caml_binaryen_switch_remove_name_at(exp, index) {
884
+ return caml_string_of_jsstring(binaryen.Switch.removeNameAt(exp, index));
885
+ }
886
+
887
+ //Provides: caml_binaryen_switch_get_default_name
888
+ //Requires: binaryen
889
+ //Requires: to_option
890
+ //Requires: caml_string_of_jsstring
891
+ function caml_binaryen_switch_get_default_name(exp) {
892
+ var name = binaryen.Switch.getDefaultName(exp);
893
+ var str = name != null ? caml_string_of_jsstring(name) : null;
894
+ return to_option(str);
895
+ }
896
+
897
+ //Provides: caml_binaryen_switch_set_default_name
898
+ //Requires: binaryen
899
+ //Requires: caml_jsstring_of_string
900
+ function caml_binaryen_switch_set_default_name(exp, name) {
901
+ return binaryen.Switch.setDefaultName(
902
+ exp,
903
+ caml_jsstring_of_string(name)
904
+ );
905
+ }
906
+
907
+ //Provides: caml_binaryen_switch_get_condition
908
+ //Requires: binaryen
909
+ function caml_binaryen_switch_get_condition(exp) {
910
+ return binaryen.Switch.getCondition(exp);
911
+ }
912
+
913
+ //Provides: caml_binaryen_switch_set_condition
914
+ //Requires: binaryen
915
+ function caml_binaryen_switch_set_condition(exp, child) {
916
+ return binaryen.Switch.setCondition(exp, child);
917
+ }
918
+
919
+ //Provides: caml_binaryen_switch_get_value
920
+ //Requires: binaryen
921
+ //Requires: to_option
922
+ function caml_binaryen_switch_get_value(exp) {
923
+ return to_option(binaryen.Switch.getValue(exp));
924
+ }
925
+
926
+ //Provides: caml_binaryen_switch_set_value
927
+ //Requires: binaryen
928
+ function caml_binaryen_switch_set_value(exp, child) {
929
+ return binaryen.Switch.setValue(exp, child);
930
+ }
931
+
932
+ //Provides: caml_binaryen_call_get_target
933
+ //Requires: binaryen
934
+ //Requires: caml_string_of_jsstring
935
+ function caml_binaryen_call_get_target(exp) {
936
+ return caml_string_of_jsstring(binaryen.Call.getTarget(exp));
937
+ }
938
+
939
+ //Provides: caml_binaryen_call_set_target
940
+ //Requires: binaryen
941
+ //Requires: caml_jsstring_of_string
942
+ function caml_binaryen_call_set_target(exp, name) {
943
+ return binaryen.Call.setTarget(
944
+ exp,
945
+ caml_jsstring_of_string(name)
946
+ );
947
+ }
948
+
949
+ //Provides: caml_binaryen_call_get_num_operands
950
+ //Requires: binaryen
951
+ function caml_binaryen_call_get_num_operands(exp) {
952
+ return binaryen.Call.getNumOperands(exp);
953
+ }
954
+
955
+ //Provides: caml_binaryen_call_get_operand_at
956
+ //Requires: binaryen
957
+ function caml_binaryen_call_get_operand_at(exp, index) {
958
+ return binaryen.Call.getOperandAt(exp, index);
959
+ }
960
+
961
+ //Provides: caml_binaryen_call_set_operand_at
962
+ //Requires: binaryen
963
+ function caml_binaryen_call_set_operand_at(exp, index, operand) {
964
+ return binaryen.Call.setOperandAt(exp, index, operand);
965
+ }
966
+
967
+ //Provides: caml_binaryen_call_append_operand
968
+ //Requires: binaryen
969
+ function caml_binaryen_call_append_operand(exp, operand) {
970
+ return binaryen.Call.appendOperand(exp, operand);
971
+ }
972
+
973
+ //Provides: caml_binaryen_call_insert_operand_at
974
+ //Requires: binaryen
975
+ function caml_binaryen_call_insert_operand_at(exp, index, operand) {
976
+ return binaryen.Call.insertOperandAt(exp, index, operand);
977
+ }
978
+
979
+ //Provides: caml_binaryen_call_remove_operand_at
980
+ //Requires: binaryen
981
+ function caml_binaryen_call_remove_operand_at(exp, index) {
982
+ return binaryen.Call.removeOperandAt(exp, index);
983
+ }
984
+
985
+ //Provides: caml_binaryen_call_is_return
986
+ //Requires: binaryen
987
+ //Requires: caml_js_to_bool
988
+ function caml_binaryen_call_is_return(exp) {
989
+ return caml_js_to_bool(binaryen.Call.isReturn(exp));
990
+ }
991
+
992
+ //Provides: caml_binaryen_call_set_return
993
+ //Requires: binaryen
994
+ //Requires: caml_js_from_bool
995
+ function caml_binaryen_call_set_return(exp, isReturn) {
996
+ return binaryen.Call.setReturn(
997
+ exp,
998
+ caml_js_from_bool(isReturn)
999
+ );
1000
+ }
1001
+
1002
+ //Provides: caml_binaryen_call_indirect_get_target
1003
+ //Requires: binaryen
1004
+ function caml_binaryen_call_indirect_get_target(exp) {
1005
+ return binaryen.CallIndirect.getTarget(exp);
1006
+ }
1007
+
1008
+ //Provides: caml_binaryen_call_indirect_set_target
1009
+ //Requires: binaryen
1010
+ function caml_binaryen_call_indirect_set_target(exp, target) {
1011
+ return binaryen.CallIndirect.setTarget(exp, target);
1012
+ }
1013
+
1014
+ //Provides: caml_binaryen_call_indirect_get_table
1015
+ //Requires: binaryen
1016
+ //Requires: caml_string_of_jsstring
1017
+ function caml_binaryen_call_indirect_get_table(exp) {
1018
+ return caml_string_of_jsstring(binaryen.CallIndirect.getTable(exp));
1019
+ }
1020
+
1021
+ //Provides: caml_binaryen_call_indirect_set_table
1022
+ //Requires: binaryen
1023
+ //Requires: caml_jsstring_of_string
1024
+ function caml_binaryen_call_indirect_set_table(exp, name) {
1025
+ return binaryen.CallIndirect.setTable(
1026
+ exp,
1027
+ caml_jsstring_of_string(name)
1028
+ );
1029
+ }
1030
+
1031
+ //Provides: caml_binaryen_call_indirect_get_num_operands
1032
+ //Requires: binaryen
1033
+ function caml_binaryen_call_indirect_get_num_operands(exp) {
1034
+ return binaryen.CallIndirect.getNumOperands(exp);
1035
+ }
1036
+
1037
+ //Provides: caml_binaryen_call_indirect_get_operand_at
1038
+ //Requires: binaryen
1039
+ function caml_binaryen_call_indirect_get_operand_at(exp, index) {
1040
+ return binaryen.CallIndirect.getOperandAt(exp, index);
1041
+ }
1042
+
1043
+ //Provides: caml_binaryen_call_indirect_set_operand_at
1044
+ //Requires: binaryen
1045
+ function caml_binaryen_call_indirect_set_operand_at(exp, index, operand) {
1046
+ return binaryen.CallIndirect.setOperandAt(exp, index, operand);
1047
+ }
1048
+
1049
+ //Provides: caml_binaryen_call_indirect_append_operand
1050
+ //Requires: binaryen
1051
+ function caml_binaryen_call_indirect_append_operand(exp, operand) {
1052
+ return binaryen.CallIndirect.appendOperand(exp, operand);
1053
+ }
1054
+
1055
+ //Provides: caml_binaryen_call_indirect_insert_operand_at
1056
+ //Requires: binaryen
1057
+ function caml_binaryen_call_indirect_insert_operand_at(exp, index, operand) {
1058
+ return binaryen.CallIndirect.insertOperandAt(exp, index, operand);
1059
+ }
1060
+
1061
+ //Provides: caml_binaryen_call_indirect_remove_operand_at
1062
+ //Requires: binaryen
1063
+ function caml_binaryen_call_indirect_remove_operand_at(exp, index) {
1064
+ return binaryen.CallIndirect.removeOperandAt(exp, index);
1065
+ }
1066
+
1067
+ //Provides: caml_binaryen_call_indirect_is_return
1068
+ //Requires: binaryen
1069
+ //Requires: caml_js_to_bool
1070
+ function caml_binaryen_call_indirect_is_return(exp) {
1071
+ return caml_js_to_bool(binaryen.CallIndirect.isReturn(exp));
1072
+ }
1073
+
1074
+ //Provides: caml_binaryen_call_indirect_set_return
1075
+ //Requires: binaryen
1076
+ //Requires: caml_js_from_bool
1077
+ function caml_binaryen_call_indirect_set_return(exp, isReturn) {
1078
+ return binaryen.CallIndirect.setReturn(
1079
+ exp,
1080
+ caml_js_from_bool(isReturn)
1081
+ );
1082
+ }
1083
+
1084
+ //Provides: caml_binaryen_local_set_get_value
1085
+ //Requires: binaryen
1086
+ function caml_binaryen_local_set_get_value(exp) {
1087
+ return binaryen.LocalSet.getValue(exp);
1088
+ }
1089
+
1090
+ //Provides: caml_binaryen_local_set_set_value
1091
+ //Requires: binaryen
1092
+ function caml_binaryen_local_set_set_value(exp, value) {
1093
+ return binaryen.LocalSet.setValue(exp, value);
1094
+ }
1095
+
1096
+ //Provides: caml_binaryen_global_get_get_name
1097
+ //Requires: binaryen
1098
+ //Requires: caml_string_of_jsstring
1099
+ function caml_binaryen_global_get_get_name(exp) {
1100
+ return caml_string_of_jsstring(binaryen.GlobalGet.getName(exp));
1101
+ }
1102
+
1103
+ //Provides: caml_binaryen_global_get_set_name
1104
+ //Requires: binaryen
1105
+ //Requires: caml_jsstring_of_string
1106
+ function caml_binaryen_global_get_set_name(exp, name) {
1107
+ return binaryen.GlobalGet.setName(
1108
+ exp,
1109
+ caml_jsstring_of_string(name)
1110
+ );
1111
+ }
1112
+
1113
+ //Provides: caml_binaryen_global_set_get_name
1114
+ //Requires: binaryen
1115
+ //Requires: caml_string_of_jsstring
1116
+ function caml_binaryen_global_set_get_name(exp) {
1117
+ return caml_string_of_jsstring(binaryen.GlobalSet.getName(exp));
1118
+ }
1119
+
1120
+ //Provides: caml_binaryen_global_set_set_name
1121
+ //Requires: binaryen
1122
+ //Requires: caml_jsstring_of_string
1123
+ function caml_binaryen_global_set_set_name(exp, name) {
1124
+ return binaryen.GlobalSet.setName(
1125
+ exp,
1126
+ caml_jsstring_of_string(name)
1127
+ );
1128
+ }
1129
+
1130
+ //Provides: caml_binaryen_global_set_get_value
1131
+ //Requires: binaryen
1132
+ function caml_binaryen_global_set_get_value(exp) {
1133
+ return binaryen.GlobalSet.getValue(exp);
1134
+ }
1135
+
1136
+ //Provides: caml_binaryen_global_set_set_value
1137
+ //Requires: binaryen
1138
+ function caml_binaryen_global_set_set_value(exp, value) {
1139
+ return binaryen.GlobalSet.setValue(exp, value);
1140
+ }
1141
+
1142
+ //Provides: caml_binaryen_memory_grow_get_delta
1143
+ //Requires: binaryen
1144
+ function caml_binaryen_memory_grow_get_delta(exp) {
1145
+ return binaryen.MemoryGrow.getDelta(exp);
1146
+ }
1147
+
1148
+ //Provides: caml_binaryen_memory_grow_set_delta
1149
+ //Requires: binaryen
1150
+ function caml_binaryen_memory_grow_set_delta(exp, delta) {
1151
+ return binaryen.MemoryGrow.setDelta(exp, delta);
1152
+ }
1153
+
1154
+ //Provides: caml_binaryen_load_get_ptr
1155
+ //Requires: binaryen
1156
+ function caml_binaryen_load_get_ptr(exp) {
1157
+ return binaryen.Load.getPtr(exp);
1158
+ }
1159
+
1160
+ //Provides: caml_binaryen_load_set_ptr
1161
+ //Requires: binaryen
1162
+ function caml_binaryen_load_set_ptr(exp, ptr) {
1163
+ return binaryen.Load.setPtr(exp, ptr);
1164
+ }
1165
+
1166
+ //Provides: caml_binaryen_store_get_ptr
1167
+ //Requires: binaryen
1168
+ function caml_binaryen_store_get_ptr(exp) {
1169
+ return binaryen.Store.getPtr(exp);
1170
+ }
1171
+
1172
+ //Provides: caml_binaryen_store_set_ptr
1173
+ //Requires: binaryen
1174
+ function caml_binaryen_store_set_ptr(exp, ptr) {
1175
+ return binaryen.Store.setPtr(exp, ptr);
1176
+ }
1177
+
1178
+ //Provides: caml_binaryen_store_get_value
1179
+ //Requires: binaryen
1180
+ function caml_binaryen_store_get_value(exp) {
1181
+ return binaryen.Store.getValue(exp);
1182
+ }
1183
+
1184
+ //Provides: caml_binaryen_store_set_value
1185
+ //Requires: binaryen
1186
+ function caml_binaryen_store_set_value(exp, value) {
1187
+ return binaryen.Store.setValue(exp, value);
1188
+ }
1189
+
1190
+ //Provides: caml_binaryen_unary_get_value
1191
+ //Requires: binaryen
1192
+ function caml_binaryen_unary_get_value(exp) {
1193
+ return binaryen.Unary.getValue(exp);
1194
+ }
1195
+
1196
+ //Provides: caml_binaryen_unary_set_value
1197
+ //Requires: binaryen
1198
+ function caml_binaryen_unary_set_value(exp, value) {
1199
+ return binaryen.Unary.setValue(exp, value);
1200
+ }
1201
+
1202
+ //Provides: caml_binaryen_binary_get_left
1203
+ //Requires: binaryen
1204
+ function caml_binaryen_binary_get_left(exp) {
1205
+ return binaryen.Binary.getLeft(exp);
1206
+ }
1207
+
1208
+ //Provides: caml_binaryen_binary_set_left
1209
+ //Requires: binaryen
1210
+ function caml_binaryen_binary_set_left(exp, value) {
1211
+ return binaryen.Binary.setLeft(exp, value);
1212
+ }
1213
+
1214
+ //Provides: caml_binaryen_binary_get_right
1215
+ //Requires: binaryen
1216
+ function caml_binaryen_binary_get_right(exp) {
1217
+ return binaryen.Binary.getRight(exp);
1218
+ }
1219
+
1220
+ //Provides: caml_binaryen_binary_set_right
1221
+ //Requires: binaryen
1222
+ function caml_binaryen_binary_set_right(exp, value) {
1223
+ return binaryen.Binary.setRight(exp, value);
1224
+ }
1225
+
1226
+ //Provides: caml_binaryen_select_get_if_true
1227
+ //Requires: binaryen
1228
+ function caml_binaryen_select_get_if_true(exp) {
1229
+ return binaryen.Select.getIfTrue(exp);
1230
+ }
1231
+
1232
+ //Provides: caml_binaryen_select_set_if_true
1233
+ //Requires: binaryen
1234
+ function caml_binaryen_select_set_if_true(exp, value) {
1235
+ return binaryen.Select.setIfTrue(exp, value);
1236
+ }
1237
+
1238
+ //Provides: caml_binaryen_select_get_if_false
1239
+ //Requires: binaryen
1240
+ function caml_binaryen_select_get_if_false(exp) {
1241
+ return binaryen.Select.getIfFalse(exp);
1242
+ }
1243
+
1244
+ //Provides: caml_binaryen_select_set_if_false
1245
+ //Requires: binaryen
1246
+ function caml_binaryen_select_set_if_false(exp, value) {
1247
+ return binaryen.Select.setIfFalse(exp, value);
1248
+ }
1249
+
1250
+ //Provides: caml_binaryen_select_get_condition
1251
+ //Requires: binaryen
1252
+ function caml_binaryen_select_get_condition(exp) {
1253
+ return binaryen.Select.getCondition(exp);
1254
+ }
1255
+
1256
+ //Provides: caml_binaryen_select_set_condition
1257
+ //Requires: binaryen
1258
+ function caml_binaryen_select_set_condition(exp, value) {
1259
+ return binaryen.Select.setCondition(exp, value);
1260
+ }
1261
+
1262
+ //Provides: caml_binaryen_drop_get_value
1263
+ //Requires: binaryen
1264
+ function caml_binaryen_drop_get_value(exp) {
1265
+ return binaryen.Drop.getValue(exp);
1266
+ }
1267
+
1268
+ //Provides: caml_binaryen_drop_set_value
1269
+ //Requires: binaryen
1270
+ function caml_binaryen_drop_set_value(exp, value) {
1271
+ return binaryen.Drop.setValue(exp, value);
1272
+ }
1273
+
1274
+ //Provides: caml_binaryen_return_get_value
1275
+ //Requires: binaryen
1276
+ //Requires: to_option
1277
+ function caml_binaryen_return_get_value(exp) {
1278
+ return to_option(binaryen.Return.getValue(exp));
1279
+ }
1280
+
1281
+ //Provides: caml_binaryen_return_set_value
1282
+ //Requires: binaryen
1283
+ function caml_binaryen_return_set_value(exp, value) {
1284
+ return binaryen.Return.setValue(exp, value);
1285
+ }
1286
+
1287
+ //Provides: caml_binaryen_memory_copy_get_dest
1288
+ //Requires: binaryen
1289
+ function caml_binaryen_memory_copy_get_dest(exp) {
1290
+ return binaryen.MemoryCopy.getDest(exp);
1291
+ }
1292
+
1293
+ //Provides: caml_binaryen_memory_copy_set_dest
1294
+ //Requires: binaryen
1295
+ function caml_binaryen_memory_copy_set_dest(exp, value) {
1296
+ return binaryen.MemoryCopy.setDest(exp, value);
1297
+ }
1298
+
1299
+ //Provides: caml_binaryen_memory_copy_get_source
1300
+ //Requires: binaryen
1301
+ function caml_binaryen_memory_copy_get_source(exp) {
1302
+ return binaryen.MemoryCopy.getSource(exp);
1303
+ }
1304
+
1305
+ //Provides: caml_binaryen_memory_copy_set_source
1306
+ //Requires: binaryen
1307
+ function caml_binaryen_memory_copy_set_source(exp, value) {
1308
+ return binaryen.MemoryCopy.setSource(exp, value);
1309
+ }
1310
+
1311
+ //Provides: caml_binaryen_memory_copy_get_size
1312
+ //Requires: binaryen
1313
+ function caml_binaryen_memory_copy_get_size(exp) {
1314
+ return binaryen.MemoryCopy.getSize(exp);
1315
+ }
1316
+
1317
+ //Provides: caml_binaryen_memory_copy_set_size
1318
+ //Requires: binaryen
1319
+ function caml_binaryen_memory_copy_set_size(exp, value) {
1320
+ return binaryen.MemoryCopy.setSize(exp, value);
1321
+ }
1322
+
1323
+ //Provides: caml_binaryen_memory_fill_get_dest
1324
+ //Requires: binaryen
1325
+ function caml_binaryen_memory_fill_get_dest(exp) {
1326
+ return binaryen.MemoryFill.getDest(exp);
1327
+ }
1328
+
1329
+ //Provides: caml_binaryen_memory_fill_set_dest
1330
+ //Requires: binaryen
1331
+ function caml_binaryen_memory_fill_set_dest(exp, value) {
1332
+ return binaryen.MemoryFill.setDest(exp, value);
1333
+ }
1334
+
1335
+ //Provides: caml_binaryen_memory_fill_get_value
1336
+ //Requires: binaryen
1337
+ function caml_binaryen_memory_fill_get_value(exp) {
1338
+ return binaryen.MemoryFill.getValue(exp);
1339
+ }
1340
+
1341
+ //Provides: caml_binaryen_memory_fill_set_value
1342
+ //Requires: binaryen
1343
+ function caml_binaryen_memory_fill_set_value(exp, value) {
1344
+ return binaryen.MemoryFill.setValue(exp, value);
1345
+ }
1346
+
1347
+ //Provides: caml_binaryen_memory_fill_get_size
1348
+ //Requires: binaryen
1349
+ function caml_binaryen_memory_fill_get_size(exp) {
1350
+ return binaryen.MemoryFill.getSize(exp);
1351
+ }
1352
+
1353
+ //Provides: caml_binaryen_memory_fill_set_size
1354
+ //Requires: binaryen
1355
+ function caml_binaryen_memory_fill_set_size(exp, value) {
1356
+ return binaryen.MemoryFill.setSize(exp, value);
1357
+ }
1358
+
1359
+ //Provides: caml_binaryen_tuple_make_get_num_operands
1360
+ //Requires: binaryen
1361
+ function caml_binaryen_tuple_make_get_num_operands(exp) {
1362
+ return binaryen.TupleMake.getNumOperands(exp);
1363
+ }
1364
+
1365
+ //Provides: caml_binaryen_tuple_make_get_operand_at
1366
+ //Requires: binaryen
1367
+ function caml_binaryen_tuple_make_get_operand_at(exp, index) {
1368
+ return binaryen.TupleMake.getOperandAt(exp, index);
1369
+ }
1370
+
1371
+ //Provides: caml_binaryen_tuple_make_set_operand_at
1372
+ //Requires: binaryen
1373
+ function caml_binaryen_tuple_make_set_operand_at(exp, index, operand) {
1374
+ return binaryen.TupleMake.setOperandAt(exp, index, operand);
1375
+ }
1376
+
1377
+ //Provides: caml_binaryen_tuple_make_append_operand
1378
+ //Requires: binaryen
1379
+ function caml_binaryen_tuple_make_append_operand(exp, operand) {
1380
+ return binaryen.TupleMake.appendOperand(exp, operand);
1381
+ }
1382
+
1383
+ //Provides: caml_binaryen_tuple_make_insert_operand_at
1384
+ //Requires: binaryen
1385
+ function caml_binaryen_tuple_make_insert_operand_at(exp, index, operand) {
1386
+ return binaryen.TupleMake.insertOperandAt(exp, index, operand);
1387
+ }
1388
+
1389
+ //Provides: caml_binaryen_tuple_make_remove_operand_at
1390
+ //Requires: binaryen
1391
+ function caml_binaryen_tuple_make_remove_operand_at(exp, index) {
1392
+ return binaryen.TupleMake.removeOperandAt(exp, index);
1393
+ }
1394
+
1395
+ //Provides: caml_binaryen_tuple_extract_get_tuple
1396
+ //Requires: binaryen
1397
+ function caml_binaryen_tuple_extract_get_tuple(exp) {
1398
+ return binaryen.TupleExtract.getTuple(exp);
1399
+ }
1400
+
1401
+ //Provides: caml_binaryen_tuple_extract_set_tuple
1402
+ //Requires: binaryen
1403
+ function caml_binaryen_tuple_extract_set_tuple(exp, value) {
1404
+ return binaryen.TupleExtract.setTuple(exp, value);
1405
+ }
1406
+
1407
+ // Ref operations
1408
+
1409
+ //Provides: caml_binaryen_ref_null
1410
+ function caml_binaryen_ref_null(wasm_mod, typ) {
1411
+ return wasm_mod.ref.null(typ);
1412
+ }
1413
+
1414
+ //Provides: caml_binaryen_ref_is
1415
+ //Requires: binaryen
1416
+ function caml_binaryen_ref_is(wasm_mod, op, value) {
1417
+ return binaryen._BinaryenRefIs(wasm_mod, op, value);
1418
+ }
1419
+
1420
+ //Provides: caml_binaryen_ref_as
1421
+ //Requires: binaryen
1422
+ function caml_binaryen_ref_as(wasm_mod, op, value) {
1423
+ return binaryen._BinaryenRefAs(wasm_mod, op, value);
1424
+ }
1425
+
1426
+ //Provides: caml_binaryen_ref_func
1427
+ //Requires: caml_jsstring_of_string
1428
+ function caml_binaryen_ref_func(wasm_mod, name, typ) {
1429
+ return wasm_mod.ref.func(
1430
+ caml_jsstring_of_string(name),
1431
+ typ
1432
+ );
1433
+ }
1434
+
1435
+ //Provides: caml_binaryen_ref_eq
1436
+ function caml_binaryen_ref_eq(wasm_mod, left, right) {
1437
+ return wasm_mod.ref.func(left, right);
1438
+ }
1439
+
1440
+ // Table operations
1441
+
1442
+ //Provides: caml_binaryen_table_get
1443
+ //Requires: caml_jsstring_of_string
1444
+ function caml_binaryen_table_get(wasm_mod, name, index, typ) {
1445
+ return wasm_mod.table.get(
1446
+ caml_jsstring_of_string(name),
1447
+ index,
1448
+ typ
1449
+ );
1450
+ }
1451
+
1452
+ //Provides: caml_binaryen_table_set
1453
+ //Requires: caml_jsstring_of_string
1454
+ function caml_binaryen_table_set(wasm_mod, name, index, value) {
1455
+ return wasm_mod.table.set(
1456
+ caml_jsstring_of_string(name),
1457
+ index,
1458
+ value
1459
+ );
1460
+ }
1461
+
1462
+ //Provides: caml_binaryen_table_size
1463
+ //Requires: caml_jsstring_of_string
1464
+ function caml_binaryen_table_size(wasm_mod, name) {
1465
+ return wasm_mod.table.size(
1466
+ caml_jsstring_of_string(name)
1467
+ );
1468
+ }
1469
+
1470
+ //Provides: caml_binaryen_table_grow
1471
+ //Requires: caml_jsstring_of_string
1472
+ function caml_binaryen_table_grow(wasm_mod, name, value, delta) {
1473
+ return wasm_mod.table.grow(
1474
+ caml_jsstring_of_string(name),
1475
+ value,
1476
+ delta
1477
+ );
1478
+ }
1479
+
1480
+ // TableGet operations
1481
+
1482
+ //Provides: caml_binaryen_tableget_get_table
1483
+ //Requires: binaryen
1484
+ //Requires: caml_string_of_jsstring
1485
+ function caml_binaryen_tableget_get_table(exp) {
1486
+ return caml_string_of_jsstring(binaryen.TableGet.getTable(exp));
1487
+ }
1488
+
1489
+ //Provides: caml_binaryen_tableget_set_table
1490
+ //Requires: binaryen
1491
+ //Requires: caml_jsstring_of_string
1492
+ function caml_binaryen_tableget_set_table(exp, table) {
1493
+ return binaryen.TableGet.setTable(
1494
+ exp,
1495
+ caml_jsstring_of_string(table)
1496
+ );
1497
+ }
1498
+
1499
+ //Provides: caml_binaryen_tableget_get_index
1500
+ //Requires: binaryen
1501
+ function caml_binaryen_tableget_get_index(exp) {
1502
+ return binaryen.TableGet.getIndex(exp);
1503
+ }
1504
+
1505
+ //Provides: caml_binaryen_tableget_set_index
1506
+ //Requires: binaryen
1507
+ function caml_binaryen_tableget_set_index(exp, index) {
1508
+ return binaryen.TableGet.setIndex(exp, index);
1509
+ }
1510
+
1511
+ // TableSet operations
1512
+
1513
+ //Provides: caml_binaryen_tableset_get_table
1514
+ //Requires: binaryen
1515
+ //Requires: caml_string_of_jsstring
1516
+ function caml_binaryen_tableset_get_table(exp) {
1517
+ return caml_string_of_jsstring(binaryen.TableSet.getTable(exp));
1518
+ }
1519
+
1520
+ //Provides: caml_binaryen_tableset_set_table
1521
+ //Requires: binaryen
1522
+ //Requires: caml_jsstring_of_string
1523
+ function caml_binaryen_tableset_set_table(exp, table) {
1524
+ return binaryen.TableSet.setTable(
1525
+ exp,
1526
+ caml_jsstring_of_string(table)
1527
+ );
1528
+ }
1529
+
1530
+ //Provides: caml_binaryen_tableset_get_index
1531
+ //Requires: binaryen
1532
+ function caml_binaryen_tableset_get_index(exp) {
1533
+ return binaryen.TableSet.getIndex(exp);
1534
+ }
1535
+
1536
+ //Provides: caml_binaryen_tableset_set_index
1537
+ //Requires: binaryen
1538
+ function caml_binaryen_tableset_set_index(exp, index) {
1539
+ return binaryen.TableSet.setIndex(exp, index);
1540
+ }
1541
+
1542
+ //Provides: caml_binaryen_tableset_get_value
1543
+ //Requires: binaryen
1544
+ function caml_binaryen_tableset_get_value(exp) {
1545
+ return binaryen.TableSet.getValue(exp);
1546
+ }
1547
+
1548
+ //Provides: caml_binaryen_tableset_set_value
1549
+ //Requires: binaryen
1550
+ function caml_binaryen_tableset_set_value(exp, value) {
1551
+ return binaryen.TableSet.setValue(exp, value);
1552
+ }
1553
+
1554
+ // TableSize operations
1555
+
1556
+ //Provides: caml_binaryen_tablesize_get_table
1557
+ //Requires: binaryen
1558
+ //Requires: caml_string_of_jsstring
1559
+ function caml_binaryen_tablesize_get_table(exp) {
1560
+ return caml_string_of_jsstring(binaryen.TableSize.getTable(exp));
1561
+ }
1562
+
1563
+ //Provides: caml_binaryen_tablesize_set_table
1564
+ //Requires: binaryen
1565
+ //Requires: caml_jsstring_of_string
1566
+ function caml_binaryen_tablesize_set_table(exp, table) {
1567
+ return binaryen.TableSize.setTable(
1568
+ exp,
1569
+ caml_jsstring_of_string(table)
1570
+ );
1571
+ }
1572
+
1573
+ // TableGrow operations
1574
+
1575
+ //Provides: caml_binaryen_tablegrow_get_table
1576
+ //Requires: binaryen
1577
+ //Requires: caml_string_of_jsstring
1578
+ function caml_binaryen_tablegrow_get_table(exp) {
1579
+ return caml_string_of_jsstring(binaryen.TableGrow.getTable(exp));
1580
+ }
1581
+
1582
+ //Provides: caml_binaryen_tablegrow_set_table
1583
+ //Requires: binaryen
1584
+ //Requires: caml_jsstring_of_string
1585
+ function caml_binaryen_tablegrow_set_table(exp, table) {
1586
+ return binaryen.TableGrow.setTable(
1587
+ exp,
1588
+ caml_jsstring_of_string(table)
1589
+ );
1590
+ }
1591
+
1592
+ //Provides: caml_binaryen_tablegrow_get_value
1593
+ //Requires: binaryen
1594
+ function caml_binaryen_tablegrow_get_value(exp) {
1595
+ return binaryen.TableGrow.getValue(exp);
1596
+ }
1597
+
1598
+ //Provides: caml_binaryen_tablegrow_set_value
1599
+ //Requires: binaryen
1600
+ function caml_binaryen_tablegrow_set_value(exp, value) {
1601
+ return binaryen.TableGrow.setValue(exp, value);
1602
+ }
1603
+
1604
+ //Provides: caml_binaryen_tablegrow_get_delta
1605
+ //Requires: binaryen
1606
+ function caml_binaryen_tablegrow_get_delta(exp) {
1607
+ return binaryen.TableGrow.getDelta(exp);
1608
+ }
1609
+
1610
+ //Provides: caml_binaryen_tablegrow_set_delta
1611
+ //Requires: binaryen
1612
+ function caml_binaryen_tablegrow_set_delta(exp, delta) {
1613
+ return binaryen.TableGrow.setDelta(exp, delta);
1614
+ }