@grain/binaryen.ml 0.11.1 → 0.13.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 (67) hide show
  1. binaryen-archive/CHANGELOG.md +53 -0
  2. binaryen-archive/README.md +25 -1
  3. binaryen-archive/binaryen.opam +5 -5
  4. binaryen-archive/esy.lock/index.json +325 -310
  5. binaryen-archive/esy.lock/opam/base-bytes.base/opam +9 -0
  6. binaryen-archive/esy.lock/opam/{base.v0.14.2 → base.v0.14.3}/opam +2 -2
  7. binaryen-archive/esy.lock/opam/{dune-build-info.2.9.1 → dune-build-info.2.9.3}/opam +5 -4
  8. binaryen-archive/esy.lock/opam/{dune-configurator.2.9.1 → dune-configurator.2.9.3}/opam +5 -4
  9. binaryen-archive/esy.lock/opam/{dune.2.9.1 → dune.2.9.3}/opam +5 -4
  10. binaryen-archive/esy.lock/opam/either.1.0.0/opam +40 -0
  11. binaryen-archive/esy.lock/opam/{fix.20211231 → fix.20220121}/opam +3 -3
  12. binaryen-archive/esy.lock/opam/menhir.20211128/opam +1 -1
  13. binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.9.0 → ocaml-lsp-server.1.9.1}/opam +5 -5
  14. binaryen-archive/esy.lock/opam/{ocamlfind.1.9.1 → ocamlfind.1.9.3}/opam +3 -3
  15. binaryen-archive/esy.lock/opam/{ocamlformat.0.18.0 → ocamlformat.0.20.1}/opam +14 -15
  16. binaryen-archive/esy.lock/opam/ocp-indent.1.7.0/opam +57 -0
  17. binaryen-archive/esy.lock/opam/odoc-parser.1.0.0/opam +46 -0
  18. binaryen-archive/esy.lock/opam/{ppxlib.0.22.2 → ppxlib.0.24.0}/opam +9 -6
  19. binaryen-archive/esy.lock/opam/{topkg.1.0.4 → topkg.1.0.5}/opam +3 -3
  20. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.1_opam_override/files/findlib-1.9.1.patch → opam__s__ocamlfind_opam__c__1.9.3_opam_override/files/findlib.patch} +0 -0
  21. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.1_opam_override → opam__s__ocamlfind_opam__c__1.9.3_opam_override}/package.json +1 -1
  22. binaryen-archive/js/binaryen.es5.js +363 -5
  23. binaryen-archive/js/dune +1 -1
  24. binaryen-archive/js/export.ml +1 -4
  25. binaryen-archive/js/expression.ml +161 -0
  26. binaryen-archive/js/literal.ml +0 -1
  27. binaryen-archive/js/module.ml +9 -9
  28. binaryen-archive/js/op.ml +0 -223
  29. binaryen-archive/js/prelude.js +2 -0
  30. binaryen-archive/js/table.ml +2 -2
  31. binaryen-archive/js/type.ml +0 -9
  32. binaryen-archive/package.json +11 -8
  33. binaryen-archive/src/binaryen_stubs_exports.c +2 -2
  34. binaryen-archive/src/binaryen_stubs_expressions.c +250 -0
  35. binaryen-archive/src/binaryen_stubs_features.c +24 -0
  36. binaryen-archive/src/binaryen_stubs_modules.c +7 -0
  37. binaryen-archive/src/binaryen_stubs_tables.c +4 -3
  38. binaryen-archive/src/dune +1 -2
  39. binaryen-archive/src/element_segment.ml +0 -1
  40. binaryen-archive/src/export.ml +2 -4
  41. binaryen-archive/src/expression.ml +94 -63
  42. binaryen-archive/src/function.ml +0 -6
  43. binaryen-archive/src/global.ml +0 -2
  44. binaryen-archive/src/literal.ml +0 -3
  45. binaryen-archive/src/module.ml +19 -9
  46. binaryen-archive/src/settings.ml +0 -6
  47. binaryen-archive/src/table.ml +2 -2
  48. binaryen-archive/src/type.ml +0 -1
  49. binaryen-archive/test/config/ocamlopt_flags.ml +8 -1
  50. binaryen-archive/test/test.expected +13 -5
  51. binaryen-archive/test/test.ml +47 -22
  52. binaryen-archive/virtual/element_segment.mli +0 -4
  53. binaryen-archive/virtual/export.mli +1 -16
  54. binaryen-archive/virtual/expression.mli +93 -115
  55. binaryen-archive/virtual/function.mli +0 -12
  56. binaryen-archive/virtual/global.mli +0 -8
  57. binaryen-archive/virtual/import.mli +0 -4
  58. binaryen-archive/virtual/literal.mli +0 -5
  59. binaryen-archive/virtual/module.mli +5 -28
  60. binaryen-archive/virtual/op.mli +0 -315
  61. binaryen-archive/virtual/settings.mli +0 -17
  62. binaryen-archive/virtual/table.mli +1 -4
  63. binaryen-archive/virtual/type.mli +0 -11
  64. binaryen-archive/esy.lock/opam/ocaml-migrate-parsetree.2.3.0/opam +0 -39
  65. binaryen-archive/esy.lock/opam/odoc.1.5.3/opam +0 -53
  66. binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +0 -42
  67. binaryen-archive/js/postlude.js +0 -2
@@ -2,44 +2,29 @@ open Binaryen
2
2
 
3
3
  (* Testing colors enable *)
4
4
  let _ = assert (Settings.are_colors_enabled () == true)
5
-
6
5
  let _ = Settings.set_colors_enabled false
7
-
8
6
  let _ = assert (Settings.are_colors_enabled () == false)
9
-
10
7
  let _ = Settings.set_colors_enabled true
11
8
 
12
9
  (* Testing debug_info enable *)
13
10
  let _ = assert (Settings.get_debug_info () == false)
14
-
15
11
  let _ = Settings.set_debug_info true
16
-
17
12
  let _ = assert (Settings.get_debug_info () == true)
18
-
19
13
  let _ = Settings.set_debug_info false
20
14
 
21
15
  (* Testing low_memory_unused enable *)
22
16
  let _ = assert (Settings.get_low_memory_unused () == false)
23
-
24
17
  let _ = Settings.set_low_memory_unused true
25
-
26
18
  let _ = assert (Settings.get_low_memory_unused () == true)
27
-
28
19
  let _ = Settings.set_low_memory_unused false
29
-
30
20
  let wasm_mod = Module.create ()
31
-
32
21
  let _ = Module.set_features wasm_mod [ Module.Feature.all ]
33
22
 
34
23
  (* Create function type for i32 (i32, i32) *)
35
24
  let params () = Type.create [| Type.int32; Type.int32 |]
36
-
37
25
  let results = Type.int32
38
-
39
26
  let x () = Expression.Local_get.make wasm_mod 0 Type.int32
40
-
41
27
  let y () = Expression.Local_get.make wasm_mod 1 Type.int32
42
-
43
28
  let load = Expression.Load.make wasm_mod 1 ~signed:true 0 0 Type.int32 (y ())
44
29
 
45
30
  let select =
@@ -76,8 +61,31 @@ let start =
76
61
  (Expression.Drop.make wasm_mod call_adder)
77
62
 
78
63
  let _ = Export.add_function_export wasm_mod "adder" "adder"
64
+ let _ = Table.add_table wasm_mod "table" 1 1 Type.funcref
65
+ let funcref_expr1 = Expression.Ref.func wasm_mod "adder" Type.funcref
66
+
67
+ let _ =
68
+ Expression.Table.set wasm_mod "table"
69
+ (Expression.Const.make wasm_mod (Literal.int32 0l))
70
+ funcref_expr1
71
+
72
+ let funcref_expr2 =
73
+ Expression.Table.get wasm_mod "table"
74
+ (Expression.Const.make wasm_mod (Literal.int32 0l))
75
+ Type.funcref
79
76
 
80
- let _ = Table.add_table wasm_mod "table" 1 1
77
+ let _ = Expression.print funcref_expr2
78
+ let table_size = Expression.Table.size wasm_mod "table"
79
+ let _ = Expression.print table_size
80
+ let table_name = Expression.Table_size.get_table table_size
81
+ let _ = Expression.Table_size.set_table table_size table_name
82
+ let null_ref = Expression.Ref.null wasm_mod Type.funcref
83
+
84
+ let table_grow =
85
+ Expression.Table.grow wasm_mod "table" null_ref
86
+ (Expression.Const.make wasm_mod (Literal.int32 0l))
87
+
88
+ let _ = Expression.print table_grow
81
89
 
82
90
  let _ =
83
91
  Global.add_global wasm_mod "max_int64" Type.int64 false
@@ -92,7 +100,6 @@ let _ =
92
100
  (Expression.Const.make wasm_mod (Literal.int32 0l))
93
101
 
94
102
  let _ = Function.set_start wasm_mod start
95
-
96
103
  let _ = Memory.set_memory wasm_mod 1 Memory.unlimited "memory" [] false
97
104
 
98
105
  (* Create an imported "write" function i32 (externref, i32, i32) *)
@@ -116,6 +123,9 @@ let _ =
116
123
 
117
124
  let _ = Export.add_function_export wasm_mod "hello" "hello"
118
125
 
126
+ (* Shouldn't actually do anything since we aren't doing function renames *)
127
+ let _ = Module.update_maps wasm_mod
128
+
119
129
  (* Finally, we print 3 versions of the module to be checked against test.expected *)
120
130
 
121
131
  (* 1. Print the the module as-is *)
@@ -125,23 +135,38 @@ let _ = Module.print wasm_mod
125
135
  (* 2. Optimize, then print the module *)
126
136
 
127
137
  let _ = Module.optimize wasm_mod
128
-
129
138
  let _ = Module.print wasm_mod
130
139
 
131
140
  (* 3. Copy previous module bytes into new module, validate, and print *)
132
141
 
133
142
  let byts, _ = Module.write wasm_mod None
134
-
135
143
  let new_mod = Module.read byts
136
144
 
137
- let _ = Module.set_features new_mod [ Module.Feature.all ]
145
+ let _ =
146
+ Module.set_features new_mod
147
+ [
148
+ Module.Feature.mvp;
149
+ Module.Feature.atomics;
150
+ Module.Feature.bulk_memory;
151
+ Module.Feature.mutable_globals;
152
+ Module.Feature.nontrapping_fp_to_int;
153
+ Module.Feature.sign_ext;
154
+ Module.Feature.simd128;
155
+ Module.Feature.exception_handling;
156
+ Module.Feature.tail_call;
157
+ Module.Feature.reference_types;
158
+ Module.Feature.multivalue;
159
+ Module.Feature.gc;
160
+ Module.Feature.memory64;
161
+ Module.Feature.typed_function_references;
162
+ Module.Feature.relaxed_simd;
163
+ Module.Feature.all;
164
+ ]
138
165
 
139
166
  let _ = Module.validate new_mod
140
-
141
167
  let _ = Module.print new_mod
142
168
 
143
169
  (* Dispose the modules 👋 *)
144
170
 
145
171
  let _ = Module.dispose wasm_mod
146
-
147
172
  let _ = Module.dispose new_mod
@@ -1,11 +1,7 @@
1
1
  type t
2
2
 
3
3
  val get_name : t -> string
4
-
5
4
  val get_table : t -> string
6
-
7
5
  val get_offset : t -> Expression.t
8
-
9
6
  val get_length : t -> int
10
-
11
7
  val get_data : t -> int -> string
@@ -1,33 +1,18 @@
1
1
  type t
2
2
 
3
3
  val add_function_export : Module.t -> string -> string -> t
4
-
5
4
  val add_table_export : Module.t -> string -> string -> t
6
-
7
5
  val add_memory_export : Module.t -> string -> string -> t
8
-
9
6
  val add_global_export : Module.t -> string -> string -> t
10
-
11
7
  val get_export : Module.t -> string -> t
12
-
13
8
  val remove_export : Module.t -> string -> unit
14
-
15
9
  val get_num_exports : Module.t -> int
16
-
17
10
  val get_export_by_index : Module.t -> int -> t
18
-
19
11
  val get_name : t -> string
20
-
21
12
  val get_value : t -> string
22
-
23
13
  val external_function : int
24
-
25
14
  val external_table : int
26
-
27
15
  val external_memory : int
28
-
29
16
  val external_global : int
30
-
31
- val external_event : int
32
-
17
+ val external_tag : int
33
18
  val export_get_kind : t -> int
@@ -69,160 +69,97 @@ type kind =
69
69
  | RefAs
70
70
 
71
71
  val get_kind : t -> kind
72
-
73
72
  val print : t -> unit
74
-
75
73
  val finalize : t -> unit
76
-
77
74
  val copy : t -> Module.t -> t
78
75
 
79
76
  (* Expression operations *)
80
77
 
81
78
  module Block : sig
82
79
  val make : ?return_type:Type.t -> Module.t -> string -> t list -> t
83
-
84
80
  val get_name : t -> string option
85
-
86
81
  val set_name : t -> string -> unit
87
-
88
82
  val get_num_children : t -> int
89
-
90
83
  val get_child_at : t -> int -> t
91
-
92
84
  val set_child_at : t -> int -> t -> unit
93
-
94
85
  val append_child : t -> t -> int
95
-
96
86
  val insert_child_at : t -> int -> t -> unit
97
-
98
87
  val remove_child_at : t -> int -> t
99
88
  end
100
89
 
101
90
  module If : sig
102
91
  val make : Module.t -> t -> t -> t -> t
103
-
104
92
  val get_condition : t -> t
105
-
106
93
  val set_condition : t -> t -> unit
107
-
108
94
  val get_if_true : t -> t
109
-
110
95
  val set_if_true : t -> t -> unit
111
-
112
96
  val get_if_false : t -> t option
113
-
114
97
  val set_if_false : t -> t -> unit
115
98
  end
116
99
 
117
100
  module Loop : sig
118
101
  val make : Module.t -> string -> t -> t
119
-
120
102
  val get_name : t -> string
121
-
122
103
  val set_name : t -> string -> unit
123
-
124
104
  val get_body : t -> t
125
-
126
105
  val set_body : t -> t -> unit
127
106
  end
128
107
 
129
108
  module Break : sig
130
109
  val make : Module.t -> string -> t -> t -> t
131
-
132
110
  val get_name : t -> string
133
-
134
111
  val set_name : t -> string -> unit
135
-
136
112
  val get_condition : t -> t option
137
-
138
113
  val set_condition : t -> t -> unit
139
-
140
114
  val get_value : t -> t option
141
-
142
115
  val set_value : t -> t -> unit
143
116
  end
144
117
 
145
118
  module Switch : sig
146
119
  val make : Module.t -> string list -> string -> t -> t -> t
147
-
148
120
  val get_num_names : t -> int
149
-
150
121
  val get_name_at : t -> int -> string
151
-
152
122
  val set_name_at : t -> int -> string -> unit
153
-
154
123
  val append_name : t -> string -> int
155
-
156
124
  val insert_name_at : t -> int -> string -> unit
157
-
158
125
  val remove_name_at : t -> int -> string
159
-
160
126
  val get_default_name : t -> string option
161
-
162
127
  val set_default_name : t -> string -> unit
163
-
164
128
  val get_condition : t -> t
165
-
166
129
  val set_condition : t -> t -> unit
167
-
168
130
  val get_value : t -> t option
169
-
170
131
  val set_value : t -> t -> unit
171
132
  end
172
133
 
173
134
  module Call : sig
174
135
  val make : Module.t -> string -> t list -> Type.t -> t
175
-
176
136
  val make_return : Module.t -> string -> t list -> Type.t -> t
177
-
178
137
  val get_target : t -> string
179
-
180
138
  val set_target : t -> string -> unit
181
-
182
139
  val get_num_operands : t -> int
183
-
184
140
  val get_operand_at : t -> int -> t
185
-
186
141
  val set_operand_at : t -> int -> t -> unit
187
-
188
142
  val append_operand : t -> t -> int
189
-
190
143
  val insert_operand_at : t -> int -> t -> unit
191
-
192
144
  val remove_operand_at : t -> int -> t
193
-
194
145
  val is_return : t -> bool
195
-
196
146
  val set_return : t -> bool -> unit
197
147
  end
198
148
 
199
149
  module Call_indirect : sig
200
150
  val make : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
201
-
202
151
  val make_return : Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
203
-
204
152
  val get_target : t -> t
205
-
206
153
  val set_target : t -> t -> unit
207
-
208
154
  val get_table : t -> string
209
-
210
155
  val set_table : t -> string -> unit
211
-
212
156
  val get_num_operands : t -> int
213
-
214
157
  val get_operand_at : t -> int -> t
215
-
216
158
  val set_operand_at : t -> int -> t -> unit
217
-
218
159
  val append_operand : t -> t -> int
219
-
220
160
  val insert_operand_at : t -> int -> t -> unit
221
-
222
161
  val remove_operand_at : t -> int -> t
223
-
224
162
  val is_return : t -> bool
225
-
226
163
  val set_return : t -> bool -> unit
227
164
  end
228
165
 
@@ -232,9 +169,7 @@ end
232
169
 
233
170
  module Local_set : sig
234
171
  val make : Module.t -> int -> t -> t
235
-
236
172
  val get_value : t -> t
237
-
238
173
  val set_value : t -> t -> unit
239
174
  end
240
175
 
@@ -244,41 +179,29 @@ end
244
179
 
245
180
  module Global_get : sig
246
181
  val make : Module.t -> string -> Type.t -> t
247
-
248
182
  val get_name : t -> string
249
-
250
183
  val set_name : t -> string -> unit
251
184
  end
252
185
 
253
186
  module Global_set : sig
254
187
  val make : Module.t -> string -> t -> t
255
-
256
188
  val get_name : t -> string
257
-
258
189
  val set_name : t -> string -> unit
259
-
260
190
  val get_value : t -> t
261
-
262
191
  val set_value : t -> t -> unit
263
192
  end
264
193
 
265
194
  module Load : sig
266
195
  val make : Module.t -> int -> ?signed:bool -> int -> int -> Type.t -> t -> t
267
-
268
196
  val get_ptr : t -> t
269
-
270
197
  val set_ptr : t -> t -> unit
271
198
  end
272
199
 
273
200
  module Store : sig
274
201
  val make : Module.t -> int -> int -> int -> t -> t -> Type.t -> t
275
-
276
202
  val get_ptr : t -> t
277
-
278
203
  val set_ptr : t -> t -> unit
279
-
280
204
  val get_value : t -> t
281
-
282
205
  val set_value : t -> t -> unit
283
206
  end
284
207
 
@@ -288,53 +211,37 @@ end
288
211
 
289
212
  module Unary : sig
290
213
  val make : Module.t -> Op.t -> t -> t
291
-
292
214
  val get_value : t -> t
293
-
294
215
  val set_value : t -> t -> unit
295
216
  end
296
217
 
297
218
  module Binary : sig
298
219
  val make : Module.t -> Op.t -> t -> t -> t
299
-
300
220
  val get_left : t -> t
301
-
302
221
  val set_left : t -> t -> unit
303
-
304
222
  val get_right : t -> t
305
-
306
223
  val set_right : t -> t -> unit
307
224
  end
308
225
 
309
226
  module Select : sig
310
227
  val make : Module.t -> t -> t -> t -> t
311
-
312
228
  val get_if_true : t -> t
313
-
314
229
  val set_if_true : t -> t -> unit
315
-
316
230
  val get_if_false : t -> t
317
-
318
231
  val set_if_false : t -> t -> unit
319
-
320
232
  val get_condition : t -> t
321
-
322
233
  val set_condition : t -> t -> unit
323
234
  end
324
235
 
325
236
  module Drop : sig
326
237
  val make : Module.t -> t -> t
327
-
328
238
  val get_value : t -> t
329
-
330
239
  val set_value : t -> t -> unit
331
240
  end
332
241
 
333
242
  module Return : sig
334
243
  val make : Module.t -> t -> t
335
-
336
244
  val get_value : t -> t
337
-
338
245
  val set_value : t -> t -> unit
339
246
  end
340
247
 
@@ -344,65 +251,43 @@ end
344
251
 
345
252
  module Memory_grow : sig
346
253
  val make : Module.t -> t -> t
347
-
348
254
  val get_delta : t -> t
349
-
350
255
  val set_delta : t -> t -> unit
351
256
  end
352
257
 
353
258
  module Memory_copy : sig
354
259
  val make : Module.t -> t -> t -> t -> t
355
-
356
260
  val get_dest : t -> t
357
-
358
261
  val set_dest : t -> t -> unit
359
-
360
262
  val get_source : t -> t
361
-
362
263
  val set_source : t -> t -> unit
363
-
364
264
  val get_size : t -> t
365
-
366
265
  val set_size : t -> t -> unit
367
266
  end
368
267
 
369
268
  module Memory_fill : sig
370
269
  val make : Module.t -> t -> t -> t -> t
371
-
372
270
  val get_dest : t -> t
373
-
374
271
  val set_dest : t -> t -> unit
375
-
376
272
  val get_value : t -> t
377
-
378
273
  val set_value : t -> t -> unit
379
-
380
274
  val get_size : t -> t
381
-
382
275
  val set_size : t -> t -> unit
383
276
  end
384
277
 
385
278
  module Tuple_make : sig
386
279
  val make : Module.t -> t list -> t
387
-
388
280
  val get_num_operands : t -> int
389
-
390
281
  val get_operand_at : t -> int -> t
391
-
392
282
  val set_operand_at : t -> int -> t -> unit
393
-
394
283
  val append_operand : t -> t -> int
395
-
396
284
  val insert_operand_at : t -> int -> t -> unit
397
-
398
285
  val remove_operand_at : t -> int -> t
399
286
  end
400
287
 
401
288
  module Tuple_extract : sig
402
289
  val make : Module.t -> t -> int -> t
403
-
404
290
  val get_tuple : t -> t
405
-
406
291
  val set_tuple : t -> t -> unit
407
292
  end
408
293
 
@@ -421,3 +306,96 @@ end
421
306
  module Null : sig
422
307
  val make : unit -> t
423
308
  end
309
+
310
+ module Ref : sig
311
+ val null : Module.t -> Type.t -> t
312
+ (** Module, type *)
313
+
314
+ val is : Module.t -> Op.t -> t -> t
315
+ (** Module, op, value *)
316
+
317
+ val as_ : Module.t -> Op.t -> t -> t
318
+ (** Module, op, value *)
319
+
320
+ val func : Module.t -> string -> Type.t -> t
321
+ (** Module, func, type *)
322
+
323
+ val eq : Module.t -> t -> t -> t
324
+ (** Module, left, right *)
325
+ end
326
+
327
+ module Table : sig
328
+ val get : Module.t -> string -> t -> Type.t -> t
329
+ (** Module, name, index, type *)
330
+
331
+ val set : Module.t -> string -> t -> t -> t
332
+ (** Module, name, index, value *)
333
+
334
+ val size : Module.t -> string -> t
335
+ (** Module, name *)
336
+
337
+ val grow : Module.t -> string -> t -> t -> t
338
+ (** Module, name, value, delta *)
339
+ end
340
+
341
+ module Table_get : sig
342
+ val get_table : t -> string
343
+ (** Gets the name of the table being accessed by a `Table.get` expression. *)
344
+
345
+ val set_table : t -> string -> unit
346
+ (** Gets the name of the table being accessed by a `Table.get` expression. *)
347
+
348
+ val get_index : t -> t
349
+ (** Gets the index expression of a `Table.get` expression. *)
350
+
351
+ val set_index : t -> t -> unit
352
+ (** Gets the index expression of a `Table.get` expression. *)
353
+ end
354
+
355
+ module Table_set : sig
356
+ val get_table : t -> string
357
+ (** Gets the name of the table being accessed by a `Table.set` expression. *)
358
+
359
+ val set_table : t -> string -> unit
360
+ (** Sets the name of the table being accessed by a `Table.set` expression. *)
361
+
362
+ val get_index : t -> t
363
+ (** Gets the index expression of a `Table.set` expression. *)
364
+
365
+ val set_index : t -> t -> unit
366
+ (** Sets the index expression of a `Table.set` expression. *)
367
+
368
+ val get_value : t -> t
369
+ (** Gets the value expression of a `Table.set` expression. *)
370
+
371
+ val set_value : t -> t -> unit
372
+ (** Sets the value expression of a `Table.set` expression. *)
373
+ end
374
+
375
+ module Table_size : sig
376
+ val get_table : t -> string
377
+ (** Gets the name of the table being accessed by a `Table.size` expression. *)
378
+
379
+ val set_table : t -> string -> unit
380
+ (** Sets the name of the table being accessed by a `Table.size` expression. *)
381
+ end
382
+
383
+ module Table_grow : sig
384
+ val get_table : t -> string
385
+ (** Gets the name of the table being accessed by a `Table.grow` expression. *)
386
+
387
+ val set_table : t -> string -> unit
388
+ (** Gets the name of the table being accessed by a `Table.grow` expression. *)
389
+
390
+ val get_value : t -> t
391
+ (** Gets the value expression of a `Table.grow` expression. *)
392
+
393
+ val set_value : t -> t -> unit
394
+ (** Sets the value expression of a `Table.grow` expression. *)
395
+
396
+ val get_delta : t -> t
397
+ (** Gets the delta of a `Table.grow` expression. *)
398
+
399
+ val set_delta : t -> t -> unit
400
+ (** Sets the delta of a `Table.grow` expression. *)
401
+ end
@@ -4,27 +4,15 @@ val add_function :
4
4
  Module.t -> string -> Type.t -> Type.t -> Type.t array -> Expression.t -> t
5
5
 
6
6
  val set_start : Module.t -> t -> unit
7
-
8
7
  val set_debug_location : t -> Expression.t -> int -> int -> int -> unit
9
-
10
8
  val get_function : Module.t -> string -> t
11
-
12
9
  val get_function_by_index : Module.t -> int -> t
13
-
14
10
  val remove_function : Module.t -> string -> unit
15
-
16
11
  val get_num_functions : Module.t -> int
17
-
18
12
  val get_name : t -> string
19
-
20
13
  val get_params : t -> Type.t
21
-
22
14
  val get_results : t -> Type.t
23
-
24
15
  val get_num_vars : t -> int
25
-
26
16
  val get_var : t -> int -> Type.t
27
-
28
17
  val get_body : t -> Expression.t
29
-
30
18
  val set_body : t -> Expression.t -> unit
@@ -1,19 +1,11 @@
1
1
  type t
2
2
 
3
3
  val add_global : Module.t -> string -> Type.t -> bool -> Expression.t -> t
4
-
5
4
  val get_global : Module.t -> string -> t
6
-
7
5
  val remove_global : Module.t -> string -> unit
8
-
9
6
  val get_num_globals : Module.t -> int
10
-
11
7
  val get_global_by_index : Module.t -> int -> t
12
-
13
8
  val get_name : t -> string
14
-
15
9
  val get_type : t -> Type.t
16
-
17
10
  val is_mutable : t -> bool
18
-
19
11
  val get_init_expr : t -> Expression.t
@@ -2,16 +2,12 @@ val add_function_import :
2
2
  Module.t -> string -> string -> string -> Type.t -> Type.t -> unit
3
3
 
4
4
  val add_table_import : Module.t -> string -> string -> string -> unit
5
-
6
5
  val add_memory_import : Module.t -> string -> string -> string -> bool -> unit
7
6
 
8
7
  val add_global_import :
9
8
  Module.t -> string -> string -> string -> Type.t -> bool -> unit
10
9
 
11
10
  val function_import_get_module : Function.t -> string
12
-
13
11
  val global_import_get_module : Global.t -> string
14
-
15
12
  val function_import_get_base : Function.t -> string
16
-
17
13
  val global_import_get_base : Global.t -> string
@@ -1,15 +1,10 @@
1
1
  type t
2
2
 
3
3
  val int32 : int32 -> t
4
-
5
4
  val int64 : int64 -> t
6
-
7
5
  val float32_bits : int32 -> t
8
-
9
6
  val float64_bits : int64 -> t
10
-
11
7
  val float32 : float -> t
12
-
13
8
  val float64 : float -> t
14
9
 
15
10
  (* Hacks for Binaryen.js stack allocations *)