diff --git a/.github/workflows/runtimes.yml b/.github/workflows/runtimes.yml index 5b6d3220..0a0ca2ce 100644 --- a/.github/workflows/runtimes.yml +++ b/.github/workflows/runtimes.yml @@ -9,8 +9,7 @@ env: RUSTUP_TOOLCHAIN: '1.78' jobs: - linux-amd64: - name: Linux AMD64 + amd64-linux: runs-on: ubuntu-latest container: image: ghcr.io/inko-lang/ci:debian-amd64 @@ -26,8 +25,7 @@ jobs: retention-days: 2 compression-level: 0 - linux-arm64: - name: Linux ARM64 + arm64-linux: runs-on: ubuntu-latest container: image: ghcr.io/inko-lang/ci:debian-arm64 @@ -43,8 +41,7 @@ jobs: retention-days: 2 compression-level: 0 - macos-amd64: - name: macOS AMD64 + amd64-mac: runs-on: macos-12 steps: - uses: actions/checkout@v4 @@ -60,8 +57,7 @@ jobs: retention-days: 2 compression-level: 0 - macos-arm64: - name: macOS ARM64 + arm64-mac: runs-on: macos-14 steps: - uses: actions/checkout@v4 @@ -77,8 +73,7 @@ jobs: retention-days: 2 compression-level: 0 - freebsd-amd64: - name: FreeBSD AMD64 + amd64-freebsd: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -109,11 +104,11 @@ jobs: RCLONE_S3_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }} RCLONE_S3_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com needs: - - linux-amd64 - - linux-arm64 - - macos-amd64 - - macos-arm64 - - freebsd-amd64 + - amd64-linux + - arm64-linux + - amd64-mac + - arm64-mac + - amd64-freebsd steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 85d183c6..4c23a1dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,8 +63,7 @@ jobs: - name: Check the formatting run: 'cd std && cargo run -- fmt --check' - linux-amd64: - name: Linux AMD64 + amd64-linux-gnu: runs-on: ubuntu-latest container: image: ghcr.io/inko-lang/ci:fedora @@ -73,14 +72,28 @@ jobs: - uses: actions/cache@v4 with: path: '${{ env.CARGO_HOME }}' - key: linux-amd64-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + key: amd64-linux-gnu-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} - name: Run compiler tests run: cargo test - name: Run stdlib tests run: 'cd std && cargo run -- test' - macos-amd64: - name: macOS AMD64 + amd64-linux-musl: + runs-on: ubuntu-latest + container: + image: ghcr.io/inko-lang/ci:alpine + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: '${{ env.CARGO_HOME }}' + key: amd64-linux-musl-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + - name: Run compiler tests + run: cargo test + - name: Run stdlib tests + run: 'cd std && cargo run -- test' + + amd64-mac-native: runs-on: macos-12 env: RUSTUP_HOME: ${{ github.workspace }}/.rustup-home @@ -91,7 +104,7 @@ jobs: path: | ${{ env.CARGO_HOME }} ${{ env.RUSTUP_HOME }} - key: mac-amd64-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + key: amd64-mac-native-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} - name: Install dependencies run: ./ci/mac.sh - name: Run compiler tests @@ -99,8 +112,7 @@ jobs: - name: Run stdlib tests run: 'cd std && cargo run -- test' - macos-arm64: - name: macOS ARM64 + arm64-mac-native: runs-on: macos-14 env: RUSTUP_HOME: ${{ github.workspace }}/.rustup-home @@ -111,7 +123,7 @@ jobs: path: | ${{ env.CARGO_HOME }} ${{ env.RUSTUP_HOME }} - key: mac-arm64-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + key: arm64-mac-native-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} - name: Install dependencies run: ./ci/mac.sh - name: Run compiler tests @@ -119,8 +131,7 @@ jobs: - name: Run stdlib tests run: 'cd std && cargo run -- test' - freebsd-amd64: - name: FreeBSD AMD64 + amd64-freebsd-native: runs-on: ubuntu-latest env: RUSTUP_HOME: ${{ github.workspace }}/.rustup-home @@ -131,7 +142,7 @@ jobs: path: | ${{ env.CARGO_HOME }} ${{ env.RUSTUP_HOME }} - key: freebsd-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + key: amd64-freebsd-native-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} - name: Run tests uses: cross-platform-actions/action@v0.24.0 with: diff --git a/Cargo.lock b/Cargo.lock index 71d2a993..22bd33ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,36 +4,36 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ast" @@ -52,17 +52,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -71,12 +71,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -85,9 +79,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake3" -version = "1.5.1" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -98,20 +92,29 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.17" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ - "lazy_static", "memchr", "regex-automata", + "serde", ] +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "cc" -version = "1.1.0" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -143,14 +146,14 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" @@ -164,9 +167,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crc32fast" @@ -211,26 +214,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide", @@ -273,9 +276,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "idna" @@ -302,9 +305,9 @@ dependencies = [ [[package]] name = "inkwell" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b597a7b2cdf279aeef6d7149071e35e4bc87c2cf05a5b7f2d731300bffe587ea" +checksum = "40fb405537710d51f6bdbc8471365ddd4cd6d3a3c3ad6e0c8291691031ba94b2" dependencies = [ "either", "inkwell_internals", @@ -316,9 +319,9 @@ dependencies = [ [[package]] name = "inkwell_internals" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa4d8d74483041a882adaa9a29f633253a66dde85055f0495c121620ac484b2" +checksum = "9dd28cfd4cfba665d47d31c08a6ba637eed16770abca2eccbbc3ca831fef1e44" dependencies = [ "proc-macro2", "quote", @@ -333,9 +336,20 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", + "redox_syscall", +] [[package]] name = "linux-raw-sys" @@ -345,9 +359,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "llvm-sys" -version = "170.1.1" +version = "170.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd263594e016a778a9cf53228b3c56fb9eb094c7bced467bd8a30802c4b40f95" +checksum = "ff1ee92492ae76bb6e24495ce15e311ba13ffb58c0140d89ac9910b92477cec8" dependencies = [ "anyhow", "cc", @@ -371,11 +385,11 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -408,9 +422,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -435,9 +449,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro2" @@ -450,9 +467,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -489,18 +506,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" [[package]] name = "regex-lite" @@ -520,7 +537,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -554,22 +571,22 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "log", "once_cell", @@ -582,9 +599,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -595,9 +612,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64", "rustls-pki-types", @@ -605,15 +622,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -622,20 +639,20 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -645,9 +662,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -659,11 +676,37 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "similar" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" dependencies = [ "bstr", "unicode-segmentation", @@ -671,9 +714,9 @@ dependencies = [ [[package]] name = "similar-asserts" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e041bb827d1bfca18f213411d51b665309f1afb37a04a5d1464530e13779fc0f" +checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" dependencies = [ "console", "similar", @@ -686,7 +729,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -703,9 +746,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.70" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -724,18 +767,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -769,9 +812,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -802,9 +845,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" +checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" dependencies = [ "base64", "log", @@ -834,9 +877,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -850,6 +893,15 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -914,6 +966,27 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zeroize" version = "1.8.1" diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 9b0f25f2..1f4efea1 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -17,8 +17,8 @@ ast = { path = "../ast" } types = { path = "../types" } fnv = "^1.0" blake3 = "^1.5" -inkwell = { version = "^0.4", features = ["llvm17-0"] } -llvm-sys-170 = { package = "llvm-sys", version = "^170.1", features = ["prefer-static"] } +inkwell = { version = "^0.5", features = ["llvm17-0"] } +llvm-sys-170 = { package = "llvm-sys", version = "^170.2", features = ["prefer-static"] } [dev-dependencies] similar-asserts = "^1.1" diff --git a/compiler/src/llvm/builder.rs b/compiler/src/llvm/builder.rs index 77cb86c1..8a3a135d 100644 --- a/compiler/src/llvm/builder.rs +++ b/compiler/src/llvm/builder.rs @@ -16,9 +16,7 @@ use inkwell::values::{ BasicValueEnum, CallSiteValue, FloatValue, FunctionValue, InstructionOpcode, IntValue, PointerValue, }; -use inkwell::{ - AddressSpace, AtomicOrdering, AtomicRMWBinOp, FloatPredicate, IntPredicate, -}; +use inkwell::{AtomicOrdering, AtomicRMWBinOp, FloatPredicate, IntPredicate}; use std::path::Path; use types::{ClassId, Database}; @@ -188,36 +186,11 @@ impl<'ctx> Builder<'ctx> { .into_float_value() } - pub(crate) fn load_untyped_pointer( - &self, - variable: PointerValue<'ctx>, - ) -> PointerValue<'ctx> { - self.load( - self.context.i8_type().ptr_type(AddressSpace::default()), - variable, - ) - .into_pointer_value() - } - - pub(crate) fn load_pointer>( + pub(crate) fn load_pointer( &self, - typ: T, - variable: PointerValue<'ctx>, - ) -> PointerValue<'ctx> { - self.load( - typ.as_basic_type_enum().ptr_type(AddressSpace::default()), - variable, - ) - .into_pointer_value() - } - - pub(crate) fn load_function_pointer( - &self, - typ: FunctionType<'ctx>, variable: PointerValue<'ctx>, ) -> PointerValue<'ctx> { - self.load(typ.ptr_type(AddressSpace::default()), variable) - .into_pointer_value() + self.load(self.context.pointer_type(), variable).into_pointer_value() } pub(crate) fn call( @@ -656,7 +629,7 @@ impl<'ctx> Builder<'ctx> { value: V, typ: T, ) -> BasicValueEnum<'ctx> { - self.inner.build_bitcast(value, typ, "").unwrap() + self.inner.build_bit_cast(value, typ, "").unwrap() } pub(crate) fn first_block(&self) -> BasicBlock<'ctx> { @@ -764,8 +737,8 @@ impl<'ctx> Builder<'ctx> { ) -> PointerValue<'ctx> { let atomic = class.is_atomic(db); let name = &names.classes[&class]; - let global = module.add_class(class, name).as_pointer_value(); - let class_ptr = self.load_untyped_pointer(global); + let global = module.add_class(name).as_pointer_value(); + let class_ptr = self.load_pointer(global); let typ = module.layouts.instances[class.0 as usize]; let res = self.malloc(module, typ); let header = module.layouts.header; diff --git a/compiler/src/llvm/context.rs b/compiler/src/llvm/context.rs index 43e8ec64..57dc286f 100644 --- a/compiler/src/llvm/context.rs +++ b/compiler/src/llvm/context.rs @@ -42,7 +42,7 @@ impl Context { } pub(crate) fn pointer_type(&self) -> PointerType<'_> { - self.inner.i8_type().ptr_type(AddressSpace::default()) + self.inner.ptr_type(AddressSpace::default()) } pub(crate) fn bool_type(&self) -> IntType { @@ -190,9 +190,7 @@ impl Context { self.i64_type().as_basic_type_enum() } FLOAT_ID => self.f64_type().as_basic_type_enum(), - _ => layouts.instances[ins.instance_of().0 as usize] - .ptr_type(AddressSpace::default()) - .as_basic_type_enum(), + _ => self.pointer_type().as_basic_type_enum(), } } } @@ -200,7 +198,7 @@ impl Context { }; if let TypeRef::Pointer(_) = type_ref { - base.ptr_type(AddressSpace::default()).as_basic_type_enum() + self.pointer_type().as_basic_type_enum() } else { base } diff --git a/compiler/src/llvm/layouts.rs b/compiler/src/llvm/layouts.rs index 542c9bb8..0e3a1a01 100644 --- a/compiler/src/llvm/layouts.rs +++ b/compiler/src/llvm/layouts.rs @@ -6,7 +6,6 @@ use inkwell::targets::TargetData; use inkwell::types::{ AnyType, BasicMetadataTypeEnum, BasicType, FunctionType, StructType, }; -use inkwell::AddressSpace; use types::{ CallConvention, BOOL_ID, BYTE_ARRAY_ID, FLOAT_ID, INT_ID, NIL_ID, STRING_ID, }; @@ -47,11 +46,6 @@ pub(crate) struct Layouts<'ctx> { /// The type to use for Inko methods (used for dynamic dispatch). pub(crate) method: StructType<'ctx>, - /// All MIR classes and their corresponding structure layouts. - /// - /// This `Vec` is indexed using `ClassId` values. - pub(crate) classes: Vec>, - /// The structure layouts for all class instances. /// /// This `Vec` is indexed using `ClassId` values. @@ -93,7 +87,6 @@ impl<'ctx> Layouts<'ctx> { // // This may over-allocate the number of classes, depending on how many // are removed through optimizations, but at worst we'd waste a few KiB. - let mut classes = vec![empty_struct; num_classes]; let mut instances = vec![empty_struct; num_classes]; let header = context.struct_type(&[ context.pointer_type().into(), // Class @@ -154,7 +147,6 @@ impl<'ctx> Layouts<'ctx> { } }; - classes[id.0 as usize] = context.class_type(method); instances[id.0 as usize] = instance; } @@ -172,7 +164,6 @@ impl<'ctx> Layouts<'ctx> { target_data, empty_class: context.class_type(method), method, - classes, instances, state: state_layout, header, @@ -410,7 +401,7 @@ impl<'ctx> Layouts<'ctx> { if target_data.get_bit_size(&typ) > state.config.target.pass_struct_size() { - args.push(typ.ptr_type(AddressSpace::default()).into()); + args.push(context.pointer_type().into()); sret = Some(typ); } else { ret = Some(typ.as_basic_type_enum()); diff --git a/compiler/src/llvm/module.rs b/compiler/src/llvm/module.rs index 0c5ee4be..afc0cc11 100644 --- a/compiler/src/llvm/module.rs +++ b/compiler/src/llvm/module.rs @@ -12,7 +12,7 @@ use std::collections::HashMap; use std::ops::Deref; use std::path::Path; use types::module_name::ModuleName; -use types::{CallConvention, ClassId, MethodId}; +use types::{CallConvention, MethodId}; /// A wrapper around an LLVM Module that provides some additional methods. pub(crate) struct Module<'a, 'ctx> { @@ -84,14 +84,10 @@ impl<'a, 'ctx> Module<'a, 'ctx> { .unwrap_or_else(|| self.add_global_pointer(name)) } - pub(crate) fn add_class( - &mut self, - id: ClassId, - name: &str, - ) -> GlobalValue<'ctx> { + pub(crate) fn add_class(&mut self, name: &str) -> GlobalValue<'ctx> { self.inner.get_global(name).unwrap_or_else(|| { - let space = AddressSpace::default(); - let typ = self.layouts.classes[id.0 as usize].ptr_type(space); + let typ = self.context.pointer_type(); + let space = typ.get_address_space(); self.inner.add_global(typ, Some(space), name) }) diff --git a/compiler/src/llvm/passes.rs b/compiler/src/llvm/passes.rs index 198b1704..d07b0f49 100644 --- a/compiler/src/llvm/passes.rs +++ b/compiler/src/llvm/passes.rs @@ -36,7 +36,6 @@ use inkwell::values::{ BasicMetadataValueEnum, BasicValue, BasicValueEnum, FloatValue, FunctionValue, GlobalValue, IntValue, PointerValue, }; -use inkwell::AddressSpace; use inkwell::OptimizationLevel; use std::collections::{HashMap, HashSet, VecDeque}; use std::fs::{read, write}; @@ -704,7 +703,6 @@ impl<'shared, 'module, 'ctx> LowerModule<'shared, 'module, 'ctx> { fn setup_classes(&mut self) { let mod_id = self.shared.mir.modules[self.index].id; - let space = AddressSpace::default(); let fn_name = &self.shared.names.setup_classes[&mod_id]; let fn_val = self.module.add_setup_function(fn_name); let builder = Builder::new(self.module.context, fn_val); @@ -739,14 +737,17 @@ impl<'shared, 'module, 'ctx> LowerModule<'shared, 'module, 'ctx> { self.module.runtime_function(RuntimeFunction::ClassObject) }; - let layout = self.layouts.classes[class_id.0 as usize]; let global_name = &self.shared.names.classes[&class_id]; - let global = self.module.add_class(class_id, global_name); + let global = self.module.add_class(global_name); // The class globals must have an initializer, otherwise LLVM treats // them as external globals. global.set_initializer( - &layout.ptr_type(space).const_null().as_basic_value_enum(), + &builder + .context + .pointer_type() + .const_null() + .as_basic_value_enum(), ); // Built-in classes are defined in the runtime library, so we should @@ -992,8 +993,7 @@ impl<'shared, 'module, 'ctx> LowerModule<'shared, 'module, 'ctx> { fn load_state(&mut self, builder: &Builder<'ctx>) -> PointerValue<'ctx> { let state_global = self.module.add_constant(STATE_GLOBAL); - builder - .load_pointer(self.layouts.state, state_global.as_pointer_value()) + builder.load_pointer(state_global.as_pointer_value()) } } @@ -1081,7 +1081,6 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { self.builder.switch_to_block(entry_block); self.define_register_variables(); - let space = AddressSpace::default(); let arg_types = self .method .arguments @@ -1090,7 +1089,8 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { .map(|r| self.variable_types[r]) .collect::>(); let args_type = self.builder.context.struct_type(&arg_types); - let args_var = self.builder.new_stack_slot(args_type.ptr_type(space)); + let args_var = + self.builder.new_stack_slot(self.builder.context.pointer_type()); self.builder.store(args_var, self.builder.argument(0)); @@ -1105,7 +1105,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { // in the context structure. for (index, reg) in self.method.arguments.iter().skip(1).enumerate() { let var = self.variables[reg]; - let args = self.builder.load_pointer(args_type, args_var); + let args = self.builder.load_pointer(args_var); let val = self.builder.load_field(args_type, args, index as _); self.builder.store(var, val); @@ -1116,7 +1116,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { // // If no arguments are passed, the data pointer is NULL. if !arg_types.is_empty() { - self.builder.free(self.builder.load_pointer(args_type, args_var)); + self.builder.free(self.builder.load_pointer(args_var)); } let (line, _) = @@ -1698,7 +1698,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { } BuiltinFunction::Panic => { let val_var = self.variables[&ins.arguments[0]]; - let val = self.builder.load_untyped_pointer(val_var); + let val = self.builder.load_pointer(val_var); let func_name = RuntimeFunction::ProcessPanic; let func = self.module.runtime_function(func_name); let proc = self.load_process().into(); @@ -1964,9 +1964,9 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { self.builder.store(idx_var, hash); - let space = AddressSpace::default(); - let fn_var = - self.builder.new_stack_slot(fn_typ.ptr_type(space)); + let fn_var = self + .builder + .new_stack_slot(self.builder.context.pointer_type()); self.builder.jump(loop_start); @@ -2031,8 +2031,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { args.push(self.builder.load(typ, var).into()); } - let func_val = - self.builder.load_function_pointer(fn_typ, fn_var); + let func_val = self.builder.load_pointer(fn_var); self.indirect_call(ins.register, fn_typ, func_val, &args); } @@ -2350,7 +2349,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { self.set_debug_location(ins.location); let var = self.variables[&ins.register]; - let val = self.builder.load_untyped_pointer(var); + let val = self.builder.load_pointer(var); let zero = self.builder.u32_literal(0); let header = self.layouts.header; let idx = HEADER_REFS_INDEX; @@ -2379,14 +2378,14 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { } Instruction::Free(ins) => { let var = self.variables[&ins.register]; - let ptr = self.builder.load_untyped_pointer(var); + let ptr = self.builder.load_pointer(var); let func = self.module.runtime_function(RuntimeFunction::Free); self.builder.call_void(func, &[ptr.into()]); } Instruction::Increment(ins) => { let reg_var = self.variables[&ins.register]; - let val = self.builder.load_untyped_pointer(reg_var); + let val = self.builder.load_pointer(reg_var); let one = self.builder.u32_literal(1); let header = self.layouts.header; let idx = HEADER_REFS_INDEX; @@ -2399,7 +2398,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { } Instruction::Decrement(ins) => { let var = self.variables[&ins.register]; - let val = self.builder.load_untyped_pointer(var); + let val = self.builder.load_pointer(var); let header = self.layouts.header; let idx = HEADER_REFS_INDEX; let old_refs = @@ -2412,7 +2411,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { } Instruction::IncrementAtomic(ins) => { let var = self.variables[&ins.register]; - let val = self.builder.load_untyped_pointer(var); + let val = self.builder.load_pointer(var); let one = self.builder.u32_literal(1); let field = self.builder.field_address( self.layouts.header, @@ -2424,8 +2423,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { } Instruction::DecrementAtomic(ins) => { let var = self.variables[&ins.register]; - let header = - self.builder.load_pointer(self.layouts.header, var); + let header = self.builder.load_pointer(var); let drop_block = all_blocks[ins.if_true.0]; let after_block = all_blocks[ins.if_false.0]; let one = self.builder.u32_literal(1); @@ -2455,9 +2453,8 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { Instruction::Spawn(ins) => { let reg_var = self.variables[&ins.register]; let name = &self.shared.names.classes[&ins.class]; - let global = - self.module.add_class(ins.class, name).as_pointer_value(); - let class = self.builder.load_untyped_pointer(global).into(); + let global = self.module.add_class(name).as_pointer_value(); + let class = self.builder.load_pointer(global).into(); let proc = self.load_process().into(); let func = self.module.runtime_function(RuntimeFunction::ProcessNew); @@ -2755,7 +2752,7 @@ impl<'shared, 'module, 'ctx> LowerMethod<'shared, 'module, 'ctx> { fn load_state(&mut self) -> PointerValue<'ctx> { let var = self.module.add_constant(STATE_GLOBAL); - self.builder.load_pointer(self.layouts.state, var.as_pointer_value()) + self.builder.load_pointer(var.as_pointer_value()) } fn load_stack_mask(&mut self) -> IntValue<'ctx> { @@ -2796,11 +2793,10 @@ impl<'a, 'ctx> GenerateMain<'a, 'ctx> { names: &'a SymbolNames, module: &'a Module<'a, 'ctx>, ) -> GenerateMain<'a, 'ctx> { - let space = AddressSpace::default(); let typ = module.context.i32_type().fn_type( &[ module.context.i32_type().into(), - module.context.i8_type().ptr_type(space).into(), + module.context.pointer_type().into(), ], false, ); @@ -2811,13 +2807,12 @@ impl<'a, 'ctx> GenerateMain<'a, 'ctx> { } fn run(self) { - let space = AddressSpace::default(); let entry_block = self.builder.add_block(); self.builder.switch_to_block(entry_block); let argc_typ = self.builder.context.i32_type(); - let argv_typ = self.builder.context.i8_type().ptr_type(space); + let argv_typ = self.builder.context.pointer_type(); let argc_var = self.builder.new_temporary(argc_typ); let argv_var = self.builder.new_temporary(argv_typ); @@ -2856,9 +2851,9 @@ impl<'a, 'ctx> GenerateMain<'a, 'ctx> { state_global.set_initializer( &self - .layouts - .state - .ptr_type(AddressSpace::default()) + .builder + .context + .pointer_type() .const_null() .as_basic_value_enum(), ); @@ -2926,8 +2921,7 @@ impl<'a, 'ctx> GenerateMain<'a, 'ctx> { .as_global_value() .as_pointer_value(); - let main_class = - self.builder.load_pointer(self.layouts.empty_class, main_class_ptr); + let main_class = self.builder.load_pointer(main_class_ptr); self.builder.call_void( rt_start, diff --git a/compiler/src/llvm/runtime_function.rs b/compiler/src/llvm/runtime_function.rs index 52debb97..7293c3a3 100644 --- a/compiler/src/llvm/runtime_function.rs +++ b/compiler/src/llvm/runtime_function.rs @@ -1,6 +1,5 @@ use crate::llvm::module::Module; use inkwell::values::FunctionValue; -use inkwell::AddressSpace; #[derive(Copy, Clone)] pub(crate) enum RuntimeFunction { @@ -55,7 +54,6 @@ impl RuntimeFunction { module: &Module<'_, 'ctx>, ) -> FunctionValue<'ctx> { let context = module.context; - let space = AddressSpace::default(); let fn_type = match self { RuntimeFunction::ReferenceCountError => { let proc = context.pointer_type().into(); @@ -85,10 +83,9 @@ impl RuntimeFunction { ret.fn_type(&[proc, terminate], false) } RuntimeFunction::RuntimeNew => { - let counts = - module.layouts.method_counts.ptr_type(space).into(); + let counts = context.pointer_type().into(); let argc = context.i32_type().into(); - let argv = context.i8_type().ptr_type(space).into(); + let argv = context.pointer_type().into(); let ret = context.pointer_type(); ret.fn_type(&[counts, argc, argv], false) @@ -122,7 +119,7 @@ impl RuntimeFunction { ret.fn_type(&[name, size, methods], false) } RuntimeFunction::ProcessSendMessage => { - let state = module.layouts.state.ptr_type(space).into(); + let state = context.pointer_type().into(); let sender = context.pointer_type().into(); let receiver = context.pointer_type().into(); let func = context.pointer_type().into(); @@ -139,7 +136,7 @@ impl RuntimeFunction { ret.fn_type(&[process, class], false) } RuntimeFunction::StringConcat => { - let state = module.layouts.state.ptr_type(space).into(); + let state = context.pointer_type().into(); let strings = context.pointer_type().into(); let length = context.i64_type().into(); let ret = context.pointer_type(); @@ -147,7 +144,7 @@ impl RuntimeFunction { ret.fn_type(&[state, strings, length], false) } RuntimeFunction::StringNew => { - let state = module.layouts.state.ptr_type(space).into(); + let state = context.pointer_type().into(); let bytes = context.pointer_type().into(); let length = context.i64_type().into(); let ret = context.pointer_type(); @@ -155,7 +152,7 @@ impl RuntimeFunction { ret.fn_type(&[state, bytes, length], false) } RuntimeFunction::RuntimeStackMask => { - let state = module.layouts.state.ptr_type(space).into(); + let state = context.pointer_type().into(); let ret = context.i64_type(); ret.fn_type(&[state], false)