@grain/binaryen.ml 0.15.0 → 0.17.1
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 +44 -0
- binaryen-archive/README.md +0 -30
- binaryen-archive/binaryen.opam +6 -6
- binaryen-archive/esy.lock/index.json +542 -290
- binaryen-archive/esy.lock/opam/base-bigarray.base/opam +6 -0
- binaryen-archive/esy.lock/opam/{cmdliner.1.1.0 → cmdliner.1.1.1}/opam +24 -18
- binaryen-archive/esy.lock/opam/{cppo.1.6.8 → cppo.1.6.9}/opam +21 -19
- binaryen-archive/esy.lock/opam/{dune-build-info.2.9.3 → dune-build-info.3.2.0}/opam +8 -5
- binaryen-archive/esy.lock/opam/{dune-configurator.2.9.3 → dune-configurator.3.2.0}/opam +9 -8
- binaryen-archive/esy.lock/opam/dune-rpc.3.2.0/opam +44 -0
- binaryen-archive/esy.lock/opam/{dune.2.9.3 → dune.3.2.0}/opam +6 -8
- binaryen-archive/esy.lock/opam/dyn.3.2.0/opam +41 -0
- binaryen-archive/esy.lock/opam/{easy-format.1.3.2 → easy-format.1.3.4}/opam +28 -18
- binaryen-archive/esy.lock/opam/fiber.3.2.0/opam +42 -0
- binaryen-archive/esy.lock/opam/{js_of_ocaml-compiler.3.11.0 → js_of_ocaml-compiler.4.0.0}/opam +13 -11
- binaryen-archive/esy.lock/opam/{menhir.20211128 → menhir.20220210}/opam +4 -4
- binaryen-archive/esy.lock/opam/{menhirLib.20211128 → menhirLib.20220210}/opam +3 -3
- binaryen-archive/esy.lock/opam/{menhirSdk.20211128 → menhirSdk.20220210}/opam +3 -3
- binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.10.3 → ocaml-lsp-server.1.11.6}/opam +15 -7
- binaryen-archive/esy.lock/opam/{ocamlformat-rpc-lib.0.19.0 → ocamlformat-rpc-lib.0.22.4}/opam +6 -7
- binaryen-archive/esy.lock/opam/octavius.1.2.2/opam +33 -0
- binaryen-archive/esy.lock/opam/omd.1.3.1/opam +39 -0
- binaryen-archive/esy.lock/opam/ordering.3.2.0/opam +39 -0
- binaryen-archive/esy.lock/opam/{ppx_yojson_conv_lib.v0.14.0 → ppx_yojson_conv_lib.v0.15.0}/opam +2 -2
- binaryen-archive/esy.lock/opam/{ppxlib.0.25.0 → ppxlib.0.26.0}/opam +5 -4
- binaryen-archive/esy.lock/opam/{re.1.10.3 → re.1.10.4}/opam +7 -7
- binaryen-archive/esy.lock/opam/{spawn.v0.15.0 → spawn.v0.15.1}/opam +4 -4
- binaryen-archive/esy.lock/opam/stdune.3.2.0/opam +44 -0
- binaryen-archive/esy.lock/opam/xdg.3.2.0/opam +40 -0
- binaryen-archive/esy.lock/overrides/opam__s__js__of__ocaml_compiler_opam__c__4.0.0_opam_override/package.json +3 -0
- binaryen-archive/package.json +5 -5
- binaryen-archive/src/binaryen_stubs_expressions.c +6 -1
- binaryen-archive/src/binaryen_stubs_expressions.js +2 -1
- 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/expression.ml +1 -1
- binaryen-archive/src/expression.mli +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/config/ocamlopt_flags.ml +1 -8
- binaryen-archive/test/test.ml +19 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
opam-version: "2.0"
|
|
2
|
+
maintainer: "Philippe Wang <philippe.wang@gmail.com>"
|
|
3
|
+
authors: [ "Philippe Wang <philippe.wang@gmail.com>" ]
|
|
4
|
+
license: "ISC"
|
|
5
|
+
homepage: "https://github.com/ocaml/omd"
|
|
6
|
+
dev-repo: "git+https://github.com/ocaml/omd.git"
|
|
7
|
+
bug-reports: "https://github.com/ocaml/omd/issues"
|
|
8
|
+
tags: [ "org:ocamllabs" "org:mirage" ]
|
|
9
|
+
build: [
|
|
10
|
+
["ocaml" "setup.ml" "-configure" "--prefix" prefix]
|
|
11
|
+
["ocaml" "setup.ml" "-build"]
|
|
12
|
+
["ocaml" "setup.ml" "-configure" "--enable-tests"] {with-test}
|
|
13
|
+
["ocaml" "setup.ml" "-build"] {with-test}
|
|
14
|
+
["ocaml" "setup.ml" "-test"] {with-test}
|
|
15
|
+
]
|
|
16
|
+
install: ["ocaml" "setup.ml" "-install"]
|
|
17
|
+
remove: [
|
|
18
|
+
["ocaml" "%{etc}%/omd/setup.ml" "-C" "%{etc}%/omd" "-uninstall"]
|
|
19
|
+
]
|
|
20
|
+
depends: [
|
|
21
|
+
"ocaml" {>= "4.01"}
|
|
22
|
+
"base-bigarray"
|
|
23
|
+
"base-bytes"
|
|
24
|
+
"ocamlbuild" {build}
|
|
25
|
+
"ocamlfind" {build & >= "1.5"}
|
|
26
|
+
]
|
|
27
|
+
synopsis: "A Markdown frontend in pure OCaml."
|
|
28
|
+
description: """
|
|
29
|
+
This Markdown library is implemented using only pure OCaml (including
|
|
30
|
+
I/O operations provided by the standard OCaml compiler distribution).
|
|
31
|
+
OMD is meant to be as faithful as possible to the original Markdown.
|
|
32
|
+
Additionally, OMD implements a few Github markdown features, an
|
|
33
|
+
extension mechanism, and some other features. Note that the opam
|
|
34
|
+
package installs both the OMD library and the command line tool `omd`."""
|
|
35
|
+
url {
|
|
36
|
+
src:
|
|
37
|
+
"https://github.com/Chris00/omd/releases/download/1.3.1/omd-1.3.1.tar.gz"
|
|
38
|
+
checksum: "md5=845fc38e86ec0e85721130f2dd044d00"
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
opam-version: "2.0"
|
|
2
|
+
synopsis: "Element ordering"
|
|
3
|
+
description: "Element ordering"
|
|
4
|
+
maintainer: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
5
|
+
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
6
|
+
license: "MIT"
|
|
7
|
+
homepage: "https://github.com/ocaml/dune"
|
|
8
|
+
doc: "https://dune.readthedocs.io/"
|
|
9
|
+
bug-reports: "https://github.com/ocaml/dune/issues"
|
|
10
|
+
depends: [
|
|
11
|
+
"dune" {>= "3.0"}
|
|
12
|
+
"ocaml" {>= "4.08.0"}
|
|
13
|
+
"odoc" {with-doc}
|
|
14
|
+
]
|
|
15
|
+
dev-repo: "git+https://github.com/ocaml/dune.git"
|
|
16
|
+
build: [
|
|
17
|
+
["dune" "subst"] {dev}
|
|
18
|
+
["rm" "-rf" "vendor/csexp"]
|
|
19
|
+
["rm" "-rf" "vendor/pp"]
|
|
20
|
+
[
|
|
21
|
+
"dune"
|
|
22
|
+
"build"
|
|
23
|
+
"-p"
|
|
24
|
+
name
|
|
25
|
+
"-j"
|
|
26
|
+
jobs
|
|
27
|
+
"@install"
|
|
28
|
+
"@doc" {with-doc}
|
|
29
|
+
]
|
|
30
|
+
]
|
|
31
|
+
url {
|
|
32
|
+
src:
|
|
33
|
+
"https://github.com/ocaml/dune/releases/download/3.2.0/chrome-trace-3.2.0.tbz"
|
|
34
|
+
checksum: [
|
|
35
|
+
"sha256=bd1fbce6ae79ed1eb26fa89bb2e2e23978afceb3f53f5578cf1bdab08a1ad5bc"
|
|
36
|
+
"sha512=b99e82d7e2233a9dd8c1fae591a03f9470fcdf9750d0e428cee2d4c8bcfa4da1595e9e10af2f234279a6ca8a120a773b247d4761d2c39210fc6101076631690e"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
x-commit-hash: "43af00f79e41ce9101d42b36dab13e1f68d49a7a"
|
binaryen-archive/esy.lock/opam/{ppx_yojson_conv_lib.v0.14.0 → ppx_yojson_conv_lib.v0.15.0}/opam
RENAMED
|
@@ -19,6 +19,6 @@ description: "
|
|
|
19
19
|
Part of the Jane Street's PPX rewriters collection.
|
|
20
20
|
"
|
|
21
21
|
url {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
src: "https://ocaml.janestreet.com/ocaml-core/v0.15/files/ppx_yojson_conv_lib-v0.15.0.tar.gz"
|
|
23
|
+
checksum: "sha256=f9d2c5eff4566ec1f1f379b186ed22c8ddd6be0909a160bc5a9ac7abc6a6b684"
|
|
24
24
|
}
|
|
@@ -24,6 +24,7 @@ depends: [
|
|
|
24
24
|
"ocaml-compiler-libs" {>= "v0.11.0"}
|
|
25
25
|
"ppx_derivers" {>= "1.0"}
|
|
26
26
|
"sexplib0" {>= "v0.12"}
|
|
27
|
+
"sexplib0" {with-test & < "v0.15"}
|
|
27
28
|
"stdlib-shims"
|
|
28
29
|
"ocamlfind" {with-test}
|
|
29
30
|
"re" {with-test & >= "1.9.0"}
|
|
@@ -53,10 +54,10 @@ build: [
|
|
|
53
54
|
dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git"
|
|
54
55
|
url {
|
|
55
56
|
src:
|
|
56
|
-
"https://github.com/ocaml-ppx/ppxlib/releases/download/0.
|
|
57
|
+
"https://github.com/ocaml-ppx/ppxlib/releases/download/0.26.0/ppxlib-0.26.0.tbz"
|
|
57
58
|
checksum: [
|
|
58
|
-
"sha256=
|
|
59
|
-
"sha512=
|
|
59
|
+
"sha256=63117b67ea5863935455fe921f88fe333c0530f0483f730313303a93af817efd"
|
|
60
|
+
"sha512=9cfc9587657d17cdee5483e2a03292f872c42886e512bcc7442652e6418ce74c0135c731d8a68288c7fecae7f1b2defd93fe5acf8edb41e25144a8cec2806227"
|
|
60
61
|
]
|
|
61
62
|
}
|
|
62
|
-
x-commit-hash: "
|
|
63
|
+
x-commit-hash: "18b1ad68b59d151d662147661e43b159ac491f68"
|
|
@@ -8,19 +8,19 @@ authors: [
|
|
|
8
8
|
"Rudi Grinberg"
|
|
9
9
|
"Gabriel Radanne"
|
|
10
10
|
]
|
|
11
|
-
license: "LGPL-2.0
|
|
11
|
+
license: "LGPL-2.0-or-later WITH OCaml-LGPL-linking-exception"
|
|
12
12
|
homepage: "https://github.com/ocaml/ocaml-re"
|
|
13
13
|
bug-reports: "https://github.com/ocaml/ocaml-re/issues"
|
|
14
14
|
dev-repo: "git+https://github.com/ocaml/ocaml-re.git"
|
|
15
15
|
|
|
16
16
|
build: [
|
|
17
|
-
["dune" "subst"] {
|
|
17
|
+
["dune" "subst"] {dev}
|
|
18
18
|
["dune" "build" "-p" name "-j" jobs]
|
|
19
19
|
["dune" "runtest" "-p" name "-j" jobs] {with-test}
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
depends: [
|
|
23
|
-
"ocaml" {>= "4.
|
|
23
|
+
"ocaml" {>= "4.03"}
|
|
24
24
|
"dune" {>= "2.0"}
|
|
25
25
|
"ounit" {with-test}
|
|
26
26
|
"seq"
|
|
@@ -37,10 +37,10 @@ Pure OCaml regular expressions with:
|
|
|
37
37
|
"""
|
|
38
38
|
url {
|
|
39
39
|
src:
|
|
40
|
-
"https://github.com/ocaml/ocaml-re/releases/download/1.10.
|
|
40
|
+
"https://github.com/ocaml/ocaml-re/releases/download/1.10.4/re-1.10.4.tbz"
|
|
41
41
|
checksum: [
|
|
42
|
-
"sha256=
|
|
43
|
-
"sha512=
|
|
42
|
+
"sha256=83eb3e4300aa9b1dc7820749010f4362ea83524742130524d78c20ce99ca747c"
|
|
43
|
+
"sha512=92b05cf92c389fa8c753f2acca837b15dd05a4a2e8e2bec7a269d2e14c35b1a786d394258376648f80b4b99250ba1900cfe68230b8385aeac153149d9ce56099"
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
|
-
x-commit-hash: "
|
|
46
|
+
x-commit-hash: "e9a4cecb8294c1839db18b1d0c30e755ec85ed5e"
|
|
@@ -45,12 +45,12 @@ build: [
|
|
|
45
45
|
]
|
|
46
46
|
]
|
|
47
47
|
dev-repo: "git+https://github.com/janestreet/spawn.git"
|
|
48
|
-
x-commit-hash: "
|
|
48
|
+
x-commit-hash: "13d279ebfa8c40d4bafe18cddfdff0de54b4eaff"
|
|
49
49
|
url {
|
|
50
50
|
src:
|
|
51
|
-
"https://github.com/janestreet/spawn/archive/v0.15.
|
|
51
|
+
"https://github.com/janestreet/spawn/archive/v0.15.1.tar.gz"
|
|
52
52
|
checksum: [
|
|
53
|
-
"sha256=
|
|
54
|
-
"sha512=
|
|
53
|
+
"sha256=9afdee314fab6c3fcd689ab6eb5608d6b78078e6dede3953a47debde06c19d50"
|
|
54
|
+
"sha512=efdb31d5ec5ea36d0bc80224d4ee04e46ce3428d1662870e6cebece92bc313d6eebee378802c0c059dd6e0cafea515308c31b7dfaf04a098eb4566583c1e9ed4"
|
|
55
55
|
]
|
|
56
56
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
opam-version: "2.0"
|
|
2
|
+
synopsis: "Dune's unstable standard library"
|
|
3
|
+
description:
|
|
4
|
+
"This library offers no backwards compatibility guarantees. Use at your own risk."
|
|
5
|
+
maintainer: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
6
|
+
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
7
|
+
license: "MIT"
|
|
8
|
+
homepage: "https://github.com/ocaml/dune"
|
|
9
|
+
doc: "https://dune.readthedocs.io/"
|
|
10
|
+
bug-reports: "https://github.com/ocaml/dune/issues"
|
|
11
|
+
depends: [
|
|
12
|
+
"dune" {>= "3.0"}
|
|
13
|
+
"ocaml" {>= "4.08.0"}
|
|
14
|
+
"dyn" {= version}
|
|
15
|
+
"ordering" {= version}
|
|
16
|
+
"pp" {>= "1.1.0"}
|
|
17
|
+
"csexp" {>= "1.5.0"}
|
|
18
|
+
"odoc" {with-doc}
|
|
19
|
+
]
|
|
20
|
+
dev-repo: "git+https://github.com/ocaml/dune.git"
|
|
21
|
+
build: [
|
|
22
|
+
["dune" "subst"] {dev}
|
|
23
|
+
["rm" "-rf" "vendor/csexp"]
|
|
24
|
+
["rm" "-rf" "vendor/pp"]
|
|
25
|
+
[
|
|
26
|
+
"dune"
|
|
27
|
+
"build"
|
|
28
|
+
"-p"
|
|
29
|
+
name
|
|
30
|
+
"-j"
|
|
31
|
+
jobs
|
|
32
|
+
"@install"
|
|
33
|
+
"@doc" {with-doc}
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
url {
|
|
37
|
+
src:
|
|
38
|
+
"https://github.com/ocaml/dune/releases/download/3.2.0/chrome-trace-3.2.0.tbz"
|
|
39
|
+
checksum: [
|
|
40
|
+
"sha256=bd1fbce6ae79ed1eb26fa89bb2e2e23978afceb3f53f5578cf1bdab08a1ad5bc"
|
|
41
|
+
"sha512=b99e82d7e2233a9dd8c1fae591a03f9470fcdf9750d0e428cee2d4c8bcfa4da1595e9e10af2f234279a6ca8a120a773b247d4761d2c39210fc6101076631690e"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
x-commit-hash: "43af00f79e41ce9101d42b36dab13e1f68d49a7a"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
opam-version: "2.0"
|
|
2
|
+
synopsis: "XDG Base Directory Specification"
|
|
3
|
+
description:
|
|
4
|
+
"https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html"
|
|
5
|
+
maintainer: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
6
|
+
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"]
|
|
7
|
+
license: "MIT"
|
|
8
|
+
homepage: "https://github.com/ocaml/dune"
|
|
9
|
+
doc: "https://dune.readthedocs.io/"
|
|
10
|
+
bug-reports: "https://github.com/ocaml/dune/issues"
|
|
11
|
+
depends: [
|
|
12
|
+
"dune" {>= "3.0"}
|
|
13
|
+
"ocaml" {>= "4.08"}
|
|
14
|
+
"odoc" {with-doc}
|
|
15
|
+
]
|
|
16
|
+
dev-repo: "git+https://github.com/ocaml/dune.git"
|
|
17
|
+
build: [
|
|
18
|
+
["dune" "subst"] {dev}
|
|
19
|
+
["rm" "-rf" "vendor/csexp"]
|
|
20
|
+
["rm" "-rf" "vendor/pp"]
|
|
21
|
+
[
|
|
22
|
+
"dune"
|
|
23
|
+
"build"
|
|
24
|
+
"-p"
|
|
25
|
+
name
|
|
26
|
+
"-j"
|
|
27
|
+
jobs
|
|
28
|
+
"@install"
|
|
29
|
+
"@doc" {with-doc}
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
url {
|
|
33
|
+
src:
|
|
34
|
+
"https://github.com/ocaml/dune/releases/download/3.2.0/chrome-trace-3.2.0.tbz"
|
|
35
|
+
checksum: [
|
|
36
|
+
"sha256=bd1fbce6ae79ed1eb26fa89bb2e2e23978afceb3f53f5578cf1bdab08a1ad5bc"
|
|
37
|
+
"sha512=b99e82d7e2233a9dd8c1fae591a03f9470fcdf9750d0e428cee2d4c8bcfa4da1595e9e10af2f234279a6ca8a120a773b247d4761d2c39210fc6101076631690e"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
x-commit-hash: "43af00f79e41ce9101d42b36dab13e1f68d49a7a"
|
binaryen-archive/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grain/binaryen.ml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
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",
|
|
9
|
-
"@grain/libbinaryen": ">=
|
|
10
|
-
"@opam/dune": ">= 2.9.1
|
|
11
|
-
"@opam/dune-configurator": ">= 2.9.1
|
|
9
|
+
"@grain/libbinaryen": ">= 107.0.0 < 108.0.0",
|
|
10
|
+
"@opam/dune": ">= 2.9.1",
|
|
11
|
+
"@opam/dune-configurator": ">= 2.9.1"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@opam/js_of_ocaml-compiler": ">= 3.10.0
|
|
14
|
+
"@opam/js_of_ocaml-compiler": ">= 3.10.0",
|
|
15
15
|
"@opam/ocamlformat": "0.20.1",
|
|
16
16
|
"@opam/ocaml-lsp-server": "^1.9.1"
|
|
17
17
|
},
|
|
@@ -1534,7 +1534,12 @@ CAMLprim value
|
|
|
1534
1534
|
caml_binaryen_return_get_value(value _exp) {
|
|
1535
1535
|
CAMLparam1(_exp);
|
|
1536
1536
|
BinaryenExpressionRef exp = BinaryenExpressionRef_val(_exp);
|
|
1537
|
-
|
|
1537
|
+
BinaryenExpressionRef val = BinaryenReturnGetValue(exp);
|
|
1538
|
+
if (val == NULL) {
|
|
1539
|
+
CAMLreturn(Val_none);
|
|
1540
|
+
} else {
|
|
1541
|
+
CAMLreturn(caml_alloc_some(alloc_BinaryenExpressionRef(val)));
|
|
1542
|
+
}
|
|
1538
1543
|
}
|
|
1539
1544
|
|
|
1540
1545
|
CAMLprim value
|
|
@@ -1273,8 +1273,9 @@ function caml_binaryen_drop_set_value(exp, value) {
|
|
|
1273
1273
|
|
|
1274
1274
|
//Provides: caml_binaryen_return_get_value
|
|
1275
1275
|
//Requires: binaryen
|
|
1276
|
+
//Requires: to_option
|
|
1276
1277
|
function caml_binaryen_return_get_value(exp) {
|
|
1277
|
-
return binaryen.Return.getValue(exp);
|
|
1278
|
+
return to_option(binaryen.Return.getValue(exp));
|
|
1278
1279
|
}
|
|
1279
1280
|
|
|
1280
1281
|
//Provides: caml_binaryen_return_set_value
|
|
@@ -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
|
|
@@ -693,7 +693,7 @@ end
|
|
|
693
693
|
|
|
694
694
|
module Return = struct
|
|
695
695
|
external make : Module.t -> t -> t = "caml_binaryen_return"
|
|
696
|
-
external get_value : t -> t = "caml_binaryen_return_get_value"
|
|
696
|
+
external get_value : t -> t option = "caml_binaryen_return_get_value"
|
|
697
697
|
external set_value : t -> t -> unit = "caml_binaryen_return_set_value"
|
|
698
698
|
end
|
|
699
699
|
|
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
|
|
|
@@ -8,14 +8,7 @@ let () =
|
|
|
8
8
|
match C.ocaml_config_var c "system" with
|
|
9
9
|
| Some "macosx" ->
|
|
10
10
|
(* These flags preserve the original C++ error behavior. Ref https://github.com/ocaml/ocaml/issues/10423 *)
|
|
11
|
-
[
|
|
12
|
-
"-cc";
|
|
13
|
-
"clang++";
|
|
14
|
-
"-cclib";
|
|
15
|
-
"-Wl,-keep_dwarf_unwind";
|
|
16
|
-
"-cclib";
|
|
17
|
-
"-Wl,-no_compact_unwind";
|
|
18
|
-
]
|
|
11
|
+
[ "-cc"; "clang++" ]
|
|
19
12
|
| Some _ -> default
|
|
20
13
|
| None -> default
|
|
21
14
|
in
|
binaryen-archive/test/test.ml
CHANGED
|
@@ -20,6 +20,20 @@ let _ = Settings.set_low_memory_unused false
|
|
|
20
20
|
let wasm_mod = Module.create ()
|
|
21
21
|
let _ = Module.set_features wasm_mod [ Module.Feature.all ]
|
|
22
22
|
|
|
23
|
+
(* Testing Return.get_value *)
|
|
24
|
+
let _ =
|
|
25
|
+
assert (
|
|
26
|
+
Option.is_some
|
|
27
|
+
(Expression.Return.get_value
|
|
28
|
+
(Expression.Return.make wasm_mod
|
|
29
|
+
(Expression.Const.make wasm_mod (Literal.int32 0l)))))
|
|
30
|
+
|
|
31
|
+
let _ =
|
|
32
|
+
assert (
|
|
33
|
+
Option.is_none
|
|
34
|
+
(Expression.Return.get_value
|
|
35
|
+
(Expression.Return.make wasm_mod (Expression.Null.make ()))))
|
|
36
|
+
|
|
23
37
|
(* Create function type for i32 (i32, i32) *)
|
|
24
38
|
let params () = Type.create [| Type.int32; Type.int32 |]
|
|
25
39
|
let results = Type.int32
|
|
@@ -163,7 +177,10 @@ let _ =
|
|
|
163
177
|
sourcemap = Some {|{"version":3,"sources":[],"names":[],"mappings":""}|})
|
|
164
178
|
|
|
165
179
|
let new_mod = Module.read byts
|
|
166
|
-
|
|
180
|
+
|
|
181
|
+
let _ =
|
|
182
|
+
Module.run_passes new_mod
|
|
183
|
+
[ Passes.name_types; Passes.merge_similar_functions ]
|
|
167
184
|
|
|
168
185
|
let _ =
|
|
169
186
|
Module.set_features new_mod
|
|
@@ -183,6 +200,7 @@ let _ =
|
|
|
183
200
|
Module.Feature.memory64;
|
|
184
201
|
Module.Feature.typed_function_references;
|
|
185
202
|
Module.Feature.relaxed_simd;
|
|
203
|
+
Module.Feature.extended_const;
|
|
186
204
|
Module.Feature.all;
|
|
187
205
|
]
|
|
188
206
|
|