toiljs 0.0.3 → 0.0.5
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.
- package/.idea/prettier.xml +1 -0
- package/as-pect.config.js +1 -1
- package/build/backend/.tsbuildinfo +1 -1
- package/build/backend/index.js +1 -2
- package/build/cli/.tsbuildinfo +1 -1
- package/build/cli/configure.d.ts +15 -0
- package/build/cli/configure.js +201 -0
- package/build/cli/create.d.ts +4 -0
- package/build/cli/create.js +169 -56
- package/build/cli/features.d.ts +23 -0
- package/build/cli/features.js +85 -0
- package/build/cli/index.js +42 -2
- package/build/cli/proc.d.ts +1 -0
- package/build/cli/proc.js +11 -0
- package/build/cli/ui.js +1 -2
- package/build/cli/validate.d.ts +4 -0
- package/build/cli/validate.js +19 -0
- package/build/client/.tsbuildinfo +1 -1
- package/build/client/Link.d.ts +8 -0
- package/build/client/Link.js +44 -0
- package/build/client/NavLink.d.ts +14 -0
- package/build/client/NavLink.js +37 -0
- package/build/client/Router.d.ts +7 -0
- package/build/client/Router.js +55 -0
- package/build/client/error-boundary.d.ts +16 -0
- package/build/client/error-boundary.js +19 -0
- package/build/client/head.d.ts +26 -0
- package/build/client/head.js +87 -0
- package/build/client/hooks.d.ts +17 -0
- package/build/client/hooks.js +48 -0
- package/build/client/index.d.ts +14 -2
- package/build/client/index.js +8 -1
- package/build/client/lazy.d.ts +16 -0
- package/build/client/lazy.js +53 -0
- package/build/client/match.js +7 -0
- package/build/client/mount.d.ts +2 -0
- package/build/client/mount.js +13 -0
- package/build/client/navigation.d.ts +13 -0
- package/build/client/navigation.js +97 -0
- package/build/client/params-context.d.ts +2 -0
- package/build/client/params-context.js +2 -0
- package/build/client/prefetch.d.ts +11 -0
- package/build/client/prefetch.js +100 -0
- package/build/client/scroll.d.ts +8 -0
- package/build/client/scroll.js +36 -0
- package/build/client/types.d.ts +27 -0
- package/build/client/types.js +1 -0
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/config.d.ts +2 -0
- package/build/compiler/config.js +4 -1
- package/build/compiler/docs.d.ts +10 -0
- package/build/compiler/docs.js +59 -0
- package/build/compiler/generate.d.ts +1 -0
- package/build/compiler/generate.js +139 -21
- package/build/compiler/index.d.ts +5 -2
- package/build/compiler/index.js +5 -3
- package/build/compiler/plugin.js +2 -1
- package/build/compiler/routes.js +5 -1
- package/build/compiler/vite.d.ts +1 -1
- package/build/compiler/vite.js +17 -1
- package/build/io/.tsbuildinfo +1 -1
- package/build/io/BinaryWriter.js +2 -2
- package/eslint.config.js +1 -1
- package/examples/basic/.toil/docs/cli.md +3 -0
- package/examples/basic/.toil/docs/client.md +3 -0
- package/examples/basic/.toil/docs/index.md +3 -0
- package/examples/basic/.toil/docs/routing.md +3 -0
- package/examples/basic/.toil/docs/server.md +3 -0
- package/examples/basic/.toil/docs/styling.md +3 -0
- package/examples/basic/.toil/entry.tsx +3 -8
- package/examples/basic/.toil/globals.ts +6 -0
- package/examples/basic/.toil/index.html +16 -12
- package/examples/basic/.toil/public/images/.gitkeep +1 -0
- package/examples/basic/.toil/public/images/logo.svg +37 -0
- package/examples/basic/.toil/public/robots.txt +2 -0
- package/examples/basic/.toil/routes.ts +9 -7
- package/examples/basic/build/client/assets/404-Bq0jNTUo.js +1 -0
- package/examples/basic/build/client/assets/_...slug_-CXKf6qnB.js +1 -0
- package/examples/basic/build/client/assets/_id_-BadAyQnb.js +1 -0
- package/examples/basic/build/client/assets/about-BOhoEcEO.js +1 -0
- package/examples/basic/build/client/assets/get-started-BIXpcjkT.js +9 -0
- package/examples/basic/build/client/assets/index-BmqcTaBB.js +1 -0
- package/examples/basic/build/client/assets/io-DEVjjaJj.js +1 -0
- package/examples/basic/build/client/assets/layout-DJegirdz.js +1 -0
- package/examples/basic/build/client/assets/react-DEQrz1q7.js +9 -0
- package/examples/basic/build/client/assets/rolldown-runtime-KL5VtC6j.js +1 -0
- package/examples/basic/build/client/assets/routes-BYWn6TxK.js +1 -0
- package/examples/basic/build/client/css/style.css +2 -0
- package/examples/basic/build/client/images/.gitkeep +1 -0
- package/examples/basic/build/client/images/logo.svg +37 -0
- package/examples/basic/build/client/index.html +17 -0
- package/examples/basic/build/client/robots.txt +2 -0
- package/examples/basic/client/404.tsx +2 -5
- package/examples/basic/client/components/.gitkeep +1 -0
- package/examples/basic/client/components/Footer.tsx +8 -0
- package/examples/basic/client/layout.tsx +39 -26
- package/examples/basic/client/public/images/.gitkeep +1 -0
- package/examples/basic/client/public/images/logo.svg +37 -0
- package/examples/basic/client/public/index.html +15 -0
- package/examples/basic/client/public/robots.txt +2 -0
- package/examples/basic/client/routes/about.tsx +1 -3
- package/examples/basic/client/routes/blog/[id].tsx +2 -4
- package/examples/basic/client/routes/docs/[...slug].tsx +3 -6
- package/examples/basic/client/routes/get-started.tsx +84 -0
- package/examples/basic/client/routes/index.tsx +74 -7
- package/examples/basic/client/routes/io.tsx +3 -7
- package/examples/basic/client/styles/main.css +461 -0
- package/examples/basic/client/toil.tsx +7 -0
- package/examples/basic/node_modules/.bin/toilinit +16 -0
- package/examples/basic/node_modules/.bin/toilinit.cmd +17 -0
- package/examples/basic/node_modules/.bin/toilinit.ps1 +28 -0
- package/examples/basic/node_modules/.bin/toilscript +16 -0
- package/examples/basic/node_modules/.bin/toilscript.cmd +17 -0
- package/examples/basic/node_modules/.bin/toilscript.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-as +16 -0
- package/examples/basic/node_modules/.bin/wasm-as.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-as.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval +16 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-dis +16 -0
- package/examples/basic/node_modules/.bin/wasm-dis.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-dis.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-merge +16 -0
- package/examples/basic/node_modules/.bin/wasm-merge.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-merge.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-metadce +16 -0
- package/examples/basic/node_modules/.bin/wasm-metadce.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-metadce.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-opt +16 -0
- package/examples/basic/node_modules/.bin/wasm-opt.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-opt.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-reduce +16 -0
- package/examples/basic/node_modules/.bin/wasm-reduce.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-reduce.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-shell +16 -0
- package/examples/basic/node_modules/.bin/wasm-shell.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-shell.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm2js +16 -0
- package/examples/basic/node_modules/.bin/wasm2js.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm2js.ps1 +28 -0
- package/examples/basic/node_modules/.package-lock.json +49 -1
- package/examples/basic/node_modules/.vite/deps/_metadata.json +9 -9
- package/examples/basic/node_modules/binaryen/LICENSE +201 -0
- package/examples/basic/node_modules/binaryen/README.md +1362 -0
- package/examples/basic/node_modules/binaryen/bin/package.json +3 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-as +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-ctor-eval +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-dis +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-merge +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-metadce +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-opt +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-reduce +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-shell +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm2js +0 -0
- package/examples/basic/node_modules/binaryen/index.d.ts +2371 -0
- package/examples/basic/node_modules/binaryen/index.js +30552 -0
- package/examples/basic/node_modules/binaryen/package.json +50 -0
- package/examples/basic/node_modules/long/LICENSE +202 -0
- package/examples/basic/node_modules/long/README.md +286 -0
- package/examples/basic/node_modules/long/index.d.ts +2 -0
- package/examples/basic/node_modules/long/index.js +1581 -0
- package/examples/basic/node_modules/long/package.json +58 -0
- package/examples/basic/node_modules/long/types.d.ts +474 -0
- package/examples/basic/node_modules/long/umd/index.d.ts +3 -0
- package/examples/basic/node_modules/long/umd/index.js +1622 -0
- package/examples/basic/node_modules/long/umd/package.json +3 -0
- package/examples/basic/node_modules/long/umd/types.d.ts +474 -0
- package/examples/basic/node_modules/toilscript/LICENSE +201 -0
- package/examples/basic/node_modules/toilscript/NOTICE +94 -0
- package/examples/basic/node_modules/toilscript/README.md +66 -0
- package/examples/basic/node_modules/toilscript/bin/toilinit.js +468 -0
- package/examples/basic/node_modules/toilscript/bin/toilscript.js +35 -0
- package/examples/basic/node_modules/toilscript/dist/cli.d.ts +4 -0
- package/examples/basic/node_modules/toilscript/dist/cli.generated.d.ts +10027 -0
- package/examples/basic/node_modules/toilscript/dist/cli.js +24474 -0
- package/examples/basic/node_modules/toilscript/dist/cli.js.map +7 -0
- package/examples/basic/node_modules/toilscript/dist/importmap.json +9 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.d.ts +4 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.generated.d.ts +11242 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.js +337 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.js.map +7 -0
- package/examples/basic/node_modules/toilscript/dist/transform.cjs +1 -0
- package/examples/basic/node_modules/toilscript/dist/transform.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/dist/transform.js +1 -0
- package/examples/basic/node_modules/toilscript/dist/web.js +22 -0
- package/examples/basic/node_modules/toilscript/lib/binaryen.d.ts +2 -0
- package/examples/basic/node_modules/toilscript/lib/binaryen.js +2 -0
- package/examples/basic/node_modules/toilscript/package.json +115 -0
- package/examples/basic/node_modules/toilscript/std/README.md +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/array.ts +550 -0
- package/examples/basic/node_modules/toilscript/std/assembly/arraybuffer.ts +77 -0
- package/examples/basic/node_modules/toilscript/std/assembly/atomics.ts +127 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/asyncify.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/dom.ts +291 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/node.ts +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bitflags.ts +53 -0
- package/examples/basic/node_modules/toilscript/std/assembly/builtins.ts +2650 -0
- package/examples/basic/node_modules/toilscript/std/assembly/byteslice.ts +177 -0
- package/examples/basic/node_modules/toilscript/std/assembly/compat.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/console.ts +42 -0
- package/examples/basic/node_modules/toilscript/std/assembly/crypto.ts +9 -0
- package/examples/basic/node_modules/toilscript/std/assembly/dataview.ts +181 -0
- package/examples/basic/node_modules/toilscript/std/assembly/date.ts +375 -0
- package/examples/basic/node_modules/toilscript/std/assembly/diagnostics.ts +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/encoding.ts +151 -0
- package/examples/basic/node_modules/toilscript/std/assembly/endian.ts +45 -0
- package/examples/basic/node_modules/toilscript/std/assembly/error.ts +44 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedarray.ts +173 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedmap.ts +326 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedset.ts +275 -0
- package/examples/basic/node_modules/toilscript/std/assembly/function.ts +42 -0
- package/examples/basic/node_modules/toilscript/std/assembly/index.d.ts +2892 -0
- package/examples/basic/node_modules/toilscript/std/assembly/iterator.ts +35 -0
- package/examples/basic/node_modules/toilscript/std/assembly/map.ts +269 -0
- package/examples/basic/node_modules/toilscript/std/assembly/math.ts +3289 -0
- package/examples/basic/node_modules/toilscript/std/assembly/memory.ts +123 -0
- package/examples/basic/node_modules/toilscript/std/assembly/number.ts +388 -0
- package/examples/basic/node_modules/toilscript/std/assembly/object.ts +36 -0
- package/examples/basic/node_modules/toilscript/std/assembly/performance.ts +9 -0
- package/examples/basic/node_modules/toilscript/std/assembly/pointer.ts +80 -0
- package/examples/basic/node_modules/toilscript/std/assembly/polyfills.ts +27 -0
- package/examples/basic/node_modules/toilscript/std/assembly/process.ts +50 -0
- package/examples/basic/node_modules/toilscript/std/assembly/reference.ts +48 -0
- package/examples/basic/node_modules/toilscript/std/assembly/regexp.ts +12 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/README.md +83 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/common.ts +81 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-incremental.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-memory.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-minimal.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-stub.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index.d.ts +37 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/itcms.ts +419 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/memory-runtime.ts +94 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/rtrace.ts +15 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/stub.ts +133 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/tcms.ts +254 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/tlsf.ts +592 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt.ts +90 -0
- package/examples/basic/node_modules/toilscript/std/assembly/set.ts +225 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/feature.ts +68 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/runtime.ts +13 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/target.ts +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/tsconfig.json +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/typeinfo.ts +72 -0
- package/examples/basic/node_modules/toilscript/std/assembly/staticarray.ts +423 -0
- package/examples/basic/node_modules/toilscript/std/assembly/string.ts +850 -0
- package/examples/basic/node_modules/toilscript/std/assembly/symbol.ts +114 -0
- package/examples/basic/node_modules/toilscript/std/assembly/table.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/toilscript.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/tsconfig.json +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/typedarray.ts +1954 -0
- package/examples/basic/node_modules/toilscript/std/assembly/uri.ts +17 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/bytes.ts +107 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/casemap.ts +497 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/error.ts +58 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/hash.ts +117 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/math.ts +1922 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/memory.ts +290 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/number.ts +873 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/sort.ts +313 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/string.ts +1202 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/uri.ts +275 -0
- package/examples/basic/node_modules/toilscript/std/assembly/vector.ts +4 -0
- package/examples/basic/node_modules/toilscript/std/assembly.json +16 -0
- package/examples/basic/node_modules/toilscript/std/portable/index.d.ts +461 -0
- package/examples/basic/node_modules/toilscript/std/portable/index.js +416 -0
- package/examples/basic/node_modules/toilscript/std/portable.json +11 -0
- package/examples/basic/node_modules/toilscript/std/types/assembly/index.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/types/assembly/package.json +3 -0
- package/examples/basic/node_modules/toilscript/std/types/portable/index.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/types/portable/package.json +3 -0
- package/examples/basic/node_modules/toilscript/tsconfig-base.json +13 -0
- package/examples/basic/node_modules/toilscript/util/README.md +23 -0
- package/examples/basic/node_modules/toilscript/util/browser/fs.js +1 -0
- package/examples/basic/node_modules/toilscript/util/browser/module.js +5 -0
- package/examples/basic/node_modules/toilscript/util/browser/path.js +520 -0
- package/examples/basic/node_modules/toilscript/util/browser/process.js +59 -0
- package/examples/basic/node_modules/toilscript/util/browser/url.js +23 -0
- package/examples/basic/node_modules/toilscript/util/cpu.d.ts +9 -0
- package/examples/basic/node_modules/toilscript/util/cpu.js +42 -0
- package/examples/basic/node_modules/toilscript/util/find.d.ts +6 -0
- package/examples/basic/node_modules/toilscript/util/find.js +20 -0
- package/examples/basic/node_modules/toilscript/util/node.d.ts +21 -0
- package/examples/basic/node_modules/toilscript/util/node.js +34 -0
- package/examples/basic/node_modules/toilscript/util/options.d.ts +70 -0
- package/examples/basic/node_modules/toilscript/util/options.js +262 -0
- package/examples/basic/node_modules/toilscript/util/terminal.d.ts +52 -0
- package/examples/basic/node_modules/toilscript/util/terminal.js +35 -0
- package/examples/basic/node_modules/toilscript/util/text.d.ts +26 -0
- package/examples/basic/node_modules/toilscript/util/text.js +114 -0
- package/examples/basic/node_modules/toilscript/util/tsconfig.json +9 -0
- package/examples/basic/node_modules/toilscript/util/web.d.ts +11 -0
- package/examples/basic/node_modules/toilscript/util/web.js +33 -0
- package/examples/basic/package-lock.json +50 -1
- package/examples/basic/package.json +5 -2
- package/examples/basic/server/index.ts +3 -0
- package/examples/basic/server/main.ts +6 -0
- package/examples/basic/server/tsconfig.json +7 -0
- package/examples/basic/toil-env.d.ts +20 -1
- package/examples/basic/toil.config.ts +2 -5
- package/examples/basic/toilconfig.json +30 -0
- package/package.json +1 -1
- package/presets/eslint.js +2 -7
- package/presets/no-uint8array-tostring.js +4 -5
- package/presets/prettier.json +8 -1
- package/src/backend/index.ts +11 -18
- package/src/cli/configure.ts +272 -0
- package/src/cli/create.ts +228 -67
- package/src/cli/features.ts +128 -0
- package/src/cli/index.ts +44 -3
- package/src/cli/proc.ts +20 -0
- package/src/cli/ui.ts +4 -6
- package/src/cli/validate.ts +31 -0
- package/src/client/Link.tsx +99 -0
- package/src/client/NavLink.tsx +86 -0
- package/src/client/Router.tsx +95 -0
- package/src/client/error-boundary.tsx +43 -0
- package/src/client/head.ts +140 -0
- package/src/client/hooks.ts +115 -0
- package/src/client/index.ts +35 -5
- package/src/client/lazy.ts +93 -0
- package/src/client/match.ts +11 -3
- package/src/client/mount.tsx +28 -0
- package/src/client/navigation.ts +142 -0
- package/src/client/params-context.ts +10 -0
- package/src/client/prefetch.ts +130 -0
- package/src/client/scroll.ts +53 -0
- package/src/client/types.ts +36 -0
- package/src/compiler/config.ts +15 -8
- package/src/compiler/docs.ts +87 -0
- package/src/compiler/generate.ts +180 -33
- package/src/compiler/index.ts +7 -4
- package/src/compiler/plugin.ts +3 -1
- package/src/compiler/routes.ts +13 -7
- package/src/compiler/vite.ts +28 -5
- package/src/io/BinaryReader.ts +1 -5
- package/src/io/BinaryWriter.ts +3 -3
- package/src/server/index.ts +3 -4
- package/src/server/tsconfig.json +4 -0
- package/test/configure.test.ts +90 -0
- package/test/features.test.ts +111 -0
- package/test/head.test.ts +35 -0
- package/test/io.test.ts +8 -0
- package/test/navlink.test.ts +28 -0
- package/test/routes.test.ts +15 -0
- package/test/validate.test.ts +42 -0
- package/vitest.config.ts +1 -1
- package/examples/basic/dist/assets/404-D1bS2aH_.js +0 -1
- package/examples/basic/dist/assets/_...slug_-wR3shlWn.js +0 -1
- package/examples/basic/dist/assets/_id_-EWYvHfi2.js +0 -1
- package/examples/basic/dist/assets/about-Ddvj1tjF.js +0 -1
- package/examples/basic/dist/assets/index-CdG0me90.js +0 -1
- package/examples/basic/dist/assets/io-CODNJU57.js +0 -1
- package/examples/basic/dist/assets/layout-C15ZTPYI.js +0 -1
- package/examples/basic/dist/assets/react-JbAfoxYe.js +0 -9
- package/examples/basic/dist/assets/rolldown-runtime-1VNLd2iN.js +0 -1
- package/examples/basic/dist/assets/routes-GoydenoY.js +0 -1
- package/examples/basic/dist/index.html +0 -12
- package/src/client/runtime.tsx +0 -190
|
@@ -0,0 +1,1362 @@
|
|
|
1
|
+
binaryen.js
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
**binaryen.js** is a port of [Binaryen](https://github.com/WebAssembly/binaryen) to the Web, allowing you to generate [WebAssembly](https://webassembly.org) using a JavaScript API.
|
|
5
|
+
|
|
6
|
+
<a href="https://github.com/AssemblyScript/binaryen.js/actions?query=workflow%3ABuild"><img src="https://img.shields.io/github/actions/workflow/status/AssemblyScript/binaryen.js/build.yml?label=build&logo=github" alt="Build status" /></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen.svg?label=latest&color=007acc&logo=npm" alt="npm version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/binaryen"><img src="https://img.shields.io/npm/v/binaryen/nightly.svg?label=nightly&color=007acc&logo=npm" alt="npm nightly version" /></a>
|
|
9
|
+
|
|
10
|
+
Usage
|
|
11
|
+
-----
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
$> npm install binaryen
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import binaryen from "binaryen";
|
|
19
|
+
|
|
20
|
+
// Create a module with a single function
|
|
21
|
+
var myModule = new binaryen.Module();
|
|
22
|
+
|
|
23
|
+
myModule.addFunction("add", binaryen.createType([ binaryen.i32, binaryen.i32 ]), binaryen.i32, [ binaryen.i32 ],
|
|
24
|
+
myModule.block(null, [
|
|
25
|
+
myModule.local.set(2,
|
|
26
|
+
myModule.i32.add(
|
|
27
|
+
myModule.local.get(0, binaryen.i32),
|
|
28
|
+
myModule.local.get(1, binaryen.i32)
|
|
29
|
+
)
|
|
30
|
+
),
|
|
31
|
+
myModule.return(
|
|
32
|
+
myModule.local.get(2, binaryen.i32)
|
|
33
|
+
)
|
|
34
|
+
])
|
|
35
|
+
);
|
|
36
|
+
myModule.addFunctionExport("add", "add");
|
|
37
|
+
|
|
38
|
+
// Optimize the module using default passes and levels
|
|
39
|
+
myModule.optimize();
|
|
40
|
+
|
|
41
|
+
// Validate the module
|
|
42
|
+
if (!myModule.validate())
|
|
43
|
+
throw new Error("validation error");
|
|
44
|
+
|
|
45
|
+
// Generate text format and binary
|
|
46
|
+
var textData = myModule.emitText();
|
|
47
|
+
var wasmData = myModule.emitBinary();
|
|
48
|
+
|
|
49
|
+
// Example usage with the WebAssembly API
|
|
50
|
+
var compiled = new WebAssembly.Module(wasmData);
|
|
51
|
+
var instance = new WebAssembly.Instance(compiled, {});
|
|
52
|
+
console.log(instance.exports.add(41, 1));
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The buildbot also publishes nightly versions once a day if there have been changes. The latest nightly can be installed through
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
$> npm install binaryen@nightly
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
or you can use one of the [previous versions](https://github.com/AssemblyScript/binaryen.js/tags) instead if necessary.
|
|
62
|
+
|
|
63
|
+
### Usage with a CDN
|
|
64
|
+
|
|
65
|
+
* From GitHub via [jsDelivr](https://www.jsdelivr.com):<br />
|
|
66
|
+
`https://cdn.jsdelivr.net/gh/AssemblyScript/binaryen.js@VERSION/index.js`
|
|
67
|
+
* From npm via [jsDelivr](https://www.jsdelivr.com):<br />
|
|
68
|
+
`https://cdn.jsdelivr.net/npm/binaryen@VERSION/index.js`
|
|
69
|
+
* From npm via [unpkg](https://unpkg.com):<br />
|
|
70
|
+
`https://unpkg.com/binaryen@VERSION/index.js`
|
|
71
|
+
|
|
72
|
+
Replace `VERSION` with a [specific version](https://github.com/AssemblyScript/binaryen.js/releases) or omit it (not recommended in production) to use main/latest.
|
|
73
|
+
|
|
74
|
+
### Command line
|
|
75
|
+
|
|
76
|
+
The package includes Node.js builds of [Binaryen's command line tools](https://github.com/WebAssembly/binaryen#tools): `wasm-shell`, `wasm-opt`, `wasm-metadce`, `wasm2js`, `wasm-as`, `wasm-dis`, `wasm-ctor-eval`, `wasm-reduce` and `wasm-merge`.
|
|
77
|
+
|
|
78
|
+
API
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
**Please note** that the Binaryen API is evolving fast and that definitions and documentation provided by the package tend to get out of sync despite our best efforts. It's a bot after all. If you rely on binaryen.js and spot an issue, please consider sending a PR our way by updating [index.d.ts](./index.d.ts) and [README.md](./README.md) to reflect the [current API](https://github.com/WebAssembly/binaryen/blob/main/src/js/binaryen.js-post.js).
|
|
82
|
+
|
|
83
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
84
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
85
|
+
### Contents
|
|
86
|
+
|
|
87
|
+
- [Types](#types)
|
|
88
|
+
- [Module construction](#module-construction)
|
|
89
|
+
- [Module manipulation](#module-manipulation)
|
|
90
|
+
- [Module validation](#module-validation)
|
|
91
|
+
- [Module optimization](#module-optimization)
|
|
92
|
+
- [Module creation](#module-creation)
|
|
93
|
+
- [Expression construction](#expression-construction)
|
|
94
|
+
- [Control flow](#control-flow)
|
|
95
|
+
- [Variable accesses](#variable-accesses)
|
|
96
|
+
- [Integer operations](#integer-operations)
|
|
97
|
+
- [Floating point operations](#floating-point-operations)
|
|
98
|
+
- [Datatype conversions](#datatype-conversions)
|
|
99
|
+
- [Function calls](#function-calls)
|
|
100
|
+
- [Linear memory accesses](#linear-memory-accesses)
|
|
101
|
+
- [Host operations](#host-operations)
|
|
102
|
+
- [Bulk memory operations](#bulk-memory-operations-)
|
|
103
|
+
- [Sign extension operations](#sign-extension-operations-)
|
|
104
|
+
- [Reference types operations](#reference-types-operations-)
|
|
105
|
+
- [Vector operations](#vector-operations-)
|
|
106
|
+
- [Multi-value operations](#multi-value-operations-)
|
|
107
|
+
- [Atomic memory accesses 🦄](#atomic-memory-accesses-)
|
|
108
|
+
- [Atomic read-modify-write operations 🦄](#atomic-read-modify-write-operations-)
|
|
109
|
+
- [Atomic wait and notify operations 🦄](#atomic-wait-and-notify-operations-)
|
|
110
|
+
- [Exception handling operations 🦄](#exception-handling-operations-)
|
|
111
|
+
- [Expression manipulation](#expression-manipulation)
|
|
112
|
+
- [Relooper](#relooper)
|
|
113
|
+
- [Source maps](#source-maps)
|
|
114
|
+
- [Debugging](#debugging)
|
|
115
|
+
|
|
116
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
117
|
+
|
|
118
|
+
[Future features](http://webassembly.org/docs/future-features/) 🦄 might not be supported by all runtimes.
|
|
119
|
+
|
|
120
|
+
### Types
|
|
121
|
+
|
|
122
|
+
* **none**: `Type`<br />
|
|
123
|
+
The none type, e.g., `void`.
|
|
124
|
+
|
|
125
|
+
* **i32**: `Type`<br />
|
|
126
|
+
32-bit integer type.
|
|
127
|
+
|
|
128
|
+
* **i64**: `Type`<br />
|
|
129
|
+
64-bit integer type.
|
|
130
|
+
|
|
131
|
+
* **f32**: `Type`<br />
|
|
132
|
+
32-bit float type.
|
|
133
|
+
|
|
134
|
+
* **f64**: `Type`<br />
|
|
135
|
+
64-bit float (double) type.
|
|
136
|
+
|
|
137
|
+
* **v128**: `Type`<br />
|
|
138
|
+
128-bit vector type. 🦄
|
|
139
|
+
|
|
140
|
+
* **funcref**: `Type`<br />
|
|
141
|
+
A function reference. 🦄
|
|
142
|
+
|
|
143
|
+
* **externref**: `Type`<br />
|
|
144
|
+
An external (host) reference. 🦄
|
|
145
|
+
|
|
146
|
+
* **anyref**: `Type`<br />
|
|
147
|
+
Any (top type) reference. 🦄
|
|
148
|
+
|
|
149
|
+
* **eqref**: `Type`<br />
|
|
150
|
+
Equal reference. 🦄
|
|
151
|
+
|
|
152
|
+
* **i31ref**: `Type`<br />
|
|
153
|
+
i31 reference. 🦄
|
|
154
|
+
|
|
155
|
+
* **structref**: `Type`<br />
|
|
156
|
+
Structure reference. 🦄
|
|
157
|
+
|
|
158
|
+
* **stringref**: `Type`<br />
|
|
159
|
+
String reference. 🦄
|
|
160
|
+
|
|
161
|
+
* **unreachable**: `Type`<br />
|
|
162
|
+
Special type indicating unreachable code when obtaining information about an expression.
|
|
163
|
+
|
|
164
|
+
* **auto**: `Type`<br />
|
|
165
|
+
Special type used in **Module#block** exclusively. Lets the API figure out a block's result type automatically.
|
|
166
|
+
|
|
167
|
+
* **createType**(types: `Type[]`): `Type`<br />
|
|
168
|
+
Creates a multi-value type from an array of types.
|
|
169
|
+
|
|
170
|
+
* **expandType**(type: `Type`): `Type[]`<br />
|
|
171
|
+
Expands a multi-value type to an array of types.
|
|
172
|
+
|
|
173
|
+
### Module construction
|
|
174
|
+
|
|
175
|
+
* new **Module**()<br />
|
|
176
|
+
Constructs a new module.
|
|
177
|
+
|
|
178
|
+
* **parseText**(text: `string`): `Module`<br />
|
|
179
|
+
Creates a module from Binaryen's s-expression text format (not official stack-style text format).
|
|
180
|
+
|
|
181
|
+
* **readBinary**(data: `Uint8Array`): `Module`<br />
|
|
182
|
+
Creates a module from binary data.
|
|
183
|
+
|
|
184
|
+
### Module manipulation
|
|
185
|
+
|
|
186
|
+
* Module#**addFunction**(name: `string`, params: `Type`, results: `Type`, vars: `Type[]`, body: `ExpressionRef`): `FunctionRef`<br />
|
|
187
|
+
Adds a function. `vars` indicate additional locals, in the given order.
|
|
188
|
+
|
|
189
|
+
* Module#**getFunction**(name: `string`): `FunctionRef`<br />
|
|
190
|
+
Gets a function, by name,
|
|
191
|
+
|
|
192
|
+
* Module#**removeFunction**(name: `string`): `void`<br />
|
|
193
|
+
Removes a function, by name.
|
|
194
|
+
|
|
195
|
+
* Module#**getNumFunctions**(): `number`<br />
|
|
196
|
+
Gets the number of functions within the module.
|
|
197
|
+
|
|
198
|
+
* Module#**getFunctionByIndex**(index: `number`): `FunctionRef`<br />
|
|
199
|
+
Gets the function at the specified index.
|
|
200
|
+
|
|
201
|
+
* Module#**addFunctionImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, params: `Type`, results: `Type`): `void`<br />
|
|
202
|
+
Adds a function import.
|
|
203
|
+
|
|
204
|
+
* Module#**addTableImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br />
|
|
205
|
+
Adds a table import. There's just one table for now, using name `"0"`.
|
|
206
|
+
|
|
207
|
+
* Module#**addMemoryImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`): `void`<br />
|
|
208
|
+
Adds a memory import. There's just one memory for now, using name `"0"`.
|
|
209
|
+
|
|
210
|
+
* Module#**addGlobalImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, globalType: `Type`): `void`<br />
|
|
211
|
+
Adds a global variable import. Imported globals must be immutable.
|
|
212
|
+
|
|
213
|
+
* Module#**addFunctionExport**(internalName: `string`, externalName: `string`): `ExportRef`<br />
|
|
214
|
+
Adds a function export.
|
|
215
|
+
|
|
216
|
+
* Module#**addTableExport**(internalName: `string`, externalName: `string`): `ExportRef`<br />
|
|
217
|
+
Adds a table export. There's just one table for now, using name `"0"`.
|
|
218
|
+
|
|
219
|
+
* Module#**addMemoryExport**(internalName: `string`, externalName: `string`): `ExportRef`<br />
|
|
220
|
+
Adds a memory export. There's just one memory for now, using name `"0"`.
|
|
221
|
+
|
|
222
|
+
* Module#**addGlobalExport**(internalName: `string`, externalName: `string`): `ExportRef`<br />
|
|
223
|
+
Adds a global variable export. Exported globals must be immutable.
|
|
224
|
+
|
|
225
|
+
* Module#**getNumExports**(): `number`<br />
|
|
226
|
+
Gets the number of exports witin the module.
|
|
227
|
+
|
|
228
|
+
* Module#**getExportByIndex**(index: `number`): `ExportRef`<br />
|
|
229
|
+
Gets the export at the specified index.
|
|
230
|
+
|
|
231
|
+
* Module#**removeExport**(externalName: `string`): `void`<br />
|
|
232
|
+
Removes an export, by external name.
|
|
233
|
+
|
|
234
|
+
* Module#**addGlobal**(name: `string`, type: `Type`, mutable: `number`, value: `ExpressionRef`): `GlobalRef`<br />
|
|
235
|
+
Adds a global instance variable.
|
|
236
|
+
|
|
237
|
+
* Module#**getGlobal**(name: `string`): `GlobalRef`<br />
|
|
238
|
+
Gets a global, by name,
|
|
239
|
+
|
|
240
|
+
* Module#**removeGlobal**(name: `string`): `void`<br />
|
|
241
|
+
Removes a global, by name.
|
|
242
|
+
|
|
243
|
+
* Module#**setMemory**(initial: `number`, maximum: `number`, exportName: `string | null`, segments: `MemorySegment[]`, shared?: `boolean`): `void`<br />
|
|
244
|
+
Sets the memory. There's just one memory for now, using name `"0"`. Providing `exportName` also creates a memory export.
|
|
245
|
+
|
|
246
|
+
* MemorySegment#**offset**: `ExpressionRef`
|
|
247
|
+
* MemorySegment#**data**: `Uint8Array`
|
|
248
|
+
* MemorySegment#**passive**: `boolean`
|
|
249
|
+
|
|
250
|
+
* Module#**getNumMemorySegments**(): `number`<br />
|
|
251
|
+
Gets the number of memory segments within the module.
|
|
252
|
+
|
|
253
|
+
* Module#**getMemorySegmentInfo**(name: `string`): `MemorySegmentInfo`<br />
|
|
254
|
+
Gets information about the memory segment at the specified index.
|
|
255
|
+
|
|
256
|
+
* MemorySegmentInfo#**offset**: `number`
|
|
257
|
+
* MemorySegmentInfo#**data**: `Uint8Array`
|
|
258
|
+
* MemorySegmentInfo#**passive**: `boolean`
|
|
259
|
+
|
|
260
|
+
* Module#**getStart**(): `FunctionRef`<br />
|
|
261
|
+
Gets the start function, if any.
|
|
262
|
+
|
|
263
|
+
* Module#**setStart**(start: `FunctionRef`): `void`<br />
|
|
264
|
+
Sets the start function.
|
|
265
|
+
|
|
266
|
+
* Module#**getFeatures**(): `Features`<br />
|
|
267
|
+
Gets the WebAssembly features enabled for this module.
|
|
268
|
+
|
|
269
|
+
Note that the return value may be a bitmask indicating multiple features. Possible feature flags are:
|
|
270
|
+
|
|
271
|
+
* Features.**MVP**: `Features`
|
|
272
|
+
* Features.**Atomics**: `Features`
|
|
273
|
+
* Features.**BulkMemory**: `Features`
|
|
274
|
+
* Features.**MutableGlobals**: `Features`
|
|
275
|
+
* Features.**NontrappingFPToInt**: `Features`
|
|
276
|
+
* Features.**SignExt**: `Features`
|
|
277
|
+
* Features.**SIMD128**: `Features`
|
|
278
|
+
* Features.**ExceptionHandling**: `Features`
|
|
279
|
+
* Features.**TailCall**: `Features`
|
|
280
|
+
* Features.**ReferenceTypes**: `Features`
|
|
281
|
+
* Features.**Multivalue**: `Features`
|
|
282
|
+
* Features.**StackSwitching**: `Features`
|
|
283
|
+
* Features.**SharedEverything**: `Features`
|
|
284
|
+
* Features.**FP16**: `Features`
|
|
285
|
+
* Features.**BulkMemoryOpt**: `Features`
|
|
286
|
+
* Features.**CallIndirectOverlong**: `Features`
|
|
287
|
+
* Features.**All**: `Features`
|
|
288
|
+
|
|
289
|
+
* Module#**setFeatures**(features: `Features`): `void`<br />
|
|
290
|
+
Sets the WebAssembly features enabled for this module.
|
|
291
|
+
|
|
292
|
+
* Module#**addCustomSection**(name: `string`, contents: `Uint8Array`): `void`<br />
|
|
293
|
+
Adds a custom section to the binary.
|
|
294
|
+
|
|
295
|
+
* **getFunctionInfo**(ftype: `FunctionRef`: `FunctionInfo`<br />
|
|
296
|
+
Obtains information about a function.
|
|
297
|
+
|
|
298
|
+
* FunctionInfo#**name**: `string`
|
|
299
|
+
* FunctionInfo#**module**: `string | null` (if imported)
|
|
300
|
+
* FunctionInfo#**base**: `string | null` (if imported)
|
|
301
|
+
* FunctionInfo#**type**: `Type`
|
|
302
|
+
* FunctionInfo#**params**: `Type`
|
|
303
|
+
* FunctionInfo#**results**: `Type`
|
|
304
|
+
* FunctionInfo#**vars**: `Type`
|
|
305
|
+
* FunctionInfo#**body**: `ExpressionRef`
|
|
306
|
+
|
|
307
|
+
* **getGlobalInfo**(global: `GlobalRef`): `GlobalInfo`<br />
|
|
308
|
+
Obtains information about a global.
|
|
309
|
+
|
|
310
|
+
* GlobalInfo#**name**: `string`
|
|
311
|
+
* GlobalInfo#**module**: `string | null` (if imported)
|
|
312
|
+
* GlobalInfo#**base**: `string | null` (if imported)
|
|
313
|
+
* GlobalInfo#**type**: `Type`
|
|
314
|
+
* GlobalInfo#**mutable**: `boolean`
|
|
315
|
+
* GlobalInfo#**init**: `ExpressionRef`
|
|
316
|
+
|
|
317
|
+
* **getTableInfo**(table: `TableRef`): `TableInfo`<br />
|
|
318
|
+
Obtains information about a table.
|
|
319
|
+
|
|
320
|
+
* TableInfo#**name**: `string`
|
|
321
|
+
* TableInfo#**module**: `string | null` (if imported)
|
|
322
|
+
* TableInfo#**base**: `string | null` (if imported)
|
|
323
|
+
* TableInfo#**initial**: `number`;
|
|
324
|
+
* TableInfo#**max**?: `number`;
|
|
325
|
+
|
|
326
|
+
* **getExportInfo**(export_: `ExportRef`): `ExportInfo`<br />
|
|
327
|
+
Obtains information about an export.
|
|
328
|
+
|
|
329
|
+
* ExportInfo#**kind**: `ExternalKind`
|
|
330
|
+
* ExportInfo#**name**: `string`
|
|
331
|
+
* ExportInfo#**value**: `string`
|
|
332
|
+
|
|
333
|
+
Possible `ExternalKind` values are:
|
|
334
|
+
|
|
335
|
+
* **ExternalFunction**: `ExternalKind`
|
|
336
|
+
* **ExternalTable**: `ExternalKind`
|
|
337
|
+
* **ExternalMemory**: `ExternalKind`
|
|
338
|
+
* **ExternalGlobal**: `ExternalKind`
|
|
339
|
+
* **ExternalTag**: `ExternalKind`
|
|
340
|
+
|
|
341
|
+
* **getTagInfo**(tag: `TagRef`): `TagInfo`<br />
|
|
342
|
+
Obtains information about a tag.
|
|
343
|
+
|
|
344
|
+
* TagInfo#**name**: `string`
|
|
345
|
+
* TagInfo#**module**: `string | null` (if imported)
|
|
346
|
+
* TagInfo#**base**: `string | null` (if imported)
|
|
347
|
+
* TagInfo#**params**: `Type`
|
|
348
|
+
* TagInfo#**results**: `Type`
|
|
349
|
+
|
|
350
|
+
* **getSideEffects**(expr: `ExpressionRef`, features: `FeatureFlags`): `SideEffects`<br />
|
|
351
|
+
Gets the side effects of the specified expression.
|
|
352
|
+
|
|
353
|
+
* SideEffects.**None**: `SideEffects`
|
|
354
|
+
* SideEffects.**Branches**: `SideEffects`
|
|
355
|
+
* SideEffects.**Calls**: `SideEffects`
|
|
356
|
+
* SideEffects.**ReadsLocal**: `SideEffects`
|
|
357
|
+
* SideEffects.**WritesLocal**: `SideEffects`
|
|
358
|
+
* SideEffects.**ReadsGlobal**: `SideEffects`
|
|
359
|
+
* SideEffects.**WritesGlobal**: `SideEffects`
|
|
360
|
+
* SideEffects.**ReadsMemory**: `SideEffects`
|
|
361
|
+
* SideEffects.**WritesMemory**: `SideEffects`
|
|
362
|
+
* SideEffects.**ReadsTable**: `SideEffects`
|
|
363
|
+
* SideEffects.**WritesTable**: `SideEffects`
|
|
364
|
+
* SideEffects.**ImplicitTrap**: `SideEffects`
|
|
365
|
+
* SideEffects.**IsAtomic**: `SideEffects`
|
|
366
|
+
* SideEffects.**Throws**: `SideEffects`
|
|
367
|
+
* SideEffects.**DanglingPop**: `SideEffects`
|
|
368
|
+
* SideEffects.**TrapsNeverHappen**: `SideEffects`
|
|
369
|
+
* SideEffects.**Any**: `SideEffects`
|
|
370
|
+
|
|
371
|
+
### Module validation
|
|
372
|
+
|
|
373
|
+
* Module#**validate**(): `boolean`<br />
|
|
374
|
+
Validates the module. Returns `true` if valid, otherwise prints validation errors and returns `false`.
|
|
375
|
+
|
|
376
|
+
### Module optimization
|
|
377
|
+
|
|
378
|
+
* Module#**optimize**(): `void`<br />
|
|
379
|
+
Optimizes the module using the default optimization passes.
|
|
380
|
+
|
|
381
|
+
* Module#**optimizeFunction**(func: `FunctionRef | string`): `void`<br />
|
|
382
|
+
Optimizes a single function using the default optimization passes.
|
|
383
|
+
|
|
384
|
+
* Module#**runPasses**(passes: `string[]`): `void`<br />
|
|
385
|
+
Runs the specified passes on the module.
|
|
386
|
+
|
|
387
|
+
* Module#**runPassesOnFunction**(func: `FunctionRef | string`, passes: `string[]`): `void`<br />
|
|
388
|
+
Runs the specified passes on a single function.
|
|
389
|
+
|
|
390
|
+
* **getOptimizeLevel**(): `number`<br />
|
|
391
|
+
Gets the currently set optimize level. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc.
|
|
392
|
+
|
|
393
|
+
* **setOptimizeLevel**(level: `number`): `void`<br />
|
|
394
|
+
Sets the optimization level to use. `0`, `1`, `2` correspond to `-O0`, `-O1`, `-O2` (default), etc.
|
|
395
|
+
|
|
396
|
+
* **getShrinkLevel**(): `number`<br />
|
|
397
|
+
Gets the currently set shrink level. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`.
|
|
398
|
+
|
|
399
|
+
* **setShrinkLevel**(level: `number`): `void`<br />
|
|
400
|
+
Sets the shrink level to use. `0`, `1`, `2` correspond to `-O0`, `-Os` (default), `-Oz`.
|
|
401
|
+
|
|
402
|
+
* **getDebugInfo**(): `boolean`<br />
|
|
403
|
+
Gets whether generating debug information is currently enabled or not.
|
|
404
|
+
|
|
405
|
+
* **setDebugInfo**(on: `boolean`): `void`<br />
|
|
406
|
+
Enables or disables debug information in emitted binaries.
|
|
407
|
+
|
|
408
|
+
* **getTrapsNeverHappen**(): `boolean`<br />
|
|
409
|
+
Gets whether no traps can be considered reached at runtime when optimizing.
|
|
410
|
+
|
|
411
|
+
* **setTrapsNeverHappen**(on: `boolean`): `void`<br />
|
|
412
|
+
Enables or disables whether no traps can be considered reached at runtime when optimizing.
|
|
413
|
+
|
|
414
|
+
* **getClosedWorld**(): `boolean`<br />
|
|
415
|
+
Gets whether considering that the code outside of the module does not inspect or interact with GC and function references.
|
|
416
|
+
|
|
417
|
+
* **setClosedWorld**(on: `boolean`): `void`<br />
|
|
418
|
+
Enables or disables whether considering that the code outside of the module does not inspect or interact with GC and function references.
|
|
419
|
+
|
|
420
|
+
* **getLowMemoryUnused**(): `boolean`<br />
|
|
421
|
+
Gets whether the low 1K of memory can be considered unused when optimizing.
|
|
422
|
+
|
|
423
|
+
* **setLowMemoryUnused**(on: `boolean`): `void`<br />
|
|
424
|
+
Enables or disables whether the low 1K of memory can be considered unused when optimizing.
|
|
425
|
+
|
|
426
|
+
* **getZeroFilledMemory**(): `boolean`<br />
|
|
427
|
+
Gets whether an imported memory is considered zero-initialized.
|
|
428
|
+
|
|
429
|
+
* **setZeroFilledMemory**(on: `boolean`): `void`<br />
|
|
430
|
+
Enables or disables whether an imported memory is considered zero-initialized.
|
|
431
|
+
|
|
432
|
+
* **getFastMath**(): `boolean`<br />
|
|
433
|
+
Gets whether fast math optimizations are enabled, ignoring for example corner cases of floating-point math like NaN changes.
|
|
434
|
+
|
|
435
|
+
* **setFastMath**(on: `boolean`): `void`<br />
|
|
436
|
+
Enables or disables fast math optimizations, ignoring for example corner cases of floating-point math like NaN changes.
|
|
437
|
+
|
|
438
|
+
* **getGenerateStackIR**(): `boolean`<br />
|
|
439
|
+
Gets whether to generate StackIR during binary writing.
|
|
440
|
+
|
|
441
|
+
* **setGenerateStackIR**(on: `boolean`): `void`<br />
|
|
442
|
+
Enable or disable StackIR generation during binary writing.
|
|
443
|
+
|
|
444
|
+
* **getOptimizeStackIR**(): `boolean`<br />
|
|
445
|
+
Gets whether to optimize StackIR during binary writing.
|
|
446
|
+
|
|
447
|
+
* **setOptimizeStackIR**(on: `boolean`): `void`<br />
|
|
448
|
+
Enable or disable StackIR optimisation during binary writing.
|
|
449
|
+
|
|
450
|
+
* **getPassArgument**(key: `string`): `string | null`<br />
|
|
451
|
+
Gets the value of the specified arbitrary pass argument.
|
|
452
|
+
|
|
453
|
+
* **setPassArgument**(key: `string`, value: `string | null`): `void`<br />
|
|
454
|
+
Sets the value of the specified arbitrary pass argument. Removes the respective argument if `value` is `null`.
|
|
455
|
+
|
|
456
|
+
* **clearPassArguments**(): `void`<br />
|
|
457
|
+
Clears all arbitrary pass arguments.
|
|
458
|
+
|
|
459
|
+
* **hasPassToSkip**(pass: `string`): `boolean`<br />
|
|
460
|
+
Gets whether a pass is in the set of passes to skip.
|
|
461
|
+
|
|
462
|
+
* **addPassToSkip**(pass: `string`): `void`<br />
|
|
463
|
+
Add a pass to the set of passes to skip.
|
|
464
|
+
|
|
465
|
+
* **clearPassesToSkip**(): `void`<br />
|
|
466
|
+
Clears the set of passes to skip.
|
|
467
|
+
|
|
468
|
+
* **getAlwaysInlineMaxSize**(): `number`<br />
|
|
469
|
+
Gets the function size at which we always inline.
|
|
470
|
+
|
|
471
|
+
* **setAlwaysInlineMaxSize**(size: `number`): `void`<br />
|
|
472
|
+
Sets the function size at which we always inline.
|
|
473
|
+
|
|
474
|
+
* **getFlexibleInlineMaxSize**(): `number`<br />
|
|
475
|
+
Gets the function size which we inline when functions are lightweight.
|
|
476
|
+
|
|
477
|
+
* **setFlexibleInlineMaxSize**(size: `number`): `void`<br />
|
|
478
|
+
Sets the function size which we inline when functions are lightweight.
|
|
479
|
+
|
|
480
|
+
* **getOneCallerInlineMaxSize**(): `number`<br />
|
|
481
|
+
Gets the function size which we inline when there is only one caller.
|
|
482
|
+
|
|
483
|
+
* **setOneCallerInlineMaxSize**(size: `number`): `void`<br />
|
|
484
|
+
Sets the function size which we inline when there is only one caller.
|
|
485
|
+
|
|
486
|
+
### Module creation
|
|
487
|
+
|
|
488
|
+
* Module#**emitBinary**(): `Uint8Array`<br />
|
|
489
|
+
Returns the module in binary format.
|
|
490
|
+
|
|
491
|
+
* Module#**emitBinary**(sourceMapUrl: `string | null`): `BinaryWithSourceMap`<br />
|
|
492
|
+
Returns the module in binary format with its source map. If `sourceMapUrl` is `null`, source map generation is skipped.
|
|
493
|
+
|
|
494
|
+
* BinaryWithSourceMap#**binary**: `Uint8Array`
|
|
495
|
+
* BinaryWithSourceMap#**sourceMap**: `string | null`
|
|
496
|
+
|
|
497
|
+
* Module#**emitText**(): `string`<br />
|
|
498
|
+
Returns the module in Binaryen's s-expression text format (not official stack-style text format).
|
|
499
|
+
|
|
500
|
+
* Module#**emitStackIR**(): `string`<br />
|
|
501
|
+
Returns the module in official stack-style text format.
|
|
502
|
+
|
|
503
|
+
* Module#**emitAsmjs**(): `string`<br />
|
|
504
|
+
Returns the [asm.js](http://asmjs.org/) representation of the module.
|
|
505
|
+
|
|
506
|
+
* Module#**dispose**(): `void`<br />
|
|
507
|
+
Releases the resources held by the module once it isn't needed anymore.
|
|
508
|
+
|
|
509
|
+
### Expression construction
|
|
510
|
+
|
|
511
|
+
#### [Control flow](http://webassembly.org/docs/semantics/#control-constructs-and-instructions)
|
|
512
|
+
|
|
513
|
+
* Module#**block**(label: `string | null`, children: `ExpressionRef[]`, resultType?: `Type`): `ExpressionRef`<br />
|
|
514
|
+
Creates a block. `resultType` defaults to `none`.
|
|
515
|
+
|
|
516
|
+
* Module#**if**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse?: `ExpressionRef`): `ExpressionRef`<br />
|
|
517
|
+
Creates an if or if/else combination.
|
|
518
|
+
|
|
519
|
+
* Module#**loop**(label: `string | null`, body: `ExpressionRef`): `ExpressionRef`<br />
|
|
520
|
+
Creates a loop.
|
|
521
|
+
|
|
522
|
+
* Module#**br**(label: `string`, condition?: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br />
|
|
523
|
+
Creates a branch (br) to a label.
|
|
524
|
+
|
|
525
|
+
* Module#**switch**(labels: `string[]`, defaultLabel: `string`, condition: `ExpressionRef`, value?: `ExpressionRef`): `ExpressionRef`<br />
|
|
526
|
+
Creates a switch (br_table).
|
|
527
|
+
|
|
528
|
+
* Module#**nop**(): `ExpressionRef`<br />
|
|
529
|
+
Creates a no-operation (nop) instruction.
|
|
530
|
+
|
|
531
|
+
* Module#**return**(value?: `ExpressionRef`): `ExpressionRef`
|
|
532
|
+
Creates a return.
|
|
533
|
+
|
|
534
|
+
* Module#**unreachable**(): `ExpressionRef`<br />
|
|
535
|
+
Creates an [unreachable](http://webassembly.org/docs/semantics/#unreachable) instruction that will always trap.
|
|
536
|
+
|
|
537
|
+
* Module#**drop**(value: `ExpressionRef`): `ExpressionRef`<br />
|
|
538
|
+
Creates a [drop](http://webassembly.org/docs/semantics/#type-parametric-operators) of a value.
|
|
539
|
+
|
|
540
|
+
* Module#**select**(condition: `ExpressionRef`, ifTrue: `ExpressionRef`, ifFalse: `ExpressionRef`): `ExpressionRef`<br />
|
|
541
|
+
Creates a [select](http://webassembly.org/docs/semantics/#type-parametric-operators) of one of two values.
|
|
542
|
+
|
|
543
|
+
#### [Variable accesses](http://webassembly.org/docs/semantics/#local-variables)
|
|
544
|
+
|
|
545
|
+
* Module#**local.get**(index: `number`, type: `Type`): `ExpressionRef`<br />
|
|
546
|
+
Creates a local.get for the local at the specified index. Note that we must specify the type here as we may not have created the local being accessed yet.
|
|
547
|
+
|
|
548
|
+
* Module#**local.set**(index: `number`, value: `ExpressionRef`): `ExpressionRef`<br />
|
|
549
|
+
Creates a local.set for the local at the specified index.
|
|
550
|
+
|
|
551
|
+
* Module#**local.tee**(index: `number`, value: `ExpressionRef`, type: `Type`): `ExpressionRef`<br />
|
|
552
|
+
Creates a local.tee for the local at the specified index. A tee differs from a set in that the value remains on the stack. Note that we must specify the type here as we may not have created the local being accessed yet.
|
|
553
|
+
|
|
554
|
+
* Module#**global.get**(name: `string`, type: `Type`): `ExpressionRef`<br />
|
|
555
|
+
Creates a global.get for the global with the specified name. Note that we must specify the type here as we may not have created the global being accessed yet.
|
|
556
|
+
|
|
557
|
+
* Module#**global.set**(name: `string`, value: `ExpressionRef`): `ExpressionRef`<br />
|
|
558
|
+
Creates a global.set for the global with the specified name.
|
|
559
|
+
|
|
560
|
+
#### [Integer operations](http://webassembly.org/docs/semantics/#32-bit-integer-operators)
|
|
561
|
+
|
|
562
|
+
* Module#i32.**const**(value: `number`): `ExpressionRef`
|
|
563
|
+
* Module#i32.**clz**(value: `ExpressionRef`): `ExpressionRef`
|
|
564
|
+
* Module#i32.**ctz**(value: `ExpressionRef`): `ExpressionRef`
|
|
565
|
+
* Module#i32.**popcnt**(value: `ExpressionRef`): `ExpressionRef`
|
|
566
|
+
* Module#i32.**eqz**(value: `ExpressionRef`): `ExpressionRef`
|
|
567
|
+
* Module#i32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
568
|
+
* Module#i32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
569
|
+
* Module#i32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
570
|
+
* Module#i32.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
571
|
+
* Module#i32.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
572
|
+
* Module#i32.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
573
|
+
* Module#i32.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
574
|
+
* Module#i32.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
575
|
+
* Module#i32.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
576
|
+
* Module#i32.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
577
|
+
* Module#i32.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
578
|
+
* Module#i32.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
579
|
+
* Module#i32.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
580
|
+
* Module#i32.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
581
|
+
* Module#i32.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
582
|
+
* Module#i32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
583
|
+
* Module#i32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
584
|
+
* Module#i32.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
585
|
+
* Module#i32.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
586
|
+
* Module#i32.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
587
|
+
* Module#i32.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
588
|
+
* Module#i32.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
589
|
+
* Module#i32.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
590
|
+
* Module#i32.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
591
|
+
* Module#i32.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
592
|
+
>
|
|
593
|
+
* Module#i64.**const**(low: `number`, high: `number`): `ExpressionRef`
|
|
594
|
+
* Module#i64.**clz**(value: `ExpressionRef`): `ExpressionRef`
|
|
595
|
+
* Module#i64.**ctz**(value: `ExpressionRef`): `ExpressionRef`
|
|
596
|
+
* Module#i64.**popcnt**(value: `ExpressionRef`): `ExpressionRef`
|
|
597
|
+
* Module#i64.**eqz**(value: `ExpressionRef`): `ExpressionRef`
|
|
598
|
+
* Module#i64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
599
|
+
* Module#i64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
600
|
+
* Module#i64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
601
|
+
* Module#i64.**div_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
602
|
+
* Module#i64.**div_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
603
|
+
* Module#i64.**rem_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
604
|
+
* Module#i64.**rem_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
605
|
+
* Module#i64.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
606
|
+
* Module#i64.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
607
|
+
* Module#i64.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
608
|
+
* Module#i64.**shl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
609
|
+
* Module#i64.**shr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
610
|
+
* Module#i64.**shr_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
611
|
+
* Module#i64.**rotl**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
612
|
+
* Module#i64.**rotr**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
613
|
+
* Module#i64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
614
|
+
* Module#i64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
615
|
+
* Module#i64.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
616
|
+
* Module#i64.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
617
|
+
* Module#i64.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
618
|
+
* Module#i64.**le_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
619
|
+
* Module#i64.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
620
|
+
* Module#i64.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
621
|
+
* Module#i64.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
622
|
+
* Module#i64.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
623
|
+
|
|
624
|
+
#### [Floating point operations](http://webassembly.org/docs/semantics/#floating-point-operators)
|
|
625
|
+
|
|
626
|
+
* Module#f32.**const**(value: `number`): `ExpressionRef`
|
|
627
|
+
* Module#f32.**const_bits**(value: `number`): `ExpressionRef`
|
|
628
|
+
* Module#f32.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
629
|
+
* Module#f32.**abs**(value: `ExpressionRef`): `ExpressionRef`
|
|
630
|
+
* Module#f32.**ceil**(value: `ExpressionRef`): `ExpressionRef`
|
|
631
|
+
* Module#f32.**floor**(value: `ExpressionRef`): `ExpressionRef`
|
|
632
|
+
* Module#f32.**trunc**(value: `ExpressionRef`): `ExpressionRef`
|
|
633
|
+
* Module#f32.**nearest**(value: `ExpressionRef`): `ExpressionRef`
|
|
634
|
+
* Module#f32.**sqrt**(value: `ExpressionRef`): `ExpressionRef`
|
|
635
|
+
* Module#f32.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
636
|
+
* Module#f32.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
637
|
+
* Module#f32.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
638
|
+
* Module#f32.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
639
|
+
* Module#f32.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
640
|
+
* Module#f32.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
641
|
+
* Module#f32.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
642
|
+
* Module#f32.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
643
|
+
* Module#f32.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
644
|
+
* Module#f32.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
645
|
+
* Module#f32.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
646
|
+
* Module#f32.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
647
|
+
* Module#f32.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
648
|
+
>
|
|
649
|
+
* Module#f64.**const**(value: `number`): `ExpressionRef`
|
|
650
|
+
* Module#f64.**const_bits**(value: `number`): `ExpressionRef`
|
|
651
|
+
* Module#f64.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
652
|
+
* Module#f64.**abs**(value: `ExpressionRef`): `ExpressionRef`
|
|
653
|
+
* Module#f64.**ceil**(value: `ExpressionRef`): `ExpressionRef`
|
|
654
|
+
* Module#f64.**floor**(value: `ExpressionRef`): `ExpressionRef`
|
|
655
|
+
* Module#f64.**trunc**(value: `ExpressionRef`): `ExpressionRef`
|
|
656
|
+
* Module#f64.**nearest**(value: `ExpressionRef`): `ExpressionRef`
|
|
657
|
+
* Module#f64.**sqrt**(value: `ExpressionRef`): `ExpressionRef`
|
|
658
|
+
* Module#f64.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
659
|
+
* Module#f64.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
660
|
+
* Module#f64.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
661
|
+
* Module#f64.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
662
|
+
* Module#f64.**copysign**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
663
|
+
* Module#f64.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
664
|
+
* Module#f64.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
665
|
+
* Module#f64.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
666
|
+
* Module#f64.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
667
|
+
* Module#f64.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
668
|
+
* Module#f64.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
669
|
+
* Module#f64.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
670
|
+
* Module#f64.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
671
|
+
|
|
672
|
+
#### [Datatype conversions](http://webassembly.org/docs/semantics/#datatype-conversions-truncations-reinterpretations-promotions-and-demotions)
|
|
673
|
+
|
|
674
|
+
* Module#i32.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef`
|
|
675
|
+
* Module#i32.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef`
|
|
676
|
+
* Module#i32.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef`
|
|
677
|
+
* Module#i32.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef`
|
|
678
|
+
* Module#i32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef`
|
|
679
|
+
* Module#i32.**wrap**(value: `ExpressionRef`): `ExpressionRef`
|
|
680
|
+
>
|
|
681
|
+
* Module#i64.**trunc_s.f32**(value: `ExpressionRef`): `ExpressionRef`
|
|
682
|
+
* Module#i64.**trunc_s.f64**(value: `ExpressionRef`): `ExpressionRef`
|
|
683
|
+
* Module#i64.**trunc_u.f32**(value: `ExpressionRef`): `ExpressionRef`
|
|
684
|
+
* Module#i64.**trunc_u.f64**(value: `ExpressionRef`): `ExpressionRef`
|
|
685
|
+
* Module#i64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef`
|
|
686
|
+
* Module#i64.**extend_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
687
|
+
* Module#i64.**extend_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
688
|
+
>
|
|
689
|
+
* Module#f32.**reinterpret**(value: `ExpressionRef`): `ExpressionRef`
|
|
690
|
+
* Module#f32.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef`
|
|
691
|
+
* Module#f32.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef`
|
|
692
|
+
* Module#f32.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef`
|
|
693
|
+
* Module#f32.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef`
|
|
694
|
+
* Module#f32.**demote**(value: `ExpressionRef`): `ExpressionRef`
|
|
695
|
+
>
|
|
696
|
+
* Module#f64.**reinterpret**(value: `ExpressionRef`): `ExpressionRef`
|
|
697
|
+
* Module#f64.**convert_s.i32**(value: `ExpressionRef`): `ExpressionRef`
|
|
698
|
+
* Module#f64.**convert_s.i64**(value: `ExpressionRef`): `ExpressionRef`
|
|
699
|
+
* Module#f64.**convert_u.i32**(value: `ExpressionRef`): `ExpressionRef`
|
|
700
|
+
* Module#f64.**convert_u.i64**(value: `ExpressionRef`): `ExpressionRef`
|
|
701
|
+
* Module#f64.**promote**(value: `ExpressionRef`): `ExpressionRef`
|
|
702
|
+
|
|
703
|
+
#### [Function calls](http://webassembly.org/docs/semantics/#calls)
|
|
704
|
+
|
|
705
|
+
* Module#**call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef`
|
|
706
|
+
Creates a call to a function. Note that we must specify the return type here as we may not have created the function being called yet.
|
|
707
|
+
|
|
708
|
+
* Module#**return_call**(name: `string`, operands: `ExpressionRef[]`, returnType: `Type`): `ExpressionRef`<br />
|
|
709
|
+
Like **call**, but creates a tail-call. 🦄
|
|
710
|
+
|
|
711
|
+
* Module#**call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br />
|
|
712
|
+
Similar to **call**, but calls indirectly, i.e., via a function pointer, so an expression replaces the name as the called value.
|
|
713
|
+
|
|
714
|
+
* Module#**return_call_indirect**(target: `ExpressionRef`, operands: `ExpressionRef[]`, params: `Type`, results: `Type`): `ExpressionRef`<br />
|
|
715
|
+
Like **call_indirect**, but creates a tail-call. 🦄
|
|
716
|
+
|
|
717
|
+
#### [Linear memory accesses](http://webassembly.org/docs/semantics/#linear-memory-accesses)
|
|
718
|
+
|
|
719
|
+
* Module#i32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br />
|
|
720
|
+
* Module#i32.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br />
|
|
721
|
+
* Module#i32.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br />
|
|
722
|
+
* Module#i32.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br />
|
|
723
|
+
* Module#i32.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`<br />
|
|
724
|
+
* Module#i32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br />
|
|
725
|
+
* Module#i32.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br />
|
|
726
|
+
* Module#i32.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`<br />
|
|
727
|
+
>
|
|
728
|
+
* Module#i64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
729
|
+
* Module#i64.**load8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
730
|
+
* Module#i64.**load8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
731
|
+
* Module#i64.**load16_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
732
|
+
* Module#i64.**load16_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
733
|
+
* Module#i64.**load32_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
734
|
+
* Module#i64.**load32_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
735
|
+
* Module#i64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
736
|
+
* Module#i64.**store8**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
737
|
+
* Module#i64.**store16**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
738
|
+
* Module#i64.**store32**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
739
|
+
>
|
|
740
|
+
* Module#f32.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
741
|
+
* Module#f32.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
742
|
+
>
|
|
743
|
+
* Module#f64.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
744
|
+
* Module#f64.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
745
|
+
|
|
746
|
+
#### [Host operations](http://webassembly.org/docs/semantics/#resizing)
|
|
747
|
+
|
|
748
|
+
* Module#**memory.size**(): `ExpressionRef`
|
|
749
|
+
* Module#**memory.grow**(value: `number`): `ExpressionRef`
|
|
750
|
+
|
|
751
|
+
#### [Vector operations](https://github.com/WebAssembly/simd/blob/main/proposals/simd/SIMD.md) 🦄
|
|
752
|
+
|
|
753
|
+
* Module#v128.**const**(bytes: `Uint8Array`): `ExpressionRef`
|
|
754
|
+
* Module#v128.**load**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
755
|
+
* Module#v128.**store**(offset: `number`, align: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
756
|
+
* Module#v128.**not**(value: `ExpressionRef`): `ExpressionRef`
|
|
757
|
+
* Module#v128.**and**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
758
|
+
* Module#v128.**or**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
759
|
+
* Module#v128.**xor**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
760
|
+
* Module#v128.**andnot**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
761
|
+
* Module#v128.**bitselect**(left: `ExpressionRef`, right: `ExpressionRef`, cond: `ExpressionRef`): `ExpressionRef`
|
|
762
|
+
>
|
|
763
|
+
* Module#i8x16.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
764
|
+
* Module#i8x16.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
765
|
+
* Module#i8x16.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
766
|
+
* Module#i8x16.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
767
|
+
* Module#i8x16.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
768
|
+
* Module#i8x16.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
769
|
+
* Module#i8x16.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
770
|
+
* Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
771
|
+
* Module#i8x16.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
772
|
+
* Module#i8x16.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
773
|
+
* Module#i8x16.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
774
|
+
* Module#i8x16.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
775
|
+
* Module#i8x16.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
776
|
+
* Module#i8x16.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
777
|
+
* Module#i8x16.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
778
|
+
* Module#i8x16.**any_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
779
|
+
* Module#i8x16.**all_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
780
|
+
* Module#i8x16.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
781
|
+
* Module#i8x16.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
782
|
+
* Module#i8x16.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
783
|
+
* Module#i8x16.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
784
|
+
* Module#i8x16.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
785
|
+
* Module#i8x16.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
786
|
+
* Module#i8x16.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
787
|
+
* Module#i8x16.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
788
|
+
* Module#i8x16.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
789
|
+
* Module#i8x16.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
790
|
+
* Module#i8x16.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
791
|
+
* Module#i8x16.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
792
|
+
* Module#i8x16.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
793
|
+
* Module#i8x16.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
794
|
+
* Module#i8x16.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
795
|
+
* Module#i8x16.**narrow_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
796
|
+
* Module#i8x16.**narrow_i16x8_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
797
|
+
>
|
|
798
|
+
* Module#i16x8.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
799
|
+
* Module#i16x8.**extract_lane_s**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
800
|
+
* Module#i16x8.**extract_lane_u**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
801
|
+
* Module#i16x8.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
802
|
+
* Module#i16x8.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
803
|
+
* Module#i16x8.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
804
|
+
* Module#i16x8.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
805
|
+
* Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
806
|
+
* Module#i16x8.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
807
|
+
* Module#i16x8.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
808
|
+
* Module#i16x8.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
809
|
+
* Module#i16x8.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
810
|
+
* Module#i16x8.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
811
|
+
* Module#i16x8.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
812
|
+
* Module#i16x8.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
813
|
+
* Module#i16x8.**any_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
814
|
+
* Module#i16x8.**all_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
815
|
+
* Module#i16x8.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
816
|
+
* Module#i16x8.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
817
|
+
* Module#i16x8.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
818
|
+
* Module#i16x8.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
819
|
+
* Module#i16x8.**add_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
820
|
+
* Module#i16x8.**add_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
821
|
+
* Module#i16x8.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
822
|
+
* Module#i16x8.**sub_saturate_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
823
|
+
* Module#i16x8.**sub_saturate_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
824
|
+
* Module#i16x8.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
825
|
+
* Module#i16x8.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
826
|
+
* Module#i16x8.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
827
|
+
* Module#i16x8.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
828
|
+
* Module#i16x8.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
829
|
+
* Module#i16x8.**avgr_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
830
|
+
* Module#i16x8.**narrow_i32x4_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
831
|
+
* Module#i16x8.**narrow_i32x4_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
832
|
+
* Module#i16x8.**widen_low_i8x16_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
833
|
+
* Module#i16x8.**widen_high_i8x16_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
834
|
+
* Module#i16x8.**widen_low_i8x16_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
835
|
+
* Module#i16x8.**widen_high_i8x16_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
836
|
+
* Module#i16x8.**load8x8_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
837
|
+
* Module#i16x8.**load8x8_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
838
|
+
>
|
|
839
|
+
* Module#i32x4.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
840
|
+
* Module#i32x4.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
841
|
+
* Module#i32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
842
|
+
* Module#i32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
843
|
+
* Module#i32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
844
|
+
* Module#i32x4.**lt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
845
|
+
* Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
846
|
+
* Module#i32x4.**gt_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
847
|
+
* Module#i32x4.**gt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
848
|
+
* Module#i32x4.**le_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
849
|
+
* Module#i32x4.**lt_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
850
|
+
* Module#i32x4.**ge_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
851
|
+
* Module#i32x4.**ge_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
852
|
+
* Module#i32x4.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
853
|
+
* Module#i32x4.**any_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
854
|
+
* Module#i32x4.**all_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
855
|
+
* Module#i32x4.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
856
|
+
* Module#i32x4.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
857
|
+
* Module#i32x4.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
858
|
+
* Module#i32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
859
|
+
* Module#i32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
860
|
+
* Module#i32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
861
|
+
* Module#i32x4.**min_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
862
|
+
* Module#i32x4.**min_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
863
|
+
* Module#i32x4.**max_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
864
|
+
* Module#i32x4.**max_u**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
865
|
+
* Module#i32x4.**dot_i16x8_s**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
866
|
+
* Module#i32x4.**trunc_sat_f32x4_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
867
|
+
* Module#i32x4.**trunc_sat_f32x4_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
868
|
+
* Module#i32x4.**widen_low_i16x8_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
869
|
+
* Module#i32x4.**widen_high_i16x8_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
870
|
+
* Module#i32x4.**widen_low_i16x8_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
871
|
+
* Module#i32x4.**widen_high_i16x8_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
872
|
+
* Module#i32x4.**load16x4_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
873
|
+
* Module#i32x4.**load16x4_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
874
|
+
>
|
|
875
|
+
* Module#i64x2.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
876
|
+
* Module#i64x2.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
877
|
+
* Module#i64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
878
|
+
* Module#i64x2.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
879
|
+
* Module#i64x2.**any_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
880
|
+
* Module#i64x2.**all_true**(value: `ExpressionRef`): `ExpressionRef`
|
|
881
|
+
* Module#i64x2.**shl**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
882
|
+
* Module#i64x2.**shr_s**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
883
|
+
* Module#i64x2.**shr_u**(vec: `ExpressionRef`, shift: `ExpressionRef`): `ExpressionRef`
|
|
884
|
+
* Module#i64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
885
|
+
* Module#i64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
886
|
+
* Module#i64x2.**trunc_sat_f64x2_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
887
|
+
* Module#i64x2.**trunc_sat_f64x2_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
888
|
+
* Module#i64x2.**load32x2_s**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
889
|
+
* Module#i64x2.**load32x2_u**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
890
|
+
>
|
|
891
|
+
* Module#f32x4.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
892
|
+
* Module#f32x4.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
893
|
+
* Module#f32x4.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
894
|
+
* Module#f32x4.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
895
|
+
* Module#f32x4.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
896
|
+
* Module#f32x4.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
897
|
+
* Module#f32x4.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
898
|
+
* Module#f32x4.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
899
|
+
* Module#f32x4.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
900
|
+
* Module#f32x4.**abs**(value: `ExpressionRef`): `ExpressionRef`
|
|
901
|
+
* Module#f32x4.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
902
|
+
* Module#f32x4.**sqrt**(value: `ExpressionRef`): `ExpressionRef`
|
|
903
|
+
* Module#f32x4.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef`
|
|
904
|
+
* Module#f32x4.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef`
|
|
905
|
+
* Module#f32x4.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
906
|
+
* Module#f32x4.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
907
|
+
* Module#f32x4.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
908
|
+
* Module#f32x4.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
909
|
+
* Module#f32x4.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
910
|
+
* Module#f32x4.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
911
|
+
* Module#f32x4.**convert_i32x4_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
912
|
+
* Module#f32x4.**convert_i32x4_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
913
|
+
>
|
|
914
|
+
* Module#f64x2.**splat**(value: `ExpressionRef`): `ExpressionRef`
|
|
915
|
+
* Module#f64x2.**extract_lane**(vec: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
916
|
+
* Module#f64x2.**replace_lane**(vec: `ExpressionRef`, index: `number`, value: `ExpressionRef`): `ExpressionRef`
|
|
917
|
+
* Module#f64x2.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
918
|
+
* Module#f64x2.**ne**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
919
|
+
* Module#f64x2.**lt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
920
|
+
* Module#f64x2.**gt**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
921
|
+
* Module#f64x2.**le**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
922
|
+
* Module#f64x2.**ge**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
923
|
+
* Module#f64x2.**abs**(value: `ExpressionRef`): `ExpressionRef`
|
|
924
|
+
* Module#f64x2.**neg**(value: `ExpressionRef`): `ExpressionRef`
|
|
925
|
+
* Module#f64x2.**sqrt**(value: `ExpressionRef`): `ExpressionRef`
|
|
926
|
+
* Module#f64x2.**qfma**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef`
|
|
927
|
+
* Module#f64x2.**qfms**(a: `ExpressionRef`, b: `ExpressionRef`, c: `ExpressionRef`): `ExpressionRef`
|
|
928
|
+
* Module#f64x2.**add**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
929
|
+
* Module#f64x2.**sub**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
930
|
+
* Module#f64x2.**mul**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
931
|
+
* Module#f64x2.**div**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
932
|
+
* Module#f64x2.**min**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
933
|
+
* Module#f64x2.**max**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
934
|
+
* Module#f64x2.**convert_i64x2_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
935
|
+
* Module#f64x2.**convert_i64x2_u**(value: `ExpressionRef`): `ExpressionRef`
|
|
936
|
+
>
|
|
937
|
+
* Module#v8x16.**shuffle**(left: `ExpressionRef`, right: `ExpressionRef`, mask: `Uint8Array`): `ExpressionRef`
|
|
938
|
+
* Module#v8x16.**swizzle**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
939
|
+
* Module#v8x16.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
940
|
+
>
|
|
941
|
+
* Module#v16x8.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
942
|
+
>
|
|
943
|
+
* Module#v32x4.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
944
|
+
>
|
|
945
|
+
* Module#v64x2.**load_splat**(offset: `number`, align: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
946
|
+
|
|
947
|
+
#### [Atomic memory accesses](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#atomic-memory-accesses) 🦄
|
|
948
|
+
|
|
949
|
+
* Module#i32.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
950
|
+
* Module#i32.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
951
|
+
* Module#i32.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
952
|
+
* Module#i32.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
953
|
+
* Module#i32.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
954
|
+
* Module#i32.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
955
|
+
>
|
|
956
|
+
* Module#i64.**atomic.load**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
957
|
+
* Module#i64.**atomic.load8_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
958
|
+
* Module#i64.**atomic.load16_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
959
|
+
* Module#i64.**atomic.load32_u**(offset: `number`, ptr: `ExpressionRef`): `ExpressionRef`
|
|
960
|
+
* Module#i64.**atomic.store**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
961
|
+
* Module#i64.**atomic.store8**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
962
|
+
* Module#i64.**atomic.store16**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
963
|
+
* Module#i64.**atomic.store32**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
964
|
+
|
|
965
|
+
#### [Atomic read-modify-write operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#read-modify-write) 🦄
|
|
966
|
+
|
|
967
|
+
* Module#i32.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
968
|
+
* Module#i32.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
969
|
+
* Module#i32.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
970
|
+
* Module#i32.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
971
|
+
* Module#i32.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
972
|
+
* Module#i32.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
973
|
+
* Module#i32.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
974
|
+
* Module#i32.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
975
|
+
* Module#i32.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
976
|
+
* Module#i32.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
977
|
+
* Module#i32.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
978
|
+
* Module#i32.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
979
|
+
* Module#i32.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
980
|
+
* Module#i32.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
981
|
+
* Module#i32.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
982
|
+
* Module#i32.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
983
|
+
* Module#i32.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
984
|
+
* Module#i32.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
985
|
+
* Module#i32.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
986
|
+
* Module#i32.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
987
|
+
* Module#i32.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
988
|
+
>
|
|
989
|
+
* Module#i64.**atomic.rmw.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
990
|
+
* Module#i64.**atomic.rmw.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
991
|
+
* Module#i64.**atomic.rmw.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
992
|
+
* Module#i64.**atomic.rmw.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
993
|
+
* Module#i64.**atomic.rmw.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
994
|
+
* Module#i64.**atomic.rmw.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
995
|
+
* Module#i64.**atomic.rmw.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
996
|
+
* Module#i64.**atomic.rmw8_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
997
|
+
* Module#i64.**atomic.rmw8_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
998
|
+
* Module#i64.**atomic.rmw8_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
999
|
+
* Module#i64.**atomic.rmw8_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1000
|
+
* Module#i64.**atomic.rmw8_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1001
|
+
* Module#i64.**atomic.rmw8_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1002
|
+
* Module#i64.**atomic.rmw8_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
1003
|
+
* Module#i64.**atomic.rmw16_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1004
|
+
* Module#i64.**atomic.rmw16_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1005
|
+
* Module#i64.**atomic.rmw16_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1006
|
+
* Module#i64.**atomic.rmw16_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1007
|
+
* Module#i64.**atomic.rmw16_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1008
|
+
* Module#i64.**atomic.rmw16_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1009
|
+
* Module#i64.**atomic.rmw16_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
1010
|
+
* Module#i64.**atomic.rmw32_u.add**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1011
|
+
* Module#i64.**atomic.rmw32_u.sub**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1012
|
+
* Module#i64.**atomic.rmw32_u.and**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1013
|
+
* Module#i64.**atomic.rmw32_u.or**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1014
|
+
* Module#i64.**atomic.rmw32_u.xor**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1015
|
+
* Module#i64.**atomic.rmw32_u.xchg**(offset: `number`, ptr: `ExpressionRef`, value: `ExpressionRef`): `ExpressionRef`
|
|
1016
|
+
* Module#i64.**atomic.rmw32_u.cmpxchg**(offset: `number`, ptr: `ExpressionRef`, expected: `ExpressionRef`, replacement: `ExpressionRef`): `ExpressionRef`
|
|
1017
|
+
|
|
1018
|
+
#### [Atomic wait and notify operations](https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-notify-operators) 🦄
|
|
1019
|
+
|
|
1020
|
+
* Module#memory.**atomic.wait32**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef`
|
|
1021
|
+
* Module#memory.**atomic.wait64**(ptr: `ExpressionRef`, expected: `ExpressionRef`, timeout: `ExpressionRef`): `ExpressionRef`
|
|
1022
|
+
* Module#memory**atomic.notify**(ptr: `ExpressionRef`, notifyCount: `ExpressionRef`): `ExpressionRef`
|
|
1023
|
+
* Module#**atomic.fence**(): `ExpressionRef`
|
|
1024
|
+
|
|
1025
|
+
#### [Sign extension operations](https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md) 🦄
|
|
1026
|
+
|
|
1027
|
+
* Module#i32.**extend8_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
1028
|
+
* Module#i32.**extend16_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
1029
|
+
>
|
|
1030
|
+
* Module#i64.**extend8_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
1031
|
+
* Module#i64.**extend16_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
1032
|
+
* Module#i64.**extend32_s**(value: `ExpressionRef`): `ExpressionRef`
|
|
1033
|
+
|
|
1034
|
+
#### [Multi-value operations](https://github.com/WebAssembly/multi-value/blob/master/proposals/multi-value/Overview.md) 🦄
|
|
1035
|
+
|
|
1036
|
+
Note that these are pseudo instructions enabling Binaryen to reason about multiple values on the stack.
|
|
1037
|
+
|
|
1038
|
+
* Module#**push**(value: `ExpressionRef`): `ExpressionRef`
|
|
1039
|
+
* Module#i32.**pop**(): `ExpressionRef`
|
|
1040
|
+
* Module#i64.**pop**(): `ExpressionRef`
|
|
1041
|
+
* Module#f32.**pop**(): `ExpressionRef`
|
|
1042
|
+
* Module#f64.**pop**(): `ExpressionRef`
|
|
1043
|
+
* Module#v128.**pop**(): `ExpressionRef`
|
|
1044
|
+
* Module#funcref.**pop**(): `ExpressionRef`
|
|
1045
|
+
* Module#anyref.**pop**(): `ExpressionRef`
|
|
1046
|
+
* Module#externref.**pop**(): `ExpressionRef`
|
|
1047
|
+
* Module#tuple.**make**(elements: `ExpressionRef[]`): `ExpressionRef`
|
|
1048
|
+
* Module#tuple.**extract**(tuple: `ExpressionRef`, index: `number`): `ExpressionRef`
|
|
1049
|
+
|
|
1050
|
+
#### [Exception handling operations](https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md) 🦄
|
|
1051
|
+
|
|
1052
|
+
* Module#**try**(name: `string`, body: `ExpressionRef`, catchTags: `string[]`, catchBodies: `ExpressionRef[]`, delegateTarget?: `string`): `ExpressionRef`
|
|
1053
|
+
* Module#**throw**(tag: `string`, operands: `ExpressionRef[]`): `ExpressionRef`
|
|
1054
|
+
* Module#**rethrow**(target: `string`): `ExpressionRef`
|
|
1055
|
+
>
|
|
1056
|
+
* Module#**addTag**(name: `string`, params: `Type`, results: `Type`): `TagRef`
|
|
1057
|
+
* Module#**getTag**(name: `string`): `TagRef`
|
|
1058
|
+
* Module#**removeTag**(name: `stirng`): `void`
|
|
1059
|
+
* Module#**addTagImport**(internalName: `string`, externalModuleName: `string`, externalBaseName: `string`, params: `Type`, results: `Type`): `void`
|
|
1060
|
+
* Module#**addTagExport**(internalName: `string`, externalName: `string`): `ExportRef`
|
|
1061
|
+
|
|
1062
|
+
#### [Reference types operations](https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md) 🦄
|
|
1063
|
+
|
|
1064
|
+
* Module#ref.**null**(type: `Type`): `ExpressionRef`
|
|
1065
|
+
* Module#ref.**is_null**(value: `ExpressionRef`): `ExpressionRef`
|
|
1066
|
+
* Module#ref.**as_non_null**(value: `ExpressionRef`): `ExpressionRef`
|
|
1067
|
+
* Module#ref.**func**(name: `string`, type: `Type`): `ExpressionRef`
|
|
1068
|
+
* Module#ref.**i31**(value: `ExpressionRef`): `ExpressionRef`
|
|
1069
|
+
* Module#ref.**eq**(left: `ExpressionRef`, right: `ExpressionRef`): `ExpressionRef`
|
|
1070
|
+
|
|
1071
|
+
#### [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md) 🦄
|
|
1072
|
+
|
|
1073
|
+
* Module#memory.**init**(segment: `string`, dest: `ExpressionRef`, offset: `ExpressionRef`, size: `ExpressionRef`): `ExpressionRef`
|
|
1074
|
+
* Module#memory.**copy**(dest: `ExpressionRef`, source: `ExpressionRef`, size: `ExpressionRef`): `ExpressionRef`
|
|
1075
|
+
* Module#memory.**fill**(dest: `ExpressionRef`, value: `ExpressionRef`, size: `ExpressionRef`): `ExpressionRef`
|
|
1076
|
+
* Module#data.**drop**(segment: `string`): `ExpressionRef`
|
|
1077
|
+
|
|
1078
|
+
### Expression manipulation
|
|
1079
|
+
|
|
1080
|
+
* **getExpressionId**(expr: `ExpressionRef`): `ExpressionId`<br />
|
|
1081
|
+
Gets the id (kind) of the specified expression. Possible values are:
|
|
1082
|
+
|
|
1083
|
+
* **InvalidId**: `ExpressionId`
|
|
1084
|
+
* **BlockId**: `ExpressionId`
|
|
1085
|
+
* **IfId**: `ExpressionId`
|
|
1086
|
+
* **LoopId**: `ExpressionId`
|
|
1087
|
+
* **BreakId**: `ExpressionId`
|
|
1088
|
+
* **SwitchId**: `ExpressionId`
|
|
1089
|
+
* **CallId**: `ExpressionId`
|
|
1090
|
+
* **CallIndirectId**: `ExpressionId`
|
|
1091
|
+
* **LocalGetId**: `ExpressionId`
|
|
1092
|
+
* **LocalSetId**: `ExpressionId`
|
|
1093
|
+
* **GlobalGetId**: `ExpressionId`
|
|
1094
|
+
* **GlobalSetId**: `ExpressionId`
|
|
1095
|
+
* **LoadId**: `ExpressionId`
|
|
1096
|
+
* **StoreId**: `ExpressionId`
|
|
1097
|
+
* **ConstId**: `ExpressionId`
|
|
1098
|
+
* **UnaryId**: `ExpressionId`
|
|
1099
|
+
* **BinaryId**: `ExpressionId`
|
|
1100
|
+
* **SelectId**: `ExpressionId`
|
|
1101
|
+
* **DropId**: `ExpressionId`
|
|
1102
|
+
* **ReturnId**: `ExpressionId`
|
|
1103
|
+
* **NopId**: `ExpressionId`
|
|
1104
|
+
* **UnreachableId**: `ExpressionId`
|
|
1105
|
+
* **AtomicCmpxchgId**: `ExpressionId`
|
|
1106
|
+
* **AtomicRMWId**: `ExpressionId`
|
|
1107
|
+
* **AtomicWaitId**: `ExpressionId`
|
|
1108
|
+
* **AtomicNotifyId**: `ExpressionId`
|
|
1109
|
+
* **AtomicFenceId**: `ExpressionId`
|
|
1110
|
+
* **SIMDExtractId**: `ExpressionId`
|
|
1111
|
+
* **SIMDReplaceId**: `ExpressionId`
|
|
1112
|
+
* **SIMDShuffleId**: `ExpressionId`
|
|
1113
|
+
* **SIMDTernaryId**: `ExpressionId`
|
|
1114
|
+
* **SIMDShiftId**: `ExpressionId`
|
|
1115
|
+
* **SIMDLoadId**: `ExpressionId`
|
|
1116
|
+
* **MemoryInitId**: `ExpressionId`
|
|
1117
|
+
* **DataDropId**: `ExpressionId`
|
|
1118
|
+
* **MemoryCopyId**: `ExpressionId`
|
|
1119
|
+
* **MemoryFillId**: `ExpressionId`
|
|
1120
|
+
* **RefNullId**: `ExpressionId`
|
|
1121
|
+
* **RefIsNullId**: `ExpressionId`
|
|
1122
|
+
* **RefFuncId**: `ExpressionId`
|
|
1123
|
+
* **TryId**: `ExpressionId`
|
|
1124
|
+
* **ThrowId**: `ExpressionId`
|
|
1125
|
+
* **RethrowId**: `ExpressionId`
|
|
1126
|
+
* **PushId**: `ExpressionId`
|
|
1127
|
+
* **PopId**: `ExpressionId`
|
|
1128
|
+
|
|
1129
|
+
* **getExpressionType**(expr: `ExpressionRef`): `Type`<br />
|
|
1130
|
+
Gets the type of the specified expression.
|
|
1131
|
+
|
|
1132
|
+
* **getExpressionInfo**(expr: `ExpressionRef`): `ExpressionInfo`<br />
|
|
1133
|
+
Obtains information about an expression, always including:
|
|
1134
|
+
|
|
1135
|
+
* Info#**id**: `ExpressionId`
|
|
1136
|
+
* Info#**type**: `Type`
|
|
1137
|
+
|
|
1138
|
+
Additional properties depend on the expression's `id` and are usually equivalent to the respective parameters when creating such an expression:
|
|
1139
|
+
|
|
1140
|
+
* BlockInfo#**name**: `string`
|
|
1141
|
+
* BlockInfo#**children**: `ExpressionRef[]`
|
|
1142
|
+
>
|
|
1143
|
+
* IfInfo#**condition**: `ExpressionRef`
|
|
1144
|
+
* IfInfo#**ifTrue**: `ExpressionRef`
|
|
1145
|
+
* IfInfo#**ifFalse**: `ExpressionRef | null`
|
|
1146
|
+
>
|
|
1147
|
+
* LoopInfo#**name**: `string`
|
|
1148
|
+
* LoopInfo#**body**: `ExpressionRef`
|
|
1149
|
+
>
|
|
1150
|
+
* BreakInfo#**name**: `string`
|
|
1151
|
+
* BreakInfo#**condition**: `ExpressionRef | null`
|
|
1152
|
+
* BreakInfo#**value**: `ExpressionRef | null`
|
|
1153
|
+
>
|
|
1154
|
+
* SwitchInfo#**names**: `string[]`
|
|
1155
|
+
* SwitchInfo#**defaultName**: `string | null`
|
|
1156
|
+
* SwitchInfo#**condition**: `ExpressionRef`
|
|
1157
|
+
* SwitchInfo#**value**: `ExpressionRef | null`
|
|
1158
|
+
>
|
|
1159
|
+
* CallInfo#**target**: `string`
|
|
1160
|
+
* CallInfo#**operands**: `ExpressionRef[]`
|
|
1161
|
+
>
|
|
1162
|
+
* CallImportInfo#**target**: `string`
|
|
1163
|
+
* CallImportInfo#**operands**: `ExpressionRef[]`
|
|
1164
|
+
>
|
|
1165
|
+
* CallIndirectInfo#**target**: `ExpressionRef`
|
|
1166
|
+
* CallIndirectInfo#**operands**: `ExpressionRef[]`
|
|
1167
|
+
>
|
|
1168
|
+
* LocalGetInfo#**index**: `number`
|
|
1169
|
+
>
|
|
1170
|
+
* LocalSetInfo#**isTee**: `boolean`
|
|
1171
|
+
* LocalSetInfo#**index**: `number`
|
|
1172
|
+
* LocalSetInfo#**value**: `ExpressionRef`
|
|
1173
|
+
>
|
|
1174
|
+
* GlobalGetInfo#**name**: `string`
|
|
1175
|
+
>
|
|
1176
|
+
* GlobalSetInfo#**name**: `string`
|
|
1177
|
+
* GlobalSetInfo#**value**: `ExpressionRef`
|
|
1178
|
+
>
|
|
1179
|
+
* LoadInfo#**isAtomic**: `boolean`
|
|
1180
|
+
* LoadInfo#**isSigned**: `boolean`
|
|
1181
|
+
* LoadInfo#**offset**: `number`
|
|
1182
|
+
* LoadInfo#**bytes**: `number`
|
|
1183
|
+
* LoadInfo#**align**: `number`
|
|
1184
|
+
* LoadInfo#**ptr**: `ExpressionRef`
|
|
1185
|
+
>
|
|
1186
|
+
* StoreInfo#**isAtomic**: `boolean`
|
|
1187
|
+
* StoreInfo#**offset**: `number`
|
|
1188
|
+
* StoreInfo#**bytes**: `number`
|
|
1189
|
+
* StoreInfo#**align**: `number`
|
|
1190
|
+
* StoreInfo#**ptr**: `ExpressionRef`
|
|
1191
|
+
* StoreInfo#**value**: `ExpressionRef`
|
|
1192
|
+
>
|
|
1193
|
+
* ConstInfo#**value**: `number | { low: number, high: number }`
|
|
1194
|
+
>
|
|
1195
|
+
* UnaryInfo#**op**: `number`
|
|
1196
|
+
* UnaryInfo#**value**: `ExpressionRef`
|
|
1197
|
+
>
|
|
1198
|
+
* BinaryInfo#**op**: `number`
|
|
1199
|
+
* BinaryInfo#**left**: `ExpressionRef`
|
|
1200
|
+
* BinaryInfo#**right**: `ExpressionRef`
|
|
1201
|
+
>
|
|
1202
|
+
* SelectInfo#**ifTrue**: `ExpressionRef`
|
|
1203
|
+
* SelectInfo#**ifFalse**: `ExpressionRef`
|
|
1204
|
+
* SelectInfo#**condition**: `ExpressionRef`
|
|
1205
|
+
>
|
|
1206
|
+
* DropInfo#**value**: `ExpressionRef`
|
|
1207
|
+
>
|
|
1208
|
+
* ReturnInfo#**value**: `ExpressionRef | null`
|
|
1209
|
+
>
|
|
1210
|
+
* NopInfo
|
|
1211
|
+
>
|
|
1212
|
+
* UnreachableInfo
|
|
1213
|
+
>
|
|
1214
|
+
* PopInfo
|
|
1215
|
+
>
|
|
1216
|
+
* MemorySizeInfo
|
|
1217
|
+
>
|
|
1218
|
+
* MemoryGrowInfo#**delta**: `ExpressionRef`
|
|
1219
|
+
>
|
|
1220
|
+
* AtomicRMWInfo#**op**: `number`
|
|
1221
|
+
* AtomicRMWInfo#**bytes**: `number`
|
|
1222
|
+
* AtomicRMWInfo#**offset**: `number`
|
|
1223
|
+
* AtomicRMWInfo#**ptr**: `ExpressionRef`
|
|
1224
|
+
* AtomicRMWInfo#**value**: `ExpressionRef`
|
|
1225
|
+
>
|
|
1226
|
+
* AtomicCmpxchgInfo#**bytes**: `number`
|
|
1227
|
+
* AtomicCmpxchgInfo#**offset**: `number`
|
|
1228
|
+
* AtomicCmpxchgInfo#**ptr**: `ExpressionRef`
|
|
1229
|
+
* AtomicCmpxchgInfo#**expected**: `ExpressionRef`
|
|
1230
|
+
* AtomicCmpxchgInfo#**replacement**: `ExpressionRef`
|
|
1231
|
+
>
|
|
1232
|
+
* AtomicWaitInfo#**ptr**: `ExpressionRef`
|
|
1233
|
+
* AtomicWaitInfo#**expected**: `ExpressionRef`
|
|
1234
|
+
* AtomicWaitInfo#**timeout**: `ExpressionRef`
|
|
1235
|
+
* AtomicWaitInfo#**expectedType**: `Type`
|
|
1236
|
+
>
|
|
1237
|
+
* AtomicNotifyInfo#**ptr**: `ExpressionRef`
|
|
1238
|
+
* AtomicNotifyInfo#**notifyCount**: `ExpressionRef`
|
|
1239
|
+
>
|
|
1240
|
+
* AtomicFenceInfo
|
|
1241
|
+
>
|
|
1242
|
+
* SIMDExtractInfo#**op**: `Op`
|
|
1243
|
+
* SIMDExtractInfo#**vec**: `ExpressionRef`
|
|
1244
|
+
* SIMDExtractInfo#**index**: `ExpressionRef`
|
|
1245
|
+
>
|
|
1246
|
+
* SIMDReplaceInfo#**op**: `Op`
|
|
1247
|
+
* SIMDReplaceInfo#**vec**: `ExpressionRef`
|
|
1248
|
+
* SIMDReplaceInfo#**index**: `ExpressionRef`
|
|
1249
|
+
* SIMDReplaceInfo#**value**: `ExpressionRef`
|
|
1250
|
+
>
|
|
1251
|
+
* SIMDShuffleInfo#**left**: `ExpressionRef`
|
|
1252
|
+
* SIMDShuffleInfo#**right**: `ExpressionRef`
|
|
1253
|
+
* SIMDShuffleInfo#**mask**: `Uint8Array`
|
|
1254
|
+
>
|
|
1255
|
+
* SIMDTernaryInfo#**op**: `Op`
|
|
1256
|
+
* SIMDTernaryInfo#**a**: `ExpressionRef`
|
|
1257
|
+
* SIMDTernaryInfo#**b**: `ExpressionRef`
|
|
1258
|
+
* SIMDTernaryInfo#**c**: `ExpressionRef`
|
|
1259
|
+
>
|
|
1260
|
+
* SIMDShiftInfo#**op**: `Op`
|
|
1261
|
+
* SIMDShiftInfo#**vec**: `ExpressionRef`
|
|
1262
|
+
* SIMDShiftInfo#**shift**: `ExpressionRef`
|
|
1263
|
+
>
|
|
1264
|
+
* SIMDLoadInfo#**op**: `Op`
|
|
1265
|
+
* SIMDLoadInfo#**offset**: `number`
|
|
1266
|
+
* SIMDLoadInfo#**align**: `number`
|
|
1267
|
+
* SIMDLoadInfo#**ptr**: `ExpressionRef`
|
|
1268
|
+
>
|
|
1269
|
+
* MemoryInitInfo#**segment**: `string`
|
|
1270
|
+
* MemoryInitInfo#**dest**: `ExpressionRef`
|
|
1271
|
+
* MemoryInitInfo#**offset**: `ExpressionRef`
|
|
1272
|
+
* MemoryInitInfo#**size**: `ExpressionRef`
|
|
1273
|
+
>
|
|
1274
|
+
* MemoryDropInfo#**segment**: `string`
|
|
1275
|
+
>
|
|
1276
|
+
* MemoryCopyInfo#**dest**: `ExpressionRef`
|
|
1277
|
+
* MemoryCopyInfo#**source**: `ExpressionRef`
|
|
1278
|
+
* MemoryCopyInfo#**size**: `ExpressionRef`
|
|
1279
|
+
>
|
|
1280
|
+
* MemoryFillInfo#**dest**: `ExpressionRef`
|
|
1281
|
+
* MemoryFillInfo#**value**: `ExpressionRef`
|
|
1282
|
+
* MemoryFillInfo#**size**: `ExpressionRef`
|
|
1283
|
+
>
|
|
1284
|
+
* RefNullInfo
|
|
1285
|
+
>
|
|
1286
|
+
* RefIsInfo#**op**: `Operations`
|
|
1287
|
+
* RefIsInfo#**value**: `ExpressionRef`
|
|
1288
|
+
>
|
|
1289
|
+
* RefAsInfo#**op**: `Operations`
|
|
1290
|
+
* RefAsInfo#**value**: `ExpressionRef`
|
|
1291
|
+
>
|
|
1292
|
+
* RefFuncInfo#**func**: `string`
|
|
1293
|
+
>
|
|
1294
|
+
* RefEqInfo#**left**: `ExpressionRef`
|
|
1295
|
+
* RefEqInfo#**right**: `ExpressionRef`
|
|
1296
|
+
>
|
|
1297
|
+
* TryInfo#**name**: `string`
|
|
1298
|
+
* TryInfo#**body**: `ExpressionRef`
|
|
1299
|
+
* TryInfo#**catchBodies**: `ExpressionRef[]`
|
|
1300
|
+
* TryInfo#**ccatchBodies**: `ExpressionRef[]`;
|
|
1301
|
+
* TryInfo#**chasCatchAll**: `boolean`;
|
|
1302
|
+
* TryInfo#**cdelegateTarget**: `string`;
|
|
1303
|
+
* TryInfo#**cisDelegate**: `boolean`;
|
|
1304
|
+
>
|
|
1305
|
+
* ThrowInfo#**tag**: `string`
|
|
1306
|
+
* ThrowInfo#**operands**: `ExpressionRef[]`
|
|
1307
|
+
>
|
|
1308
|
+
* RethrowInfo#**target**: `string`
|
|
1309
|
+
>
|
|
1310
|
+
* TupleMakeInfo#**operands**: `ExpressionRef[]`
|
|
1311
|
+
>
|
|
1312
|
+
* TupleExtract#**tuple**: `ExpressionRef`
|
|
1313
|
+
* TupleExtract#**index**: `number`
|
|
1314
|
+
>
|
|
1315
|
+
* RefI31Info#**value**: `ExpressionRef`
|
|
1316
|
+
>
|
|
1317
|
+
* I31GetInfo#**i31**: `ExpressionRef`
|
|
1318
|
+
* I31GetInfo#**isSigned**: `boolean`
|
|
1319
|
+
>
|
|
1320
|
+
* PushInfo#**value**: `ExpressionRef`
|
|
1321
|
+
|
|
1322
|
+
* **emitText**(expression: `ExpressionRef`): `string`<br />
|
|
1323
|
+
Emits the expression in Binaryen's s-expression text format (not official stack-style text format).
|
|
1324
|
+
|
|
1325
|
+
* **copyExpression**(expression: `ExpressionRef`): `ExpressionRef`<br />
|
|
1326
|
+
Creates a deep copy of an expression.
|
|
1327
|
+
|
|
1328
|
+
### Relooper
|
|
1329
|
+
|
|
1330
|
+
* new **Relooper**()<br />
|
|
1331
|
+
Constructs a relooper instance. This lets you provide an arbitrary CFG, and the relooper will structure it for WebAssembly.
|
|
1332
|
+
|
|
1333
|
+
* Relooper#**addBlock**(code: `ExpressionRef`): `RelooperBlockRef`<br />
|
|
1334
|
+
Adds a new block to the CFG, containing the provided code as its body.
|
|
1335
|
+
|
|
1336
|
+
* Relooper#**addBranch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, condition: `ExpressionRef`, code: `ExpressionRef`): `void`<br />
|
|
1337
|
+
Adds a branch from a block to another block, with a condition (or nothing, if this is the default branch to take from the origin - each block must have one such branch), and optional code to execute on the branch (useful for phis).
|
|
1338
|
+
|
|
1339
|
+
* Relooper#**addBlockWithSwitch**(code: `ExpressionRef`, condition: `ExpressionRef`): `RelooperBlockRef`<br />
|
|
1340
|
+
Adds a new block, which ends with a switch/br_table, with provided code and condition (that determines where we go in the switch).
|
|
1341
|
+
|
|
1342
|
+
* Relooper#**addBranchForSwitch**(from: `RelooperBlockRef`, to: `RelooperBlockRef`, indexes: `number[]`, code: `ExpressionRef`): `void`<br />
|
|
1343
|
+
Adds a branch from a block ending in a switch, to another block, using an array of indexes that determine where to go, and optional code to execute on the branch.
|
|
1344
|
+
|
|
1345
|
+
* Relooper#**renderAndDispose**(entry: `RelooperBlockRef`, labelHelper: `number`, module: `Module`): `ExpressionRef`<br />
|
|
1346
|
+
Renders and cleans up the Relooper instance. Call this after you have created all the blocks and branches, giving it the entry block (where control flow begins), a label helper variable (an index of a local we can use, necessary for irreducible control flow), and the module. This returns an expression - normal WebAssembly code - that you can use normally anywhere.
|
|
1347
|
+
|
|
1348
|
+
### Source maps
|
|
1349
|
+
|
|
1350
|
+
* Module#**addDebugInfoFileName**(filename: `string`): `number`<br />
|
|
1351
|
+
Adds a debug info file name to the module and returns its index.
|
|
1352
|
+
|
|
1353
|
+
* Module#**getDebugInfoFileName**(index: `number`): `string | null` <br />
|
|
1354
|
+
Gets the name of the debug info file at the specified index.
|
|
1355
|
+
|
|
1356
|
+
* Module#**setDebugLocation**(func: `FunctionRef`, expr: `ExpressionRef`, fileIndex: `number`, lineNumber: `number`, columnNumber: `number`): `void`<br />
|
|
1357
|
+
Sets the debug location of the specified `ExpressionRef` within the specified `FunctionRef`.
|
|
1358
|
+
|
|
1359
|
+
### Debugging
|
|
1360
|
+
|
|
1361
|
+
* Module#**interpret**(): `void`<br />
|
|
1362
|
+
Runs the module in the interpreter, calling the start function.
|