diff --git a/Cargo.lock b/Cargo.lock index 0dd4135eba0..8e6da63424b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,67 +84,71 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cranelift-entity 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cranelift-codegen" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cranelift-bforest 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-codegen-meta 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-entity 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-bforest 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen-meta 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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.5 (registry+https://github.com/rust-lang/crates.io-index)", - "target-lexicon 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cranelift-codegen-meta" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "cranelift-entity" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cranelift-frontend" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cranelift-codegen 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cranelift-native" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cranelift-codegen 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "raw-cpuid 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "target-lexicon 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cranelift-wasm" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cranelift-codegen 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-entity 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-frontend 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-frontend 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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.5 (registry+https://github.com/rust-lang/crates.io-index)", - "target-lexicon 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.21.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -188,22 +192,22 @@ dependencies = [ [[package]] name = "failure" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -323,7 +327,7 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "5.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -371,7 +375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "mach 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -465,16 +469,6 @@ dependencies = [ "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "syn" -version = "0.14.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "syn" version = "0.15.9" @@ -487,22 +481,22 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "target-lexicon" -version = "0.0.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -600,10 +594,10 @@ dependencies = [ name = "wasmer" version = "0.1.0" dependencies = [ - "cranelift-codegen 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-entity 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-native 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cranelift-wasm 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-codegen 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-native 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cranelift-wasm 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (git+https://github.com/rust-lang/libc)", @@ -614,7 +608,7 @@ dependencies = [ "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "target-lexicon 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasmparser 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -622,12 +616,12 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.17.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasmparser" -version = "0.20.0" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -660,19 +654,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" "checksum cmake 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "6ec65ee4f9c9d16f335091d23693457ed4928657ba4982289d7fafee03bc614a" -"checksum cranelift-bforest 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "edd9d4c68e251628d0a224720034280ed3fe1bff90853e6199c7e3c07e7569fc" -"checksum cranelift-codegen 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b56502b1ad2a1dc52455687309d80ca7e9a6ceb9b219935a50146dbd850c27b" -"checksum cranelift-codegen-meta 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7baf504162041c394fe8a31f55e01138298c19cf3808ce9454e1315cb1e2dcd" -"checksum cranelift-entity 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75c34e9d94525517f1e13957e8402de2b92a1db9ac90def5fec969999e7160ae" -"checksum cranelift-frontend 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68c77d95a0e374f72d73d39530f2fbf9214854f49ffa21a04229429c814f030c" -"checksum cranelift-native 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "764e004b73b6aaa20ff2a0127094950b67f25552c9b87662b35272f670a6c17f" -"checksum cranelift-wasm 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97dba85d4788c520458e5d75eecccca39df43747dbcfbd8d45ac0d4e8aba475e" +"checksum cranelift-bforest 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8c5f8e1ab4f73b59a98531a8013d8ed3ca7edb4e36984cb301d9c06f6892787b" +"checksum cranelift-codegen 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437ec8212686e6cdacfea75aaedb4ab8b013869be1e8693a4cb97a60f135035" +"checksum cranelift-codegen-meta 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4eac16097b96e9f609df735555f2d1658531750fbc3805bca1daca7671aef9eb" +"checksum cranelift-entity 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9be3f82369346201c2e0cff720522e6eb55459e51c916b2199f25cff2058ca96" +"checksum cranelift-frontend 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5d18ab2bc89a09b4275442a9559dc0f947b9a8ad9ae9ee89452a057df54ced" +"checksum cranelift-native 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d8d3b5951eefd89778dc59b0e33b556573a870538bc21982019bd4c4003b0a2d" +"checksum cranelift-wasm 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e5906a111814d43d84002ef974eb0c023804fd4d1866b34f43c1bb588a759ad8" "checksum docopt 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d60c92df70dfaaabecc14b409fd79f55ba0f247780529db1d73bfa601e1d3ac0" "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" -"checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" -"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" +"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7" +"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" @@ -688,7 +682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd" -"checksum raw-cpuid 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3c460bd35fdb75644e94ab498372bdf29a4849367ce7ba74cf358edce590c4" +"checksum raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "30a9d219c32c9132f7be513c18be77c9881c7107d2ab5569d205a6a0f0e6dc7d" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2069749032ea3ec200ca51e4a31df41759190a88edca0d2d86ee8bedf7073341" @@ -706,10 +700,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum structopt 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ca85f2c9a5a1e2d5ac686fc0be48e40f8ad803f5bbe31f692ff71eb2dd8aad45" "checksum structopt-derive 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "1383e5db585da799a5c4acc496c5c868e18bf82e658c00c75cc91038fa26b55f" -"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" "checksum syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b10ee269228fb723234fce98e9aac0eaed2bd5f1ad2f6930e8d5b93f04445a1a" -"checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" -"checksum target-lexicon 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a34226bd63b5a26fc909f5f0d7ef4dc55d5851077035e49437e4e14bf567247f" +"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" +"checksum target-lexicon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4af5e2227f0b887d591d3724b796a96eff04226104d872f5b3883fcd427d64b9" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" @@ -723,8 +716,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wabt 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5b24b2494bd6077dff717f41523f6e3e0161d58f578198589a6a6c8b314cb763" "checksum wabt-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "122aefe1d22c067cce1dc5d20d89d1ca47ce0eb10120246a3e2340863f9e6ddd" -"checksum wasmparser 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc6511bad33610d7798f80d48e10495a6eb4f1e39306b0bb340b2de0816c4ca" "checksum wasmparser 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2a75e0c3fe9a4d4fd91901348a5be05ba4791e29dda89e8596bfe87900ba7edc" +"checksum wasmparser 0.21.10 (registry+https://github.com/rust-lang/crates.io-index)" = "48b8ebfeb364ff50e0ff043f491c270f58a7563aa3dc97402a0e813bfeb6df6f" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 892d7c21592..3c795b0aab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,13 +20,13 @@ include = [ ] [dependencies] -cranelift-native = "0.22.0" +cranelift-native = "0.23.0" # cranelift-native = { path = "cranelift/lib/native" } -cranelift-codegen = "0.22.0" +cranelift-codegen = "0.23.0" # cranelift-codegen = { path = "cranelift/lib/codegen" } -cranelift-entity = "0.22.0" +cranelift-entity = "0.23.0" # cranelift-entity = { path = "cranelift/lib/entity" } -cranelift-wasm = "0.22.0" +cranelift-wasm = "0.23.0" # cranelift-wasm = { path = "cranelift/lib/wasm" } docopt = "1.0.0" serde = "1.0.55" @@ -40,7 +40,7 @@ region = "0.3.0" memmap = "0.6.2" # spin = "0.4.10" log = "0.4.5" -target-lexicon = { version = "0.0.3", default-features = false } +target-lexicon = "0.2.0" # libc = "0.2" libc = { git = "https://github.com/rust-lang/libc" } nix = "0.11" diff --git a/src/webassembly/instance.rs b/src/webassembly/instance.rs index 63178674abf..3901988aad1 100644 --- a/src/webassembly/instance.rs +++ b/src/webassembly/instance.rs @@ -7,9 +7,10 @@ //! primary way to get an Instance is through the asynchronous //! webassembly::instantiate_streaming() function. use cranelift_codegen::ir::LibCall; -use cranelift_codegen::{binemit, isa, Context}; +use cranelift_codegen::{binemit, Context}; use cranelift_entity::EntityRef; use cranelift_wasm::{FuncIndex, GlobalInit}; +use cranelift_codegen::isa::TargetIsa; use region; use std::iter::Iterator; use std::ptr::write_unaligned; @@ -114,10 +115,10 @@ pub struct DataPointers { } -#[derive(Debug, Clone)] pub struct InstanceOptions { // Shall we mock automatically the imported functions if they don't exist? pub mock_missing_imports: bool, + pub isa: Box, } // extern fn mock_fn() -> i32 { @@ -135,7 +136,7 @@ impl Instance { pub fn new( module: &Module, import_object: ImportObject<&str, &str>, - _options: InstanceOptions, + options: InstanceOptions, ) -> Result { let mut tables: Vec> = Vec::new(); let mut memories: Vec = Vec::new(); @@ -151,9 +152,6 @@ impl Instance { // Instantiate functions { functions.reserve_exact(module.info.functions.len()); - let isa = isa::lookup(module.info.triple.clone()) - .unwrap() - .finish(module.info.flags.clone()); let mut relocations = Vec::new(); // let imported_functions: Vec = module.info.imported_funcs.iter().map(|(module, field)| { @@ -210,7 +208,7 @@ impl Instance { // and will push any inner function calls to the reloc sync. // In case traps need to be triggered, they will go to trap_sink func_context - .compile_and_emit(&*isa, &mut code_buf, &mut reloc_sink, &mut trap_sink) + .compile_and_emit(&*options.isa, &mut code_buf, &mut reloc_sink, &mut trap_sink) .map_err(|e| { debug!("CompileError: {}", e.to_string()); ErrorKind::CompileError(e.to_string()) @@ -337,7 +335,7 @@ impl Instance { let base = 0; - let table = &mut tables[table_element.table_index]; + let table = &mut tables[table_element.table_index.index()]; for (i, func_index) in table_element.elements.iter().enumerate() { // since the table just contains functions in the MVP // we get the address of the specified function indexes @@ -375,7 +373,7 @@ impl Instance { for init in &module.info.data_initializers { debug_assert!(init.base.is_none(), "globalvar base not supported yet"); let offset = init.offset; - let mem_mut = memories[init.memory_index].as_mut(); + let mem_mut = memories[init.memory_index.index()].as_mut(); let to_init = &mut mem_mut[offset..offset + init.data.len()]; to_init.copy_from_slice(&init.data); } diff --git a/src/webassembly/mod.rs b/src/webassembly/mod.rs index 033f1c8492e..9e2a2ed0164 100644 --- a/src/webassembly/mod.rs +++ b/src/webassembly/mod.rs @@ -12,6 +12,8 @@ use std::str::FromStr; use target_lexicon; use wasmparser; use wasmparser::WasmDecoder; +use cranelift_codegen::{isa, settings}; +use cranelift_codegen::isa::TargetIsa; pub use self::errors::{Error, ErrorKind}; pub use self::import_object::{ImportObject, ImportValue}; @@ -46,6 +48,9 @@ pub fn instantiate( buffer_source: Vec, import_object: ImportObject<&str, &str>, ) -> Result { + let flags = settings::Flags::new(settings::builder()); + let isa = isa::lookup(triple!("x86_64")).unwrap().finish(flags); + let module = compile(buffer_source)?; debug!("webassembly - creating instance"); let instance = Instance::new( @@ -53,6 +58,7 @@ pub fn instantiate( import_object, InstanceOptions { mock_missing_imports: true, + isa: isa }, )?; debug!("webassembly - instance created"); @@ -84,8 +90,11 @@ pub fn compile(buffer_source: Vec) -> Result { debug!("webassembly - validating module"); validate_or_error(&buffer_source)?; + let flags = settings::Flags::new(settings::builder()); + let isa = isa::lookup(triple!("x86_64")).unwrap().finish(flags); + debug!("webassembly - creating module"); - let module = Module::from_bytes(buffer_source, triple!("x86_64"), None)?; + let module = Module::from_bytes(buffer_source, isa.frontend_config())?; debug!("webassembly - module created"); Ok(module) diff --git a/src/webassembly/module.rs b/src/webassembly/module.rs index 0049c3192d0..1b8a76c6620 100644 --- a/src/webassembly/module.rs +++ b/src/webassembly/module.rs @@ -4,7 +4,6 @@ use std::collections::HashMap; use std::string::String; use std::vec::Vec; -use target_lexicon::{PointerWidth, Triple}; use cranelift_codegen::cursor::FuncCursor; use cranelift_codegen::ir::immediates::{Imm64, Offset32}; @@ -12,13 +11,12 @@ use cranelift_codegen::ir::types::*; use cranelift_codegen::ir::{ self, AbiParam, ArgumentPurpose, ExtFuncData, ExternalName, FuncRef, InstBuilder, Signature, }; -use cranelift_codegen::print_errors::pretty_verifier_error; -use cranelift_codegen::settings::CallConv; -use cranelift_codegen::{isa, settings, verifier}; +use cranelift_codegen::isa::{CallConv, TargetFrontendConfig}; use cranelift_entity::{EntityRef, PrimaryMap}; use cranelift_wasm::{ - translate_module, // ReturnMode, + translate_module, + ReturnMode, DefinedFuncIndex, FuncEnvironment as FuncEnvironmentTrait, FuncIndex, @@ -57,16 +55,16 @@ pub fn native_pointer_size() -> i32 { } } -// /// Convert a TlsData offset into a `Offset32` for a global decl. -// fn offset32(offset: usize) -> ir::immediates::Offset32 { -// assert!(offset <= i32::max_value() as usize); -// (offset as i32).into() -// } +/// Convert a TlsData offset into a `Offset32` for a global decl. +fn offset32(offset: usize) -> ir::immediates::Offset32 { + assert!(offset <= i32::max_value() as usize); + (offset as i32).into() +} -// /// Convert a usize offset into a `Imm64` for an iadd_imm. -// fn imm64(offset: usize) -> ir::immediates::Imm64 { -// (offset as i64).into() -// } +/// Convert a usize offset into a `Imm64` for an iadd_imm. +fn imm64(offset: usize) -> ir::immediates::Imm64 { + (offset as i64).into() +} /// Compute a `ir::ExternalName` for a given wasm function index. fn get_func_name(func_index: FuncIndex) -> ir::ExternalName { @@ -110,11 +108,8 @@ pub enum Export { /// `Module` to allow it to be borrowed separately from the /// `FuncTranslator` field. pub struct ModuleInfo { - /// Target description. - pub triple: Triple, - - /// Compilation setting flags. - pub flags: settings::Flags, + /// Target description relevant to frontends producing Cranelift IR. + config: TargetFrontendConfig, pub main_memory_base: Option, @@ -171,10 +166,9 @@ pub struct ModuleInfo { impl ModuleInfo { /// Allocates the data structures with the given flags. - pub fn with_triple_flags(triple: Triple, flags: settings::Flags) -> Self { + pub fn new(config: TargetFrontendConfig) -> Self { Self { - triple, - flags, + config, signatures: Vec::new(), functions: PrimaryMap::new(), function_bodies: PrimaryMap::new(), @@ -247,17 +241,16 @@ pub struct Module { // return_mode: ReturnMode, } + impl Module { /// Instantiate a Module given WASM bytecode pub fn from_bytes( buffer_source: Vec, - triple: Triple, - flags: Option, + config: TargetFrontendConfig, ) -> Result { // let return_mode = ReturnMode::NormalReturns; - let flags = flags.unwrap_or_else(|| settings::Flags::new(settings::builder())); let mut module = Self { - info: ModuleInfo::with_triple_flags(triple, flags), + info: ModuleInfo::new(config), trans: FuncTranslator::new(), func_bytecode_sizes: Vec::new(), // return_mode, @@ -298,15 +291,16 @@ impl Module { } pub fn verify(&self) { - let isa = isa::lookup(self.info.triple.clone()) - .unwrap() - .finish(self.info.flags.clone()); - - for func in self.info.function_bodies.values() { - verifier::verify_function(func, &*isa) - .map_err(|errors| panic!(pretty_verifier_error(func, Some(&*isa), None, errors))) - .unwrap(); - } + unimplemented!(); + // let isa = isa::lookup(self.info.triple.clone()) + // .unwrap() + // .finish(self.info.flags.clone()); + + // for func in self.info.function_bodies.values() { + // verifier::verify_function(func, &*isa) + // .map_err(|errors| panic!(pretty_verifier_error(func, Some(&*isa), None, errors))) + // .unwrap(); + // } } } @@ -335,30 +329,31 @@ impl<'environment> FuncEnvironment<'environment> { // Create a signature for `sigidx` amended with a `vmctx` argument after the standard wasm // arguments. fn vmctx_sig(&self, sigidx: SignatureIndex) -> ir::Signature { - let mut sig = self.mod_info.signatures[sigidx].clone(); + let mut sig = self.mod_info.signatures[sigidx.index()].clone(); sig.params.push(ir::AbiParam::special( self.pointer_type(), ir::ArgumentPurpose::VMContext, )); sig } - - fn ptr_size(&self) -> usize { - if self.triple().pointer_width().unwrap() == PointerWidth::U64 { - 8 - } else { - 4 - } - } } impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { - fn triple(&self) -> &Triple { - &self.mod_info.triple + /// Get the information needed to produce Cranelift IR for the given target. + fn target_config(&self) -> TargetFrontendConfig { + self.mod_info.config } - fn flags(&self) -> &settings::Flags { - &self.mod_info.flags + /// Get the Cranelift integer type to use for native pointers. + /// + /// This returns `I64` for 64-bit architectures and `I32` for 32-bit architectures. + fn pointer_type(&self) -> ir::Type { + ir::Type::int(u16::from(self.target_config().pointer_bits())).unwrap() + } + + /// Get the size of a native pointer, in bytes. + fn pointer_bytes(&self) -> u8 { + self.target_config().pointer_bytes() } // TODO: offsets should be based on the architecture the wasmer was compiled for. @@ -366,19 +361,20 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { // however the 32-bit wasmer may be running on 64-bit arch, which means ptr_size here will // be 8 bytes. That will definitely gove the wrong offset values fn make_table(&mut self, func: &mut ir::Function, table_index: TableIndex) -> ir::Table { + assert_eq!(table_index.index(), 0, "Only one WebAssembly memory supported"); let instance = func.create_global_value(ir::GlobalValueData::VMContext); - let ptr_size = self.ptr_size(); - + let ptr_size = native_pointer_size(); // Load value at (instance + TABLES_OFFSET) // which is the address of data_pointer.tables let base = func.create_global_value(ir::GlobalValueData::Load { base: instance, offset: Offset32::new(Instance::TABLES_OFFSET as i32), global_type: self.pointer_type(), + readonly: true, }); // Offset based on table_index - let table_data_offset = (table_index as usize * ptr_size * 2) as i32; + let table_data_offset = table_index.index() as i32 * ptr_size * 2; // Load value at the (base + table_data_offset) // which is the address of data_pointer.tables[index].data @@ -386,6 +382,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base, offset: Offset32::new(table_data_offset), global_type: native_pointer_type(), + readonly: false, }); // Load value at the (base + table_data_offset) @@ -394,6 +391,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base, offset: Offset32::new(table_data_offset + ptr_size as i32), global_type: self.pointer_type(), + readonly: false, }); // Create table based on the data above @@ -402,7 +400,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { min_size: Imm64::new(0), bound_gv, element_size: Imm64::new(i64::from(self.pointer_bytes())), - index_type: self.pointer_type(), + index_type: I64, }); table @@ -413,9 +411,9 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { // however the 32-bit wasmer may be running on 64-bit arch, which means ptr_size here will // be 8 bytes. That will definitely gove the wrong offset values fn make_heap(&mut self, func: &mut ir::Function, memory_index: MemoryIndex) -> ir::Heap { - assert_eq!(memory_index, 0, "Only one WebAssembly memory supported"); + debug_assert_eq!(memory_index.index(), 0, "Only one WebAssembly memory supported"); let instance = func.create_global_value(ir::GlobalValueData::VMContext); - let ptr_size = self.ptr_size(); + let ptr_size = native_pointer_size(); // Load value at (instance + MEMORIES_OFFSET) // which is the address of data_pointer.memories @@ -423,6 +421,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base: instance, offset: Offset32::new(Instance::MEMORIES_OFFSET as i32), global_type: self.pointer_type(), + readonly: true, }); // Based on the index provided, we need to know the offset into memories array @@ -435,6 +434,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base, offset: Offset32::new(memory_data_offset), global_type: self.pointer_type(), + readonly: true }); // Load value at the (base + memory_data_offset) @@ -443,6 +443,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base, offset: Offset32::new(memory_data_offset + ptr_size as i32), global_type: I32, + readonly: false, }); // Create table based on the data above @@ -459,8 +460,8 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { heap } - fn make_global(&mut self, func: &mut ir::Function, index: GlobalIndex) -> GlobalVariable { - let ptr_size = self.ptr_size(); + fn make_global(&mut self, func: &mut ir::Function, global_index: GlobalIndex) -> GlobalVariable { + let ptr_size = native_pointer_size(); let instance = func.create_global_value(ir::GlobalValueData::VMContext); @@ -468,9 +469,10 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { base: instance, offset: Offset32::new(Instance::GLOBALS_OFFSET as i32), global_type: self.pointer_type(), + readonly: false, }); - let offset = (index * ptr_size) as i64; + let offset = global_index.index() as i64 * ptr_size as i64; let iadd = func.create_global_value(ir::GlobalValueData::IAddImm { base: globals_base_addr, offset: Imm64::new(offset), @@ -479,7 +481,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { GlobalVariable::Memory { gv: iadd, - ty: self.mod_info.globals[index].entity.ty, + ty: self.mod_info.globals[global_index.index()].entity.ty, } } @@ -523,18 +525,22 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { // The `callee` value is an index into a table of function pointers. // Apparently, that table is stored at absolute address 0 in this dummy environment. // TODO: Generate bounds checking code. - let ptr = self.pointer_type(); + let ptr = native_pointer_type(); let callee_offset = if ptr == I32 { // pos.ins().imul_imm(callee, 4) callee } else { - let ext = pos.ins().uextend(I64, callee); + let ext = pos.ins().uextend(ptr, callee); ext // pos.ins().imul_imm(ext, 4) }; + // let entry_size = native_pointer_size() as i64 * 2; + // let callee_scaled = pos.ins().imul_imm(callee_offset, entry_size); + let entry_addr = pos .ins() - .table_addr(self.pointer_type(), table, callee_offset, 0); + .table_addr(ptr, table, callee_offset, 0); + let mut mflags = ir::MemFlags::new(); mflags.set_notrap(); mflags.set_aligned(); @@ -569,7 +575,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { .expect("Missing vmctx parameter"); // println!("POINTER BYTES {}", self.pointer_bytes()); - // println!("POINTER SIZE {}", self.ptr_size()); + // println!("POINTER SIZE {}", native_pointer_size()); // Build a value list for the call instruction containing the call_args and the vmctx // parameter. @@ -583,11 +589,11 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { fn translate_memory_grow( &mut self, mut pos: FuncCursor, - index: MemoryIndex, + memory_index: MemoryIndex, _heap: ir::Heap, val: ir::Value, ) -> WasmResult { - debug_assert_eq!(index, 0, "non-default memories not supported yet"); + debug_assert_eq!(memory_index.index(), 0, "non-default memories not supported yet"); let grow_mem_func = self.mod_info.grow_memory_extfunc.unwrap_or_else(|| { let sig_ref = pos.func.import_signature(Signature { call_conv: CallConv::SystemV, @@ -611,20 +617,20 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { }); // self.mod_info.grow_memory_extfunc = Some(grow_mem_func); - let memory_index = pos.ins().iconst(I32, index as i64); + let memory_index_value = pos.ins().iconst(I32, imm64(memory_index.index())); let vmctx = pos.func.special_param(ArgumentPurpose::VMContext).unwrap(); - let call_inst = pos.ins().call(grow_mem_func, &[val, memory_index, vmctx]); + let call_inst = pos.ins().call(grow_mem_func, &[val, memory_index_value, vmctx]); Ok(*pos.func.dfg.inst_results(call_inst).first().unwrap()) } fn translate_memory_size( &mut self, mut pos: FuncCursor, - index: MemoryIndex, + memory_index: MemoryIndex, _heap: ir::Heap, ) -> WasmResult { - debug_assert_eq!(index, 0, "non-default memories not supported yet"); + debug_assert_eq!(memory_index.index(), 0, "non-default memories not supported yet"); let cur_mem_func = self.mod_info.current_memory_extfunc.unwrap_or_else(|| { let sig_ref = pos.func.import_signature(Signature { call_conv: CallConv::SystemV, @@ -648,22 +654,23 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> { // self.mod_info.current_memory_extfunc = cur_mem_func; - let memory_index = pos.ins().iconst(I32, index as i64); + let memory_index_value = pos.ins().iconst(I32, imm64(memory_index.index())); let vmctx = pos.func.special_param(ArgumentPurpose::VMContext).unwrap(); - let call_inst = pos.ins().call(cur_mem_func, &[memory_index, vmctx]); + let call_inst = pos.ins().call(cur_mem_func, &[memory_index_value, vmctx]); Ok(*pos.func.dfg.inst_results(call_inst).first().unwrap()) // Ok(pos.ins().iconst(I32, -1)) } - // fn return_mode(&self) -> ReturnMode { - // self.return_mode - // } + fn return_mode(&self) -> ReturnMode { + ReturnMode::NormalReturns + // ReturnMode::FallthroughReturn + } } impl<'data> ModuleEnvironment<'data> for Module { - fn flags(&self) -> &settings::Flags { - &self.info.flags + fn target_config(&self) -> &TargetFrontendConfig { + &self.info.config } fn get_func_name(&self, func_index: FuncIndex) -> ir::ExternalName { @@ -687,7 +694,7 @@ impl<'data> ModuleEnvironment<'data> for Module { } fn get_signature(&self, sig_index: SignatureIndex) -> &ir::Signature { - &self.info.signatures[sig_index] + &self.info.signatures[sig_index.index()] } fn declare_func_import( @@ -724,7 +731,7 @@ impl<'data> ModuleEnvironment<'data> for Module { } fn get_global(&self, global_index: GlobalIndex) -> &Global { - &self.info.globals[global_index].entity + &self.info.globals[global_index.index()].entity } fn declare_table(&mut self, table: Table) { @@ -777,7 +784,7 @@ impl<'data> ModuleEnvironment<'data> for Module { } fn declare_table_export(&mut self, table_index: TableIndex, name: &'data str) { - self.info.tables[table_index] + self.info.tables[table_index.index()] .export_names .push(String::from(name)); // We add to the exports to have O(1) retrieval @@ -787,7 +794,7 @@ impl<'data> ModuleEnvironment<'data> for Module { } fn declare_memory_export(&mut self, memory_index: MemoryIndex, name: &'data str) { - self.info.memories[memory_index] + self.info.memories[memory_index.index()] .export_names .push(String::from(name)); // We add to the exports to have O(1) retrieval @@ -797,7 +804,7 @@ impl<'data> ModuleEnvironment<'data> for Module { } fn declare_global_export(&mut self, global_index: GlobalIndex, name: &'data str) { - self.info.globals[global_index] + self.info.globals[global_index.index()] .export_names .push(String::from(name)); // We add to the exports to have O(1) retrieval