@grain/binaryen.ml 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binaryen-archive/CHANGELOG.md +22 -0
- binaryen-archive/binaryen.opam +2 -2
- binaryen-archive/dune +1 -1
- binaryen-archive/esy.lock/index.json +384 -68
- binaryen-archive/package.json +2 -2
- binaryen-archive/src/expression.c +3 -4
- binaryen-archive/src/expression.js +2 -2
- binaryen-archive/src/expression.ml +13 -6
- binaryen-archive/src/import.ml +8 -4
- binaryen-archive/src/memory.ml +2 -1
- binaryen-archive/src/module.c +0 -8
- binaryen-archive/src/module.js +0 -5
- binaryen-archive/src/module.ml +0 -2
- binaryen-archive/src/module.mli +0 -1
- binaryen-archive/src/passes.ml +31 -15
- binaryen-archive/src/passes.mli +29 -14
binaryen-archive/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grain/binaryen.ml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "OCaml bindings for Binaryen.",
|
|
5
5
|
"author": "Oscar Spencer <oscar@grain-lang.org>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"ocaml": ">= 4.13.0 < 5.4.0",
|
|
9
|
-
"@grain/libbinaryen": "
|
|
9
|
+
"@grain/libbinaryen": "121.0.0-b",
|
|
10
10
|
"@opam/dune": ">= 3.0.0",
|
|
11
11
|
"@opam/dune-configurator": ">= 3.0.0"
|
|
12
12
|
},
|
|
@@ -285,14 +285,13 @@ caml_binaryen_binary(value _module, value _op, value _p1, value _p2) {
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
CAMLprim value
|
|
288
|
-
caml_binaryen_select(value _module, value _cond, value _tru, value _fals
|
|
289
|
-
|
|
288
|
+
caml_binaryen_select(value _module, value _cond, value _tru, value _fals) {
|
|
289
|
+
CAMLparam4(_module, _cond, _tru, _fals);
|
|
290
290
|
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
|
|
291
291
|
BinaryenExpressionRef cond = BinaryenExpressionRef_val(_cond);
|
|
292
292
|
BinaryenExpressionRef tru = BinaryenExpressionRef_val(_tru);
|
|
293
293
|
BinaryenExpressionRef fals = BinaryenExpressionRef_val(_fals);
|
|
294
|
-
|
|
295
|
-
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals, ty);
|
|
294
|
+
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals);
|
|
296
295
|
CAMLreturn(alloc_BinaryenExpressionRef(exp));
|
|
297
296
|
}
|
|
298
297
|
|
|
@@ -403,8 +403,8 @@ function caml_binaryen_binary(wasm_mod, op, p1, p2) {
|
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
//Provides: caml_binaryen_select
|
|
406
|
-
function caml_binaryen_select(wasm_mod, cond, if_true, if_false
|
|
407
|
-
return wasm_mod.select(cond, if_true, if_false
|
|
406
|
+
function caml_binaryen_select(wasm_mod, cond, if_true, if_false) {
|
|
407
|
+
return wasm_mod.select(cond, if_true, if_false);
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
//Provides: caml_binaryen_drop
|
|
@@ -480,7 +480,8 @@ end
|
|
|
480
480
|
module Switch = struct
|
|
481
481
|
external make : Module.t -> string list -> string -> t -> t -> t
|
|
482
482
|
= "caml_binaryen_switch"
|
|
483
|
-
(** Module, branch names, default branch name, condition, value. Value may be
|
|
483
|
+
(** Module, branch names, default branch name, condition, value. Value may be
|
|
484
|
+
null. *)
|
|
484
485
|
|
|
485
486
|
external get_num_names : t -> int = "caml_binaryen_switch_get_num_names"
|
|
486
487
|
external get_name_at : t -> int -> string = "caml_binaryen_switch_get_name_at"
|
|
@@ -544,7 +545,8 @@ module Call_indirect = struct
|
|
|
544
545
|
|
|
545
546
|
external make_return :
|
|
546
547
|
Module.t -> string -> t -> t list -> Type.t -> Type.t -> t
|
|
547
|
-
= "caml_binaryen_return_call_indirect__bytecode"
|
|
548
|
+
= "caml_binaryen_return_call_indirect__bytecode"
|
|
549
|
+
"caml_binaryen_return_call_indirect"
|
|
548
550
|
(** Module, table, function value, params, params type, return type. *)
|
|
549
551
|
|
|
550
552
|
external get_target : t -> t = "caml_binaryen_call_indirect_get_target"
|
|
@@ -662,11 +664,11 @@ module Binary = struct
|
|
|
662
664
|
end
|
|
663
665
|
|
|
664
666
|
module Select = struct
|
|
665
|
-
external make : Module.t -> t -> t -> t ->
|
|
667
|
+
external make : Module.t -> t -> t -> t -> t
|
|
666
668
|
= "caml_binaryen_select"
|
|
667
669
|
|
|
668
670
|
(** Module, condition, true branch, false branch. *)
|
|
669
|
-
let make wasm_mod cond tru fals = make wasm_mod cond tru fals
|
|
671
|
+
let make wasm_mod cond tru fals = make wasm_mod cond tru fals
|
|
670
672
|
|
|
671
673
|
external get_if_true : t -> t = "caml_binaryen_select_get_if_true"
|
|
672
674
|
external set_if_true : t -> t -> unit = "caml_binaryen_select_set_if_true"
|
|
@@ -705,10 +707,13 @@ end
|
|
|
705
707
|
module Memory_init = struct
|
|
706
708
|
external make : Module.t -> string -> t -> t -> t -> string -> t
|
|
707
709
|
= "caml_binaryen_memory_init__bytecode" "caml_binaryen_memory_init"
|
|
708
|
-
|
|
710
|
+
|
|
709
711
|
external get_segment : t -> string = "caml_binaryen_memory_init_get_segment"
|
|
712
|
+
(** Module, segment, destination, offset, size, memory_name *)
|
|
713
|
+
|
|
710
714
|
external set_segment : t -> string -> unit
|
|
711
715
|
= "caml_binaryen_memory_init_set_segment"
|
|
716
|
+
|
|
712
717
|
external get_dest : t -> t = "caml_binaryen_memory_init_get_dest"
|
|
713
718
|
external set_dest : t -> t -> unit = "caml_binaryen_memory_init_set_dest"
|
|
714
719
|
external get_offset : t -> t = "caml_binaryen_memory_init_get_offset"
|
|
@@ -719,8 +724,10 @@ end
|
|
|
719
724
|
|
|
720
725
|
module Data_drop = struct
|
|
721
726
|
external make : Module.t -> string -> t = "caml_binaryen_data_drop"
|
|
722
|
-
|
|
727
|
+
|
|
723
728
|
external get_segment : t -> string = "caml_binaryen_data_drop_get_segment"
|
|
729
|
+
(** Module, segment. *)
|
|
730
|
+
|
|
724
731
|
external set_segment : t -> string -> unit
|
|
725
732
|
= "caml_binaryen_data_drop_set_segment"
|
|
726
733
|
end
|
binaryen-archive/src/import.ml
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
external add_function_import :
|
|
2
2
|
Module.t -> string -> string -> string -> Type.t -> Type.t -> unit
|
|
3
|
-
= "caml_binaryen_add_function_import__bytecode"
|
|
4
|
-
|
|
3
|
+
= "caml_binaryen_add_function_import__bytecode"
|
|
4
|
+
"caml_binaryen_add_function_import"
|
|
5
|
+
(** Module, internal name, external module name, external base name, params
|
|
6
|
+
type, results type. *)
|
|
5
7
|
|
|
6
8
|
external add_table_import : Module.t -> string -> string -> string -> unit
|
|
7
9
|
= "caml_binaryen_add_table_import"
|
|
@@ -14,8 +16,10 @@ external add_memory_import :
|
|
|
14
16
|
|
|
15
17
|
external add_global_import :
|
|
16
18
|
Module.t -> string -> string -> string -> Type.t -> bool -> unit
|
|
17
|
-
= "caml_binaryen_add_global_import__bytecode"
|
|
18
|
-
|
|
19
|
+
= "caml_binaryen_add_global_import__bytecode"
|
|
20
|
+
"caml_binaryen_add_global_import"
|
|
21
|
+
(** Module, internal name, external module name, external base name, type,
|
|
22
|
+
mutable. *)
|
|
19
23
|
|
|
20
24
|
external function_import_get_module : Function.t -> string
|
|
21
25
|
= "caml_binaryen_function_import_get_module"
|
binaryen-archive/src/memory.ml
CHANGED
|
@@ -16,7 +16,8 @@ external set_memory :
|
|
|
16
16
|
type segment = { name : string; data : bytes; kind : segment_kind; size : int }
|
|
17
17
|
and segment_kind = Passive | Active of { offset : Expression.t }
|
|
18
18
|
|
|
19
|
-
(** Module, initial size, maximum size, export name, segments, shared, memory64,
|
|
19
|
+
(** Module, initial size, maximum size, export name, segments, shared, memory64,
|
|
20
|
+
moduleName . *)
|
|
20
21
|
let set_memory wasm_mod initial maximum export_name (segments : segment list)
|
|
21
22
|
shared memory64 moduleName =
|
|
22
23
|
let split_segments segments =
|
binaryen-archive/src/module.c
CHANGED
|
@@ -78,14 +78,6 @@ caml_binaryen_module_run_passes(value _module, value _passes) {
|
|
|
78
78
|
CAMLreturn(Val_unit);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
CAMLprim value
|
|
82
|
-
caml_binaryen_module_auto_drop(value _module) {
|
|
83
|
-
CAMLparam1(_module);
|
|
84
|
-
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
|
|
85
|
-
BinaryenModuleAutoDrop(module);
|
|
86
|
-
CAMLreturn(Val_unit);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
81
|
CAMLprim value
|
|
90
82
|
caml_binaryen_module_write(value _module, value _sourceMapUrl) {
|
|
91
83
|
CAMLparam2(_module, _sourceMapUrl);
|
binaryen-archive/src/module.js
CHANGED
|
@@ -67,11 +67,6 @@ function caml_binaryen_module_run_passes(wasm_mod, passes) {
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
//Provides: caml_binaryen_module_auto_drop
|
|
71
|
-
function caml_binaryen_module_auto_drop(wasm_mod) {
|
|
72
|
-
return wasm_mod.autoDrop();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
70
|
//Provides: caml_binaryen_module_write
|
|
76
71
|
//Requires: to_option
|
|
77
72
|
//Requires: caml_jsstring_of_string, caml_string_of_jsstring, caml_bytes_of_array
|
binaryen-archive/src/module.ml
CHANGED
|
@@ -115,8 +115,6 @@ let set_features wasm_mod features =
|
|
|
115
115
|
external run_passes : t -> Passes.t list -> unit
|
|
116
116
|
= "caml_binaryen_module_run_passes"
|
|
117
117
|
|
|
118
|
-
external auto_drop : t -> unit = "caml_binaryen_module_auto_drop"
|
|
119
|
-
|
|
120
118
|
external write : t -> string option -> bytes * string option
|
|
121
119
|
= "caml_binaryen_module_write"
|
|
122
120
|
|
binaryen-archive/src/module.mli
CHANGED
|
@@ -35,7 +35,6 @@ val optimize : t -> unit
|
|
|
35
35
|
val get_features : t -> Feature.t list
|
|
36
36
|
val set_features : t -> Feature.t list -> unit
|
|
37
37
|
val run_passes : t -> Passes.t list -> unit
|
|
38
|
-
val auto_drop : t -> unit
|
|
39
38
|
val write : t -> string option -> bytes * string option
|
|
40
39
|
val write_text : t -> string
|
|
41
40
|
val write_stack_ir : t -> string
|
binaryen-archive/src/passes.ml
CHANGED
|
@@ -12,7 +12,8 @@ let avoid_reinterprets = "avoid-reinterprets"
|
|
|
12
12
|
(** removes arguments to calls in an lto-like manner *)
|
|
13
13
|
let dae = "dae"
|
|
14
14
|
|
|
15
|
-
(** removes arguments to calls in an lto-like manner, and optimizes where we
|
|
15
|
+
(** removes arguments to calls in an lto-like manner, and optimizes where we
|
|
16
|
+
removed *)
|
|
16
17
|
let dae_optimizing = "dae-optimizing"
|
|
17
18
|
|
|
18
19
|
(** refine and merge abstract (never-created) types *)
|
|
@@ -75,7 +76,8 @@ let extract_function_index = "extract-function-index"
|
|
|
75
76
|
(** flattens out code, removing nesting *)
|
|
76
77
|
let flatten = "flatten"
|
|
77
78
|
|
|
78
|
-
(** emulates function pointer casts, allowing incorrect indirect calls to
|
|
79
|
+
(** emulates function pointer casts, allowing incorrect indirect calls to
|
|
80
|
+
(sometimes) work *)
|
|
79
81
|
let fpcast_emu = "fpcast-emu"
|
|
80
82
|
|
|
81
83
|
(** reports function metrics *)
|
|
@@ -84,7 +86,9 @@ let func_metrics = "func-metrics"
|
|
|
84
86
|
(** generate dynCall fuctions used by emscripten ABI *)
|
|
85
87
|
let generate_dyncalls = "generate-dyncalls"
|
|
86
88
|
|
|
87
|
-
(** generate dynCall functions used by emscripten ABI, but only for functions
|
|
89
|
+
(** generate dynCall functions used by emscripten ABI, but only for functions
|
|
90
|
+
with i64 in their signature (which cannot be invoked via the wasm table
|
|
91
|
+
without JavaScript BigInt support). *)
|
|
88
92
|
let generate_i64_dyncalls = "generate-i64-dyncalls"
|
|
89
93
|
|
|
90
94
|
(** generate global effect info (helps later passes) *)
|
|
@@ -102,7 +106,8 @@ let gsi = "gsi"
|
|
|
102
106
|
(** globally optimize GC types *)
|
|
103
107
|
let gto = "gto"
|
|
104
108
|
|
|
105
|
-
(** Grand Unified Flow Analysis: optimize the entire program using information
|
|
109
|
+
(** Grand Unified Flow Analysis: optimize the entire program using information
|
|
110
|
+
about what content can actually appear in each location *)
|
|
106
111
|
let gufa = "gufa"
|
|
107
112
|
|
|
108
113
|
(** GUFA plus local optimizations in functions we modified *)
|
|
@@ -132,7 +137,8 @@ let jspi = "jspi"
|
|
|
132
137
|
(** legalizes i64 types on the import/export boundary *)
|
|
133
138
|
let legalize_js_interface = "legalize-js-interface"
|
|
134
139
|
|
|
135
|
-
(** legalizes i64 types on the import/export boundary in a minimal manner, only
|
|
140
|
+
(** legalizes i64 types on the import/export boundary in a minimal manner, only
|
|
141
|
+
on things only JS will call *)
|
|
136
142
|
let legalize_js_interface_minimally = "legalize-js-interface-minimally"
|
|
137
143
|
|
|
138
144
|
(** common subexpression elimination inside basic blocks *)
|
|
@@ -177,17 +183,21 @@ let merge_locals = "merge-locals"
|
|
|
177
183
|
(** reports metrics *)
|
|
178
184
|
let metrics = "metrics"
|
|
179
185
|
|
|
180
|
-
(** minifies import names (only those, and not export names), and emits a
|
|
186
|
+
(** minifies import names (only those, and not export names), and emits a
|
|
187
|
+
mapping to the minified ones *)
|
|
181
188
|
let minify_imports = "minify-imports"
|
|
182
189
|
|
|
183
|
-
(** minifies both import and export names, and emits a mapping to the minified
|
|
190
|
+
(** minifies both import and export names, and emits a mapping to the minified
|
|
191
|
+
ones *)
|
|
184
192
|
let minify_imports_and_exports = "minify-imports-and-exports"
|
|
185
193
|
|
|
186
|
-
(** minifies both import and export names, and emits a mapping to the minified
|
|
194
|
+
(** minifies both import and export names, and emits a mapping to the minified
|
|
195
|
+
ones, and minifies the modules as well *)
|
|
187
196
|
let minify_imports_and_exports_and_modules =
|
|
188
197
|
"minify-imports-and-exports-and-modules"
|
|
189
198
|
|
|
190
|
-
(** apply the assumption that asyncify imports always unwind, and we never
|
|
199
|
+
(** apply the assumption that asyncify imports always unwind, and we never
|
|
200
|
+
rewind *)
|
|
191
201
|
let mod_asyncify_always_and_only_unwind = "mod-asyncify-always-and-only-unwind"
|
|
192
202
|
|
|
193
203
|
(** apply the assumption that asyncify never unwinds *)
|
|
@@ -202,7 +212,8 @@ let monomorphize_always = "monomorphize-always"
|
|
|
202
212
|
(** combines multiple memories into a single memory *)
|
|
203
213
|
let multi_memory_lowering = "multi-memory-lowering"
|
|
204
214
|
|
|
205
|
-
(** combines multiple memories into a single memory, trapping if the read or
|
|
215
|
+
(** combines multiple memories into a single memory, trapping if the read or
|
|
216
|
+
write is larger than the length of the memory's data *)
|
|
206
217
|
let multi_memory_lowering_with_bounds_checks =
|
|
207
218
|
"multi-memory-lowering-with-bounds-checks"
|
|
208
219
|
|
|
@@ -218,7 +229,8 @@ let once_reduction = "once-reduction"
|
|
|
218
229
|
(** optimizes added constants into load/store offsets *)
|
|
219
230
|
let optimize_added_constants = "optimize-added-constants"
|
|
220
231
|
|
|
221
|
-
(** optimizes added constants into load/store offsets, propagating them across
|
|
232
|
+
(** optimizes added constants into load/store offsets, propagating them across
|
|
233
|
+
locals too *)
|
|
222
234
|
let optimize_added_constants_propagate = "optimize-added-constants-propagate"
|
|
223
235
|
|
|
224
236
|
(** eliminate and reuse casts *)
|
|
@@ -245,7 +257,8 @@ let optimize_for_js = "optimize-for-js"
|
|
|
245
257
|
(** computes compile-time evaluatable expressions *)
|
|
246
258
|
let precompute = "precompute"
|
|
247
259
|
|
|
248
|
-
(** computes compile-time evaluatable expressions and propagates them through
|
|
260
|
+
(** computes compile-time evaluatable expressions and propagates them through
|
|
261
|
+
locals *)
|
|
249
262
|
let precompute_propagate = "precompute-propagate"
|
|
250
263
|
|
|
251
264
|
(** print in s-expression format *)
|
|
@@ -330,19 +343,22 @@ let signature_pruning = "signature-pruning"
|
|
|
330
343
|
(** apply more specific subtypes to signature types where possible *)
|
|
331
344
|
let signature_refining = "signature-refining"
|
|
332
345
|
|
|
333
|
-
(** lower sign-ext operations to wasm mvp and disable the sign extension feature
|
|
346
|
+
(** lower sign-ext operations to wasm mvp and disable the sign extension feature
|
|
347
|
+
*)
|
|
334
348
|
let signext_lowering = "signext-lowering"
|
|
335
349
|
|
|
336
350
|
(** miscellaneous globals-related optimizations *)
|
|
337
351
|
let simplify_globals = "simplify-globals"
|
|
338
352
|
|
|
339
|
-
(** miscellaneous globals-related optimizations, and optimizes where we replaced
|
|
353
|
+
(** miscellaneous globals-related optimizations, and optimizes where we replaced
|
|
354
|
+
global.gets with constants *)
|
|
340
355
|
let simplify_globals_optimizing = "simplify-globals-optimizing"
|
|
341
356
|
|
|
342
357
|
(** miscellaneous locals-related optimizations *)
|
|
343
358
|
let simplify_locals = "simplify-locals"
|
|
344
359
|
|
|
345
|
-
(** miscellaneous locals-related optimizations (no nesting at all; preserves
|
|
360
|
+
(** miscellaneous locals-related optimizations (no nesting at all; preserves
|
|
361
|
+
flatness) *)
|
|
346
362
|
let simplify_locals_nonesting = "simplify-locals-nonesting"
|
|
347
363
|
|
|
348
364
|
(** miscellaneous locals-related optimizations (no tees) *)
|
binaryen-archive/src/passes.mli
CHANGED
|
@@ -13,7 +13,8 @@ val dae : t
|
|
|
13
13
|
(** removes arguments to calls in an lto-like manner *)
|
|
14
14
|
|
|
15
15
|
val dae_optimizing : t
|
|
16
|
-
(** removes arguments to calls in an lto-like manner, and optimizes where we
|
|
16
|
+
(** removes arguments to calls in an lto-like manner, and optimizes where we
|
|
17
|
+
removed *)
|
|
17
18
|
|
|
18
19
|
val abstract_type_refining : t
|
|
19
20
|
(** refine and merge abstract (never-created) types *)
|
|
@@ -76,7 +77,8 @@ val flatten : t
|
|
|
76
77
|
(** flattens out code, removing nesting *)
|
|
77
78
|
|
|
78
79
|
val fpcast_emu : t
|
|
79
|
-
(** emulates function pointer casts, allowing incorrect indirect calls to
|
|
80
|
+
(** emulates function pointer casts, allowing incorrect indirect calls to
|
|
81
|
+
(sometimes) work *)
|
|
80
82
|
|
|
81
83
|
val func_metrics : t
|
|
82
84
|
(** reports function metrics *)
|
|
@@ -85,7 +87,9 @@ val generate_dyncalls : t
|
|
|
85
87
|
(** generate dynCall fuctions used by emscripten ABI *)
|
|
86
88
|
|
|
87
89
|
val generate_i64_dyncalls : t
|
|
88
|
-
(** generate dynCall functions used by emscripten ABI, but only for functions
|
|
90
|
+
(** generate dynCall functions used by emscripten ABI, but only for functions
|
|
91
|
+
with i64 in their signature (which cannot be invoked via the wasm table
|
|
92
|
+
without JavaScript BigInt support). *)
|
|
89
93
|
|
|
90
94
|
val generate_global_effects : t
|
|
91
95
|
(** generate global effect info (helps later passes) *)
|
|
@@ -103,7 +107,8 @@ val gto : t
|
|
|
103
107
|
(** globally optimize GC types *)
|
|
104
108
|
|
|
105
109
|
val gufa : t
|
|
106
|
-
(** Grand Unified Flow Analysis: optimize the entire program using information
|
|
110
|
+
(** Grand Unified Flow Analysis: optimize the entire program using information
|
|
111
|
+
about what content can actually appear in each location *)
|
|
107
112
|
|
|
108
113
|
val gufa_optimizing : t
|
|
109
114
|
(** GUFA plus local optimizations in functions we modified *)
|
|
@@ -133,7 +138,8 @@ val legalize_js_interface : t
|
|
|
133
138
|
(** legalizes i64 types on the import/export boundary *)
|
|
134
139
|
|
|
135
140
|
val legalize_js_interface_minimally : t
|
|
136
|
-
(** legalizes i64 types on the import/export boundary in a minimal manner, only
|
|
141
|
+
(** legalizes i64 types on the import/export boundary in a minimal manner, only
|
|
142
|
+
on things only JS will call *)
|
|
137
143
|
|
|
138
144
|
val local_cse : t
|
|
139
145
|
(** common subexpression elimination inside basic blocks *)
|
|
@@ -178,16 +184,20 @@ val metrics : t
|
|
|
178
184
|
(** reports metrics *)
|
|
179
185
|
|
|
180
186
|
val minify_imports : t
|
|
181
|
-
(** minifies import names (only those, and not export names), and emits a
|
|
187
|
+
(** minifies import names (only those, and not export names), and emits a
|
|
188
|
+
mapping to the minified ones *)
|
|
182
189
|
|
|
183
190
|
val minify_imports_and_exports : t
|
|
184
|
-
(** minifies both import and export names, and emits a mapping to the minified
|
|
191
|
+
(** minifies both import and export names, and emits a mapping to the minified
|
|
192
|
+
ones *)
|
|
185
193
|
|
|
186
194
|
val minify_imports_and_exports_and_modules : t
|
|
187
|
-
(** minifies both import and export names, and emits a mapping to the minified
|
|
195
|
+
(** minifies both import and export names, and emits a mapping to the minified
|
|
196
|
+
ones, and minifies the modules as well *)
|
|
188
197
|
|
|
189
198
|
val mod_asyncify_always_and_only_unwind : t
|
|
190
|
-
(** apply the assumption that asyncify imports always unwind, and we never
|
|
199
|
+
(** apply the assumption that asyncify imports always unwind, and we never
|
|
200
|
+
rewind *)
|
|
191
201
|
|
|
192
202
|
val mod_asyncify_never_unwind : t
|
|
193
203
|
(** apply the assumption that asyncify never unwinds *)
|
|
@@ -202,7 +212,8 @@ val multi_memory_lowering : t
|
|
|
202
212
|
(** combines multiple memories into a single memory *)
|
|
203
213
|
|
|
204
214
|
val multi_memory_lowering_with_bounds_checks : t
|
|
205
|
-
(** combines multiple memories into a single memory, trapping if the read or
|
|
215
|
+
(** combines multiple memories into a single memory, trapping if the read or
|
|
216
|
+
write is larger than the length of the memory's data *)
|
|
206
217
|
|
|
207
218
|
val nm : t
|
|
208
219
|
(** name list *)
|
|
@@ -217,7 +228,8 @@ val optimize_added_constants : t
|
|
|
217
228
|
(** optimizes added constants into load/store offsets *)
|
|
218
229
|
|
|
219
230
|
val optimize_added_constants_propagate : t
|
|
220
|
-
(** optimizes added constants into load/store offsets, propagating them across
|
|
231
|
+
(** optimizes added constants into load/store offsets, propagating them across
|
|
232
|
+
locals too *)
|
|
221
233
|
|
|
222
234
|
val optimize_casts : t
|
|
223
235
|
(** eliminate and reuse casts *)
|
|
@@ -244,7 +256,8 @@ val precompute : t
|
|
|
244
256
|
(** computes compile-time evaluatable expressions *)
|
|
245
257
|
|
|
246
258
|
val precompute_propagate : t
|
|
247
|
-
(** computes compile-time evaluatable expressions and propagates them through
|
|
259
|
+
(** computes compile-time evaluatable expressions and propagates them through
|
|
260
|
+
locals *)
|
|
248
261
|
|
|
249
262
|
val print : t
|
|
250
263
|
(** print in s-expression format *)
|
|
@@ -334,13 +347,15 @@ val simplify_globals : t
|
|
|
334
347
|
(** miscellaneous globals-related optimizations *)
|
|
335
348
|
|
|
336
349
|
val simplify_globals_optimizing : t
|
|
337
|
-
(** miscellaneous globals-related optimizations, and optimizes where we replaced
|
|
350
|
+
(** miscellaneous globals-related optimizations, and optimizes where we replaced
|
|
351
|
+
global.gets with constants *)
|
|
338
352
|
|
|
339
353
|
val simplify_locals : t
|
|
340
354
|
(** miscellaneous locals-related optimizations *)
|
|
341
355
|
|
|
342
356
|
val simplify_locals_nonesting : t
|
|
343
|
-
(** miscellaneous locals-related optimizations (no nesting at all; preserves
|
|
357
|
+
(** miscellaneous locals-related optimizations (no nesting at all; preserves
|
|
358
|
+
flatness) *)
|
|
344
359
|
|
|
345
360
|
val simplify_locals_notee : t
|
|
346
361
|
(** miscellaneous locals-related optimizations (no tees) *)
|