From b1701acf4c1763bf2cd3e7a5dcdc29e59941e57a Mon Sep 17 00:00:00 2001 From: jubianchi Date: Wed, 31 Mar 2021 21:49:08 +0200 Subject: [PATCH 1/4] chore: Update Cranelift to the latest version --- Cargo.lock | 27 ++-- fuzz/Cargo.lock | 24 ++-- lib/compiler-cranelift/Cargo.toml | 8 +- lib/deprecated/runtime-core/Cargo.lock | 165 +++++++++++++++---------- lib/deprecated/runtime/Cargo.lock | 165 +++++++++++++++---------- 5 files changed, 225 insertions(+), 164 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3814fe55e37..c876379d4be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -377,18 +377,18 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cranelift-bforest" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f782ffb172d8095cbb4c6464d85432c3bcfa8609b0bb1dc27cfd35bd90e052" +checksum = "841476ab6d3530136b5162b64a2c6969d68141843ad2fd59126e5ea84fd9b5fe" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e0910022b490bd0a65d5baa1693b0475cdbeea1c26472343f2acea1f1f55b8" +checksum = "2b5619cef8d19530298301f91e9a0390d369260799a3d8dd01e28fc88e53637a" dependencies = [ "byteorder", "cranelift-bforest", @@ -407,9 +407,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cafe95cb5ac659e113549b2794a2c8d3a14f36e1a98728a6e0ea7a773be2129" +checksum = "2a319709b8267939155924114ea83f2a5b5af65ece3ac6f703d4735f3c66bb0d" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -417,24 +417,27 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d1bd002e42cc094a131a8227d06d48df28ea3b9127e5e3bc3010e079858e9af" +checksum = "15925b23cd3a448443f289d85a8f53f3cf7a80f0137aa53c8e3b01ae8aefaef7" +dependencies = [ + "serde", +] [[package]] name = "cranelift-entity" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55e9043403f0dec775f317280015150e78b2352fb947d2f37407fd4ce6311c7" +checksum = "610cf464396c89af0f9f7c64b5aa90aa9e8812ac84084098f1565b40051bc415" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0153680ebce89aac7cad90a5442bb136faacfc86ea62587a01b8e8e79f8249c9" +checksum = "4d20c8bd4a1c41ded051734f0e33ad1d843a0adc98b9bd975ee6657e2c70cdc9" dependencies = [ "cranelift-codegen", "hashbrown", diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index da12f7c70d3..e6c62f230af 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -103,18 +103,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cranelift-bforest" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f782ffb172d8095cbb4c6464d85432c3bcfa8609b0bb1dc27cfd35bd90e052" +checksum = "841476ab6d3530136b5162b64a2c6969d68141843ad2fd59126e5ea84fd9b5fe" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e0910022b490bd0a65d5baa1693b0475cdbeea1c26472343f2acea1f1f55b8" +checksum = "2b5619cef8d19530298301f91e9a0390d369260799a3d8dd01e28fc88e53637a" dependencies = [ "byteorder", "cranelift-bforest", @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cafe95cb5ac659e113549b2794a2c8d3a14f36e1a98728a6e0ea7a773be2129" +checksum = "2a319709b8267939155924114ea83f2a5b5af65ece3ac6f703d4735f3c66bb0d" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -141,24 +141,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d1bd002e42cc094a131a8227d06d48df28ea3b9127e5e3bc3010e079858e9af" +checksum = "15925b23cd3a448443f289d85a8f53f3cf7a80f0137aa53c8e3b01ae8aefaef7" [[package]] name = "cranelift-entity" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55e9043403f0dec775f317280015150e78b2352fb947d2f37407fd4ce6311c7" +checksum = "610cf464396c89af0f9f7c64b5aa90aa9e8812ac84084098f1565b40051bc415" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.70.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0153680ebce89aac7cad90a5442bb136faacfc86ea62587a01b8e8e79f8249c9" +checksum = "4d20c8bd4a1c41ded051734f0e33ad1d843a0adc98b9bd975ee6657e2c70cdc9" dependencies = [ "cranelift-codegen", "log", diff --git a/lib/compiler-cranelift/Cargo.toml b/lib/compiler-cranelift/Cargo.toml index d6c45996984..d2fcaa59dcb 100644 --- a/lib/compiler-cranelift/Cargo.toml +++ b/lib/compiler-cranelift/Cargo.toml @@ -15,9 +15,9 @@ edition = "2018" wasmer-compiler = { path = "../compiler", version = "1.0.2", features = ["translator"], default-features = false } wasmer-vm = { path = "../vm", version = "1.0.2" } wasmer-types = { path = "../types", version = "1.0.2", default-features = false, features = ["std"] } -cranelift-entity = { version = "0.70", default-features = false } -cranelift-codegen = { version = "0.70", default-features = false, features = ["x86", "arm64"] } -cranelift-frontend = { version = "0.70", default-features = false } +cranelift-entity = { version = "0.72", default-features = false } +cranelift-codegen = { version = "0.72", default-features = false, features = ["x86", "arm64"] } +cranelift-frontend = { version = "0.72", default-features = false } tracing = "0.1" hashbrown = { version = "0.9", optional = true } rayon = "1.5" @@ -29,7 +29,7 @@ loupe = "0.1" [dev-dependencies] target-lexicon = { version = "0.11", default-features = false } -cranelift-codegen = { version = "0.70", features = ["enable-serde", "all-arch"] } +cranelift-codegen = { version = "0.72", features = ["enable-serde", "all-arch"] } lazy_static = "1.4" [badges] diff --git a/lib/deprecated/runtime-core/Cargo.lock b/lib/deprecated/runtime-core/Cargo.lock index ea1fad1c428..e7ce3216fe4 100644 --- a/lib/deprecated/runtime-core/Cargo.lock +++ b/lib/deprecated/runtime-core/Cargo.lock @@ -6,7 +6,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ - "gimli", + "gimli 0.22.0", ] [[package]] @@ -134,25 +134,25 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cranelift-bforest" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9221545c0507dc08a62b2d8b5ffe8e17ac580b0a74d1813b496b8d70b070fbd0" +checksum = "841476ab6d3530136b5162b64a2c6969d68141843ad2fd59126e5ea84fd9b5fe" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9936ea608b6cd176f107037f6adbb4deac933466fc7231154f96598b2d3ab1" +checksum = "2b5619cef8d19530298301f91e9a0390d369260799a3d8dd01e28fc88e53637a" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli", + "gimli 0.23.0", "log", "regalloc", "smallvec", @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef2b2768568306540f4c8db3acce9105534d34c4a1e440529c1e702d7f8c8d7" +checksum = "2a319709b8267939155924114ea83f2a5b5af65ece3ac6f703d4735f3c66bb0d" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -172,24 +172,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759012d6d19c4caec95793f052613e9d4113e925e7f14154defbac0f1d4c938" +checksum = "15925b23cd3a448443f289d85a8f53f3cf7a80f0137aa53c8e3b01ae8aefaef7" [[package]] name = "cranelift-entity" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86badbce14e15f52a45b666b38abe47b204969dd7f8fb7488cb55dd46b361fa6" +checksum = "610cf464396c89af0f9f7c64b5aa90aa9e8812ac84084098f1565b40051bc415" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" +checksum = "4d20c8bd4a1c41ded051734f0e33ad1d843a0adc98b9bd975ee6657e2c70cdc9" dependencies = [ "cranelift-codegen", "log", @@ -398,6 +398,12 @@ name = "gimli" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" + +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", @@ -406,9 +412,9 @@ dependencies = [ [[package]] name = "goblin" -version = "0.2.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884" +checksum = "669cdc3826f69a51d3f8fc3f86de81c2378110254f678b8407977736122057a4" dependencies = [ "log", "plain", @@ -417,12 +423,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" -dependencies = [ - "autocfg", -] +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "hermit-abi" @@ -447,9 +450,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.5.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", "hashbrown", @@ -458,9 +461,9 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.1.0-llvm10sample" +version = "0.1.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e079c12273d96e41481454a37ad968e607e1ce51b39b9facd3a802a12df6e9dc" +checksum = "f5fe0be1e47c0c0f3da4397693e08f5d78329ae095c25d529e12ade78420fb41" dependencies = [ "either", "inkwell_internals", @@ -473,9 +476,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22cf4eda09069b48204cce4b7cd9a25311da813780e95a038524f2210fab44e" +checksum = "c2e1f71330ccec54ee62533ae88574c4169b67fb4b95cbb1196a1322582abd11" dependencies = [ "proc-macro2", "quote", @@ -493,9 +496,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" dependencies = [ "either", ] @@ -520,24 +523,25 @@ checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" [[package]] name = "libloading" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ + "cfg-if 1.0.0", "winapi", ] [[package]] name = "llvm-sys" -version = "100.1.0" +version = "110.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5545bf9a09267c644e4d0ac68f37ac200af6579ae2e82aebce382654eb4abab1" +checksum = "21ede189444b8c78907e5d36da5dabcf153170fcff9c1dba48afc4b33c7e19f0" dependencies = [ "cc", "lazy_static", "libc", "regex", - "semver 0.9.0", + "semver 0.11.0", ] [[package]] @@ -558,6 +562,27 @@ dependencies = [ "cfg-if 0.1.10", ] +[[package]] +name = "loupe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79b0cc3aa7552a59274f642a0a6e7419b7f5438aba06a0a82825918ba69f0e6" +dependencies = [ + "indexmap", + "loupe-derive", + "rustversion", +] + +[[package]] +name = "loupe-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a545b22ceeec36de91c46206afd384c17946bd62b95b76e927a2adb77fbdcc0" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "mach" version = "0.3.2" @@ -643,9 +668,9 @@ checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" dependencies = [ "crc32fast", "indexmap", @@ -653,9 +678,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.4.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "parking_lot" @@ -789,17 +814,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "raw-cpuid" -version = "7.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - [[package]] name = "rayon" version = "1.5.0" @@ -902,6 +916,12 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustversion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1148,10 +1168,11 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasmer" -version = "1.0.1" +version = "1.0.2" dependencies = [ "cfg-if 0.1.10", "indexmap", + "loupe", "more-asserts", "target-lexicon", "thiserror", @@ -1171,7 +1192,7 @@ dependencies = [ [[package]] name = "wasmer-cache" -version = "1.0.1" +version = "1.0.2" dependencies = [ "blake3", "hex", @@ -1181,10 +1202,10 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.1" +version = "1.0.2" dependencies = [ "enumset", - "raw-cpuid", + "loupe", "serde", "serde_bytes", "smallvec", @@ -1197,11 +1218,13 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.1" +version = "1.0.2" dependencies = [ "cranelift-codegen", + "cranelift-entity", "cranelift-frontend", - "gimli", + "gimli 0.23.0", + "loupe", "more-asserts", "rayon", "serde", @@ -1214,7 +1237,7 @@ dependencies = [ [[package]] name = "wasmer-compiler-llvm" -version = "1.0.1" +version = "1.0.2" dependencies = [ "byteorder", "cc", @@ -1223,6 +1246,7 @@ dependencies = [ "itertools", "lazy_static", "libc", + "loupe", "rayon", "regex", "rustc_version", @@ -1236,12 +1260,13 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "1.0.1" +version = "1.0.2" dependencies = [ "byteorder", "dynasm", "dynasmrt", "lazy_static", + "loupe", "more-asserts", "rayon", "serde", @@ -1253,7 +1278,7 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.1" +version = "1.0.2" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1263,11 +1288,12 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.1" +version = "1.0.2" dependencies = [ "backtrace", "bincode", "lazy_static", + "loupe", "memmap2", "more-asserts", "rustc-demangle", @@ -1282,10 +1308,11 @@ dependencies = [ [[package]] name = "wasmer-engine-jit" -version = "1.0.1" +version = "1.0.2" dependencies = [ "bincode", "cfg-if 0.1.10", + "loupe", "region", "serde", "serde_bytes", @@ -1298,12 +1325,13 @@ dependencies = [ [[package]] name = "wasmer-engine-native" -version = "1.0.1" +version = "1.0.2" dependencies = [ "bincode", "cfg-if 0.1.10", "leb128", "libloading", + "loupe", "serde", "tempfile", "tracing", @@ -1317,9 +1345,9 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.1" +version = "1.0.2" dependencies = [ - "object 0.22.0", + "object 0.23.0", "thiserror", "wasmer-compiler", "wasmer-types", @@ -1345,22 +1373,23 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.1" +version = "1.0.2" dependencies = [ - "cranelift-entity", + "loupe", "serde", "thiserror", ] [[package]] name = "wasmer-vm" -version = "1.0.1" +version = "1.0.2" dependencies = [ "backtrace", "cc", "cfg-if 0.1.10", "indexmap", "libc", + "loupe", "memoffset 0.6.1", "more-asserts", "region", @@ -1372,9 +1401,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.65.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" +checksum = "4a4d63608421d9a22d4bce220f2841f3b609a5aaabd3ed3aeeb5fed2702c3c78" [[package]] name = "wast" diff --git a/lib/deprecated/runtime/Cargo.lock b/lib/deprecated/runtime/Cargo.lock index 18004ccc46e..24eecff8f49 100644 --- a/lib/deprecated/runtime/Cargo.lock +++ b/lib/deprecated/runtime/Cargo.lock @@ -6,7 +6,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ - "gimli", + "gimli 0.22.0", ] [[package]] @@ -134,25 +134,25 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cranelift-bforest" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9221545c0507dc08a62b2d8b5ffe8e17ac580b0a74d1813b496b8d70b070fbd0" +checksum = "841476ab6d3530136b5162b64a2c6969d68141843ad2fd59126e5ea84fd9b5fe" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9936ea608b6cd176f107037f6adbb4deac933466fc7231154f96598b2d3ab1" +checksum = "2b5619cef8d19530298301f91e9a0390d369260799a3d8dd01e28fc88e53637a" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli", + "gimli 0.23.0", "log", "regalloc", "smallvec", @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef2b2768568306540f4c8db3acce9105534d34c4a1e440529c1e702d7f8c8d7" +checksum = "2a319709b8267939155924114ea83f2a5b5af65ece3ac6f703d4735f3c66bb0d" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -172,24 +172,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6759012d6d19c4caec95793f052613e9d4113e925e7f14154defbac0f1d4c938" +checksum = "15925b23cd3a448443f289d85a8f53f3cf7a80f0137aa53c8e3b01ae8aefaef7" [[package]] name = "cranelift-entity" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86badbce14e15f52a45b666b38abe47b204969dd7f8fb7488cb55dd46b361fa6" +checksum = "610cf464396c89af0f9f7c64b5aa90aa9e8812ac84084098f1565b40051bc415" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.68.0" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" +checksum = "4d20c8bd4a1c41ded051734f0e33ad1d843a0adc98b9bd975ee6657e2c70cdc9" dependencies = [ "cranelift-codegen", "log", @@ -398,6 +398,12 @@ name = "gimli" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" + +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", @@ -406,9 +412,9 @@ dependencies = [ [[package]] name = "goblin" -version = "0.2.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884" +checksum = "669cdc3826f69a51d3f8fc3f86de81c2378110254f678b8407977736122057a4" dependencies = [ "log", "plain", @@ -417,12 +423,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34f595585f103464d8d2f6e9864682d74c1601fed5e07d62b1c9058dba8246fb" -dependencies = [ - "autocfg", -] +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" [[package]] name = "hermit-abi" @@ -447,9 +450,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.5.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b88cd59ee5f71fea89a62248fc8f387d44400cefe05ef548466d61ced9029a7" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", "hashbrown", @@ -458,9 +461,9 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.1.0-llvm10sample" +version = "0.1.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e079c12273d96e41481454a37ad968e607e1ce51b39b9facd3a802a12df6e9dc" +checksum = "f5fe0be1e47c0c0f3da4397693e08f5d78329ae095c25d529e12ade78420fb41" dependencies = [ "either", "inkwell_internals", @@ -473,9 +476,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22cf4eda09069b48204cce4b7cd9a25311da813780e95a038524f2210fab44e" +checksum = "c2e1f71330ccec54ee62533ae88574c4169b67fb4b95cbb1196a1322582abd11" dependencies = [ "proc-macro2", "quote", @@ -493,9 +496,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" dependencies = [ "either", ] @@ -520,24 +523,25 @@ checksum = "bd7d4bd64732af4bf3a67f367c27df8520ad7e230c5817b8ff485864d80242b9" [[package]] name = "libloading" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ + "cfg-if 1.0.0", "winapi", ] [[package]] name = "llvm-sys" -version = "100.1.0" +version = "110.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5545bf9a09267c644e4d0ac68f37ac200af6579ae2e82aebce382654eb4abab1" +checksum = "21ede189444b8c78907e5d36da5dabcf153170fcff9c1dba48afc4b33c7e19f0" dependencies = [ "cc", "lazy_static", "libc", "regex", - "semver 0.9.0", + "semver 0.11.0", ] [[package]] @@ -558,6 +562,27 @@ dependencies = [ "cfg-if 0.1.10", ] +[[package]] +name = "loupe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d79b0cc3aa7552a59274f642a0a6e7419b7f5438aba06a0a82825918ba69f0e6" +dependencies = [ + "indexmap", + "loupe-derive", + "rustversion", +] + +[[package]] +name = "loupe-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a545b22ceeec36de91c46206afd384c17946bd62b95b76e927a2adb77fbdcc0" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "mach" version = "0.3.2" @@ -643,9 +668,9 @@ checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" dependencies = [ "crc32fast", "indexmap", @@ -653,9 +678,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.4.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "parking_lot" @@ -789,17 +814,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "raw-cpuid" -version = "7.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - [[package]] name = "rayon" version = "1.5.0" @@ -902,6 +916,12 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustversion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1148,10 +1168,11 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasmer" -version = "1.0.1" +version = "1.0.2" dependencies = [ "cfg-if 0.1.10", "indexmap", + "loupe", "more-asserts", "target-lexicon", "thiserror", @@ -1171,7 +1192,7 @@ dependencies = [ [[package]] name = "wasmer-cache" -version = "1.0.1" +version = "1.0.2" dependencies = [ "blake3", "hex", @@ -1181,10 +1202,10 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.1" +version = "1.0.2" dependencies = [ "enumset", - "raw-cpuid", + "loupe", "serde", "serde_bytes", "smallvec", @@ -1197,11 +1218,13 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.1" +version = "1.0.2" dependencies = [ "cranelift-codegen", + "cranelift-entity", "cranelift-frontend", - "gimli", + "gimli 0.23.0", + "loupe", "more-asserts", "rayon", "serde", @@ -1214,7 +1237,7 @@ dependencies = [ [[package]] name = "wasmer-compiler-llvm" -version = "1.0.1" +version = "1.0.2" dependencies = [ "byteorder", "cc", @@ -1223,6 +1246,7 @@ dependencies = [ "itertools", "lazy_static", "libc", + "loupe", "rayon", "regex", "rustc_version", @@ -1236,12 +1260,13 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "1.0.1" +version = "1.0.2" dependencies = [ "byteorder", "dynasm", "dynasmrt", "lazy_static", + "loupe", "more-asserts", "rayon", "serde", @@ -1253,7 +1278,7 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.1" +version = "1.0.2" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1263,11 +1288,12 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.1" +version = "1.0.2" dependencies = [ "backtrace", "bincode", "lazy_static", + "loupe", "memmap2", "more-asserts", "rustc-demangle", @@ -1282,10 +1308,11 @@ dependencies = [ [[package]] name = "wasmer-engine-jit" -version = "1.0.1" +version = "1.0.2" dependencies = [ "bincode", "cfg-if 0.1.10", + "loupe", "region", "serde", "serde_bytes", @@ -1298,12 +1325,13 @@ dependencies = [ [[package]] name = "wasmer-engine-native" -version = "1.0.1" +version = "1.0.2" dependencies = [ "bincode", "cfg-if 0.1.10", "leb128", "libloading", + "loupe", "serde", "tempfile", "tracing", @@ -1317,9 +1345,9 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.1" +version = "1.0.2" dependencies = [ - "object 0.22.0", + "object 0.23.0", "thiserror", "wasmer-compiler", "wasmer-types", @@ -1352,22 +1380,23 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.1" +version = "1.0.2" dependencies = [ - "cranelift-entity", + "loupe", "serde", "thiserror", ] [[package]] name = "wasmer-vm" -version = "1.0.1" +version = "1.0.2" dependencies = [ "backtrace", "cc", "cfg-if 0.1.10", "indexmap", "libc", + "loupe", "memoffset 0.6.1", "more-asserts", "region", @@ -1379,9 +1408,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.65.0" +version = "0.74.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" +checksum = "4a4d63608421d9a22d4bce220f2841f3b609a5aaabd3ed3aeeb5fed2702c3c78" [[package]] name = "wast" From 704c6f2ce37559db60547a4cb8cb1807b673fcd3 Mon Sep 17 00:00:00 2001 From: jubianchi Date: Wed, 31 Mar 2021 21:49:58 +0200 Subject: [PATCH 2/4] fix(cranelift): Enable optimization even when SIMD is enabled --- lib/compiler-cranelift/src/config.rs | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index ed8419c2fce..2a80f60f8e1 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -48,7 +48,6 @@ impl Cranelift { enable_verifier: false, opt_level: CraneliftOptLevel::Speed, enable_pic: false, - enable_simd: true, middlewares: vec![], } } @@ -62,12 +61,6 @@ impl Cranelift { self } - /// Enable SIMD support. - pub fn enable_simd(&mut self, enable: bool) -> &mut Self { - self.enable_simd = enable; - self - } - /// The optimization levels when optimizing the IR. pub fn opt_level(&mut self, opt_level: CraneliftOptLevel) -> &mut Self { self.opt_level = opt_level; @@ -153,18 +146,15 @@ impl Cranelift { .set("enable_verifier", enable_verifier) .expect("should be valid flag"); - let opt_level = if self.enable_simd { - "none" - } else { - match self.opt_level { - CraneliftOptLevel::None => "none", - CraneliftOptLevel::Speed => "speed", - CraneliftOptLevel::SpeedAndSize => "speed_and_size", - } - }; - flags - .set("opt_level", opt_level) + .set( + "opt_level", + match self.opt_level { + CraneliftOptLevel::None => "none", + CraneliftOptLevel::Speed => "speed", + CraneliftOptLevel::SpeedAndSize => "speed_and_size", + }, + ) .expect("should be valid flag"); let enable_simd = if self.enable_simd { "true" } else { "false" }; From 62a8d07697778174c8dd6580f917fc78df046145 Mon Sep 17 00:00:00 2001 From: jubianchi Date: Wed, 31 Mar 2021 22:20:40 +0200 Subject: [PATCH 3/4] fixup! fix(cranelift): Enable optimization even when SIMD is enabled --- lib/compiler-cranelift/src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index 2a80f60f8e1..6a1f139c3f1 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -48,6 +48,7 @@ impl Cranelift { enable_verifier: false, opt_level: CraneliftOptLevel::Speed, enable_pic: false, + enable_simd: true, middlewares: vec![], } } From 1231cb23de286fd5b3a8d1479befe5f6ef0c8f6a Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Wed, 31 Mar 2021 14:49:03 -0700 Subject: [PATCH 4/4] Set cranelift simd config based on Wasm Features --- lib/compiler-cranelift/src/compiler.rs | 8 +++++--- lib/compiler-cranelift/src/config.rs | 10 ++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/compiler-cranelift/src/compiler.rs b/lib/compiler-cranelift/src/compiler.rs index dd297033098..98489643fd0 100644 --- a/lib/compiler-cranelift/src/compiler.rs +++ b/lib/compiler-cranelift/src/compiler.rs @@ -60,12 +60,14 @@ impl Compiler for CraneliftCompiler { module_translation_state: &ModuleTranslationState, function_body_inputs: PrimaryMap>, ) -> Result { - let isa = self.config().isa(target); + let config = self.config(); + let flags = self.config().flags(compile_info.features.simd); + let isa = config.isa(target, flags); let frontend_config = isa.frontend_config(); let memory_styles = &compile_info.memory_styles; let table_styles = &compile_info.table_styles; let mut module = (*compile_info.module).clone(); - self.config.middlewares.apply_on_module_info(&mut module); + config.middlewares.apply_on_module_info(&mut module); compile_info.module = Arc::new(module); let module = &compile_info.module; let signatures = module @@ -126,7 +128,7 @@ impl Compiler for CraneliftCompiler { &mut context.func, &mut func_env, *i, - &self.config, + &config, )?; let mut code_buf: Vec = Vec::new(); diff --git a/lib/compiler-cranelift/src/config.rs b/lib/compiler-cranelift/src/config.rs index 6a1f139c3f1..a956c57723c 100644 --- a/lib/compiler-cranelift/src/config.rs +++ b/lib/compiler-cranelift/src/config.rs @@ -32,7 +32,6 @@ pub enum CraneliftOptLevel { pub struct Cranelift { enable_nan_canonicalization: bool, enable_verifier: bool, - enable_simd: bool, enable_pic: bool, opt_level: CraneliftOptLevel, /// The middleware chain. @@ -48,7 +47,6 @@ impl Cranelift { enable_verifier: false, opt_level: CraneliftOptLevel::Speed, enable_pic: false, - enable_simd: true, middlewares: vec![], } } @@ -69,7 +67,7 @@ impl Cranelift { } /// Generates the ISA for the provided target - pub fn isa(&self, target: &Target) -> Box { + pub fn isa(&self, target: &Target, flags: settings::Flags) -> Box { let mut builder = lookup(target.triple().clone()).expect("construct Cranelift ISA for triple"); // Cpu Features @@ -120,11 +118,11 @@ impl Cranelift { builder.enable("has_lzcnt").expect("should be valid flag"); } - builder.finish(self.flags()) + builder.finish(flags) } /// Generates the flags for the compiler - pub fn flags(&self) -> settings::Flags { + pub fn flags(&self, enable_simd: bool) -> settings::Flags { let mut flags = settings::builder(); // There are two possible traps for division, and this way @@ -158,7 +156,7 @@ impl Cranelift { ) .expect("should be valid flag"); - let enable_simd = if self.enable_simd { "true" } else { "false" }; + let enable_simd = if enable_simd { "true" } else { "false" }; flags .set("enable_simd", enable_simd) .expect("should be valid flag");