@grain/binaryen.ml 0.16.0 → 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.
- binaryen-archive/CHANGELOG.md +14 -0
- binaryen-archive/binaryen.opam +2 -2
- binaryen-archive/esy.lock/index.json +6 -6
- binaryen-archive/package.json +2 -2
- binaryen-archive/src/binaryen_stubs_features.c +6 -0
- binaryen-archive/src/binaryen_stubs_features.js +6 -0
- binaryen-archive/src/binaryen_stubs_ops.c +2 -2
- binaryen-archive/src/binaryen_stubs_ops.js +1 -1
- binaryen-archive/src/module.ml +4 -0
- binaryen-archive/src/module.mli +1 -0
- binaryen-archive/src/passes.ml +6 -0
- binaryen-archive/src/passes.mli +6 -0
- binaryen-archive/test/test.ml +5 -1
binaryen-archive/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.17.0](https://github.com/grain-lang/binaryen.ml/compare/v0.16.0...v0.17.0) (2022-05-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Update libbinaryen to 107 ([#152](https://github.com/grain-lang/binaryen.ml/issues/152))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Add merge_similar_functions pass ([#154](https://github.com/grain-lang/binaryen.ml/issues/154)) ([54b03fd](https://github.com/grain-lang/binaryen.ml/commit/54b03fd854311f49aa1821868a8265116be922c2))
|
|
13
|
+
* Add signature_pruning pass ([#155](https://github.com/grain-lang/binaryen.ml/issues/155)) ([206b6cf](https://github.com/grain-lang/binaryen.ml/commit/206b6cf0ade48a778f4e991cf5d2ab0daf559bf8))
|
|
14
|
+
* Add support for extended_const feature ([260c2a1](https://github.com/grain-lang/binaryen.ml/commit/260c2a131a08720eac0f21abf68689fd201eb753))
|
|
15
|
+
* Update libbinaryen to 107 ([#152](https://github.com/grain-lang/binaryen.ml/issues/152)) ([260c2a1](https://github.com/grain-lang/binaryen.ml/commit/260c2a131a08720eac0f21abf68689fd201eb753))
|
|
16
|
+
|
|
3
17
|
## [0.16.0](https://github.com/grain-lang/binaryen.ml/compare/v0.15.0...v0.16.0) (2022-05-11)
|
|
4
18
|
|
|
5
19
|
|
binaryen-archive/binaryen.opam
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
opam-version: "2.0"
|
|
2
|
-
version: "0.
|
|
2
|
+
version: "0.17.0"
|
|
3
3
|
synopsis: "OCaml bindings for Binaryen"
|
|
4
4
|
maintainer: "oscar@grain-lang.org"
|
|
5
5
|
author: "Oscar Spencer"
|
|
@@ -16,5 +16,5 @@ depends: [
|
|
|
16
16
|
"dune" {>= "2.9.1" < "3.0.0"}
|
|
17
17
|
"dune-configurator" {>= "2.9.1" < "3.0.0"}
|
|
18
18
|
"js_of_ocaml-compiler" {>= "3.10.0" < "4.0.0"}
|
|
19
|
-
"libbinaryen" {>= "
|
|
19
|
+
"libbinaryen" {>= "107.0.0" < "108.0.0"}
|
|
20
20
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"checksum": "
|
|
2
|
+
"checksum": "b457058cff75c1d285583590fc14c29b",
|
|
3
3
|
"root": "@grain/binaryen.ml@link-dev:./package.json",
|
|
4
4
|
"node": {
|
|
5
5
|
"ocaml@4.13.1000@d41d8cd9": {
|
|
@@ -1238,14 +1238,14 @@
|
|
|
1238
1238
|
],
|
|
1239
1239
|
"devDependencies": [ "ocaml@4.13.1000@d41d8cd9" ]
|
|
1240
1240
|
},
|
|
1241
|
-
"@grain/libbinaryen@
|
|
1242
|
-
"id": "@grain/libbinaryen@
|
|
1241
|
+
"@grain/libbinaryen@107.0.0@d41d8cd9": {
|
|
1242
|
+
"id": "@grain/libbinaryen@107.0.0@d41d8cd9",
|
|
1243
1243
|
"name": "@grain/libbinaryen",
|
|
1244
|
-
"version": "
|
|
1244
|
+
"version": "107.0.0",
|
|
1245
1245
|
"source": {
|
|
1246
1246
|
"type": "install",
|
|
1247
1247
|
"source": [
|
|
1248
|
-
"archive:https://registry.npmjs.org/@grain/libbinaryen/-/libbinaryen-
|
|
1248
|
+
"archive:https://registry.npmjs.org/@grain/libbinaryen/-/libbinaryen-107.0.0.tgz#sha1:f6325f0b6ae301a3603d56c8d2414b56ec596e80"
|
|
1249
1249
|
]
|
|
1250
1250
|
},
|
|
1251
1251
|
"overrides": [],
|
|
@@ -1272,7 +1272,7 @@
|
|
|
1272
1272
|
"ocaml@4.13.1000@d41d8cd9",
|
|
1273
1273
|
"@opam/dune-configurator@opam:2.9.3@174e411b",
|
|
1274
1274
|
"@opam/dune@opam:2.9.3@f57a6d69",
|
|
1275
|
-
"@grain/libbinaryen@
|
|
1275
|
+
"@grain/libbinaryen@107.0.0@d41d8cd9"
|
|
1276
1276
|
],
|
|
1277
1277
|
"devDependencies": [
|
|
1278
1278
|
"@opam/ocamlformat@opam:0.20.1@30a05b69",
|
binaryen-archive/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grain/binaryen.ml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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.12.0 < 4.14.0",
|
|
9
|
-
"@grain/libbinaryen": ">=
|
|
9
|
+
"@grain/libbinaryen": ">= 107.0.0 < 108.0.0",
|
|
10
10
|
"@opam/dune": ">= 2.9.1 < 3.0.0",
|
|
11
11
|
"@opam/dune-configurator": ">= 2.9.1 < 3.0.0"
|
|
12
12
|
},
|
|
@@ -113,6 +113,12 @@ caml_binaryen_feature_relaxed_simd(value unit) {
|
|
|
113
113
|
CAMLreturn(Val_int(BinaryenFeatureRelaxedSIMD()));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
CAMLprim value
|
|
117
|
+
caml_binaryen_feature_extended_const(value unit) {
|
|
118
|
+
CAMLparam1(unit);
|
|
119
|
+
CAMLreturn(Val_int(BinaryenFeatureExtendedConst()));
|
|
120
|
+
}
|
|
121
|
+
|
|
116
122
|
CAMLprim value
|
|
117
123
|
caml_binaryen_feature_all(value unit) {
|
|
118
124
|
CAMLparam1(unit);
|
|
@@ -98,6 +98,12 @@ function caml_binaryen_feature_relaxed_simd() {
|
|
|
98
98
|
return binaryen.Features.RelaxedSIMD;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
//Provides: caml_binaryen_feature_extended_const
|
|
102
|
+
//Requires: binaryen
|
|
103
|
+
function caml_binaryen_feature_extended_const() {
|
|
104
|
+
return binaryen.Features.ExtendedConst;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
//Provides: caml_binaryen_feature_all
|
|
102
108
|
//Requires: binaryen
|
|
103
109
|
function caml_binaryen_feature_all() {
|
|
@@ -2167,7 +2167,7 @@ caml_binaryen_binaryen_narrow_u_vec_i32x4_to_vec_i16x8(value unit) {
|
|
|
2167
2167
|
CAMLprim value
|
|
2168
2168
|
caml_binaryen_binaryen_swizzle_vec8x16(value unit) {
|
|
2169
2169
|
CAMLparam1(unit);
|
|
2170
|
-
BinaryenOp op =
|
|
2170
|
+
BinaryenOp op = BinaryenSwizzleVecI8x16();
|
|
2171
2171
|
CAMLreturn(alloc_BinaryenOp(op));
|
|
2172
2172
|
}
|
|
2173
2173
|
|
|
@@ -2225,4 +2225,4 @@ caml_binaryen_binaryen_ref_as_i31(value unit) {
|
|
|
2225
2225
|
CAMLparam1(unit);
|
|
2226
2226
|
BinaryenOp op = BinaryenRefAsI31();
|
|
2227
2227
|
CAMLreturn(alloc_BinaryenOp(op));
|
|
2228
|
-
}
|
|
2228
|
+
}
|
|
@@ -1843,7 +1843,7 @@ function caml_binaryen_binaryen_narrow_u_vec_i32x4_to_vec_i16x8() {
|
|
|
1843
1843
|
//Provides: caml_binaryen_binaryen_swizzle_vec8x16
|
|
1844
1844
|
//Requires: binaryen
|
|
1845
1845
|
function caml_binaryen_binaryen_swizzle_vec8x16() {
|
|
1846
|
-
return binaryen.Operations.
|
|
1846
|
+
return binaryen.Operations.SwizzleVecI8x16;
|
|
1847
1847
|
}
|
|
1848
1848
|
|
|
1849
1849
|
//Provides: caml_binaryen_binaryen_ref_is_null
|
binaryen-archive/src/module.ml
CHANGED
|
@@ -69,6 +69,10 @@ module Feature = struct
|
|
|
69
69
|
|
|
70
70
|
let relaxed_simd = relaxed_simd ()
|
|
71
71
|
|
|
72
|
+
external extended_const : unit -> t = "caml_binaryen_feature_extended_const"
|
|
73
|
+
|
|
74
|
+
let extended_const = extended_const ()
|
|
75
|
+
|
|
72
76
|
external all : unit -> t = "caml_binaryen_feature_all"
|
|
73
77
|
|
|
74
78
|
let all = all ()
|
binaryen-archive/src/module.mli
CHANGED
binaryen-archive/src/passes.ml
CHANGED
|
@@ -147,6 +147,9 @@ let memory_packing = "memory-packing"
|
|
|
147
147
|
(** merges blocks to their parents *)
|
|
148
148
|
let merge_blocks = "merge-blocks"
|
|
149
149
|
|
|
150
|
+
(** merges similar functions when benefical *)
|
|
151
|
+
let merge_similar_functions = "merge-similar-functions"
|
|
152
|
+
|
|
150
153
|
(** merges locals when beneficial *)
|
|
151
154
|
let merge_locals = "merge-locals"
|
|
152
155
|
|
|
@@ -275,6 +278,9 @@ let safe_heap = "safe-heap"
|
|
|
275
278
|
(** sets specified globals to specified values *)
|
|
276
279
|
let set_globals = "set-globals"
|
|
277
280
|
|
|
281
|
+
(** remove params from function signature types where possible *)
|
|
282
|
+
let signature_pruning = "signature-pruning"
|
|
283
|
+
|
|
278
284
|
(** apply more specific subtypes to signature types where possible *)
|
|
279
285
|
let signature_refining = "signature-refining"
|
|
280
286
|
|
binaryen-archive/src/passes.mli
CHANGED
|
@@ -147,6 +147,9 @@ val memory_packing : t
|
|
|
147
147
|
val merge_blocks : t
|
|
148
148
|
(** merges blocks to their parents *)
|
|
149
149
|
|
|
150
|
+
val merge_similar_functions : t
|
|
151
|
+
(** merges similar functions when benefical *)
|
|
152
|
+
|
|
150
153
|
val merge_locals : t
|
|
151
154
|
(** merges locals when beneficial *)
|
|
152
155
|
|
|
@@ -273,6 +276,9 @@ val safe_heap : t
|
|
|
273
276
|
val set_globals : t
|
|
274
277
|
(** sets specified globals to specified values *)
|
|
275
278
|
|
|
279
|
+
val signature_pruning : t
|
|
280
|
+
(** remove params from function signature types where possible *)
|
|
281
|
+
|
|
276
282
|
val signature_refining : t
|
|
277
283
|
(** apply more specific subtypes to signature types where possible *)
|
|
278
284
|
|
binaryen-archive/test/test.ml
CHANGED
|
@@ -177,7 +177,10 @@ let _ =
|
|
|
177
177
|
sourcemap = Some {|{"version":3,"sources":[],"names":[],"mappings":""}|})
|
|
178
178
|
|
|
179
179
|
let new_mod = Module.read byts
|
|
180
|
-
|
|
180
|
+
|
|
181
|
+
let _ =
|
|
182
|
+
Module.run_passes new_mod
|
|
183
|
+
[ Passes.name_types; Passes.merge_similar_functions ]
|
|
181
184
|
|
|
182
185
|
let _ =
|
|
183
186
|
Module.set_features new_mod
|
|
@@ -197,6 +200,7 @@ let _ =
|
|
|
197
200
|
Module.Feature.memory64;
|
|
198
201
|
Module.Feature.typed_function_references;
|
|
199
202
|
Module.Feature.relaxed_simd;
|
|
203
|
+
Module.Feature.extended_const;
|
|
200
204
|
Module.Feature.all;
|
|
201
205
|
]
|
|
202
206
|
|