From f68153fa66d214995fdb8c05c750f001fb67c418 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 21 Apr 2024 22:09:22 +0200 Subject: [PATCH] Update + Fix everything --- Cargo.lock | 804 +++++++++--------- bencher/src/main.rs | 617 +++++++------- compiler/Cargo.toml | 2 +- .../src/passes/assign/include_liveness.rs | 3 + compiler/src/passes/assign/mod.rs | 3 +- compiler/src/passes/atomize/mod.rs | 4 +- compiler/src/passes/conclude/conclude.rs | 141 ++- compiler/src/passes/emit/binary.rs | 172 ++-- compiler/src/passes/emit/mod.rs | 106 +-- compiler/src/passes/emit/push_pop.rs | 13 +- compiler/src/passes/parse/grammar.lalrpop | 30 +- compiler/src/passes/patch/patch.rs | 32 +- compiler/src/passes/reveal/mod.rs | 4 +- compiler/src/passes/select/macros.rs | 70 +- compiler/src/passes/select/mod.rs | 40 +- compiler/src/passes/select/select.rs | 39 +- compiler/src/passes/validate/mod.rs | 16 +- compiler/src/passes/validate/resolve.rs | 142 ++-- compiler/src/passes/validate/uniquify/expr.rs | 64 +- 19 files changed, 1127 insertions(+), 1175 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4799b2e..c37ad47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -32,9 +32,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -70,36 +70,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -134,13 +134,13 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" dependencies = [ "concurrent-queue", - "event-listener 4.0.0", - "event-listener-strategy", + "event-listener 5.3.0", + "event-listener-strategy 0.5.1", "futures-core", "pin-project-lite", ] @@ -196,18 +196,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d3b15875ba253d1110c740755e246537483f152fa334f91abd7fe84c88b3ff" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ - "async-lock 3.1.2", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.0.1", + "futures-lite 2.3.0", "parking", - "polling 3.3.1", - "rustix 0.38.25", + "polling 3.6.0", + "rustix 0.38.33", "slab", "tracing", "windows-sys 0.52.0", @@ -224,12 +224,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.1.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea8b3453dd7cc96711834b75400d671b73e3656975fa68d9f277163b7f7e316" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.0", - "event-listener-strategy", + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", "pin-project-lite", ] @@ -246,26 +246,26 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.25", + "rustix 0.38.33", "windows-sys 0.48.0", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" dependencies = [ - "async-io 2.2.1", - "async-lock 2.8.0", + "async-io 2.3.2", + "async-lock 3.3.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.25", + "rustix 0.38.33", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -313,19 +313,19 @@ dependencies = [ [[package]] name = "async-task" -version = "4.5.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -336,15 +336,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -372,9 +372,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bencher" @@ -423,9 +423,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -454,27 +454,27 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.1.2", + "async-channel 2.2.1", + "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", - "futures-lite 2.0.1", + "futures-lite 2.3.0", "piper", "tracing", ] [[package]] name = "bson" -version = "2.7.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58da0ae1e701ea752cc46c1bb9f39d5ecefc7395c3ecd526261a566d4f16e0c2" +checksum = "4d43b38e074cc0de2957f10947e376a1d88b9c4dbab340b590800cc1b2e066b2" dependencies = [ "ahash", "base64 0.13.1", "bitvec", "hex", - "indexmap 1.9.3", + "indexmap", "js-sys", "once_cell", "rand 0.8.5", @@ -487,9 +487,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -499,18 +499,19 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -521,21 +522,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "clap" -version = "4.4.8" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -543,33 +544,33 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -588,14 +589,14 @@ name = "compiler" version = "0.1.0" dependencies = [ "binary-heap-plus", - "bitflags 2.4.1", + "bitflags 2.5.0", "clap", "derive-name", "derive_more", "enum-display", "functor_derive", "indenter", - "itertools 0.12.0", + "itertools 0.12.1", "lalrpop", "lalrpop-util", "miette", @@ -610,9 +611,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -634,27 +635,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -692,7 +690,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] @@ -715,9 +713,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -749,7 +747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa60999fb9292247d7c7eec5dada22b4ba337394612b0d935616bf49964c8bfd" dependencies = [ "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -765,12 +763,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -805,9 +797,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "ena" @@ -824,7 +816,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -832,18 +824,18 @@ dependencies = [ [[package]] name = "enum-display" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d4df33d54dd1959d177a0e2c2f4e5a8637a3054aa56861ed7e173ad2043fe2" +checksum = "02058bb25d8d0605829af88230427dd5cd50661590bd2b09d1baf7c64c417f24" dependencies = [ "enum-display-macro", ] [[package]] name = "enum-display-macro" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ce3a36047ede676eb0d2721d065beed8410cf4f113f489604d2971331cb378" +checksum = "d4be2cf2fe7b971b1865febbacd4d8df544aa6bd377cca011a6d69dcf4c60d94" dependencies = [ "convert_case 0.6.0", "quote", @@ -858,12 +850,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -885,9 +877,20 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" dependencies = [ "concurrent-queue", "parking", @@ -900,7 +903,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +dependencies = [ + "event-listener 5.3.0", "pin-project-lite", ] @@ -915,9 +928,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "finl_unicode" @@ -969,7 +982,7 @@ checksum = "528dcee17708842e42ec482eb77946d0f80b0a23aec649f67f916a32f1275007" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -980,24 +993,24 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1006,9 +1019,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1027,9 +1040,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3831c2651acb5177cbd83943f3d9c8912c5ad03c76afcc0e9511ba568ec5ebb" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "futures-core", "pin-project-lite", @@ -1037,32 +1050,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-io", @@ -1086,9 +1099,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -1103,11 +1116,11 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" -version = "0.18.1" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", "libgit2-sys", "log", @@ -1130,27 +1143,27 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] -name = "hashbrown" -version = "0.14.2" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1180,9 +1193,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1236,22 +1249,12 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] @@ -1280,7 +1283,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.5", + "socket2 0.5.6", "widestring", "windows-sys 0.48.0", "winreg", @@ -1294,29 +1297,20 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix 0.38.25", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.52.0", ] [[package]] name = "is_ci" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" - -[[package]] -name = "itertools" -version = "0.10.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itertools" @@ -1329,33 +1323,33 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1371,34 +1365,33 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop-util", "petgraph", "pico-args", "regex", - "regex-syntax 0.7.5", + "regex-syntax", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex", + "regex-automata", ] [[package]] @@ -1409,15 +1402,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -1429,13 +1422,12 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -1454,9 +1446,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" dependencies = [ "cc", "libc", @@ -1478,9 +1470,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -1494,9 +1486,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ "value-bag", ] @@ -1534,9 +1526,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "miette" @@ -1567,23 +1559,23 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1592,9 +1584,9 @@ dependencies = [ [[package]] name = "mongodb" -version = "2.7.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c926772050c3a3f87c837626bf6135c8ca688d91d31dd39a3da547fc2bc9fe" +checksum = "ef206acb1b72389b49bc9985efe7eb1f8a9bb18e5680d262fac26c07f44025f1" dependencies = [ "async-executor", "async-std", @@ -1626,7 +1618,7 @@ dependencies = [ "sha2", "socket2 0.4.10", "stringprep", - "strsim", + "strsim 0.10.0", "take_mut", "thiserror", "tokio", @@ -1641,15 +1633,21 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -1666,18 +1664,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" @@ -1687,9 +1685,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -1760,7 +1758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap", ] [[package]] @@ -1780,9 +1778,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1797,15 +1795,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-io", ] [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" @@ -1825,14 +1823,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.1" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.25", + "rustix 0.38.33", "tracing", "windows-sys 0.52.0", ] @@ -1855,35 +1854,11 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -1896,9 +1871,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1987,9 +1962,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -1998,38 +1973,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "remove_dir_all" @@ -2052,16 +2021,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2085,7 +2055,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.22", ] [[package]] @@ -2114,22 +2084,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "e3cc72858054fcff6d7dea32df2aeaee6a7c24227366d7ea429aada2f26b16ad" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.11", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", @@ -2143,7 +2113,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -2158,15 +2128,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -2204,9 +2174,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "semver-parser" @@ -2216,40 +2186,40 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ - "indexmap 2.1.0", + "indexmap", "itoa", "ryu", "serde", @@ -2301,9 +2271,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2325,9 +2295,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smawk" @@ -2347,12 +2317,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2391,6 +2361,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "subtle" version = "2.5.0" @@ -2418,9 +2394,9 @@ dependencies = [ [[package]] name = "supports-unicode" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" +checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" dependencies = [ "is-terminal", ] @@ -2438,9 +2414,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2471,15 +2447,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "redox_syscall", - "rustix 0.38.25", - "windows-sys 0.48.0", + "fastrand 2.0.2", + "rustix 0.38.33", + "windows-sys 0.52.0", ] [[package]] @@ -2505,14 +2480,14 @@ dependencies = [ [[package]] name = "test_each_file" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35e692782e9ed6f0fc285a2c179950f7b386213034de258aab961aabf2123bc" +checksum = "0f1a92330478de0709111391059475f7d960692519e2c54c823c662408bab365" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", + "unicode-ident", ] [[package]] @@ -2528,32 +2503,33 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2568,10 +2544,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -2601,9 +2578,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -2611,7 +2588,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.5.6", "tokio-macros", "windows-sys 0.48.0", ] @@ -2624,7 +2601,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -2731,9 +2708,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2749,18 +2726,18 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" @@ -2799,9 +2776,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", "serde", @@ -2809,9 +2786,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.4.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" +checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" [[package]] name = "vcpkg" @@ -2833,9 +2810,9 @@ checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -2849,9 +2826,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2859,24 +2836,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2886,9 +2863,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2896,28 +2873,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2925,15 +2902,15 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -2968,11 +2945,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -2990,7 +2967,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -3010,17 +2987,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -3031,9 +3009,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -3043,9 +3021,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -3055,9 +3033,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -3067,9 +3051,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -3079,9 +3063,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -3091,9 +3075,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -3103,9 +3087,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -3128,9 +3112,9 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "byteorder", "zerocopy-derive", @@ -3138,11 +3122,11 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] diff --git a/bencher/src/main.rs b/bencher/src/main.rs index daebd96..55e45ad 100644 --- a/bencher/src/main.rs +++ b/bencher/src/main.rs @@ -1,310 +1,307 @@ -use clap::Parser; -use compiler::interpreter::TestIO; -use compiler::passes::parse::parse::parse; -use compiler::passes::select::interpreter::IStats; -use compiler::utils::split_test::split_test; -use git2::{Commit, Repository}; -use mongodb::bson; -use mongodb::bson::{doc, to_bson, Bson, Document}; -use mongodb::options::{ClientOptions, Credential, ServerAddress}; -use mongodb::sync::{Client, Collection}; -use pathdiff::diff_paths; -use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use std::env; -use std::fs::read_to_string; -use std::fs::File; -use std::path::Path; -use tempdir::TempDir; -use walkdir::WalkDir; - -/// Stats gathered by the bencher. -// #[derive(Check)] -#[derive(Debug, Deserialize, Serialize)] -struct BStats { - // #[lower_is_better] - binary_size: usize, - // todo: speed? -} - -/// Accumulated stats. -// #[derive(Check)] -#[derive(Debug, Deserialize, Serialize)] -struct Stats { - // #[recursive] - bencher_stats: BStats, - // #[recursive] - interpreter_stats: IStats, -} - -#[derive(Debug, Deserialize, Serialize)] -struct StatsPartial { - bencher_stats: Option, - interpreter_stats: Option, -} - -#[derive(Debug, Deserialize, Serialize)] -struct BStatsPartial { - binary_size: Option, -} - -#[derive(Debug, Deserialize, Serialize)] -struct IStatsPartial { - branches_taken: Option, - instructions_executed: Option, -} - -trait Check { - type Partial; - - /// Checks whether `self` does not regress compared to `other`. - fn check(&self, prev: &Self::Partial) -> bool; -} - -impl Check for Stats { - type Partial = StatsPartial; - - fn check(&self, prev: &Self::Partial) -> bool { - if let Some(prev) = &prev.bencher_stats { - if !self.bencher_stats.check(prev) { - return false; - } - } - if let Some(prev) = &prev.interpreter_stats { - if !self.interpreter_stats.check(prev) { - return false; - } - } - - true - } -} - -impl Check for BStats { - type Partial = BStatsPartial; - - fn check(&self, prev: &Self::Partial) -> bool { - if let Some(prev) = prev.binary_size { - if !(self.binary_size <= prev) { - eprint!( - "Statistic `binary_size` regressed from {prev:?} to {:?} in test ", - self.binary_size - ); - return false; - } - } - - true - } -} - -impl Check for IStats { - type Partial = IStatsPartial; - - fn check(&self, prev: &Self::Partial) -> bool { - if let Some(prev) = prev.branches_taken { - if !(self.branches_taken <= prev) { - eprint!( - "Statistic `branches_taken` regressed from {prev:?} to {:?} in test ", - self.branches_taken - ); - return false; - } - } - - if let Some(prev) = prev.instructions_executed { - if !(self.instructions_executed <= prev) { - eprint!( - "Statistic `instructions_executed` regressed from {prev:?} to {:?} in test ", - self.instructions_executed - ); - return false; - } - } - - true - } -} - -#[derive(Parser, Debug)] -#[command(author, version, about, long_about = None)] -struct Args { - #[arg(short, long)] - read: bool, - - #[arg(short, long)] - write: bool, -} - -fn main() { - let args = Args::parse(); - assert!( - args.read || args.write, - "Should compare results or write new ones." - ); - - let mongo_pw = - env::var("MONGO_PW").expect("No environment variable was set to connect to the database."); - let address = env::var("MONGO_ADDRESS") - .expect("No environment variable was set to connect to the database."); - - let client_options = ClientOptions::builder() - .credential(Some( - Credential::builder() - .username(Some("cc".to_string())) - .password(Some(mongo_pw)) - .build(), - )) - .hosts(vec![ServerAddress::parse(address).unwrap()]) - .build(); - let client = Client::with_options(client_options).unwrap(); - - let mut test_data = doc!(); - - for entry in WalkDir::new("./programs/good") - .into_iter() - .filter_map(|e| e.ok()) - .filter(|f| f.file_type().is_file()) - { - let program = read_to_string(entry.path()).unwrap(); - - let mut path = diff_paths(entry.path(), "./programs/good").unwrap(); - path.set_extension(""); - let path = path - .to_str() - .unwrap() - .to_string() - .replace(['/', '\\'], "::"); - - test_data.insert(path, to_bson(&Stats::from_program(&program)).unwrap()); - } - - let db = client.database("rust-compiler-construction"); - let benches = db.collection("benches"); - - let repo = Repository::open(".").unwrap(); - let oid = repo.head().unwrap().target().unwrap(); - let commit = repo.find_commit(oid).unwrap(); - - let new_stats = - bson::from_bson::>(Bson::Document(test_data.clone())).unwrap(); - - if args.read { - assert!(check_parents(&benches, &commit, &new_stats)); - } - - if args.write { - write_commit(&benches, &commit, &test_data); - } -} - -fn check_parents( - benches: &Collection, - commit: &Commit, - new_stats: &HashMap, -) -> bool { - let mut ok = true; - for parent in commit.parents() { - let filter = doc!("commits.hash": parent.id().to_string()); - let options = None; - if let Some(parent_data) = benches.find_one(filter, options).unwrap() { - let parent_data = parent_data - .get_array("commits") - .unwrap() - .first() - .unwrap() - .as_document() - .unwrap() - .get_document("tests") - .unwrap(); - - let old_stats = bson::from_bson::>(Bson::Document( - parent_data.clone(), - )) - .unwrap(); - - for (test_name, new_stats) in new_stats { - if let Some(old_stats) = old_stats.get(test_name) { - if !new_stats.check(old_stats) { - ok = false; - eprintln!( - "`{test_name}` when comparing with parent `{}`.", - parent.id() - ); - } - } - } - } else { - ok &= check_parents(benches, &parent, new_stats); - }; - } - ok -} - -fn write_commit(benches: &Collection, commit: &Commit<'_>, test_data: &Document) { - let hash = commit.id().to_string(); - let time = commit.time().seconds(); - let summary = commit.summary().unwrap(); - - let commit = doc!( - "hash": hash, - "summary": summary, - "time": time, - "tests": test_data - ); - - let filter = doc!(); - let update = doc! ("$push": {"commits": commit}); - let options = None; - benches - .find_one_and_update(filter, update, options) - .unwrap() - .unwrap(); -} - -impl Stats { - fn from_program(program: &str) -> Self { - let (input, _, _, _) = split_test(program); - let mut io = TestIO::new(input); - - let tempdir = TempDir::new("cc-bench").unwrap(); - let output = tempdir.path().join("output"); - - let prg_concluded = parse(program) - .unwrap() - .validate() - .unwrap() - .reveal() - .atomize() - .explicate() - .eliminate() - .select() - .assign() - .patch() - .conclude(); - - let (_, interpreter_stats) = prg_concluded.interpret_with_stats(&mut io); - - let mut file = File::create(&output).unwrap(); - prg_concluded.emit().write(&mut file); - - let bencher_stats = BStats::new(&output); - - Stats { - bencher_stats, - interpreter_stats, - } - } -} - -impl BStats { - fn new(output: &Path) -> Self { - BStats { - binary_size: binary_size(output), - } - } -} - -fn binary_size(output: &Path) -> usize { - output.metadata().unwrap().len() as usize -} +// use clap::Parser; +// use compiler::passes::parse::parse::parse; +// use compiler::utils::split_test::split_test; +// use git2::{Commit, Repository}; +// use mongodb::bson; +// use mongodb::bson::{doc, to_bson, Bson, Document}; +// use mongodb::options::{ClientOptions, Credential, ServerAddress}; +// use mongodb::sync::{Client, Collection}; +// use pathdiff::diff_paths; +// use serde::{Deserialize, Serialize}; +// use std::collections::HashMap; +// use std::env; +// use std::fs::read_to_string; +// use std::fs::File; +// use std::path::Path; +// use tempdir::TempDir; +// use walkdir::WalkDir; +// +// /// Stats gathered by the bencher. +// // #[derive(Check)] +// #[derive(Debug, Deserialize, Serialize)] +// struct BStats { +// // #[lower_is_better] +// binary_size: usize, +// // todo: speed? +// } +// +// /// Accumulated stats. +// // #[derive(Check)] +// #[derive(Debug, Deserialize, Serialize)] +// struct Stats { +// // #[recursive] +// bencher_stats: BStats, +// // #[recursive] +// } +// +// #[derive(Debug, Deserialize, Serialize)] +// struct StatsPartial { +// bencher_stats: Option, +// interpreter_stats: Option, +// } +// +// #[derive(Debug, Deserialize, Serialize)] +// struct BStatsPartial { +// binary_size: Option, +// } +// +// #[derive(Debug, Deserialize, Serialize)] +// struct IStatsPartial { +// branches_taken: Option, +// instructions_executed: Option, +// } +// +// trait Check { +// type Partial; +// +// /// Checks whether `self` does not regress compared to `other`. +// fn check(&self, prev: &Self::Partial) -> bool; +// } +// +// impl Check for Stats { +// type Partial = StatsPartial; +// +// fn check(&self, prev: &Self::Partial) -> bool { +// if let Some(prev) = &prev.bencher_stats { +// if !self.bencher_stats.check(prev) { +// return false; +// } +// } +// if let Some(prev) = &prev.interpreter_stats { +// if !self.interpreter_stats.check(prev) { +// return false; +// } +// } +// +// true +// } +// } +// +// impl Check for BStats { +// type Partial = BStatsPartial; +// +// fn check(&self, prev: &Self::Partial) -> bool { +// if let Some(prev) = prev.binary_size { +// if !(self.binary_size <= prev) { +// eprint!( +// "Statistic `binary_size` regressed from {prev:?} to {:?} in test ", +// self.binary_size +// ); +// return false; +// } +// } +// +// true +// } +// } +// +// impl Check for IStats { +// type Partial = IStatsPartial; +// +// fn check(&self, prev: &Self::Partial) -> bool { +// if let Some(prev) = prev.branches_taken { +// if !(self.branches_taken <= prev) { +// eprint!( +// "Statistic `branches_taken` regressed from {prev:?} to {:?} in test ", +// self.branches_taken +// ); +// return false; +// } +// } +// +// if let Some(prev) = prev.instructions_executed { +// if !(self.instructions_executed <= prev) { +// eprint!( +// "Statistic `instructions_executed` regressed from {prev:?} to {:?} in test ", +// self.instructions_executed +// ); +// return false; +// } +// } +// +// true +// } +// } +// +// #[derive(Parser, Debug)] +// #[command(author, version, about, long_about = None)] +// struct Args { +// #[arg(short, long)] +// read: bool, +// +// #[arg(short, long)] +// write: bool, +// } +// +// fn main() { +// let args = Args::parse(); +// assert!( +// args.read || args.write, +// "Should compare results or write new ones." +// ); +// +// let mongo_pw = +// env::var("MONGO_PW").expect("No environment variable was set to connect to the database."); +// let address = env::var("MONGO_ADDRESS") +// .expect("No environment variable was set to connect to the database."); +// +// let client_options = ClientOptions::builder() +// .credential(Some( +// Credential::builder() +// .username(Some("cc".to_string())) +// .password(Some(mongo_pw)) +// .build(), +// )) +// .hosts(vec![ServerAddress::parse(address).unwrap()]) +// .build(); +// let client = Client::with_options(client_options).unwrap(); +// +// let mut test_data = doc!(); +// +// for entry in WalkDir::new("./programs/good") +// .into_iter() +// .filter_map(|e| e.ok()) +// .filter(|f| f.file_type().is_file()) +// { +// let program = read_to_string(entry.path()).unwrap(); +// +// let mut path = diff_paths(entry.path(), "./programs/good").unwrap(); +// path.set_extension(""); +// let path = path +// .to_str() +// .unwrap() +// .to_string() +// .replace(['/', '\\'], "::"); +// +// test_data.insert(path, to_bson(&Stats::from_program(&program)).unwrap()); +// } +// +// let db = client.database("rust-compiler-construction"); +// let benches = db.collection("benches"); +// +// let repo = Repository::open(".").unwrap(); +// let oid = repo.head().unwrap().target().unwrap(); +// let commit = repo.find_commit(oid).unwrap(); +// +// let new_stats = +// bson::from_bson::>(Bson::Document(test_data.clone())).unwrap(); +// +// if args.read { +// assert!(check_parents(&benches, &commit, &new_stats)); +// } +// +// if args.write { +// write_commit(&benches, &commit, &test_data); +// } +// } +// +// fn check_parents( +// benches: &Collection, +// commit: &Commit, +// new_stats: &HashMap, +// ) -> bool { +// let mut ok = true; +// for parent in commit.parents() { +// let filter = doc!("commits.hash": parent.id().to_string()); +// let options = None; +// if let Some(parent_data) = benches.find_one(filter, options).unwrap() { +// let parent_data = parent_data +// .get_array("commits") +// .unwrap() +// .first() +// .unwrap() +// .as_document() +// .unwrap() +// .get_document("tests") +// .unwrap(); +// +// let old_stats = bson::from_bson::>(Bson::Document( +// parent_data.clone(), +// )) +// .unwrap(); +// +// for (test_name, new_stats) in new_stats { +// if let Some(old_stats) = old_stats.get(test_name) { +// if !new_stats.check(old_stats) { +// ok = false; +// eprintln!( +// "`{test_name}` when comparing with parent `{}`.", +// parent.id() +// ); +// } +// } +// } +// } else { +// ok &= check_parents(benches, &parent, new_stats); +// }; +// } +// ok +// } +// +// fn write_commit(benches: &Collection, commit: &Commit<'_>, test_data: &Document) { +// let hash = commit.id().to_string(); +// let time = commit.time().seconds(); +// let summary = commit.summary().unwrap(); +// +// let commit = doc!( +// "hash": hash, +// "summary": summary, +// "time": time, +// "tests": test_data +// ); +// +// let filter = doc!(); +// let update = doc! ("$push": {"commits": commit}); +// let options = None; +// benches +// .find_one_and_update(filter, update, options) +// .unwrap() +// .unwrap(); +// } +// +// impl Stats { +// fn from_program(program: &str) -> Self { +// let (input, _, _, _) = split_test(program); +// let mut io = TestIO::new(input); +// +// let tempdir = TempDir::new("cc-bench").unwrap(); +// let output = tempdir.path().join("output"); +// +// let prg_concluded = parse(program) +// .unwrap() +// .validate() +// .unwrap() +// .reveal() +// .atomize() +// .explicate() +// .eliminate() +// .select() +// .assign() +// .patch() +// .conclude(); +// +// let (_, interpreter_stats) = prg_concluded.interpret_with_stats(&mut io); +// +// let mut file = File::create(&output).unwrap(); +// prg_concluded.emit().write(&mut file); +// +// let bencher_stats = BStats::new(&output); +// +// Stats { +// bencher_stats, +// interpreter_stats, +// } +// } +// } +// +// impl BStats { +// fn new(output: &Path) -> Self { +// BStats { +// binary_size: binary_size(output), +// } +// } +// } +// +// fn binary_size(output: &Path) -> usize { +// output.metadata().unwrap().len() as usize +// } diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 707ba60..37887b0 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -24,7 +24,7 @@ binary-heap-plus = "0.5.0" lalrpop = "0.20.0" [dev-dependencies] -test_each_file = "0.3.0" +test_each_file = "0.3.2" tempfile = "3.8.1" enum-display = "0.1.3" derive-name = "1.1.0" diff --git a/compiler/src/passes/assign/include_liveness.rs b/compiler/src/passes/assign/include_liveness.rs index 30b97b3..50bdbaf 100644 --- a/compiler/src/passes/assign/include_liveness.rs +++ b/compiler/src/passes/assign/include_liveness.rs @@ -185,5 +185,8 @@ pub fn handle_instr<'p>( } arg(src, R); } + InstrSelected::IDiv { .. } => todo!(), + InstrSelected::IMul { .. } => todo!(), + InstrSelected::MovSX { .. } => todo!(), } } diff --git a/compiler/src/passes/assign/mod.rs b/compiler/src/passes/assign/mod.rs index 495af41..90175ce 100644 --- a/compiler/src/passes/assign/mod.rs +++ b/compiler/src/passes/assign/mod.rs @@ -5,7 +5,6 @@ mod display; mod include_liveness; use crate::passes::select::{Block, FunSelected, Instr, InstrSelected, Reg, VarArg, X86Selected}; -use crate::passes::validate::Int; use crate::utils::unique_sym::UniqueSym; use derive_more::Display; use functor_derive::Functor; @@ -30,7 +29,7 @@ pub type InstrAssigned<'p> = Instr>; #[derive(Clone, Display)] pub enum Arg { #[display(fmt = "${_0}")] - Imm(Int), + Imm(i32), #[display(fmt = "%{_0}")] Reg(Reg), #[display(fmt = "[%{reg} + ${off}]")] diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 7fffb01..e24599e 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -4,7 +4,7 @@ mod display; use crate::passes::parse::types::Type; use crate::passes::parse::{BinaryOp, Def, Lit, Typed, UnaryOp}; use crate::passes::select::InstrSelected; -use crate::passes::validate::Int; + use crate::utils::unique_sym::UniqueSym; use derive_more::Display; use itertools::Itertools; @@ -81,7 +81,7 @@ pub enum AExpr<'p> { #[derive(Copy, Clone, Display)] pub enum Atom<'p> { - Val { val: Lit }, + Val { val: Lit }, Var { sym: UniqueSym<'p> }, } diff --git a/compiler/src/passes/conclude/conclude.rs b/compiler/src/passes/conclude/conclude.rs index bb572c1..1caa343 100644 --- a/compiler/src/passes/conclude/conclude.rs +++ b/compiler/src/passes/conclude/conclude.rs @@ -6,83 +6,82 @@ use crate::utils::unique_sym::gen_sym; use crate::*; use std::collections::HashMap; + impl<'p> X86Patched<'p> { #[must_use] pub fn conclude(self) -> X86Concluded<'p> { - // let entries = self - // .fns - // .iter() - // .map(|(sym, f)| (*sym, f.entry)) - // .collect::>(); - // - // let mut blocks = self - // .fns - // .into_iter() - // .flat_map(|(_, mut fun)| { - // fix_stack_space(fun.blocks.get_mut(&fun.entry).unwrap(), fun.stack_space); - // fix_stack_space(fun.blocks.get_mut(&fun.exit).unwrap(), fun.stack_space); - // - // // Replace calls to function labels with calls to the entries of those functions. - // fun.blocks.into_iter().map(|(block_sym, mut block)| { - // for instr in &mut block.instrs { - // match instr { - // Instr::CallDirect { lbl, .. } | Instr::LoadLbl { lbl, .. } => { - // *lbl = entries[&lbl]; - // } - // _ => {} - // } - // } - // (block_sym, block) - // }) - // }) - // .collect::>(); - // - // let entry = gen_sym("runtime"); - // blocks.insert( - // entry, - // block!( - // call_direct!(entries[&self.entry], 0), - // mov!(reg!(RAX), reg!(RDI)), - // mov!(imm32!(0x3C), reg!(RAX)), // todo: can be smaller - // syscall!(2) - // ), - // ); - // - // let program = X86Concluded { blocks, entry }; - // - // // display!(&program, Conclude); // todo - // time!("conclude"); - // - // program - todo!() + let entries = self + .fns + .iter() + .map(|(sym, f)| (*sym, f.entry)) + .collect::>(); + + let mut blocks = self + .fns + .into_iter() + .flat_map(|(_, mut fun)| { + fix_stack_space(fun.blocks.get_mut(&fun.entry).unwrap(), fun.stack_space); + fix_stack_space(fun.blocks.get_mut(&fun.exit).unwrap(), fun.stack_space); + + // Replace calls to function labels with calls to the entries of those functions. + fun.blocks.into_iter().map(|(block_sym, mut block)| { + for instr in &mut block.instrs { + match instr { + Instr::CallDirect { lbl, .. } | Instr::LoadLbl { lbl, .. } => { + *lbl = entries[&lbl]; + } + _ => {} + } + } + (block_sym, block) + }) + }) + .collect::>(); + + let entry = gen_sym("runtime"); + blocks.insert( + entry, + block!( + call_direct!(entries[&self.entry], 0), + mov!(reg!(RAX), reg!(RDI)), + mov!(imm!(0x3C), reg!(RAX)), // todo: can be smaller + syscall!(2) + ), + ); + + let program = X86Concluded { blocks, entry }; + + // display!(&program, Conclude); // todo + time!("conclude"); + + program } } /// Fixes stack allocation for spilled variables. fn fix_stack_space(block: &mut Block, stack_space: usize) { - // for instr in &mut block.instrs { - // match instr { - // InstrAssigned::Addq { - // src: Arg::Imm(Imm::Imm32(val)), - // .. - // } - // | InstrAssigned::Sub { - // src: Arg::Imm(Imm::Imm32(val)), - // .. - // } => { - // assert_eq!(*val, 0x1000); - // *val = stack_space as u32; - // } - // InstrAssigned::Addq { - // src: Arg::Imm(_), .. - // } - // | InstrAssigned::Sub { - // src: Arg::Imm(_), .. - // } => { - // todo!() - // } - // _ => {} - // } - // } - todo!() + for instr in &mut block.instrs { + match instr { + InstrAssigned::Add { + src: Arg::Imm(val), + .. + } + | InstrAssigned::Sub { + src: Arg::Imm(val), + .. + } => { + assert_eq!(*val, 0x1000); + *val = stack_space as i32; + } + InstrAssigned::Add { + src: Arg::Imm(_), .. + } + | InstrAssigned::Sub { + src: Arg::Imm(_), .. + } => { + todo!() + } + _ => {} + } + } } diff --git a/compiler/src/passes/emit/binary.rs b/compiler/src/passes/emit/binary.rs index 58d8030..d155581 100644 --- a/compiler/src/passes/emit/binary.rs +++ b/compiler/src/passes/emit/binary.rs @@ -63,93 +63,85 @@ pub const MOVQ_INFO: BinaryOpInfo = BinaryOpInfo { }; pub fn encode_binary_instr(op_info: BinaryOpInfo, src: &Arg, dst: &Arg) -> Vec { - todo!() - // match (src, dst) { - // (Arg::Reg(src), Arg::Reg(dst)) => { - // let (s, sss) = encode_reg(src); - // let (d, ddd) = encode_reg(dst); - // vec![ - // 0b0100_1000 | (s << 2) | d, - // op_info.r_rm, - // 0b11_000_000 | sss << 3 | ddd, - // ] - // } - // (Arg::Deref { reg: src, off }, Arg::Reg(dst)) => { - // let (s, sss) = encode_reg(src); - // let (d, ddd) = encode_reg(dst); - // let off = *off as i32; - // - // let mut v = vec![ - // 0b0100_1000 | (d << 2) | s, - // op_info.rm_r, - // 0b10_000_000 | ddd << 3 | sss, - // ]; - // if matches!(src, Reg::RSP | Reg::R12) { - // v.push(0x24); - // } - // v.extend(off.to_le_bytes()); - // v - // } - // (Arg::Reg(src), Arg::Deref { reg: dst, off }) => { - // let (s, sss) = encode_reg(src); - // let (d, ddd) = encode_reg(dst); - // let off = *off as i32; - // - // let mut v = vec![ - // 0b0100_1000 | (s << 2) | d, - // op_info.r_rm, - // 0b10_000_000 | sss << 3 | ddd, - // ]; - // if matches!(dst, Reg::RSP | Reg::R12) { - // v.push(0x24); - // } - // v.extend(off.to_le_bytes()); - // v - // } - // (Arg::Imm(imm), Arg::Reg(dst)) => match imm { - // Imm::Imm8(_) => todo!(), - // Imm::Imm16(_) => todo!(), - // Imm::Imm32(imm) => { - // let (d, ddd) = encode_reg(dst); - // - // let mut v = vec![ - // 0b0100_1000 | d, - // op_info.i_rm, - // 0b11_000_000 | op_info.pad << 3 | ddd, - // ]; - // v.extend(imm.to_le_bytes()); - // v - // } - // Imm::Imm64(_) => todo!(), - // }, - // (Arg::Imm(imm), Arg::Deref { reg: dst, off }) => match imm { - // Imm::Imm8(_) => todo!(), - // Imm::Imm16(_) => todo!(), - // Imm::Imm32(imm) => { - // let (d, ddd) = encode_reg(dst); - // let off = *off as i32; - // - // let mut v = vec![ - // 0b0100_1000 | d, - // op_info.i_rm, - // 0b10_000_000 | op_info.pad << 3 | ddd, - // ]; - // if matches!(dst, Reg::RSP | Reg::R12) { - // v.push(0x24); - // } - // v.extend(off.to_le_bytes()); - // v.extend(imm.to_le_bytes()); - // v - // } - // Imm::Imm64(_) => todo!(), - // }, - // (Arg::Deref { .. }, Arg::Deref { .. }) => { - // unreachable!("Found binary instruction with 2 derefs."); - // } - // (_, Arg::Imm { .. }) => { - // unreachable!("Found immediate in destination position."); - // } - // } + match (src, dst) { + (Arg::Reg(src), Arg::Reg(dst)) => { + let (s, sss) = encode_reg(src); + let (d, ddd) = encode_reg(dst); + vec![ + 0b0100_1000 | (s << 2) | d, + op_info.r_rm, + 0b11_000_000 | sss << 3 | ddd, + ] + } + (Arg::Deref { reg: src, off }, Arg::Reg(dst)) => { + let (s, sss) = encode_reg(src); + let (d, ddd) = encode_reg(dst); + let off = *off as i32; + + let mut v = vec![ + 0b0100_1000 | (d << 2) | s, + op_info.rm_r, + 0b10_000_000 | ddd << 3 | sss, + ]; + if matches!(src, Reg::RSP | Reg::R12) { + v.push(0x24); + } + v.extend(off.to_le_bytes()); + v + } + (Arg::Reg(src), Arg::Deref { reg: dst, off }) => { + let (s, sss) = encode_reg(src); + let (d, ddd) = encode_reg(dst); + let off = *off as i32; + + let mut v = vec![ + 0b0100_1000 | (s << 2) | d, + op_info.r_rm, + 0b10_000_000 | sss << 3 | ddd, + ]; + if matches!(dst, Reg::RSP | Reg::R12) { + v.push(0x24); + } + v.extend(off.to_le_bytes()); + v + } + (Arg::Imm(imm), Arg::Reg(dst)) => { + let (d, ddd) = encode_reg(dst); + + let mut v = vec![ + 0b0100_1000 | d, + op_info.i_rm, + 0b11_000_000 | op_info.pad << 3 | ddd, + ]; + v.extend(imm.to_le_bytes()); + v + + }, + (Arg::Imm(imm), Arg::Deref { reg: dst, off }) => { + + let (d, ddd) = encode_reg(dst); + let off = *off as i32; + + let mut v = vec![ + 0b0100_1000 | d, + op_info.i_rm, + 0b10_000_000 | op_info.pad << 3 | ddd, + ]; + if matches!(dst, Reg::RSP | Reg::R12) { + v.push(0x24); + } + v.extend(off.to_le_bytes()); + v.extend(imm.to_le_bytes()); + v + + }, + (Arg::Deref { .. }, Arg::Deref { .. }) => { + unreachable!("Found binary instruction with 2 derefs."); + } + (_, Arg::Imm { .. }) => { + unreachable!("Found immediate in destination position."); + } + } } // #[cfg(test)] @@ -246,7 +238,7 @@ pub fn encode_binary_instr(op_info: BinaryOpInfo, src: &Arg, dst: &Arg) -> Vec Vec Vec( rel_jumps: &mut HashMap>, abs_jumps: &mut HashMap>, ) { - // let v = match instr { - // Instr::Addq { src, dst } => encode_binary_instr(ADDQ_INFO, src, dst), - // Instr::Sub { src, dst } => encode_binary_instr(SUBQ_INFO, src, dst), - // Instr::Movq { src, dst } => encode_binary_instr(MOVQ_INFO, src, dst), - // Instr::Negq { dst } => encode_unary_instr(NEGQ_INFO, dst), - // Instr::Pushq { src } => encode_push_pop(PUSHQ_INFO, src), - // Instr::Popq { dst } => encode_push_pop(POPQ_INFO, dst), - // Instr::Cmpq { src, dst } => encode_binary_instr(CMPQ_INFO, src, dst), - // Instr::Andq { src, dst } => encode_binary_instr(ANDQ_INFO, src, dst), - // Instr::Or { src, dst } => encode_binary_instr(ORQ_INFO, src, dst), - // Instr::Xorq { src, dst } => encode_binary_instr(XORQ_INFO, src, dst), - // Instr::Notq { .. } => todo!(), - // Instr::Setcc { cnd } => encode_setcc(cnd), - // Instr::CallDirect { lbl, .. } => { - // rel_jumps.insert(machine_code.len() + 1, *lbl); - // vec![0xE8, 0x00, 0x00, 0x00, 0x00] - // } - // Instr::CallIndirect { src, .. } => encode_unary_instr(CALLQ_INDIRECT_INFO, src), - // Instr::Jmp { lbl } => { - // rel_jumps.insert(machine_code.len() + 1, *lbl); - // vec![0xE9, 0x00, 0x00, 0x00, 0x00] - // } - // Instr::Jcc { lbl, cnd } => { - // rel_jumps.insert(machine_code.len() + 2, *lbl); - // vec![0x0F, encode_cnd(*cnd), 0x00, 0x00, 0x00, 0x00] - // } - // Instr::Retq => vec![0xC3], - // Instr::Syscall { .. } => vec![0x0F, 0x05], - // Instr::Divq { divisor } => encode_muldiv_instr( - // MulDivOpInfo { - // op: 0xF7, - // imm_as_src: 0b110, - // }, - // divisor, - // ), - // Instr::Mulq { src } => encode_muldiv_instr( - // MulDivOpInfo { - // op: 0xF7, - // imm_as_src: 0b100, - // }, - // src, - // ), - // Instr::LoadLbl { lbl, dst } => { - // // This instruction creates a 32-bit placeholder and stores the offset so it can be set to `lbl` later. - // let bytes = encode_binary_instr(MOVQ_INFO, &imm!(0), dst); - // // The label should, regardless of the destination variant, always be stored in the last 4 bytes (we hope). - // abs_jumps.insert(machine_code.len() + bytes.len() - 4, *lbl); - // bytes - // } - // }; - // machine_code.extend(v); - todo!() + let v = match instr { + Instr::Add { src, dst } => encode_binary_instr(ADDQ_INFO, src, dst), + Instr::Sub { src, dst } => encode_binary_instr(SUBQ_INFO, src, dst), + Instr::Mov { src, dst } => encode_binary_instr(MOVQ_INFO, src, dst), + Instr::Neg { dst } => encode_unary_instr(NEGQ_INFO, dst), + Instr::Push { src } => encode_push_pop(PUSHQ_INFO, src), + Instr::Pop { dst } => encode_push_pop(POPQ_INFO, dst), + Instr::Cmp { src, dst } => encode_binary_instr(CMPQ_INFO, src, dst), + Instr::And { src, dst } => encode_binary_instr(ANDQ_INFO, src, dst), + Instr::Or { src, dst } => encode_binary_instr(ORQ_INFO, src, dst), + Instr::Xor { src, dst } => encode_binary_instr(XORQ_INFO, src, dst), + Instr::Not { .. } => todo!(), + Instr::Setcc { cnd } => encode_setcc(cnd), + Instr::CallDirect { lbl, .. } => { + rel_jumps.insert(machine_code.len() + 1, *lbl); + vec![0xE8, 0x00, 0x00, 0x00, 0x00] + } + Instr::CallIndirect { src, .. } => encode_unary_instr(CALLQ_INDIRECT_INFO, src), + Instr::Jmp { lbl } => { + rel_jumps.insert(machine_code.len() + 1, *lbl); + vec![0xE9, 0x00, 0x00, 0x00, 0x00] + } + Instr::Jcc { lbl, cnd } => { + rel_jumps.insert(machine_code.len() + 2, *lbl); + vec![0x0F, encode_cnd(*cnd), 0x00, 0x00, 0x00, 0x00] + } + Instr::Ret => vec![0xC3], + Instr::Syscall { .. } => vec![0x0F, 0x05], + Instr::Div { divisor } => encode_muldiv_instr( + MulDivOpInfo { + op: 0xF7, + imm_as_src: 0b110, + }, + divisor, + ), + Instr::Mul { src } => encode_muldiv_instr( + MulDivOpInfo { + op: 0xF7, + imm_as_src: 0b100, + }, + src, + ), + Instr::LoadLbl { lbl, dst } => { + // This instruction creates a 32-bit placeholder and stores the offset so it can be set to `lbl` later. + let bytes = encode_binary_instr(MOVQ_INFO, &imm!(0), dst); + // The label should, regardless of the destination variant, always be stored in the last 4 bytes (we hope). + abs_jumps.insert(machine_code.len() + bytes.len() - 4, *lbl); + bytes + } + Instr::IDiv { .. } => todo!(), + Instr::IMul { .. } => todo!(), + Instr::MovSX { .. } => todo!(), + }; + machine_code.extend(v); } fn encode_reg(reg: &Reg) -> (u8, u8) { diff --git a/compiler/src/passes/emit/push_pop.rs b/compiler/src/passes/emit/push_pop.rs index f20bfcc..269c3cf 100644 --- a/compiler/src/passes/emit/push_pop.rs +++ b/compiler/src/passes/emit/push_pop.rs @@ -1,6 +1,6 @@ use crate::passes::assign::Arg; use crate::passes::emit; -use crate::passes::validate::Int; + pub struct PushPopInfo { pub op_reg: u8, @@ -25,13 +25,10 @@ pub const POPQ_INFO: PushPopInfo = PushPopInfo { pub fn encode_push_pop(op_info: PushPopInfo, reg: &Arg) -> Vec { match reg { - Arg::Imm(imm) => match imm { - Int::I64(val) => { - let mut v = vec![op_info.op_imm]; - v.extend(val.to_le_bytes()); - v - } - _ => todo!(), + Arg::Imm(val) => { + let mut v = vec![op_info.op_imm]; + v.extend(val.to_le_bytes()); + v }, Arg::Reg(reg) => { let (r, rrr) = emit::encode_reg(reg); diff --git a/compiler/src/passes/parse/grammar.lalrpop b/compiler/src/passes/parse/grammar.lalrpop index a83e270..66524a5 100644 --- a/compiler/src/passes/parse/grammar.lalrpop +++ b/compiler/src/passes/parse/grammar.lalrpop @@ -3,7 +3,7 @@ use crate::passes::parse::{ }; use crate::passes::select::{VarArg, Reg}; use functor_derive::Functor; -use crate::passes::validate::Int; + use crate::passes::select::Size; grammar; @@ -399,26 +399,26 @@ Comma: Vec = { Spanned: Spanned = => Meta { meta: (l, r - l), inner }; AsmInstr: InstrParsed<'input> = { - "addq" => InstrParsed::Add { src, dst, size: Size::Bit64 }, - "subq" => InstrParsed::Sub { src, dst, size: Size::Bit64 }, - "mulq" => InstrParsed::Mul { src, size: Size::Bit64 }, - "divq" => InstrParsed::Div { divisor, size: Size::Bit64 }, - "negq" => InstrParsed::Neg { dst, size: Size::Bit64 }, - "movq" => InstrParsed::Mov { src, dst, size: Size::Bit64 }, - "pushq" => InstrParsed::Push { src, size: Size::Bit64 }, - "popq" => InstrParsed::Pop { dst, size: Size::Bit64 }, - "andq" => InstrParsed::And { src, dst, size: Size::Bit64 }, - "orq" => InstrParsed::Or { src, dst, size: Size::Bit64 }, - "xorq" => InstrParsed::Xor { src, dst, size: Size::Bit64 }, - "notq" => InstrParsed::Not { dst, size: Size::Bit64 }, - "cmpq" => InstrParsed::Cmp { src, dst, size: Size::Bit64 }, + "addq" => InstrParsed::Add { src, dst }, + "subq" => InstrParsed::Sub { src, dst }, + "mulq" => InstrParsed::Mul { src }, + "divq" => InstrParsed::Div { divisor }, + "negq" => InstrParsed::Neg { dst }, + "movq" => InstrParsed::Mov { src, dst }, + "pushq" => InstrParsed::Push { src }, + "popq" => InstrParsed::Pop { dst }, + "andq" => InstrParsed::And { src, dst }, + "orq" => InstrParsed::Or { src, dst }, + "xorq" => InstrParsed::Xor { src, dst }, + "notq" => InstrParsed::Not { dst }, + "cmpq" => InstrParsed::Cmp { src, dst }, "syscall" => InstrParsed::Syscall { arity: arity.parse().expect("internal compiler error :(") }, } AsmArg: VarArg> = { => VarArg::Reg(reg), "{" "}" => VarArg::XVar(sym), - "$" => VarArg::Imm(Int::I64(val.parse().expect("Internal compiler error (oh no!): We were too lazy to make a proper error for this"))), + "$" => VarArg::Imm(val.parse().expect("Internal compiler error (oh no!): We were too lazy to make a proper error for this")), "[" "+" "]" => VarArg::Deref { reg, off: off.parse().expect("Internal compiler error (oh no!): We were too lazy to make a proper error for this"), diff --git a/compiler/src/passes/patch/patch.rs b/compiler/src/passes/patch/patch.rs index 90470de..cd97148 100644 --- a/compiler/src/passes/patch/patch.rs +++ b/compiler/src/passes/patch/patch.rs @@ -44,13 +44,12 @@ fn patch_block(block: Block<'_, Arg>) -> Block<'_, Arg> { } fn patch_instr(instr: Instr>) -> Vec>> { - // match instr { - // Instr::Addq { src, dst } => patch_args(src, dst, |src, dst| add!(src, dst)), - // Instr::Sub { src, dst } => patch_args(src, dst, |src, dst| sub!(src, dst)), - // Instr::Movq { src, dst } => patch_args(src, dst, |src, dst| mov!(src, dst)), - // _ => vec![instr], - // } - todo!() + match instr { + Instr::Add { src, dst } => patch_args(src, dst, |src, dst| add!(src, dst)), + Instr::Sub { src, dst } => patch_args(src, dst, |src, dst| sub!(src, dst)), + Instr::Mov { src, dst } => patch_args(src, dst, |src, dst| mov!(src, dst)), + _ => vec![instr], + } } fn patch_args<'p>( @@ -58,14 +57,13 @@ fn patch_args<'p>( dst: Arg, op: fn(Arg, Arg) -> Instr>, ) -> Vec>> { - // match (&src, &dst) { - // (Arg::Deref { .. }, Arg::Deref { .. }) => vec![ - // push!(reg!(R8)), - // mov!(src, reg!(R8)), - // op(reg!(R8), dst), - // pop!(reg!(R8)), - // ], - // _ => vec![op(src, dst)], - // } - todo!() + match (&src, &dst) { + (Arg::Deref { .. }, Arg::Deref { .. }) => vec![ + push!(reg!(R8)), + mov!(src, reg!(R8)), + op(reg!(R8), dst), + pop!(reg!(R8)), + ], + _ => vec![op(src, dst)], + } } diff --git a/compiler/src/passes/reveal/mod.rs b/compiler/src/passes/reveal/mod.rs index 2baf2a0..4a8f053 100644 --- a/compiler/src/passes/reveal/mod.rs +++ b/compiler/src/passes/reveal/mod.rs @@ -3,7 +3,7 @@ pub mod reveal; use crate::passes::parse::{BinaryOp, Def, Lit, Typed, UnaryOp}; use crate::passes::select::InstrSelected; -use crate::passes::validate::Int; + use crate::utils::unique_sym::UniqueSym; use derive_more::Display; use itertools::Itertools; @@ -20,7 +20,7 @@ pub type DefRevealed<'p> = Def, &'p str, Typed<'p, RExpr<'p>>>; pub enum RExpr<'p> { Lit { - val: Lit, + val: Lit, }, Var { sym: UniqueSym<'p>, diff --git a/compiler/src/passes/select/macros.rs b/compiler/src/passes/select/macros.rs index 63a16da..dfdb9f8 100644 --- a/compiler/src/passes/select/macros.rs +++ b/compiler/src/passes/select/macros.rs @@ -7,122 +7,122 @@ macro_rules! block { #[macro_export] macro_rules! add { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Add { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! sub { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Sub { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! div { - ($divisor:expr, $size:expr) => { + ($divisor:expr) => { $crate::passes::select::Instr::Div { divisor: $divisor, - size: $size, + } }; } #[macro_export] macro_rules! idiv { - ($divisor:expr, $size:expr) => { + ($divisor:expr) => { $crate::passes::select::Instr::IDiv { divisor: $divisor, - size: $size, + } }; } #[macro_export] macro_rules! mul { - ($src:expr, $size:expr) => { + ($src:expr) => { $crate::passes::select::Instr::Mul { src: $src, - size: $size, + } }; } #[macro_export] macro_rules! imul { - ($src:expr, $size:expr) => { + ($src:expr) => { $crate::passes::select::Instr::IMul { src: $src, - size: $size, + } }; } #[macro_export] macro_rules! neg { - ($dst:expr, $size:expr) => { + ($dst:expr) => { $crate::passes::select::Instr::Neg { dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! mov { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Mov { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! movsx { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::MovSX { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! push { - ($src:expr, $size:expr) => { + ($src:expr) => { $crate::passes::select::Instr::Push { src: $src, - size: $size, + } }; } #[macro_export] macro_rules! pop { - ($dst:expr, $size:expr) => { + ($dst:expr) => { $crate::passes::select::Instr::Pop { dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! ret { - ($arity:expr) => { - $crate::passes::select::Instr::Ret { arity: $arity } + () => { + $crate::passes::select::Instr::Ret }; } @@ -135,11 +135,11 @@ macro_rules! syscall { #[macro_export] macro_rules! cmp { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Cmp { src: $src, dst: $dst, - size: $size, + } }; } @@ -163,43 +163,43 @@ macro_rules! jcc { #[macro_export] macro_rules! and { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::And { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! or { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Or { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! xor { - ($src:expr, $dst:expr, $size:expr) => { + ($src:expr, $dst:expr) => { $crate::passes::select::Instr::Xor { src: $src, dst: $dst, - size: $size, + } }; } #[macro_export] macro_rules! not { - ($dst:expr, $size:expr) => { + ($dst:expr) => { $crate::passes::select::Instr::Not { dst: $dst, - size: $size, + } }; } @@ -244,7 +244,7 @@ macro_rules! call_indirect { #[macro_export] macro_rules! imm { ($val:expr) => { - $crate::passes::assign::Arg::Imm($crate::passes::validate::Int::I64($val as i64)).into() + $crate::passes::assign::Arg::Imm($val as i32).into() }; } diff --git a/compiler/src/passes/select/mod.rs b/compiler/src/passes/select/mod.rs index b47317e..592b374 100644 --- a/compiler/src/passes/select/mod.rs +++ b/compiler/src/passes/select/mod.rs @@ -2,7 +2,7 @@ mod display; pub mod macros; pub mod select; -use crate::passes::validate::Int; + use crate::utils::unique_sym::UniqueSym; use derive_more::Display; use functor_derive::Functor; @@ -56,46 +56,46 @@ pub enum Cnd { pub enum Instr { /// Add. https://www.felixcloutier.com/x86/add. #[display(fmt = "add\t{src} {dst}")] - Add { src: Arg, dst: Arg, size: Size }, + Add { src: Arg, dst: Arg }, /// Subtract. https://www.felixcloutier.com/x86/sub. #[display(fmt = "sub\t{src} {dst}")] - Sub { src: Arg, dst: Arg, size: Size }, + Sub { src: Arg, dst: Arg }, /// Unsigned Divide. https://www.felixcloutier.com/x86/div. #[display(fmt = "div\t{divisor}")] - Div { divisor: Arg, size: Size }, + Div { divisor: Arg }, /// Signed Divide. https://www.felixcloutier.com/x86/idiv. #[display(fmt = "div\t{divisor}")] - IDiv { divisor: Arg, size: Size }, + IDiv { divisor: Arg }, /// Unsigned Multiply. https://www.felixcloutier.com/x86/mul. #[display(fmt = "mul\t{src}")] - Mul { src: Arg, size: Size }, + Mul { src: Arg }, /// Signed Multiply. https://www.felixcloutier.com/x86/imul. #[display(fmt = "mul\t{src}")] - IMul { src: Arg, size: Size }, + IMul { src: Arg }, /// Two's Complement Negation. https://www.felixcloutier.com/x86/neg. #[display(fmt = "neg\t{dst}")] - Neg { dst: Arg, size: Size }, + Neg { dst: Arg }, /// Move. https://www.felixcloutier.com/x86/mov. #[display(fmt = "mov\t{src} {dst}")] - Mov { src: Arg, dst: Arg, size: Size }, + Mov { src: Arg, dst: Arg }, /// Move with sign extension. https://www.felixcloutier.com/x86/movsx:movsxd. #[display(fmt = "mov\t{src} {dst}")] - MovSX { src: Arg, dst: Arg, size: Size }, + MovSX { src: Arg, dst: Arg }, #[display(fmt = "push\t{src}")] /// Push Word, Doubleword, or Quadword Onto the Stack. https://www.felixcloutier.com/x86/push. - Push { src: Arg, size: Size }, + Push { src: Arg }, /// Pop a Value From the Stack. https://www.felixcloutier.com/x86/pop. #[display(fmt = "pop\t{dst}")] - Pop { dst: Arg, size: Size }, + Pop { dst: Arg }, /// Return From Procedure. https://www.felixcloutier.com/x86/ret. - #[display(fmt = "ret\t{arity}")] - Ret { arity: usize }, + #[display(fmt = "ret")] + Ret, /// Fast System Call. https://www.felixcloutier.com/x86/syscall. #[display(fmt = "syscall\t{arity}")] Syscall { arity: usize }, /// Compare Two Operands. https://www.felixcloutier.com/x86/cmp. #[display(fmt = "cmp\t{src} {dst}")] - Cmp { src: Arg, dst: Arg, size: Size }, + Cmp { src: Arg, dst: Arg }, /// Jump. https://www.felixcloutier.com/x86/jmp. #[display(fmt = "jmp\t{lbl}")] Jmp { lbl: IdentVars }, @@ -104,16 +104,16 @@ pub enum Instr { Jcc { lbl: IdentVars, cnd: Cnd }, /// Logical AND. https://www.felixcloutier.com/x86/and. #[display(fmt = "and {src} {dst}")] - And { src: Arg, dst: Arg, size: Size }, + And { src: Arg, dst: Arg }, /// Logical Inclusive OR. https://www.felixcloutier.com/x86/or. #[display(fmt = "orq {src} {dst}")] - Or { src: Arg, dst: Arg, size: Size }, + Or { src: Arg, dst: Arg }, /// Logical Exclusive OR. https://www.felixcloutier.com/x86/xor. #[display(fmt = "xor\t{src} {dst}")] - Xor { src: Arg, dst: Arg, size: Size }, + Xor { src: Arg, dst: Arg }, #[display(fmt = "not\t{dst}")] /// One's Complement Negation. https://www.felixcloutier.com/x86/not. - Not { dst: Arg, size: Size }, + Not { dst: Arg }, /// Set Byte On Condition. https://www.felixcloutier.com/x86/setcc #[display(fmt = "setcc\t{cnd}")] Setcc { cnd: Cnd }, @@ -131,7 +131,7 @@ pub enum Instr { #[derive(Debug, PartialEq, Clone, Display, Functor)] pub enum VarArg { #[display(fmt = "${_0}")] - Imm(Int), + Imm(i32), #[display(fmt = "%{_0}")] Reg(Reg), #[display(fmt = "[%{reg} + ${off}]")] diff --git a/compiler/src/passes/select/select.rs b/compiler/src/passes/select/select.rs index 79f7f03..1b95c0f 100644 --- a/compiler/src/passes/select/select.rs +++ b/compiler/src/passes/select/select.rs @@ -6,7 +6,7 @@ use crate::passes::select::{ Block, Cnd, FunSelected, InstrSelected, VarArg, X86Selected, CALLEE_SAVED_NO_STACK, CALLER_SAVED, }; -use crate::passes::validate::Int; + use crate::utils::unique_sym::{gen_sym, UniqueSym}; use crate::*; use std::collections::HashMap; @@ -61,21 +61,21 @@ fn entry_block<'p>( let mut instrs = Vec::new(); // Save stack pointers. - instrs.push(push!(reg!(RBP), Size::Bit64)); - instrs.push(mov!(reg!(RSP), reg!(RBP), Size::Bit64)); + instrs.push(push!(reg!(RBP))); + instrs.push(mov!(reg!(RSP), reg!(RBP))); // Save callee-saved registers (excluding stack pointers). for reg in CALLEE_SAVED_NO_STACK { - instrs.push(push!(VarArg::Reg(reg), Size::Bit64)); + instrs.push(push!(VarArg::Reg(reg))); } // Prepare temporary stack space - this will be optimized in later passes. - instrs.push(sub!(imm32!(0x1000), reg!(RSP), Size::Bit64)); + instrs.push(sub!(imm!(0x1000), reg!(RSP))); // Introduce parameters as local variables. for (reg, param) in CALLER_SAVED.into_iter().zip(fun.params.iter()) { // Sometimes not the entire register needs to be moved. But we considered this to be negligible. - instrs.push(mov!(VarArg::Reg(reg), VarArg::XVar(param.sym), Size::Bit64)); + instrs.push(mov!(VarArg::Reg(reg), VarArg::XVar(param.sym))); } assert!( @@ -98,15 +98,15 @@ fn exit_block<'p>( let mut instrs = Vec::new(); // Restore temporary stack space. - instrs.push(add!(imm!(0x1000), reg!(RSP), Size::Bit64)); + instrs.push(add!(imm!(0x1000), reg!(RSP))); // Restore callee-saved registers (excluding stack pointers). for reg in CALLEE_SAVED_NO_STACK.into_iter().rev() { - instrs.push(pop!(VarArg::Reg(reg), Size::Bit64)); + instrs.push(pop!(VarArg::Reg(reg))); } // Restore stack pointers. - instrs.push(pop!(reg!(RBP), Size::Bit64)); + instrs.push(pop!(reg!(RBP))); instrs.push(ret!()); blocks.insert(exit, Block { instrs }); @@ -189,14 +189,14 @@ fn select_assign<'p>( mov!(reg!(RAX), dst), ], BinaryOp::Div => vec![ - mov!(imm32!(0), reg!(RDX)), + mov!(imm!(0), reg!(RDX)), mov!(select_atom(a0), reg!(RAX)), mov!(select_atom(a1), reg!(RBX)), div!(reg!(RBX)), mov!(reg!(RAX), dst), ], BinaryOp::Mod => vec![ - mov!(imm32!(0), reg!(RDX)), + mov!(imm!(0), reg!(RDX)), mov!(select_atom(a0), reg!(RAX)), mov!(select_atom(a1), reg!(RBX)), div!(reg!(RBX)), @@ -224,7 +224,7 @@ fn select_assign<'p>( vec![ mov!(select_atom(a0), var!(tmp)), cmp!(select_atom(a1), var!(tmp)), - mov!(imm32!(0), reg!(RAX)), // todo: can be smaller + mov!(imm!(0), reg!(RAX)), // todo: can be smaller setcc!(select_cmp(op)), mov!(reg!(RAX), dst), ] @@ -232,7 +232,7 @@ fn select_assign<'p>( }, ExprEliminated::UnaryOp { op, expr: a0 } => match op { UnaryOp::Neg => vec![mov!(select_atom(a0), dst.clone()), neg!(dst)], - UnaryOp::Not => vec![mov!(select_atom(a0), dst.clone()), xor!(imm32!(1), dst)], // todo: can be smaller + UnaryOp::Not => vec![mov!(select_atom(a0), dst.clone()), xor!(imm!(1), dst)], // todo: can be smaller }, ExprEliminated::FunRef { sym, .. } => vec![load_lbl!(sym, dst)], ExprEliminated::Apply { fun, args, .. } => { @@ -262,18 +262,7 @@ fn select_atom(expr: Atom<'_>) -> VarArg> { match expr { Atom::Val { val } => { match val { - Lit::Int(int) => { - match int { - Int::I8(_) => todo!(), - Int::U8(_) => todo!(), - Int::I16(_) => todo!(), - Int::U16(_) => todo!(), - Int::I32(_) => todo!(), - Int::U32(_) => todo!(), - Int::I64(int) => imm!(int as i32), // not correct yet - Int::U64(_) => todo!(), - } - } + Lit::Int(int) => imm!(int), Lit::Bool(bool) => imm!(bool as i32), // todo: can be smaller Lit::Unit => imm!(0), // todo: can be smaller } diff --git a/compiler/src/passes/validate/mod.rs b/compiler/src/passes/validate/mod.rs index f57a10e..8297c8b 100644 --- a/compiler/src/passes/validate/mod.rs +++ b/compiler/src/passes/validate/mod.rs @@ -32,7 +32,7 @@ pub struct PrgConstrained<'p> { } pub type DefValidated<'p> = Def, &'p str, Typed<'p, ExprValidated<'p>>>; -pub type ExprValidated<'p> = Expr, &'p str, Lit, Type>>; +pub type ExprValidated<'p> = Expr, &'p str, Lit, Type>>; pub type DefConstrained<'p> = Def>, Spanned<&'p str>, Constrained>>; @@ -47,16 +47,4 @@ pub type InstrUniquified<'p> = Instr>>, Spanned( Lit::Int(val) => match &typ { Some(typ) => { let int = match typ { - Type::Int(int) => match int { - IntType::I8 => todo!(), - IntType::U8 => Int::U8({ - resolve_int_lit(val, expr.meta.span, u8::from_str_radix)? - }), - IntType::I16 => Int::I16(resolve_int_lit( - val, - expr.meta.span, - i16::from_str_radix, - )?), - IntType::U16 => Int::U16(resolve_int_lit( - val, - expr.meta.span, - u16::from_str_radix, - )?), - IntType::I32 => Int::I32(resolve_int_lit( - val, - expr.meta.span, - i32::from_str_radix, - )?), - IntType::U32 => Int::U32(resolve_int_lit( - val, - expr.meta.span, - u32::from_str_radix, - )?), - IntType::I64 => Int::I64(resolve_int_lit( - val, - expr.meta.span, - i64::from_str_radix, - )?), - IntType::U64 => Int::U64(resolve_int_lit( - val, - expr.meta.span, - u64::from_str_radix, - )?), - }, + Type::Int(_int) => resolve_int_lit( + val, + expr.meta.span, + i64::from_str_radix, + )?, + // match int { + // IntType::I8 => todo!(), + // IntType::U8 => Int::U8({ + // resolve_int_lit(val, expr.meta.span, u8::from_str_radix)? + // }), + // IntType::I16 => Int::I16(resolve_int_lit( + // val, + // expr.meta.span, + // i16::from_str_radix, + // )?), + // IntType::U16 => Int::U16(resolve_int_lit( + // val, + // expr.meta.span, + // u16::from_str_radix, + // )?), + // IntType::I32 => Int::I32(resolve_int_lit( + // val, + // expr.meta.span, + // i32::from_str_radix, + // )?), + // IntType::U32 => Int::U32(resolve_int_lit( + // val, + // expr.meta.span, + // u32::from_str_radix, + // )?), + // IntType::I64 => Int::I64(resolve_int_lit( + // val, + // expr.meta.span, + // i64::from_str_radix, + // )?), + // IntType::U64 => Int::U64(resolve_int_lit( + // val, + // expr.meta.span, + // u64::from_str_radix, + // )?), + // }, _ => unreachable!(), }; Lit::Int(int) @@ -314,78 +319,77 @@ pub fn resolve_instr<'p>( }; match instr { - InstrUniquified::Add { src, dst, size } => InstrSelected::Add { + InstrUniquified::Add { src, dst } => InstrSelected::Add { src: map(src), dst: map(dst), - size, }, - InstrUniquified::Sub { src, dst, size } => InstrSelected::Sub { + InstrUniquified::Sub { src, dst } => InstrSelected::Sub { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::Div { divisor, size } => InstrSelected::Div { + InstrUniquified::Div { divisor } => InstrSelected::Div { divisor: map(divisor), - size, + }, - InstrUniquified::IDiv { divisor, size } => InstrSelected::IDiv { + InstrUniquified::IDiv { divisor } => InstrSelected::IDiv { divisor: map(divisor), - size, + }, - InstrUniquified::Mul { src, size } => InstrSelected::Mul { + InstrUniquified::Mul { src } => InstrSelected::Mul { src: map(src), - size, + }, - InstrUniquified::IMul { src, size } => InstrSelected::IMul { + InstrUniquified::IMul { src } => InstrSelected::IMul { src: map(src), - size, + }, - InstrUniquified::Neg { dst, size } => InstrSelected::Neg { + InstrUniquified::Neg { dst } => InstrSelected::Neg { dst: map(dst), - size, + }, - InstrUniquified::Mov { src, dst, size } => InstrSelected::Mov { + InstrUniquified::Mov { src, dst } => InstrSelected::Mov { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::MovSX { src, dst, size } => InstrSelected::MovSX { + InstrUniquified::MovSX { src, dst } => InstrSelected::MovSX { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::Push { src, size } => InstrSelected::Push { + InstrUniquified::Push { src } => InstrSelected::Push { src: map(src), - size, + }, - InstrUniquified::Pop { dst, size } => InstrSelected::Pop { + InstrUniquified::Pop { dst } => InstrSelected::Pop { dst: map(dst), - size, + }, InstrUniquified::Syscall { arity } => InstrSelected::Syscall { arity }, - InstrUniquified::Cmp { src, dst, size } => InstrSelected::Cmp { + InstrUniquified::Cmp { src, dst } => InstrSelected::Cmp { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::And { src, dst, size } => InstrSelected::And { + InstrUniquified::And { src, dst } => InstrSelected::And { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::Or { src, dst, size } => InstrSelected::Or { + InstrUniquified::Or { src, dst } => InstrSelected::Or { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::Xor { src, dst, size } => InstrSelected::Xor { + InstrUniquified::Xor { src, dst } => InstrSelected::Xor { src: map(src), dst: map(dst), - size, + }, - InstrUniquified::Not { dst, size } => InstrSelected::Not { + InstrUniquified::Not { dst } => InstrSelected::Not { dst: map(dst), - size, + }, InstrUniquified::Setcc { .. } | InstrUniquified::Ret { .. } diff --git a/compiler/src/passes/validate/uniquify/expr.rs b/compiler/src/passes/validate/uniquify/expr.rs index c94188c..d31d6bc 100644 --- a/compiler/src/passes/validate/uniquify/expr.rs +++ b/compiler/src/passes/validate/uniquify/expr.rs @@ -121,79 +121,79 @@ fn uniquify_instr<'p>( }; let instr = match instr { - InstrParsed::Add { src, dst, size } => InstrUniquified::Add { + InstrParsed::Add { src, dst } => InstrUniquified::Add { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Sub { src, dst, size } => InstrUniquified::Sub { + InstrParsed::Sub { src, dst } => InstrUniquified::Sub { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Div { divisor, size } => InstrUniquified::Div { + InstrParsed::Div { divisor } => InstrUniquified::Div { divisor: map(divisor)?, - size, + }, - InstrParsed::IDiv { divisor, size } => InstrUniquified::IDiv { + InstrParsed::IDiv { divisor } => InstrUniquified::IDiv { divisor: map(divisor)?, - size, + }, - InstrParsed::Mul { src, size } => InstrUniquified::Mul { + InstrParsed::Mul { src } => InstrUniquified::Mul { src: map(src)?, - size, + }, - InstrParsed::IMul { src, size } => InstrUniquified::IMul { + InstrParsed::IMul { src } => InstrUniquified::IMul { src: map(src)?, - size, + }, - InstrParsed::Neg { dst, size } => InstrUniquified::Neg { + InstrParsed::Neg { dst } => InstrUniquified::Neg { dst: map(dst)?, - size, + }, - InstrParsed::Mov { src, dst, size } => InstrUniquified::Mov { + InstrParsed::Mov { src, dst } => InstrUniquified::Mov { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::MovSX { src, dst, size } => InstrUniquified::MovSX { + InstrParsed::MovSX { src, dst } => InstrUniquified::MovSX { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Push { src, size } => InstrUniquified::Push { + InstrParsed::Push { src } => InstrUniquified::Push { src: map(src)?, - size, + }, - InstrParsed::Pop { dst, size } => InstrUniquified::Pop { + InstrParsed::Pop { dst } => InstrUniquified::Pop { dst: map(dst)?, - size, + }, InstrParsed::Syscall { arity } => InstrUniquified::Syscall { arity }, - InstrParsed::Cmp { src, dst, size } => InstrUniquified::Cmp { + InstrParsed::Cmp { src, dst } => InstrUniquified::Cmp { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::And { src, dst, size } => InstrUniquified::And { + InstrParsed::And { src, dst } => InstrUniquified::And { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Or { src, dst, size } => InstrUniquified::Or { + InstrParsed::Or { src, dst } => InstrUniquified::Or { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Xor { src, dst, size } => InstrUniquified::Xor { + InstrParsed::Xor { src, dst } => InstrUniquified::Xor { src: map(src)?, dst: map(dst)?, - size, + }, - InstrParsed::Not { dst, size } => InstrUniquified::Not { + InstrParsed::Not { dst } => InstrUniquified::Not { dst: map(dst)?, - size, + }, InstrParsed::Setcc { .. } | InstrParsed::Ret { .. }