Bug 1563263: Bump Cranelift to 312516a69da03dc06eace32f61412389a8dcadf3; r=lth

Differential Revision: https://phabricator.services.mozilla.com/D36777

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Benjamin Bouvier 2019-07-04 06:28:01 +00:00
Родитель f05f8c08fd
Коммит 2da5b73fca
31 изменённых файлов: 368 добавлений и 272 удалений

Просмотреть файл

@ -24,7 +24,7 @@ replace-with = "vendored-sources"
[source."https://github.com/CraneStation/Cranelift"]
git = "https://github.com/CraneStation/Cranelift"
rev = "e455f6ae0f3577ceb210c0ce167181c33c133a69"
rev = "312516a69da03dc06eace32f61412389a8dcadf3"
replace-with = "vendored-sources"
[source.vendored-sources]

64
Cargo.lock сгенерированный
Просмотреть файл

@ -197,8 +197,8 @@ name = "baldrdash"
version = "0.1.0"
dependencies = [
"bindgen 0.49.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-wasm 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-codegen 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"cranelift-wasm 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -612,20 +612,20 @@ dependencies = [
[[package]]
name = "cranelift-bforest"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
dependencies = [
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-entity 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
]
[[package]]
name = "cranelift-codegen"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
dependencies = [
"cranelift-bforest 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-codegen-meta 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-bforest 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"cranelift-codegen-meta 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"cranelift-entity 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -634,39 +634,39 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
dependencies = [
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-entity 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
]
[[package]]
name = "cranelift-entity"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
[[package]]
name = "cranelift-frontend"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
dependencies = [
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-codegen 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"target-lexicon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cranelift-wasm"
version = "0.30.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69#e455f6ae0f3577ceb210c0ce167181c33c133a69"
version = "0.32.0"
source = "git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3#312516a69da03dc06eace32f61412389a8dcadf3"
dependencies = [
"cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-entity 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-frontend 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)",
"cranelift-codegen 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"cranelift-entity 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"cranelift-frontend 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)",
"failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmparser 0.31.1 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -3540,7 +3540,7 @@ dependencies = [
[[package]]
name = "wasmparser"
version = "0.31.1"
version = "0.32.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -3887,12 +3887,12 @@ dependencies = [
"checksum core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3f46450d6f2397261af420b4ccce23807add2e45fa206410a03d66fb7f050ae"
"checksum cose 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72fa26cb151d3ae4b70f63d67d0fed57ce04220feafafbae7f503bef7aae590d"
"checksum cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "49726015ab0ca765144fcca61e4a7a543a16b795a777fa53f554da2fffff9a94"
"checksum cranelift-bforest 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-codegen 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-codegen-meta 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-entity 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-frontend 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-wasm 0.30.0 (git+https://github.com/CraneStation/Cranelift?rev=e455f6ae0f3577ceb210c0ce167181c33c133a69)" = "<none>"
"checksum cranelift-bforest 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum cranelift-codegen 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum cranelift-codegen-meta 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum cranelift-entity 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum cranelift-frontend 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum cranelift-wasm 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
"checksum crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd5d02c0aac6bd68393ed69e00bbc2457f3e89075c6349db7189618dc4ddc1d7"
"checksum crossbeam-channel 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8d4f5844607ce8da3fff431e7dba56cda8bfcc570aa50bee36adba8a32b8cad7"
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
@ -4158,7 +4158,7 @@ dependencies = [
"checksum walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "63636bd0eb3d00ccb8b9036381b526efac53caf112b7783b730ab3f8e44da369"
"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3"
"checksum warp 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8f0a120bf7041d4381a5429c4e6d12633bfb874c968a78ec3a3563e9ca6e12d6"
"checksum wasmparser 0.31.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6f324afc05fd8282bbc49dae854a1c20f74aeff10a575b5a43453d1864db97"
"checksum wasmparser 0.32.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22d1801de30f112ddaf665291097694ee33a36d1cb414b53a921d05b3519674a"
"checksum weedle 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26a4c67f132386d965390b8a734d5d10adbcd30eb5cc74bd9229af8b83f10044"
"checksum which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4be6cfa54dab45266e98b5d7be2f8ce959ddd49abd141a05d52dce4b07f803bb"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"

Просмотреть файл

@ -64,8 +64,8 @@ packed_simd = { git = "https://github.com/hsivonen/packed_simd", branch = "rust_
[patch.crates-io.cranelift-codegen]
git = "https://github.com/CraneStation/Cranelift"
rev = "e455f6ae0f3577ceb210c0ce167181c33c133a69"
rev = "312516a69da03dc06eace32f61412389a8dcadf3"
[patch.crates-io.cranelift-wasm]
git = "https://github.com/CraneStation/Cranelift"
rev = "e455f6ae0f3577ceb210c0ce167181c33c133a69"
rev = "312516a69da03dc06eace32f61412389a8dcadf3"

Просмотреть файл

@ -16,8 +16,8 @@ name = "baldrdash"
# dependencies (codegen and wasm).
# - $TOP_LEVEL/.cargo/config.in, look for the revision (rev) field of the
# Cranelift source.
cranelift-codegen = { version = "0.30", default-features = false }
cranelift-wasm = "0.30"
cranelift-codegen = { version = "0.32", default-features = false }
cranelift-wasm = "0.32"
target-lexicon = "0.4.0"
log = { version = "0.4.6", default-features = false, features = ["release_max_level_info"] }
env_logger = "0.5.6"

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"4fb2be5a108736ec2eeb257fd9c90d7e4384321e34eaef0fc7c5517a8e096650","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"af367c67340fa7f6fb9a35b0aa637dcf303957f7ae7427a5f4f6356801c8bb04","src/lib.rs":"1b23abbfe5850a4cd77ae6ae5dcfc2f678ef36b4032fd7496f2b333c51e63301","src/map.rs":"5d891d62814941e19dfc88ff36538efa3da5479f3f97de8219a6f610c9a1ee32","src/node.rs":"e620c64e78488035f11723b14892c7986c06ad37dc5b115a35a453ff1ae66ca3","src/path.rs":"a86ee1c882c173e8af96fd53a416a0fb485dd3f045ac590ef313a9d9ecf90f56","src/pool.rs":"6090f8c0e0da16ebee0e31bca66392d0075b3aff529d30d4e716fa20cd0aef99","src/set.rs":"b411158f813a310c7a6c337d4ada3bf0a021088c443875dc25233415dcbe0633"},"package":null}
{"files":{"Cargo.toml":"1bd727aa095825902dcacc15d67f21693eea560cf57a13eb3de7d458e4ec047f","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"af367c67340fa7f6fb9a35b0aa637dcf303957f7ae7427a5f4f6356801c8bb04","src/lib.rs":"1b23abbfe5850a4cd77ae6ae5dcfc2f678ef36b4032fd7496f2b333c51e63301","src/map.rs":"5d891d62814941e19dfc88ff36538efa3da5479f3f97de8219a6f610c9a1ee32","src/node.rs":"e620c64e78488035f11723b14892c7986c06ad37dc5b115a35a453ff1ae66ca3","src/path.rs":"a86ee1c882c173e8af96fd53a416a0fb485dd3f045ac590ef313a9d9ecf90f56","src/pool.rs":"6090f8c0e0da16ebee0e31bca66392d0075b3aff529d30d4e716fa20cd0aef99","src/set.rs":"b411158f813a310c7a6c337d4ada3bf0a021088c443875dc25233415dcbe0633"},"package":null}

Просмотреть файл

@ -1,7 +1,7 @@
[package]
authors = ["The Cranelift Project Developers"]
name = "cranelift-bforest"
version = "0.30.0"
version = "0.32.0"
description = "A forest of B+-trees"
license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://cranelift.readthedocs.io/"
@ -12,7 +12,7 @@ keywords = ["btree", "forest", "set", "map"]
edition = "2018"
[dependencies]
cranelift-entity = { path = "../cranelift-entity", version = "0.30.0", default-features = false }
cranelift-entity = { path = "../cranelift-entity", version = "0.32.0", default-features = false }
[features]
default = ["std"]

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"253c80832ab598570d604ae8a8108ea9835b8eef8d9b9645408ed025ce3b574a","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"b123f056d0d458396679c5f7f2a16d2762af0258fcda4ac14b6655a95e5a0022","src/cdsl/ast.rs":"170f0526c73e4ebdd22cf25290607b6610e9e3fe0b1d79ee38962085f878d2e4","src/cdsl/cpu_modes.rs":"57c40621115a58faa7af1c729ecaf8cda01c2b143008bde6d8c70885e7c3fd75","src/cdsl/formats.rs":"8eaee84c9c574e7a2ab73b4bf63b97c1cea3ffce0a477f1701e75a7a523ada57","src/cdsl/instructions.rs":"dd734b1ff0750ec09a06e5746338f479ae97eb122dc64dba37b656ab5ae79ebd","src/cdsl/isa.rs":"569bf078c68c800fbd36fde1b52e0371747f6249252655e2dc4715d4e975be40","src/cdsl/mod.rs":"86149f101e1b00a9623028dcd779ad66b6a67f0f67b423c5ac88cd96dabdd227","src/cdsl/operands.rs":"1cda258798d861c4f467783b5c70c1202a57f554861017eead6477af2ee34063","src/cdsl/regs.rs":"049d299c63a757aad7adb7945b3919bd62c9204348a4f8b9727ca84fecbf3115","src/cdsl/settings.rs":"b6b1653b486fb4b86aaab59328a959cf784cb4b61b3216fe7acebe0490849642","src/cdsl/type_inference.rs":"2771631701c150e077c5dcf705c8ae8705944d86ab945ae9e7adc82f3ca5447a","src/cdsl/types.rs":"4cc1f20eb8383fdee6a9e7ca0f7758e563a4fb715056b5edbd4db72f8dfd471b","src/cdsl/typevar.rs":"7249fcd7c3cd3645e8489c73595bd5327bedc499bd7bc87f2a68e241fba329c3","src/cdsl/xform.rs":"005bd2fca7f8b737c605a75a0f44f2d70f0138e67f3013343ced81f639dce8bb","src/constant_hash.rs":"b8acd3f8712a4999819d9d9beced2938d9940a5748ba016c182f1132d97eefab","src/error.rs":"5110a4e3c1e97396ba02d9f5abbb8af4b586f0cc4d33a5c2473f1718cc4bef05","src/gen_inst.rs":"94e71181683f022fdcc55abf487a20be5d4dd51fe3092345b6bc4e2bde04441b","src/gen_legalizer.rs":"368ea72fe2d253f7d4d7548ae449fde875781e43ce0ecb9a604765595e387cc2","src/gen_registers.rs":"a544a2b91fafe08639e39e50bea0892fda89fe2f6eaf111b2d5f3e98e4d07b86","src/gen_settings.rs":"4469bf496f9539835fce3cd9743ac0fbc270b3029b0e6c949f406e790685199c","src/gen_types.rs":"3935da6c6a53f9332e06f74bc3a46270656b4d4231ad28ed2648d7b1d2774e90","src/isa/arm32/mod.rs":"54e88d89644c5cee61cdc8315f1d77b01c232dc322c52f6e244cef9e7688a3ad","src/isa/arm64/mod.rs":"c5169b92c1bcb562649a48b7880033f542c9affa73274d23b3817e4ac83942fe","src/isa/mod.rs":"fce60d19dd3c099ebee3ac5ae64a2bee363f13da9ff5a4960d3c1a0bee71d29a","src/isa/riscv/mod.rs":"2da05e3974ef0b72431c9fdda14314890f72500b94def1d74cdf5e74bd950bc0","src/isa/x86/instructions.rs":"ad88f311fd51f341f7dfe395f98d8805ea55e1c86d1a89272ed999f5ae8dc3f0","src/isa/x86/legalize.rs":"251af731b2514fead08e27e812ca44dc674a41bd4a9637d9d919259497961961","src/isa/x86/mod.rs":"14715e552eedfeae1693a416bb82bda2156b31cd4b306e07530a3c1acdc17125","src/isa/x86/registers.rs":"c0bc60336a8c8b7b4db92dc623e9419a60af14dd6252f0b19e227e46f7166178","src/isa/x86/settings.rs":"1a74b3d1ef5e99e0b7c75528b9fd5afbb3394979615b005b43b72108757a9886","src/lib.rs":"8c9364c6fce73c158abfb7c88ecff01dc608a05c250e89df9bec3082773cde6d","src/shared/entities.rs":"80b8ff57a09c7b2f9dab755abbcc2738317de474776fe1de0d2a581310aa9af8","src/shared/formats.rs":"20908b1048c5e71a185de6b6ded79cdff2c26ddb38ba7b134b7a27f37e8324f3","src/shared/immediates.rs":"804c4c9ffa2fe55d90279ee158aaa6bd6c7f0c604d63d7457a98e82269cec9a7","src/shared/instructions.rs":"85f74df59fb0564613055df2173699e61d9e711fb481015635de47c5286690fd","src/shared/legalize.rs":"e3ed83c004afd088bedad0db6664983bfc15149fb99d7d28dea535b2ff48d761","src/shared/mod.rs":"6e30631fe2ba19d819330ea14d29cce4910b435f030e706be2fc94af23b88d71","src/shared/settings.rs":"42c2c5b6f5fdef090c35760c5920d5013afe4ddc472ee9cc37eb6d8ddaae2906","src/shared/types.rs":"158d73840185e6aa8385463bbf6568efdda0c8de8284cf6b4e565f425ec5d921","src/srcgen.rs":"79fee2f603b33f76f7c9c8b9452c745a363d732c40c0814d84001ff3ef805677","src/unique_table.rs":"90b7203b29241a1ede70f0a3e50d96799e0b41d8f7455170d6ffb127f87f3cc3"},"package":null}
{"files":{"Cargo.toml":"b5dee75ce6c2fc2f678809ee361b2dde077697f0e22b664a937aa1132de9e4c4","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"b123f056d0d458396679c5f7f2a16d2762af0258fcda4ac14b6655a95e5a0022","src/cdsl/ast.rs":"170f0526c73e4ebdd22cf25290607b6610e9e3fe0b1d79ee38962085f878d2e4","src/cdsl/cpu_modes.rs":"57c40621115a58faa7af1c729ecaf8cda01c2b143008bde6d8c70885e7c3fd75","src/cdsl/formats.rs":"8eaee84c9c574e7a2ab73b4bf63b97c1cea3ffce0a477f1701e75a7a523ada57","src/cdsl/instructions.rs":"dd734b1ff0750ec09a06e5746338f479ae97eb122dc64dba37b656ab5ae79ebd","src/cdsl/isa.rs":"569bf078c68c800fbd36fde1b52e0371747f6249252655e2dc4715d4e975be40","src/cdsl/mod.rs":"86149f101e1b00a9623028dcd779ad66b6a67f0f67b423c5ac88cd96dabdd227","src/cdsl/operands.rs":"1cda258798d861c4f467783b5c70c1202a57f554861017eead6477af2ee34063","src/cdsl/regs.rs":"049d299c63a757aad7adb7945b3919bd62c9204348a4f8b9727ca84fecbf3115","src/cdsl/settings.rs":"b6b1653b486fb4b86aaab59328a959cf784cb4b61b3216fe7acebe0490849642","src/cdsl/type_inference.rs":"2771631701c150e077c5dcf705c8ae8705944d86ab945ae9e7adc82f3ca5447a","src/cdsl/types.rs":"4cc1f20eb8383fdee6a9e7ca0f7758e563a4fb715056b5edbd4db72f8dfd471b","src/cdsl/typevar.rs":"7249fcd7c3cd3645e8489c73595bd5327bedc499bd7bc87f2a68e241fba329c3","src/cdsl/xform.rs":"005bd2fca7f8b737c605a75a0f44f2d70f0138e67f3013343ced81f639dce8bb","src/constant_hash.rs":"b8acd3f8712a4999819d9d9beced2938d9940a5748ba016c182f1132d97eefab","src/error.rs":"5110a4e3c1e97396ba02d9f5abbb8af4b586f0cc4d33a5c2473f1718cc4bef05","src/gen_inst.rs":"94e71181683f022fdcc55abf487a20be5d4dd51fe3092345b6bc4e2bde04441b","src/gen_legalizer.rs":"368ea72fe2d253f7d4d7548ae449fde875781e43ce0ecb9a604765595e387cc2","src/gen_registers.rs":"a544a2b91fafe08639e39e50bea0892fda89fe2f6eaf111b2d5f3e98e4d07b86","src/gen_settings.rs":"4469bf496f9539835fce3cd9743ac0fbc270b3029b0e6c949f406e790685199c","src/gen_types.rs":"3935da6c6a53f9332e06f74bc3a46270656b4d4231ad28ed2648d7b1d2774e90","src/isa/arm32/mod.rs":"54e88d89644c5cee61cdc8315f1d77b01c232dc322c52f6e244cef9e7688a3ad","src/isa/arm64/mod.rs":"c5169b92c1bcb562649a48b7880033f542c9affa73274d23b3817e4ac83942fe","src/isa/mod.rs":"fce60d19dd3c099ebee3ac5ae64a2bee363f13da9ff5a4960d3c1a0bee71d29a","src/isa/riscv/mod.rs":"2da05e3974ef0b72431c9fdda14314890f72500b94def1d74cdf5e74bd950bc0","src/isa/x86/instructions.rs":"ad88f311fd51f341f7dfe395f98d8805ea55e1c86d1a89272ed999f5ae8dc3f0","src/isa/x86/legalize.rs":"251af731b2514fead08e27e812ca44dc674a41bd4a9637d9d919259497961961","src/isa/x86/mod.rs":"14715e552eedfeae1693a416bb82bda2156b31cd4b306e07530a3c1acdc17125","src/isa/x86/registers.rs":"c0bc60336a8c8b7b4db92dc623e9419a60af14dd6252f0b19e227e46f7166178","src/isa/x86/settings.rs":"1a74b3d1ef5e99e0b7c75528b9fd5afbb3394979615b005b43b72108757a9886","src/lib.rs":"8c9364c6fce73c158abfb7c88ecff01dc608a05c250e89df9bec3082773cde6d","src/shared/entities.rs":"80b8ff57a09c7b2f9dab755abbcc2738317de474776fe1de0d2a581310aa9af8","src/shared/formats.rs":"20908b1048c5e71a185de6b6ded79cdff2c26ddb38ba7b134b7a27f37e8324f3","src/shared/immediates.rs":"804c4c9ffa2fe55d90279ee158aaa6bd6c7f0c604d63d7457a98e82269cec9a7","src/shared/instructions.rs":"85f74df59fb0564613055df2173699e61d9e711fb481015635de47c5286690fd","src/shared/legalize.rs":"e3ed83c004afd088bedad0db6664983bfc15149fb99d7d28dea535b2ff48d761","src/shared/mod.rs":"6e30631fe2ba19d819330ea14d29cce4910b435f030e706be2fc94af23b88d71","src/shared/settings.rs":"42c2c5b6f5fdef090c35760c5920d5013afe4ddc472ee9cc37eb6d8ddaae2906","src/shared/types.rs":"158d73840185e6aa8385463bbf6568efdda0c8de8284cf6b4e565f425ec5d921","src/srcgen.rs":"79fee2f603b33f76f7c9c8b9452c745a363d732c40c0814d84001ff3ef805677","src/unique_table.rs":"90b7203b29241a1ede70f0a3e50d96799e0b41d8f7455170d6ffb127f87f3cc3"},"package":null}

Просмотреть файл

@ -1,7 +1,7 @@
[package]
name = "cranelift-codegen-meta"
authors = ["The Cranelift Project Developers"]
version = "0.30.0"
version = "0.32.0"
description = "Metaprogram for cranelift-codegen code generator library"
license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/CraneStation/cranelift"
@ -9,7 +9,7 @@ readme = "README.md"
edition = "2018"
[dependencies]
cranelift-entity = { path = "../../cranelift-entity", version = "0.30.0", default-features = false }
cranelift-entity = { path = "../../cranelift-entity", version = "0.32.0", default-features = false }
[badges]
maintenance = { status = "experimental" }

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,7 +1,7 @@
[package]
authors = ["The Cranelift Project Developers"]
name = "cranelift-codegen"
version = "0.30.0"
version = "0.32.0"
description = "Low-level code generator library"
license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://cranelift.readthedocs.io/"
@ -13,8 +13,8 @@ build = "build.rs"
edition = "2018"
[dependencies]
cranelift-entity = { path = "../cranelift-entity", version = "0.30.0", default-features = false }
cranelift-bforest = { path = "../cranelift-bforest", version = "0.30.0", default-features = false }
cranelift-entity = { path = "../cranelift-entity", version = "0.32.0", default-features = false }
cranelift-bforest = { path = "../cranelift-bforest", version = "0.32.0", default-features = false }
failure = { version = "0.1.1", default-features = false, features = ["derive"] }
failure_derive = { version = "0.1.1", default-features = false }
hashmap_core = { version = "0.1.9", optional = true }
@ -26,7 +26,7 @@ log = { version = "0.4.6", default-features = false }
# accomodated in `tests`.
[build-dependencies]
cranelift-codegen-meta = { path = "meta", version = "0.30.0", default-features = false }
cranelift-codegen-meta = { path = "meta", version = "0.32.0", default-features = false }
[features]
default = ["std", "x86", "arm32", "arm64", "riscv"]

Просмотреть файл

@ -267,6 +267,8 @@ struct Verifier<'a> {
expected_cfg: ControlFlowGraph,
expected_domtree: DominatorTree,
isa: Option<&'a dyn TargetIsa>,
// To be removed when #796 is completed.
verify_encodable_as_bb: bool,
}
impl<'a> Verifier<'a> {
@ -278,6 +280,7 @@ impl<'a> Verifier<'a> {
expected_cfg,
expected_domtree,
isa: fisa.isa,
verify_encodable_as_bb: std::env::var("CRANELIFT_BB").is_ok(),
}
}
@ -468,6 +471,53 @@ impl<'a> Verifier<'a> {
Ok(())
}
/// Check that the given EBB can be encoded as a BB, by checking that only
/// branching instructions are ending the EBB.
fn encodable_as_bb(&self, ebb: Ebb, errors: &mut VerifierErrors) -> VerifierStepResult<()> {
// Skip this verification if the environment variable is not set.
if !self.verify_encodable_as_bb {
return Ok(());
};
let dfg = &self.func.dfg;
let inst_iter = self.func.layout.ebb_insts(ebb);
// Skip non-branching instructions.
let mut inst_iter = inst_iter.skip_while(|&inst| !dfg[inst].opcode().is_branch());
let branch = match inst_iter.next() {
// There is no branch in the current EBB.
None => return Ok(()),
Some(br) => br,
};
let after_branch = match inst_iter.next() {
// The branch is also the terminator.
None => return Ok(()),
Some(inst) => inst,
};
let after_branch_opcode = dfg[after_branch].opcode();
if !after_branch_opcode.is_terminator() {
return fatal!(
errors,
branch,
"branch followed by a non-terminator instruction."
);
};
// Allow only one conditional branch and a fallthrough implemented with
// a jump or fallthrough instruction. Any other, which returns or check
// a different condition would have to be moved to a different EBB.
match after_branch_opcode {
Opcode::Fallthrough | Opcode::Jump => Ok(()),
_ => fatal!(
errors,
after_branch,
"terminator instruction not fallthrough or jump"
),
}
}
fn ebb_integrity(
&self,
ebb: Ebb,
@ -1744,6 +1794,7 @@ impl<'a> Verifier<'a> {
self.verify_encoding(inst, errors)?;
self.immediate_constraints(inst, errors)?;
}
self.encodable_as_bb(ebb, errors)?;
}
verify_flags(self.func, &self.expected_cfg, self.isa, errors)?;

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"48e037bea5be27018e3f98bfba7ca7b0af1322c2083c69a137ab3320cd64b9fb","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"96ceffbfd88fb06e3b41aa4d3087cffbbf8441d04eba7ab09662a72ab600a321","src/boxed_slice.rs":"687428ee0442013c0d5962dd78d0964830233bc4cb19aa530d30da0f1dc437a9","src/iter.rs":"4a4d3309fe9aad14fd7702f02459f4277b4ddb50dba700e58dcc75665ffebfb3","src/keys.rs":"b8c2fba26dee15bf3d1880bb2b41e8d66fe1428d242ee6d9fd30ee94bbd0407d","src/lib.rs":"f83cdc6c4a2cd0d75e85c355ee2c8b19b25194c86468c2285bde1f725656062f","src/list.rs":"fc3decc81bcef92e106aae53e586a0ef21d70916fa53a48f7b813c5da44b8dc2","src/map.rs":"f35031459aca446734726c132c0a571482f1ec2ca8221b352d2e18c74950e977","src/packed_option.rs":"9d47f5b8302ee685c096817e376144e363507d1c77ef562d3ae4dbddae568195","src/primary.rs":"e95e4b2ed36413d80c4c0dcfc19dcf8a9f52e34467aaec196c774fd639747028","src/set.rs":"ec0ff7a9ee674c90ff9d06ea1fd4ab05039369146c2d259f476c6f612417933f","src/sparse.rs":"cf345a81d69a5dddaed4778b6aaaf06c70da2c1fd4cd21e366ed6ca5906ffdab"},"package":null}
{"files":{"Cargo.toml":"f215748dacfbc0ef020fe578f893c71d7e7326c8888a3bc1c11687050f351a12","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"96ceffbfd88fb06e3b41aa4d3087cffbbf8441d04eba7ab09662a72ab600a321","src/boxed_slice.rs":"687428ee0442013c0d5962dd78d0964830233bc4cb19aa530d30da0f1dc437a9","src/iter.rs":"4a4d3309fe9aad14fd7702f02459f4277b4ddb50dba700e58dcc75665ffebfb3","src/keys.rs":"b8c2fba26dee15bf3d1880bb2b41e8d66fe1428d242ee6d9fd30ee94bbd0407d","src/lib.rs":"f83cdc6c4a2cd0d75e85c355ee2c8b19b25194c86468c2285bde1f725656062f","src/list.rs":"fc3decc81bcef92e106aae53e586a0ef21d70916fa53a48f7b813c5da44b8dc2","src/map.rs":"f35031459aca446734726c132c0a571482f1ec2ca8221b352d2e18c74950e977","src/packed_option.rs":"9d47f5b8302ee685c096817e376144e363507d1c77ef562d3ae4dbddae568195","src/primary.rs":"e95e4b2ed36413d80c4c0dcfc19dcf8a9f52e34467aaec196c774fd639747028","src/set.rs":"ec0ff7a9ee674c90ff9d06ea1fd4ab05039369146c2d259f476c6f612417933f","src/sparse.rs":"cf345a81d69a5dddaed4778b6aaaf06c70da2c1fd4cd21e366ed6ca5906ffdab"},"package":null}

Просмотреть файл

@ -1,7 +1,7 @@
[package]
authors = ["The Cranelift Project Developers"]
name = "cranelift-entity"
version = "0.30.0"
version = "0.32.0"
description = "Data structures using entity references as mapping keys"
license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://cranelift.readthedocs.io/"

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"c92f07d9959d10331c6b4770a4db12f706927a18897dfed45472abcd6e58190e","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"dea43e8044284df50f8b8772e9b48ba8b109b45c74111ff73619775d57ad8d67","src/frontend.rs":"f2fcd908b6a3c9b4a925702a578c9b2f0c6af6ed53cfc3cd7070b6fa3b7d58cb","src/lib.rs":"1cc2e7aaffa45bccea9e59fcc9d9c5d295a9f7adacd6bd55933834e20e969aef","src/ssa.rs":"88cb07071943f3e72a91c91afb58960689b4d9c56352b3bb7cd5d69288066190","src/switch.rs":"b8f337966b540254feb5f979b4a146f5ef69ae199864da6332c9d7513ff3ec8b","src/variable.rs":"f082efaa4b2d3c5eb48f6344149408074e1e15cb581f7a63f549313c7a1037be"},"package":null}
{"files":{"Cargo.toml":"586eed003b2623981c5a96f9d1bab3421986ac9adc2fecc55b56eb66bbb8d100","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"dea43e8044284df50f8b8772e9b48ba8b109b45c74111ff73619775d57ad8d67","src/frontend.rs":"f2fcd908b6a3c9b4a925702a578c9b2f0c6af6ed53cfc3cd7070b6fa3b7d58cb","src/lib.rs":"1cc2e7aaffa45bccea9e59fcc9d9c5d295a9f7adacd6bd55933834e20e969aef","src/ssa.rs":"88cb07071943f3e72a91c91afb58960689b4d9c56352b3bb7cd5d69288066190","src/switch.rs":"b8f337966b540254feb5f979b4a146f5ef69ae199864da6332c9d7513ff3ec8b","src/variable.rs":"f082efaa4b2d3c5eb48f6344149408074e1e15cb581f7a63f549313c7a1037be"},"package":null}

Просмотреть файл

@ -1,7 +1,7 @@
[package]
authors = ["The Cranelift Project Developers"]
name = "cranelift-frontend"
version = "0.30.0"
version = "0.32.0"
description = "Cranelift IR builder helper"
license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://cranelift.readthedocs.io/"
@ -11,7 +11,7 @@ readme = "README.md"
edition = "2018"
[dependencies]
cranelift-codegen = { path = "../cranelift-codegen", version = "0.30.0", default-features = false }
cranelift-codegen = { path = "../cranelift-codegen", version = "0.32.0", default-features = false }
target-lexicon = { version = "0.4.0", default-features = false }
log = { version = "0.4.6", default-features = false }
hashmap_core = { version = "0.1.9", optional = true }

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"1988715f39ef56d0e40ffcb2ffde965a1753a8ed15375e8a30fccabba16bd701","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"87679cdb53e8cbec3b1aa45afb2124727c1c059f8bd10363d27daf318a9f9a36","src/code_translator.rs":"77040f6e49784aafce63a04057a3464651ed7a817ba055226d40ef5755914989","src/environ/dummy.rs":"ee4d8d4924b4b04027f8af07968d5098ecd72ee62b53622d30334d1a38b227b8","src/environ/mod.rs":"617c147485038dfd797ab0ea71b4cfa9574d95d5d5b1ca362c6b7b6a462cf577","src/environ/spec.rs":"f45b20f6f9e60d94eb13829168ce8f7078ac61282689d43f58e1fccf9815d488","src/func_translator.rs":"07e1ebda4949f744e7d7b5a679bf1951fbefd807a0f0748231353cf1ef536d82","src/lib.rs":"0897b0270e746961db3d4dc74e5f766aced0ef23f870399aa9e685f1ec62ea83","src/module_translator.rs":"2345a4ee009eb59a90898795f939b9c7b241604a44abb27278610257cce84156","src/sections_translator.rs":"8ad698652ec7741feea8c10badfd6891d27d9b5b2b06819b08ec009afa584e81","src/state.rs":"9e4f67900439f6aa18cfa3f16c694487374ddf42530db4504bccab0ebc360c96","src/translation_utils.rs":"cb6b1ab91b4dd4739e5282989c61e6778cd1150319c8c7466b32f6ecc5db7afe","tests/wasm_testsuite.rs":"9b4e008587c61377cf38f9d0e4635418ee38e32a865db8da5dfc6e0fae047436"},"package":null}
{"files":{"Cargo.toml":"24bff87297bfe329c58a4e7f72618bf4409dee48642ea5c210bf8c8cd931d840","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"87679cdb53e8cbec3b1aa45afb2124727c1c059f8bd10363d27daf318a9f9a36","src/code_translator.rs":"64c5828b0b93b789281f0ed79b732d1d521481e8a2a2f220d64a4549144290f8","src/environ/dummy.rs":"ee4d8d4924b4b04027f8af07968d5098ecd72ee62b53622d30334d1a38b227b8","src/environ/mod.rs":"617c147485038dfd797ab0ea71b4cfa9574d95d5d5b1ca362c6b7b6a462cf577","src/environ/spec.rs":"f45b20f6f9e60d94eb13829168ce8f7078ac61282689d43f58e1fccf9815d488","src/func_translator.rs":"07e1ebda4949f744e7d7b5a679bf1951fbefd807a0f0748231353cf1ef536d82","src/lib.rs":"0897b0270e746961db3d4dc74e5f766aced0ef23f870399aa9e685f1ec62ea83","src/module_translator.rs":"2345a4ee009eb59a90898795f939b9c7b241604a44abb27278610257cce84156","src/sections_translator.rs":"a36b68aae6317e1f0ed2a7b2b456add0e465382390fe4f82f13777eeb56eff0f","src/state.rs":"9e4f67900439f6aa18cfa3f16c694487374ddf42530db4504bccab0ebc360c96","src/translation_utils.rs":"801e732c53bb0f1c088d9528d39b42c5773ae530f8ab69b610d2ef840e1ee9c7","tests/wasm_testsuite.rs":"9b4e008587c61377cf38f9d0e4635418ee38e32a865db8da5dfc6e0fae047436"},"package":null}

10
third_party/rust/cranelift-wasm/Cargo.toml поставляемый
Просмотреть файл

@ -1,6 +1,6 @@
[package]
name = "cranelift-wasm"
version = "0.30.0"
version = "0.32.0"
authors = ["The Cranelift Project Developers"]
description = "Translator from WebAssembly to Cranelift IR"
repository = "https://github.com/CraneStation/cranelift"
@ -11,10 +11,10 @@ keywords = ["webassembly", "wasm"]
edition = "2018"
[dependencies]
wasmparser = { version = "0.31.0", default-features = false }
cranelift-codegen = { path = "../cranelift-codegen", version = "0.30.0", default-features = false }
cranelift-entity = { path = "../cranelift-entity", version = "0.30.0", default-features = false }
cranelift-frontend = { path = "../cranelift-frontend", version = "0.30.0", default-features = false }
wasmparser = { version = "0.32.1", default-features = false }
cranelift-codegen = { path = "../cranelift-codegen", version = "0.32.0", default-features = false }
cranelift-entity = { path = "../cranelift-entity", version = "0.32.0", default-features = false }
cranelift-frontend = { path = "../cranelift-frontend", version = "0.32.0", default-features = false }
hashmap_core = { version = "0.1.9", optional = true }
failure = { version = "0.1.1", default-features = false, features = ["derive"] }
failure_derive = { version = "0.1.1", default-features = false }

Просмотреть файл

@ -135,7 +135,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
if let Ok(ty_cre) = blocktype_to_type(ty) {
builder.append_ebb_param(next, ty_cre);
}
state.push_block(next, num_return_values(ty));
state.push_block(next, num_return_values(ty)?);
}
Operator::Loop { ty } => {
let loop_body = builder.create_ebb();
@ -144,7 +144,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
builder.append_ebb_param(next, ty_cre);
}
builder.ins().jump(loop_body, &[]);
state.push_loop(loop_body, next, num_return_values(ty));
state.push_loop(loop_body, next, num_return_values(ty)?);
builder.switch_to_block(loop_body);
environ.translate_loop_header(builder.cursor())?;
}
@ -161,7 +161,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
if let Ok(ty_cre) = blocktype_to_type(ty) {
builder.append_ebb_param(if_not, ty_cre);
}
state.push_if(jump_inst, if_not, num_return_values(ty));
state.push_if(jump_inst, if_not, num_return_values(ty)?);
}
Operator::Else => {
// We take the control frame pushed by the if, use its ebb as the else body
@ -1047,7 +1047,9 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
| Operator::F32x4ConvertSI32x4
| Operator::F32x4ConvertUI32x4
| Operator::F64x2ConvertSI64x2
| Operator::F64x2ConvertUI64x2 => {
| Operator::F64x2ConvertUI64x2
| Operator::V8x16Shuffle1
| Operator::V8x16Shuffle2Imm { .. } => {
return Err(WasmError::Unsupported("proposed SIMD operators"));
}
};

Просмотреть файл

@ -7,10 +7,10 @@
//! The special case of the initialize expressions for table elements offsets or global variables
//! is handled, according to the semantics of WebAssembly, to only specific expressions that are
//! interpreted on the fly.
use crate::environ::{ModuleEnvironment, WasmResult};
use crate::environ::{ModuleEnvironment, WasmError, WasmResult};
use crate::translation_utils::{
type_to_type, FuncIndex, Global, GlobalIndex, GlobalInit, Memory, MemoryIndex, SignatureIndex,
Table, TableElementType, TableIndex,
tabletype_to_type, type_to_type, FuncIndex, Global, GlobalIndex, GlobalInit, Memory,
MemoryIndex, SignatureIndex, Table, TableElementType, TableIndex,
};
use core::convert::TryFrom;
use cranelift_codegen::ir::{self, AbiParam, Signature};
@ -51,7 +51,7 @@ pub fn parse_type_section(
}));
environ.declare_signature(sig);
}
ref s => panic!("unsupported type: {:?}", s),
_ => return Err(WasmError::Unsupported("unsupported type in type section")),
}
}
Ok(())
@ -101,9 +101,9 @@ pub fn parse_import_section<'data>(
ImportSectionEntryType::Table(ref tab) => {
environ.declare_table_import(
Table {
ty: match type_to_type(tab.element_type) {
Ok(t) => TableElementType::Val(t),
Err(()) => TableElementType::Func,
ty: match tabletype_to_type(tab.element_type)? {
Some(t) => TableElementType::Val(t),
None => TableElementType::Func,
},
minimum: tab.limits.initial,
maximum: tab.limits.maximum,
@ -144,9 +144,9 @@ pub fn parse_table_section(
for entry in tables {
let table = entry?;
environ.declare_table(Table {
ty: match type_to_type(table.element_type) {
Ok(t) => TableElementType::Val(t),
Err(()) => TableElementType::Func,
ty: match tabletype_to_type(table.element_type)? {
Some(t) => TableElementType::Val(t),
None => TableElementType::Func,
},
minimum: table.limits.initial,
maximum: table.limits.maximum,

Просмотреть файл

@ -1,4 +1,5 @@
//! Helper functions and structures for the translation.
use crate::environ::{WasmError, WasmResult};
use core::u32;
use cranelift_codegen::entity::entity_impl;
use cranelift_codegen::ir;
@ -109,21 +110,36 @@ pub struct Memory {
}
/// Helper function translating wasmparser types to Cranelift types when possible.
pub fn type_to_type(ty: wasmparser::Type) -> Result<ir::Type, ()> {
pub fn type_to_type(ty: wasmparser::Type) -> WasmResult<ir::Type> {
Ok(match ty {
wasmparser::Type::I32 => ir::types::I32,
wasmparser::Type::I64 => ir::types::I64,
wasmparser::Type::F32 => ir::types::F32,
wasmparser::Type::F64 => ir::types::F64,
_ => return Err(()),
_ => return Err(WasmError::Unsupported("unsupported wasm type")),
})
}
/// Helper function translating wasmparser possible table types to Cranelift types when possible,
/// or None for Func tables.
pub fn tabletype_to_type(ty: wasmparser::Type) -> WasmResult<Option<ir::Type>> {
Ok(match ty {
wasmparser::Type::I32 => Some(ir::types::I32),
wasmparser::Type::I64 => Some(ir::types::I64),
wasmparser::Type::F32 => Some(ir::types::F32),
wasmparser::Type::F64 => Some(ir::types::F64),
wasmparser::Type::AnyFunc => None,
_ => return Err(WasmError::Unsupported("unsupported table wasm type")),
})
}
/// Helper function translating wasmparser block signatures to Cranelift types when possible.
pub fn blocktype_to_type(ty: wasmparser::TypeOrFuncType) -> Result<ir::Type, ()> {
pub fn blocktype_to_type(ty: wasmparser::TypeOrFuncType) -> WasmResult<ir::Type> {
match ty {
wasmparser::TypeOrFuncType::Type(ty) => type_to_type(ty),
wasmparser::TypeOrFuncType::FuncType(_) => unimplemented!("multi-value block signatures"),
wasmparser::TypeOrFuncType::FuncType(_) => {
Err(WasmError::Unsupported("multi-value block signatures"))
}
}
}
@ -138,17 +154,19 @@ pub fn f64_translation(x: wasmparser::Ieee64) -> ir::immediates::Ieee64 {
}
/// Translate a `wasmparser` type into its `Cranelift` equivalent, when possible
pub fn num_return_values(ty: wasmparser::TypeOrFuncType) -> usize {
pub fn num_return_values(ty: wasmparser::TypeOrFuncType) -> WasmResult<usize> {
match ty {
wasmparser::TypeOrFuncType::Type(ty) => match ty {
wasmparser::Type::EmptyBlockType => 0,
wasmparser::Type::EmptyBlockType => Ok(0),
wasmparser::Type::I32
| wasmparser::Type::F32
| wasmparser::Type::I64
| wasmparser::Type::F64 => 1,
_ => panic!("unsupported return value type"),
| wasmparser::Type::F64 => Ok(1),
_ => Err(WasmError::Unsupported("unsupported return value type")),
},
wasmparser::TypeOrFuncType::FuncType(_) => unimplemented!("multi-value block signatures"),
wasmparser::TypeOrFuncType::FuncType(_) => {
Err(WasmError::Unsupported("multi-value block signatures"))
}
}
}

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"83c9345be6b7ac1c67bf7aa61e82fb440c299277dd02817a86e7dac7ba3ac7fa","LICENSE":"a6c48161a09acc75a0e25503bab66a731eb5fba5392ed4bb4743e4ba5085327a","README.md":"13ea373a411dfa7371cd994736289bb000db51957da92315fecbcc9fe7dcab92","benches/benchmark.rs":"25caa5e42e88412fdc443cdf1e870b100c9bf5e2907bbfd75f077757be3090bc","compare-master.sh":"165490eab36ef4eceb2913a6c5cdeff479a05e1e0119a7f4551b03dbcda51ad4","examples/dump.rs":"de2bbdba75e21b9ff92b32697b3d9941f8695b8f7e3a8dee8fc5d7f4c3a0649c","examples/simple.rs":"c79ae542913e72cfcd03711543d173b2e8f62783e6c206459953bdb94dbb8c0c","format-all.sh":"6b02a40629ef3d2c0b9671222582a6217d526317a41262ae06c7a95de53bcbeb","src/binary_reader.rs":"e523ef680480c5a106e0238b1fa4eb77ecaabc2652b65d5dc0f683ee0eed66d7","src/lib.rs":"bc786f619be99366d838c8837416c9008fa15beb873395e8b9ab98579a6b1c18","src/limits.rs":"4e4f9b7ed1d26e7a6727e36b136015cd9f4e38f596b3c8f82236789f45905cae","src/operators_validator.rs":"be295f7529ba863884a10d3236ee3e39c2b4b138ae5a1343b15612a367cd99ca","src/parser.rs":"9b1ab93de63117cfc43900cc99c9912dcd307b347ca982eb4e307331edab4ca2","src/primitives.rs":"9f1417b9dba839c548d9afd94488be7c1d179d243cfeca4f8b10c9805995af62","src/readers/code_section.rs":"2034c399b76428ac993c22f551f3c541b132d8b4ccc74e34f0043e25534d107b","src/readers/data_count_section.rs":"27ef37517b6beac21245008b14b5416b851c52d0af8e2ae85c1456674e1c9a9e","src/readers/data_section.rs":"e7e2a539d2d3049d4a8f68df9ea2f21d97e7061657bbd91845e1df3e9c1f2ebc","src/readers/element_section.rs":"e31e1d819c0b10acf58b8975238554245defe36db1c3206683b056c52978fb21","src/readers/export_section.rs":"7c74f7a11406a95c162f6ad4f77aafd0b1eee309f33b69f06bea12b23925e143","src/readers/function_section.rs":"57c0479ba8d7f61908ed74e86cbc26553fdd6d2d952f032ce29385a39f82efd3","src/readers/global_section.rs":"5fa18bed0fffadcc2dbdcbaedbe4e4398992fd1ce9e611b0319333a7681082ac","src/readers/import_section.rs":"1db4bf7290d04783d5cf526050d025b15a1daaf2bd97fca1a92ecb873d48f641","src/readers/init_expr.rs":"7020c80013dad4518a5f969c3ab4d624b46d778f03e632871cf343964f63441c","src/readers/linking_section.rs":"9df71f3ee5356f0d273c099212213353080001e261ca697caddf6b847fb5af09","src/readers/memory_section.rs":"83212f86cfc40d18fb392e9234c880afdf443f4af38a727ba346f9c740ef8718","src/readers/mod.rs":"13822fff4190b72f6ae14e29635d2c148a38ee972e148eb99a4688b0309bc2c9","src/readers/module.rs":"66473e7077b3d77ed01ed58d2796c8de7afdb2b90f2b0669c06fa90ca1b3434e","src/readers/name_section.rs":"297f57393d5fef745ec265438108aa6eb7ed2762c03c3beb539493612442f3da","src/readers/operators.rs":"da43ee8afcb0c1d6e7f1e19e8a10143101f0c598b1e533a394c7397f43881a82","src/readers/producers_section.rs":"674f402fc4545c94487f827153871b37adab44ed5eff4070a436eb18e514023a","src/readers/reloc_section.rs":"0ef818a8b83a4542c4c29c23642436a92d3e7c37bc0248e817ed5a9d65ec38ce","src/readers/section_reader.rs":"3d2260449fa0455d710ba6d97810372ec36cba70722c10dd236c3a18ca0eb56f","src/readers/sourcemappingurl_section.rs":"ababe84d51e4817ad19f827aa2b5239578e7f202e5ec06dd688b618885138434","src/readers/start_section.rs":"3eeae00e1aa0fcb2e0d93b7b0eaac30a60d3f1431c71c589cd3f73adb363d532","src/readers/table_section.rs":"e564876825a7b31df2b5dc850279b523e26dc50a08da935cc8d635a49e809951","src/readers/type_section.rs":"2fa33a7b793f3bfa01c259b5dbc38633b7343931886ab41f0cb96dd78db3bf6e","src/tests.rs":"927ed18fc70cf340a02b3e2f7f535a062003fcc3d6f66857093c431b88054dd3","src/validator.rs":"592db08da9b2f6a6cd658faac06d737434de98a09fd8bdc125e7a3c7f003d008","test-all.sh":"ff894f4e5e34389ad6ef697bd4ade28a2483dd456eabba8b757945546568f4c9","test-no_std.sh":"f8bc939b378fe618b7ec6297152708e7c8740858eb94e5756464934a38796b8c"},"package":"8a6f324afc05fd8282bbc49dae854a1c20f74aeff10a575b5a43453d1864db97"}
{"files":{"Cargo.toml":"262449f0052477b2921b1eb9ec4356227b1d411ab704733542e1e6103e8474ad","LICENSE":"a6c48161a09acc75a0e25503bab66a731eb5fba5392ed4bb4743e4ba5085327a","README.md":"13ea373a411dfa7371cd994736289bb000db51957da92315fecbcc9fe7dcab92","benches/benchmark.rs":"6220edf25e89eac0073c4a9e75d1e483bbaf0059bd1dbad00100027ae1b360cf","compare-master.sh":"165490eab36ef4eceb2913a6c5cdeff479a05e1e0119a7f4551b03dbcda51ad4","examples/dump.rs":"de2bbdba75e21b9ff92b32697b3d9941f8695b8f7e3a8dee8fc5d7f4c3a0649c","examples/simple.rs":"c79ae542913e72cfcd03711543d173b2e8f62783e6c206459953bdb94dbb8c0c","format-all.sh":"6b02a40629ef3d2c0b9671222582a6217d526317a41262ae06c7a95de53bcbeb","src/binary_reader.rs":"8fcb019ecc10b364fa3cf705db44c76c35c5b0302164ab2cc3791041184934e3","src/lib.rs":"abcb8d4f9a604fbc0997add13a0213bc9abc163ac6c2d4534096a3d620a0bd0f","src/limits.rs":"4e4f9b7ed1d26e7a6727e36b136015cd9f4e38f596b3c8f82236789f45905cae","src/operators_validator.rs":"6b2e74d37b4ce205f3a4e94737cbe7bd818ef98fbbf5b3a3a860b91ca6ff00bb","src/parser.rs":"c5afcf039a62952f4e674773416d4c4507711d10b4248ed3bce5e1223cc97034","src/primitives.rs":"166390d1a8c00f17cd1c9a9bd1589fb3a9012df4f482b6d339d85198b31494f6","src/readers/code_section.rs":"2034c399b76428ac993c22f551f3c541b132d8b4ccc74e34f0043e25534d107b","src/readers/data_count_section.rs":"27ef37517b6beac21245008b14b5416b851c52d0af8e2ae85c1456674e1c9a9e","src/readers/data_section.rs":"e7e2a539d2d3049d4a8f68df9ea2f21d97e7061657bbd91845e1df3e9c1f2ebc","src/readers/element_section.rs":"e31e1d819c0b10acf58b8975238554245defe36db1c3206683b056c52978fb21","src/readers/export_section.rs":"7c74f7a11406a95c162f6ad4f77aafd0b1eee309f33b69f06bea12b23925e143","src/readers/function_section.rs":"57c0479ba8d7f61908ed74e86cbc26553fdd6d2d952f032ce29385a39f82efd3","src/readers/global_section.rs":"5fa18bed0fffadcc2dbdcbaedbe4e4398992fd1ce9e611b0319333a7681082ac","src/readers/import_section.rs":"1db4bf7290d04783d5cf526050d025b15a1daaf2bd97fca1a92ecb873d48f641","src/readers/init_expr.rs":"7020c80013dad4518a5f969c3ab4d624b46d778f03e632871cf343964f63441c","src/readers/linking_section.rs":"9df71f3ee5356f0d273c099212213353080001e261ca697caddf6b847fb5af09","src/readers/memory_section.rs":"83212f86cfc40d18fb392e9234c880afdf443f4af38a727ba346f9c740ef8718","src/readers/mod.rs":"13822fff4190b72f6ae14e29635d2c148a38ee972e148eb99a4688b0309bc2c9","src/readers/module.rs":"3b5e687874fd6211b8e083d7a8589c50dd80377eb85c605b21e505da5f546899","src/readers/name_section.rs":"297f57393d5fef745ec265438108aa6eb7ed2762c03c3beb539493612442f3da","src/readers/operators.rs":"da43ee8afcb0c1d6e7f1e19e8a10143101f0c598b1e533a394c7397f43881a82","src/readers/producers_section.rs":"674f402fc4545c94487f827153871b37adab44ed5eff4070a436eb18e514023a","src/readers/reloc_section.rs":"0ef818a8b83a4542c4c29c23642436a92d3e7c37bc0248e817ed5a9d65ec38ce","src/readers/section_reader.rs":"3d2260449fa0455d710ba6d97810372ec36cba70722c10dd236c3a18ca0eb56f","src/readers/sourcemappingurl_section.rs":"ababe84d51e4817ad19f827aa2b5239578e7f202e5ec06dd688b618885138434","src/readers/start_section.rs":"3eeae00e1aa0fcb2e0d93b7b0eaac30a60d3f1431c71c589cd3f73adb363d532","src/readers/table_section.rs":"e564876825a7b31df2b5dc850279b523e26dc50a08da935cc8d635a49e809951","src/readers/type_section.rs":"2fa33a7b793f3bfa01c259b5dbc38633b7343931886ab41f0cb96dd78db3bf6e","src/tests.rs":"f8aaad098140ed6e50f3273aa39d7dab825bef9ba5e24bbc6e2ec4156348c942","src/validator.rs":"1a85ab9028b937f43ba94cb2a38599179ce3fe79015377515c4307b6a39fc78c","test-all.sh":"ff894f4e5e34389ad6ef697bd4ade28a2483dd456eabba8b757945546568f4c9","test-no_std.sh":"f8bc939b378fe618b7ec6297152708e7c8740858eb94e5756464934a38796b8c"},"package":"22d1801de30f112ddaf665291097694ee33a36d1cb414b53a921d05b3519674a"}

9
third_party/rust/wasmparser/Cargo.toml поставляемый
Просмотреть файл

@ -11,8 +11,9 @@
# will likely look very different (and much more reasonable)
[package]
edition = "2018"
name = "wasmparser"
version = "0.31.1"
version = "0.32.1"
authors = ["Yury Delendik <ydelendik@mozilla.com>"]
exclude = ["fuzz/**/*", "tests/**/*"]
description = "A simple event-driven library for parsing WebAssembly binary files.\n"
@ -23,14 +24,14 @@ repository = "https://github.com/yurydelendik/wasmparser.rs"
[[bench]]
name = "benchmark"
harness = false
[dependencies.hashmap_core]
version = "0.1.10"
[dependencies.hashbrown]
version = "0.5.0"
optional = true
[dev-dependencies.criterion]
version = "0.2"
[features]
core = ["hashmap_core"]
core = ["hashbrown"]
default = ["std"]
std = []
[badges.travis-ci]

Просмотреть файл

@ -11,6 +11,7 @@ const VALIDATOR_CONFIG: Option<ValidatingParserConfig> = Some(ValidatingParserCo
enable_reference_types: true,
enable_simd: true,
enable_bulk_memory: true,
enable_multi_value: true,
},
mutable_global_imports: true,
});

Просмотреть файл

@ -17,15 +17,15 @@ use std::boxed::Box;
use std::str;
use std::vec::Vec;
use limits::{
use crate::limits::{
MAX_WASM_FUNCTION_LOCALS, MAX_WASM_FUNCTION_PARAMS, MAX_WASM_FUNCTION_RETURNS,
MAX_WASM_FUNCTION_SIZE, MAX_WASM_STRING_SIZE,
};
use primitives::{
use crate::primitives::{
BinaryReaderError, BrTable, CustomSectionKind, ExternalKind, FuncType, GlobalType, Ieee32,
Ieee64, LinkingType, MemoryImmediate, MemoryType, NameType, Operator, RelocType,
ResizableLimits, Result, SIMDLineIndex, SectionCode, TableType, Type, TypeOrFuncType, V128,
ResizableLimits, Result, SIMDLaneIndex, SectionCode, TableType, Type, TypeOrFuncType, V128,
};
const MAX_WASM_BR_TABLE_SIZE: usize = MAX_WASM_FUNCTION_SIZE;
@ -814,7 +814,7 @@ impl<'a> BinaryReader<'a> {
} else {
self.position = position;
let idx = self.read_var_s33()?;
if idx < 0 || idx > (::std::u32::MAX as i64) {
if idx < 0 || idx > (core::u32::MAX as i64) {
return Err(BinaryReaderError {
message: "invalid function type",
offset: position,
@ -1218,15 +1218,15 @@ impl<'a> BinaryReader<'a> {
})
}
fn read_line_index(&mut self, max: u32) -> Result<SIMDLineIndex> {
fn read_lane_index(&mut self, max: u32) -> Result<SIMDLaneIndex> {
let index = self.read_u8()?;
if index >= max {
return Err(BinaryReaderError {
message: "line index out of range",
message: "lane index out of range",
offset: self.original_position() - 1,
});
}
Ok(index as SIMDLineIndex)
Ok(index as SIMDLaneIndex)
}
fn read_v128(&mut self) -> Result<V128> {
@ -1248,59 +1248,59 @@ impl<'a> BinaryReader<'a> {
value: self.read_v128()?,
},
0x03 => {
let mut lines = [0 as SIMDLineIndex; 16];
let mut lanes = [0 as SIMDLaneIndex; 16];
for i in 0..16 {
lines[i] = self.read_line_index(32)?
lanes[i] = self.read_lane_index(32)?
}
Operator::V8x16Shuffle { lines }
Operator::V8x16Shuffle { lanes }
}
0x04 => Operator::I8x16Splat,
0x05 => Operator::I8x16ExtractLaneS {
line: self.read_line_index(16)?,
lane: self.read_lane_index(16)?,
},
0x06 => Operator::I8x16ExtractLaneU {
line: self.read_line_index(16)?,
lane: self.read_lane_index(16)?,
},
0x07 => Operator::I8x16ReplaceLane {
line: self.read_line_index(16)?,
lane: self.read_lane_index(16)?,
},
0x08 => Operator::I16x8Splat,
0x09 => Operator::I16x8ExtractLaneS {
line: self.read_line_index(8)?,
lane: self.read_lane_index(8)?,
},
0x0a => Operator::I16x8ExtractLaneU {
line: self.read_line_index(8)?,
lane: self.read_lane_index(8)?,
},
0x0b => Operator::I16x8ReplaceLane {
line: self.read_line_index(8)?,
lane: self.read_lane_index(8)?,
},
0x0c => Operator::I32x4Splat,
0x0d => Operator::I32x4ExtractLane {
line: self.read_line_index(4)?,
lane: self.read_lane_index(4)?,
},
0x0e => Operator::I32x4ReplaceLane {
line: self.read_line_index(4)?,
lane: self.read_lane_index(4)?,
},
0x0f => Operator::I64x2Splat,
0x10 => Operator::I64x2ExtractLane {
line: self.read_line_index(2)?,
lane: self.read_lane_index(2)?,
},
0x11 => Operator::I64x2ReplaceLane {
line: self.read_line_index(2)?,
lane: self.read_lane_index(2)?,
},
0x12 => Operator::F32x4Splat,
0x13 => Operator::F32x4ExtractLane {
line: self.read_line_index(4)?,
lane: self.read_lane_index(4)?,
},
0x14 => Operator::F32x4ReplaceLane {
line: self.read_line_index(4)?,
lane: self.read_lane_index(4)?,
},
0x15 => Operator::F64x2Splat,
0x16 => Operator::F64x2ExtractLane {
line: self.read_line_index(2)?,
lane: self.read_lane_index(2)?,
},
0x17 => Operator::F64x2ReplaceLane {
line: self.read_line_index(2)?,
lane: self.read_lane_index(2)?,
},
0x18 => Operator::I8x16Eq,
0x19 => Operator::I8x16Ne,
@ -1418,6 +1418,14 @@ impl<'a> BinaryReader<'a> {
0xb0 => Operator::F32x4ConvertUI32x4,
0xb1 => Operator::F64x2ConvertSI64x2,
0xb2 => Operator::F64x2ConvertUI64x2,
0xc0 => Operator::V8x16Shuffle1,
0xc1 => {
let mut lanes = [0 as SIMDLaneIndex; 16];
for i in 0..16 {
lanes[i] = self.read_lane_index(32)?
}
Operator::V8x16Shuffle2Imm { lanes }
}
_ => {
return Err(BinaryReaderError {
message: "Unknown 0xfd opcode",

176
third_party/rust/wasmparser/src/lib.rs поставляемый
Просмотреть файл

@ -26,95 +26,100 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(feature = "std"))]
extern crate hashmap_core;
#[macro_use]
extern crate alloc as std;
#[cfg(feature = "std")]
#[macro_use]
extern crate std;
#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;
use hashbrown::HashSet;
#[cfg(feature = "std")]
use std::collections::HashSet;
pub use binary_reader::BinaryReader;
pub use binary_reader::Range;
use binary_reader::SectionHeader;
pub use crate::binary_reader::BinaryReader;
pub use crate::binary_reader::Range;
use crate::binary_reader::SectionHeader;
pub use parser::LocalName;
pub use parser::NameEntry;
pub use parser::Parser;
pub use parser::ParserInput;
pub use parser::ParserState;
pub use parser::RelocEntry;
pub use parser::WasmDecoder;
pub use crate::parser::LocalName;
pub use crate::parser::NameEntry;
pub use crate::parser::Parser;
pub use crate::parser::ParserInput;
pub use crate::parser::ParserState;
pub use crate::parser::RelocEntry;
pub use crate::parser::WasmDecoder;
pub use primitives::BinaryReaderError;
pub use primitives::BrTable;
pub use primitives::CustomSectionKind;
pub use primitives::ExternalKind;
pub use primitives::FuncType;
pub use primitives::GlobalType;
pub use primitives::Ieee32;
pub use primitives::Ieee64;
pub use primitives::ImportSectionEntryType;
pub use primitives::LinkingType;
pub use primitives::MemoryImmediate;
pub use primitives::MemoryType;
pub use primitives::NameType;
pub use primitives::Naming;
pub use primitives::Operator;
pub use primitives::RelocType;
pub use primitives::ResizableLimits;
pub use primitives::Result;
pub use primitives::SectionCode;
pub use primitives::TableType;
pub use primitives::Type;
pub use primitives::TypeOrFuncType;
pub use primitives::V128;
pub use crate::primitives::BinaryReaderError;
pub use crate::primitives::BrTable;
pub use crate::primitives::CustomSectionKind;
pub use crate::primitives::ExternalKind;
pub use crate::primitives::FuncType;
pub use crate::primitives::GlobalType;
pub use crate::primitives::Ieee32;
pub use crate::primitives::Ieee64;
pub use crate::primitives::ImportSectionEntryType;
pub use crate::primitives::LinkingType;
pub use crate::primitives::MemoryImmediate;
pub use crate::primitives::MemoryType;
pub use crate::primitives::NameType;
pub use crate::primitives::Naming;
pub use crate::primitives::Operator;
pub use crate::primitives::RelocType;
pub use crate::primitives::ResizableLimits;
pub use crate::primitives::Result;
pub use crate::primitives::SectionCode;
pub use crate::primitives::TableType;
pub use crate::primitives::Type;
pub use crate::primitives::TypeOrFuncType;
pub use crate::primitives::V128;
pub use validator::validate;
pub use validator::validate_function_body;
pub use validator::ValidatingOperatorParser;
pub use validator::ValidatingParser;
pub use validator::ValidatingParserConfig;
pub use crate::validator::validate;
pub use crate::validator::validate_function_body;
pub use crate::validator::ValidatingOperatorParser;
pub use crate::validator::ValidatingParser;
pub use crate::validator::ValidatingParserConfig;
pub use operators_validator::OperatorValidatorConfig;
pub use operators_validator::WasmModuleResources;
pub use crate::operators_validator::OperatorValidatorConfig;
pub use crate::operators_validator::WasmModuleResources;
pub use readers::CodeSectionReader;
pub use readers::Data;
pub use readers::DataKind;
pub use readers::DataSectionReader;
pub use readers::Element;
pub use readers::ElementItems;
pub use readers::ElementItemsReader;
pub use readers::ElementKind;
pub use readers::ElementSectionReader;
pub use readers::Export;
pub use readers::ExportSectionReader;
pub use readers::FunctionBody;
pub use readers::FunctionSectionReader;
pub use readers::Global;
pub use readers::GlobalSectionReader;
pub use readers::Import;
pub use readers::ImportSectionReader;
pub use readers::InitExpr;
pub use readers::LinkingSectionReader;
pub use readers::LocalsReader;
pub use readers::MemorySectionReader;
pub use readers::ModuleReader;
pub use readers::Name;
pub use readers::NameSectionReader;
pub use readers::NamingReader;
pub use readers::OperatorsReader;
pub use readers::ProducersField;
pub use readers::ProducersFieldValue;
pub use readers::ProducersSectionReader;
pub use readers::Reloc;
pub use readers::RelocSectionReader;
pub use readers::Section;
pub use readers::SectionIterator;
pub use readers::SectionIteratorLimited;
pub use readers::SectionReader;
pub use readers::SectionWithLimitedItems;
pub use readers::TableSectionReader;
pub use readers::TypeSectionReader;
pub use crate::readers::CodeSectionReader;
pub use crate::readers::Data;
pub use crate::readers::DataKind;
pub use crate::readers::DataSectionReader;
pub use crate::readers::Element;
pub use crate::readers::ElementItems;
pub use crate::readers::ElementItemsReader;
pub use crate::readers::ElementKind;
pub use crate::readers::ElementSectionReader;
pub use crate::readers::Export;
pub use crate::readers::ExportSectionReader;
pub use crate::readers::FunctionBody;
pub use crate::readers::FunctionSectionReader;
pub use crate::readers::Global;
pub use crate::readers::GlobalSectionReader;
pub use crate::readers::Import;
pub use crate::readers::ImportSectionReader;
pub use crate::readers::InitExpr;
pub use crate::readers::LinkingSectionReader;
pub use crate::readers::LocalsReader;
pub use crate::readers::MemorySectionReader;
pub use crate::readers::ModuleReader;
pub use crate::readers::Name;
pub use crate::readers::NameSectionReader;
pub use crate::readers::NamingReader;
pub use crate::readers::OperatorsReader;
pub use crate::readers::ProducersField;
pub use crate::readers::ProducersFieldValue;
pub use crate::readers::ProducersSectionReader;
pub use crate::readers::Reloc;
pub use crate::readers::RelocSectionReader;
pub use crate::readers::Section;
pub use crate::readers::SectionIterator;
pub use crate::readers::SectionIteratorLimited;
pub use crate::readers::SectionReader;
pub use crate::readers::SectionWithLimitedItems;
pub use crate::readers::TableSectionReader;
pub use crate::readers::TypeSectionReader;
mod binary_reader;
mod limits;
@ -124,12 +129,3 @@ mod primitives;
mod readers;
mod tests;
mod validator;
#[cfg(not(feature = "std"))]
mod std {
pub use alloc::{boxed, string, vec};
pub use core::*;
pub mod collections {
pub use hashmap_core::HashSet;
}
}

Просмотреть файл

@ -13,13 +13,13 @@
* limitations under the License.
*/
use std::cmp::min;
use std::result;
use core::cmp::min;
use core::result;
use std::str;
use std::vec::Vec;
use primitives::{
FuncType, GlobalType, MemoryImmediate, MemoryType, Operator, SIMDLineIndex, TableType, Type,
use crate::primitives::{
FuncType, GlobalType, MemoryImmediate, MemoryType, Operator, SIMDLaneIndex, TableType, Type,
TypeOrFuncType,
};
@ -455,7 +455,7 @@ impl OperatorValidator {
resources: &dyn WasmModuleResources,
) -> OperatorValidatorResult<()> {
if memory_index as usize >= resources.memories().len() {
return Err("no liner memories are present");
return Err("no linear memories are present");
}
Ok(())
}
@ -466,7 +466,7 @@ impl OperatorValidator {
resources: &dyn WasmModuleResources,
) -> OperatorValidatorResult<()> {
if memory_index as usize >= resources.memories().len() {
return Err("no liner memories are present");
return Err("no linear memories are present");
}
if !resources.memories()[memory_index as usize].shared {
return Err("atomic accesses require shared memory");
@ -525,7 +525,7 @@ impl OperatorValidator {
Ok(())
}
fn check_simd_line_index(&self, index: SIMDLineIndex, max: u8) -> OperatorValidatorResult<()> {
fn check_simd_lane_index(&self, index: SIMDLaneIndex, max: u8) -> OperatorValidatorResult<()> {
if index >= max {
return Err("SIMD index out of bounds");
}
@ -1250,11 +1250,11 @@ impl OperatorValidator {
self.check_simd_enabled()?;
self.func_state.change_frame_with_type(0, Type::V128)?;
}
Operator::V8x16Shuffle { ref lines } => {
Operator::V8x16Shuffle { ref lanes } => {
self.check_simd_enabled()?;
self.check_operands_2(Type::V128, Type::V128)?;
for i in lines {
self.check_simd_line_index(*i, 32)?;
for i in lanes {
self.check_simd_lane_index(*i, 32)?;
}
self.func_state.change_frame_with_type(2, Type::V128)?;
}
@ -1278,75 +1278,75 @@ impl OperatorValidator {
self.check_operands_1(Type::F64)?;
self.func_state.change_frame_with_type(1, Type::V128)?;
}
Operator::I8x16ExtractLaneS { line } | Operator::I8x16ExtractLaneU { line } => {
Operator::I8x16ExtractLaneS { lane } | Operator::I8x16ExtractLaneU { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 16)?;
self.check_simd_lane_index(lane, 16)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::I32)?;
}
Operator::I16x8ExtractLaneS { line } | Operator::I16x8ExtractLaneU { line } => {
Operator::I16x8ExtractLaneS { lane } | Operator::I16x8ExtractLaneU { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 8)?;
self.check_simd_lane_index(lane, 8)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::I32)?;
}
Operator::I32x4ExtractLane { line } => {
Operator::I32x4ExtractLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 4)?;
self.check_simd_lane_index(lane, 4)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::I32)?;
}
Operator::I8x16ReplaceLane { line } => {
Operator::I8x16ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 16)?;
self.check_simd_lane_index(lane, 16)?;
self.check_operands_2(Type::V128, Type::I32)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::I16x8ReplaceLane { line } => {
Operator::I16x8ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 8)?;
self.check_simd_lane_index(lane, 8)?;
self.check_operands_2(Type::V128, Type::I32)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::I32x4ReplaceLane { line } => {
Operator::I32x4ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 4)?;
self.check_simd_lane_index(lane, 4)?;
self.check_operands_2(Type::V128, Type::I32)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::I64x2ExtractLane { line } => {
Operator::I64x2ExtractLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 2)?;
self.check_simd_lane_index(lane, 2)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::I64)?;
}
Operator::I64x2ReplaceLane { line } => {
Operator::I64x2ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 2)?;
self.check_simd_lane_index(lane, 2)?;
self.check_operands_2(Type::V128, Type::I64)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::F32x4ExtractLane { line } => {
Operator::F32x4ExtractLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 4)?;
self.check_simd_lane_index(lane, 4)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::F32)?;
}
Operator::F32x4ReplaceLane { line } => {
Operator::F32x4ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 4)?;
self.check_simd_lane_index(lane, 4)?;
self.check_operands_2(Type::V128, Type::F32)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::F64x2ExtractLane { line } => {
Operator::F64x2ExtractLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 2)?;
self.check_simd_lane_index(lane, 2)?;
self.check_operands_1(Type::V128)?;
self.func_state.change_frame_with_type(1, Type::F64)?;
}
Operator::F64x2ReplaceLane { line } => {
Operator::F64x2ReplaceLane { lane } => {
self.check_simd_enabled()?;
self.check_simd_line_index(line, 2)?;
self.check_simd_lane_index(lane, 2)?;
self.check_operands_2(Type::V128, Type::F64)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
@ -1456,7 +1456,7 @@ impl OperatorValidator {
Operator::V128Bitselect => {
self.check_simd_enabled()?;
self.check_operands(&[Type::V128, Type::V128, Type::V128])?;
self.func_state.change_frame_with_type(2, Type::V128)?;
self.func_state.change_frame_with_type(3, Type::V128)?;
}
Operator::I8x16AnyTrue
| Operator::I8x16AllTrue
@ -1484,7 +1484,20 @@ impl OperatorValidator {
| Operator::I64x2ShrU => {
self.check_simd_enabled()?;
self.check_operands_2(Type::V128, Type::I32)?;
self.func_state.change_frame_with_type(1, Type::V128)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::V8x16Shuffle1 => {
self.check_simd_enabled()?;
self.check_operands_2(Type::V128, Type::V128)?;
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::V8x16Shuffle2Imm { ref lanes } => {
self.check_simd_enabled()?;
self.check_operands_2(Type::V128, Type::V128)?;
for i in lanes {
self.check_simd_lane_index(*i, 32)?;
}
self.func_state.change_frame_with_type(2, Type::V128)?;
}
Operator::MemoryInit { segment } => {

8
third_party/rust/wasmparser/src/parser.rs поставляемый
Просмотреть файл

@ -17,17 +17,17 @@
use std::boxed::Box;
use std::vec::Vec;
use limits::{
use crate::limits::{
MAX_WASM_FUNCTIONS, MAX_WASM_FUNCTION_LOCALS, MAX_WASM_STRING_SIZE, MAX_WASM_TABLE_ENTRIES,
};
use primitives::{
use crate::primitives::{
BinaryReaderError, CustomSectionKind, ExternalKind, FuncType, GlobalType,
ImportSectionEntryType, LinkingType, MemoryType, Naming, Operator, RelocType, Result,
SectionCode, TableType, Type,
};
use readers::{
use crate::readers::{
CodeSectionReader, Data, DataKind, DataSectionReader, Element, ElementItems, ElementKind,
ElementSectionReader, Export, ExportSectionReader, FunctionBody, FunctionSectionReader, Global,
GlobalSectionReader, Import, ImportSectionReader, LinkingSectionReader, MemorySectionReader,
@ -35,7 +35,7 @@ use readers::{
RelocSectionReader, Section, SectionReader, TableSectionReader, TypeSectionReader,
};
use binary_reader::{BinaryReader, Range};
use crate::binary_reader::{BinaryReader, Range};
const MAX_DATA_CHUNK_SIZE: usize = MAX_WASM_STRING_SIZE;

36
third_party/rust/wasmparser/src/primitives.rs поставляемый
Просмотреть файл

@ -13,9 +13,9 @@
* limitations under the License.
*/
use core::result;
use std::boxed::Box;
use std::fmt;
use std::result;
#[cfg(feature = "std")]
use std::error::Error;
@ -227,7 +227,7 @@ impl V128 {
}
}
pub type SIMDLineIndex = u8;
pub type SIMDLaneIndex = u8;
/// Instructions as defined [here].
///
@ -513,27 +513,27 @@ pub enum Operator<'a> {
V128Load { memarg: MemoryImmediate },
V128Store { memarg: MemoryImmediate },
V128Const { value: V128 },
V8x16Shuffle { lines: [SIMDLineIndex; 16] },
V8x16Shuffle { lanes: [SIMDLaneIndex; 16] },
I8x16Splat,
I8x16ExtractLaneS { line: SIMDLineIndex },
I8x16ExtractLaneU { line: SIMDLineIndex },
I8x16ReplaceLane { line: SIMDLineIndex },
I8x16ExtractLaneS { lane: SIMDLaneIndex },
I8x16ExtractLaneU { lane: SIMDLaneIndex },
I8x16ReplaceLane { lane: SIMDLaneIndex },
I16x8Splat,
I16x8ExtractLaneS { line: SIMDLineIndex },
I16x8ExtractLaneU { line: SIMDLineIndex },
I16x8ReplaceLane { line: SIMDLineIndex },
I16x8ExtractLaneS { lane: SIMDLaneIndex },
I16x8ExtractLaneU { lane: SIMDLaneIndex },
I16x8ReplaceLane { lane: SIMDLaneIndex },
I32x4Splat,
I32x4ExtractLane { line: SIMDLineIndex },
I32x4ReplaceLane { line: SIMDLineIndex },
I32x4ExtractLane { lane: SIMDLaneIndex },
I32x4ReplaceLane { lane: SIMDLaneIndex },
I64x2Splat,
I64x2ExtractLane { line: SIMDLineIndex },
I64x2ReplaceLane { line: SIMDLineIndex },
I64x2ExtractLane { lane: SIMDLaneIndex },
I64x2ReplaceLane { lane: SIMDLaneIndex },
F32x4Splat,
F32x4ExtractLane { line: SIMDLineIndex },
F32x4ReplaceLane { line: SIMDLineIndex },
F32x4ExtractLane { lane: SIMDLaneIndex },
F32x4ReplaceLane { lane: SIMDLaneIndex },
F64x2Splat,
F64x2ExtractLane { line: SIMDLineIndex },
F64x2ReplaceLane { line: SIMDLineIndex },
F64x2ExtractLane { lane: SIMDLaneIndex },
F64x2ReplaceLane { lane: SIMDLaneIndex },
I8x16Eq,
I8x16Ne,
I8x16LtS,
@ -650,4 +650,6 @@ pub enum Operator<'a> {
F32x4ConvertUI32x4,
F64x2ConvertSI64x2,
F64x2ConvertUI64x2,
V8x16Shuffle1,
V8x16Shuffle2Imm { lanes: [SIMDLaneIndex; 16] },
}

Просмотреть файл

@ -13,7 +13,7 @@
* limitations under the License.
*/
use std::iter::{IntoIterator, Iterator};
use core::iter::{IntoIterator, Iterator};
use super::{
BinaryReader, BinaryReaderError, CustomSectionKind, Range, Result, SectionCode, SectionHeader,

8
third_party/rust/wasmparser/src/tests.rs поставляемый
Просмотреть файл

@ -16,13 +16,13 @@
#[cfg(feature = "std")]
#[cfg(test)]
mod simple_tests {
use operators_validator::OperatorValidatorConfig;
use parser::{Parser, ParserInput, ParserState, WasmDecoder};
use primitives::{Operator, SectionCode};
use crate::operators_validator::OperatorValidatorConfig;
use crate::parser::{Parser, ParserInput, ParserState, WasmDecoder};
use crate::primitives::{Operator, SectionCode};
use crate::validator::{ValidatingParser, ValidatingParserConfig};
use std::fs::{read_dir, File};
use std::io::prelude::*;
use std::path::PathBuf;
use validator::{ValidatingParser, ValidatingParserConfig};
const VALIDATOR_CONFIG: Option<ValidatingParserConfig> = Some(ValidatingParserConfig {
operator_config: OperatorValidatorConfig {

22
third_party/rust/wasmparser/src/validator.rs поставляемый
Просмотреть файл

@ -13,32 +13,32 @@
* limitations under the License.
*/
use std::collections::HashSet;
use std::result;
use super::HashSet;
use core::result;
use std::str;
use std::string::String;
use std::vec::Vec;
use limits::{
use crate::limits::{
MAX_WASM_FUNCTIONS, MAX_WASM_FUNCTION_LOCALS, MAX_WASM_GLOBALS, MAX_WASM_MEMORIES,
MAX_WASM_MEMORY_PAGES, MAX_WASM_TABLES, MAX_WASM_TYPES,
};
use binary_reader::BinaryReader;
use crate::binary_reader::BinaryReader;
use primitives::{
use crate::primitives::{
BinaryReaderError, ExternalKind, FuncType, GlobalType, ImportSectionEntryType, MemoryType,
Operator, ResizableLimits, Result, SectionCode, TableType, Type,
};
use parser::{Parser, ParserInput, ParserState, WasmDecoder};
use crate::parser::{Parser, ParserInput, ParserState, WasmDecoder};
use operators_validator::{
use crate::operators_validator::{
FunctionEnd, OperatorValidator, OperatorValidatorConfig, WasmModuleResources,
DEFAULT_OPERATOR_VALIDATOR_CONFIG,
};
use readers::FunctionBody;
use crate::readers::FunctionBody;
type ValidatorResult<'a, T> = result::Result<T, ParserState<'a>>;
@ -222,7 +222,11 @@ impl<'a> ValidatingParser<'a> {
if let Type::Func = func_type.form {
self.check_value_types(&*func_type.params)?;
self.check_value_types(&*func_type.returns)?;
Ok(())
if !self.config.operator_config.enable_multi_value && func_type.returns.len() > 1 {
self.create_error("func type returns multiple values")
} else {
Ok(())
}
} else {
self.create_error("type signature is not a func")
}