wasmtime 15.0.1 → 16.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.lock +83 -103
- data/ext/Cargo.toml +6 -6
- data/ext/cargo-vendor/cranelift-bforest-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-bforest-0.103.0/Cargo.toml +40 -0
- data/ext/cargo-vendor/cranelift-bforest-0.103.0/src/lib.rs +183 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/Cargo.toml +175 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/binemit/mod.rs +171 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/egraph/cost.rs +171 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/egraph/elaborate.rs +750 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/egraph.rs +703 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/ir/dfg.rs +1735 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/ir/pcc.rs +1682 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/aarch64/lower/isle.rs +874 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/riscv64/inst/mod.rs +2041 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/riscv64/inst.isle +2928 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/riscv64/lower.isle +2864 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/s390x/lower/isle.rs +1029 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/x64/lower/isle.rs +1064 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isa/x64/pcc.rs +916 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/isle_prelude.rs +977 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/lib.rs +106 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/machinst/isle.rs +896 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/opts/arithmetic.isle +152 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/opts/cprop.isle +237 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/opts/icmp.isle +199 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/opts/selects.isle +76 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/opts.rs +172 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/prelude.isle +649 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/timing.rs +297 -0
- data/ext/cargo-vendor/cranelift-codegen-0.103.0/src/unionfind.rs +75 -0
- data/ext/cargo-vendor/cranelift-codegen-meta-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-codegen-meta-0.103.0/Cargo.toml +35 -0
- data/ext/cargo-vendor/cranelift-codegen-shared-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-codegen-shared-0.103.0/Cargo.toml +22 -0
- data/ext/cargo-vendor/cranelift-codegen-shared-0.103.0/src/lib.rs +10 -0
- data/ext/cargo-vendor/cranelift-control-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-control-0.103.0/Cargo.toml +30 -0
- data/ext/cargo-vendor/cranelift-entity-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-entity-0.103.0/Cargo.toml +50 -0
- data/ext/cargo-vendor/cranelift-entity-0.103.0/src/lib.rs +317 -0
- data/ext/cargo-vendor/cranelift-entity-0.103.0/src/primary.rs +516 -0
- data/ext/cargo-vendor/cranelift-entity-0.103.0/src/unsigned.rs +71 -0
- data/ext/cargo-vendor/cranelift-frontend-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-frontend-0.103.0/Cargo.toml +68 -0
- data/ext/cargo-vendor/cranelift-frontend-0.103.0/src/lib.rs +189 -0
- data/ext/cargo-vendor/cranelift-isle-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-isle-0.103.0/Cargo.toml +46 -0
- data/ext/cargo-vendor/cranelift-isle-0.103.0/isle_examples/link/multi_constructor_main.rs +88 -0
- data/ext/cargo-vendor/cranelift-isle-0.103.0/isle_examples/link/multi_extractor_main.rs +63 -0
- data/ext/cargo-vendor/cranelift-isle-0.103.0/src/codegen.rs +886 -0
- data/ext/cargo-vendor/cranelift-native-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-native-0.103.0/Cargo.toml +43 -0
- data/ext/cargo-vendor/cranelift-native-0.103.0/src/lib.rs +184 -0
- data/ext/cargo-vendor/cranelift-wasm-0.103.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/cranelift-wasm-0.103.0/Cargo.toml +106 -0
- data/ext/cargo-vendor/cranelift-wasm-0.103.0/src/environ/dummy.rs +953 -0
- data/ext/cargo-vendor/cranelift-wasm-0.103.0/src/lib.rs +62 -0
- data/ext/cargo-vendor/cranelift-wasm-0.103.0/src/translation_utils.rs +89 -0
- data/ext/cargo-vendor/wasi-cap-std-sync-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasi-cap-std-sync-16.0.0/Cargo.toml +102 -0
- data/ext/cargo-vendor/wasi-common-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasi-common-16.0.0/Cargo.toml +131 -0
- data/ext/cargo-vendor/wasi-common-16.0.0/src/lib.rs +76 -0
- data/ext/cargo-vendor/wasi-common-16.0.0/src/snapshots/preview_1.rs +1492 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/Cargo.toml +211 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/compiler.rs +682 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/component/component.rs +505 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/component/func/typed.rs +2400 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/config.rs +2422 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/func.rs +2391 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/lib.rs +520 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/memory.rs +998 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/module.rs +1370 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/stack.rs +73 -0
- data/ext/cargo-vendor/wasmtime-16.0.0/src/v128.rs +122 -0
- data/ext/cargo-vendor/wasmtime-asm-macros-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-asm-macros-16.0.0/Cargo.toml +22 -0
- data/ext/cargo-vendor/wasmtime-cache-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-cache-16.0.0/Cargo.toml +81 -0
- data/ext/cargo-vendor/wasmtime-cache-16.0.0/src/lib.rs +235 -0
- data/ext/cargo-vendor/wasmtime-cache-16.0.0/src/worker.rs +890 -0
- data/ext/cargo-vendor/wasmtime-component-macro-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-component-macro-16.0.0/Cargo.toml +67 -0
- data/ext/cargo-vendor/wasmtime-component-util-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-component-util-16.0.0/Cargo.toml +25 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/Cargo.toml +112 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/compiler/component.rs +959 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/compiler.rs +1317 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/debug/transform/expression.rs +1252 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/debug/transform/simulate.rs +410 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/debug.rs +18 -0
- data/ext/cargo-vendor/wasmtime-cranelift-16.0.0/src/func_environ.rs +2750 -0
- data/ext/cargo-vendor/wasmtime-cranelift-shared-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-cranelift-shared-16.0.0/Cargo.toml +71 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/Cargo.lock +660 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/Cargo.toml +125 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/compilation.rs +402 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/component/compiler.rs +47 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/component/translate.rs +951 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/component/types.rs +1876 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/lib.rs +59 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/module.rs +1075 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/module_environ.rs +892 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/module_types.rs +120 -0
- data/ext/cargo-vendor/wasmtime-environ-16.0.0/src/scopevec.rs +78 -0
- data/ext/cargo-vendor/wasmtime-fiber-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-fiber-16.0.0/Cargo.toml +63 -0
- data/ext/cargo-vendor/wasmtime-fiber-16.0.0/src/lib.rs +328 -0
- data/ext/cargo-vendor/wasmtime-fiber-16.0.0/src/unix.rs +265 -0
- data/ext/cargo-vendor/wasmtime-fiber-16.0.0/src/windows.c +9 -0
- data/ext/cargo-vendor/wasmtime-jit-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-jit-16.0.0/Cargo.toml +125 -0
- data/ext/cargo-vendor/wasmtime-jit-16.0.0/src/code_memory.rs +319 -0
- data/ext/cargo-vendor/wasmtime-jit-16.0.0/src/instantiate.rs +772 -0
- data/ext/cargo-vendor/wasmtime-jit-16.0.0/src/lib.rs +21 -0
- data/ext/cargo-vendor/wasmtime-jit-debug-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-jit-debug-16.0.0/Cargo.toml +67 -0
- data/ext/cargo-vendor/wasmtime-jit-icache-coherence-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-jit-icache-coherence-16.0.0/Cargo.toml +46 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/Cargo.toml +139 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/build.rs +28 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/proptest-regressions/instance/allocator/pooling/memory_pool.txt +9 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/arch/aarch64.rs +120 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/arch/mod.rs +32 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/arch/riscv64.rs +88 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/arch/s390x.rs +61 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/arch/x86_64.rs +106 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/cow.rs +888 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/helpers.c +113 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/instance/allocator/pooling/memory_pool.rs +1005 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/instance/allocator/pooling/stack_pool.rs +242 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/instance/allocator/pooling/table_pool.rs +227 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/instance/allocator/pooling.rs +698 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/lib.rs +264 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/libcalls.rs +776 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/mmap.rs +214 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/mpk/enabled.rs +204 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/mpk/pkru.rs +102 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/miri/mod.rs +10 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/miri/traphandlers.rs +42 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/miri/unwind.rs +17 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/miri/vm.rs +63 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/mod.rs +30 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/machports.rs +487 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/macos_traphandlers.rs +28 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/mod.rs +21 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/signals.rs +402 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/unwind.rs +91 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/unix/vm.rs +208 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/windows/mod.rs +6 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/windows/traphandlers.rs +105 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/windows/unwind.rs +46 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/sys/windows/vm.rs +79 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/traphandlers/backtrace.rs +265 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/traphandlers.rs +733 -0
- data/ext/cargo-vendor/wasmtime-runtime-16.0.0/src/vmcontext.rs +1197 -0
- data/ext/cargo-vendor/wasmtime-types-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-types-16.0.0/Cargo.toml +36 -0
- data/ext/cargo-vendor/wasmtime-types-16.0.0/src/lib.rs +504 -0
- data/ext/cargo-vendor/wasmtime-versioned-export-macros-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-versioned-export-macros-16.0.0/Cargo.toml +32 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/Cargo.toml +261 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/lib.rs +137 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/host/io.rs +368 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/host/network.rs +570 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/host/tcp.rs +632 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/host/udp.rs +550 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/mod.rs +328 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/preview0.rs +870 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/preview1.rs +2348 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/stdio.rs +259 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/stream.rs +182 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/src/preview2/table.rs +337 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/all/api.rs +218 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/all/async_.rs +360 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/all/main.rs +113 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/all/preview1.rs +239 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/all/sync.rs +299 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/tests/process_stdin.rs +165 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/command-extended.wit +6 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/deps/cli/command.wit +7 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/deps/cli/imports.wit +20 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/deps/http/proxy.wit +32 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/deps/http/types.wit +570 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/wit/test.wit +22 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/witx/preview0/typenames.witx +746 -0
- data/ext/cargo-vendor/wasmtime-wasi-16.0.0/witx/preview0/wasi_unstable.witx +513 -0
- data/ext/cargo-vendor/wasmtime-winch-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-winch-16.0.0/Cargo.toml +77 -0
- data/ext/cargo-vendor/wasmtime-winch-16.0.0/src/compiler.rs +243 -0
- data/ext/cargo-vendor/wasmtime-wit-bindgen-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-wit-bindgen-16.0.0/Cargo.toml +41 -0
- data/ext/cargo-vendor/wasmtime-wmemcheck-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wasmtime-wmemcheck-16.0.0/Cargo.toml +29 -0
- data/ext/cargo-vendor/wiggle-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wiggle-16.0.0/Cargo.toml +115 -0
- data/ext/cargo-vendor/wiggle-16.0.0/src/lib.rs +1198 -0
- data/ext/cargo-vendor/wiggle-generate-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wiggle-generate-16.0.0/Cargo.toml +65 -0
- data/ext/cargo-vendor/wiggle-generate-16.0.0/src/types/handle.rs +84 -0
- data/ext/cargo-vendor/wiggle-generate-16.0.0/src/types/record.rs +132 -0
- data/ext/cargo-vendor/wiggle-generate-16.0.0/src/types/variant.rs +191 -0
- data/ext/cargo-vendor/wiggle-macro-16.0.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/wiggle-macro-16.0.0/Cargo.toml +55 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/.cargo-checksum.json +1 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/Cargo.toml +76 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/abi/local.rs +81 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/abi/mod.rs +614 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/codegen/call.rs +345 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/codegen/context.rs +545 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/codegen/control.rs +497 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/codegen/env.rs +251 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/codegen/mod.rs +428 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/frame/mod.rs +221 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/aarch64/abi.rs +313 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/aarch64/masm.rs +444 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/aarch64/mod.rs +137 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/mod.rs +225 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/x64/abi.rs +524 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/x64/asm.rs +1117 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/x64/masm.rs +994 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/x64/mod.rs +172 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/isa/x64/regs.rs +247 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/masm.rs +679 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/stack.rs +436 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/trampoline.rs +734 -0
- data/ext/cargo-vendor/winch-codegen-0.14.0/src/visitor.rs +1383 -0
- data/lib/wasmtime/version.rb +1 -1
- metadata +903 -977
- data/ext/cargo-vendor/cranelift-bforest-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-bforest-0.102.1/Cargo.toml +0 -31
- data/ext/cargo-vendor/cranelift-bforest-0.102.1/src/lib.rs +0 -184
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/Cargo.toml +0 -164
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/binemit/mod.rs +0 -171
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/egraph/cost.rs +0 -91
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/egraph/elaborate.rs +0 -731
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/egraph.rs +0 -678
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/ir/dfg.rs +0 -1730
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/ir/pcc.rs +0 -1682
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/aarch64/lower/isle.rs +0 -875
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/riscv64/inst/mod.rs +0 -2041
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/riscv64/inst.isle +0 -2909
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/riscv64/lower.isle +0 -2860
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/s390x/lower/isle.rs +0 -1029
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/x64/lower/isle.rs +0 -1070
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isa/x64/pcc.rs +0 -884
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/isle_prelude.rs +0 -972
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/lib.rs +0 -108
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/machinst/isle.rs +0 -897
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/opts/arithmetic.isle +0 -128
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/opts/cprop.isle +0 -210
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/opts/icmp.isle +0 -177
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/opts/selects.isle +0 -59
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/opts.rs +0 -138
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/prelude.isle +0 -646
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/timing.rs +0 -271
- data/ext/cargo-vendor/cranelift-codegen-0.102.1/src/unionfind.rs +0 -74
- data/ext/cargo-vendor/cranelift-codegen-meta-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-codegen-meta-0.102.1/Cargo.toml +0 -26
- data/ext/cargo-vendor/cranelift-codegen-shared-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-codegen-shared-0.102.1/Cargo.toml +0 -22
- data/ext/cargo-vendor/cranelift-codegen-shared-0.102.1/src/lib.rs +0 -12
- data/ext/cargo-vendor/cranelift-control-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-control-0.102.1/Cargo.toml +0 -30
- data/ext/cargo-vendor/cranelift-entity-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-entity-0.102.1/Cargo.toml +0 -41
- data/ext/cargo-vendor/cranelift-entity-0.102.1/src/lib.rs +0 -316
- data/ext/cargo-vendor/cranelift-entity-0.102.1/src/primary.rs +0 -456
- data/ext/cargo-vendor/cranelift-frontend-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-frontend-0.102.1/Cargo.toml +0 -59
- data/ext/cargo-vendor/cranelift-frontend-0.102.1/src/lib.rs +0 -191
- data/ext/cargo-vendor/cranelift-isle-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-isle-0.102.1/Cargo.toml +0 -37
- data/ext/cargo-vendor/cranelift-isle-0.102.1/isle_examples/link/multi_constructor_main.rs +0 -71
- data/ext/cargo-vendor/cranelift-isle-0.102.1/isle_examples/link/multi_extractor_main.rs +0 -50
- data/ext/cargo-vendor/cranelift-isle-0.102.1/src/codegen.rs +0 -763
- data/ext/cargo-vendor/cranelift-native-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-native-0.102.1/Cargo.toml +0 -43
- data/ext/cargo-vendor/cranelift-native-0.102.1/src/lib.rs +0 -190
- data/ext/cargo-vendor/cranelift-wasm-0.102.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/cranelift-wasm-0.102.1/Cargo.toml +0 -97
- data/ext/cargo-vendor/cranelift-wasm-0.102.1/src/environ/dummy.rs +0 -953
- data/ext/cargo-vendor/cranelift-wasm-0.102.1/src/lib.rs +0 -64
- data/ext/cargo-vendor/cranelift-wasm-0.102.1/src/translation_utils.rs +0 -97
- data/ext/cargo-vendor/wasi-cap-std-sync-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasi-cap-std-sync-15.0.1/Cargo.toml +0 -93
- data/ext/cargo-vendor/wasi-common-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasi-common-15.0.1/Cargo.toml +0 -122
- data/ext/cargo-vendor/wasi-common-15.0.1/src/lib.rs +0 -73
- data/ext/cargo-vendor/wasi-common-15.0.1/src/snapshots/preview_1.rs +0 -1490
- data/ext/cargo-vendor/wasm-encoder-0.36.2/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasm-encoder-0.36.2/Cargo.toml +0 -37
- data/ext/cargo-vendor/wasm-encoder-0.36.2/README.md +0 -80
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/aliases.rs +0 -160
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/builder.rs +0 -455
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/canonicals.rs +0 -159
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/components.rs +0 -29
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/exports.rs +0 -124
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/imports.rs +0 -175
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/instances.rs +0 -200
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/modules.rs +0 -29
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/names.rs +0 -149
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/start.rs +0 -52
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component/types.rs +0 -771
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/component.rs +0 -168
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/code.rs +0 -2989
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/custom.rs +0 -73
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/data.rs +0 -185
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/dump.rs +0 -627
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/elements.rs +0 -220
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/exports.rs +0 -98
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/functions.rs +0 -63
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/globals.rs +0 -100
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/imports.rs +0 -155
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/linking.rs +0 -263
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/memories.rs +0 -111
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/names.rs +0 -265
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/producers.rs +0 -180
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/start.rs +0 -39
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/tables.rs +0 -115
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/tags.rs +0 -104
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core/types.rs +0 -584
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/core.rs +0 -168
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/lib.rs +0 -215
- data/ext/cargo-vendor/wasm-encoder-0.36.2/src/raw.rs +0 -30
- data/ext/cargo-vendor/wasmparser-0.116.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmparser-0.116.1/Cargo.lock +0 -674
- data/ext/cargo-vendor/wasmparser-0.116.1/Cargo.toml +0 -60
- data/ext/cargo-vendor/wasmparser-0.116.1/README.md +0 -36
- data/ext/cargo-vendor/wasmparser-0.116.1/benches/benchmark.rs +0 -370
- data/ext/cargo-vendor/wasmparser-0.116.1/examples/simple.rs +0 -37
- data/ext/cargo-vendor/wasmparser-0.116.1/src/binary_reader.rs +0 -1706
- data/ext/cargo-vendor/wasmparser-0.116.1/src/define_types.rs +0 -782
- data/ext/cargo-vendor/wasmparser-0.116.1/src/lib.rs +0 -729
- data/ext/cargo-vendor/wasmparser-0.116.1/src/limits.rs +0 -58
- data/ext/cargo-vendor/wasmparser-0.116.1/src/parser.rs +0 -1612
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/aliases.rs +0 -119
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/canonicals.rs +0 -120
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/exports.rs +0 -135
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/imports.rs +0 -129
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/instances.rs +0 -163
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/names.rs +0 -102
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/start.rs +0 -30
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component/types.rs +0 -549
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/component.rs +0 -17
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/code.rs +0 -146
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/coredumps.rs +0 -243
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/custom.rs +0 -63
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/data.rs +0 -96
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/dylink0.rs +0 -132
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/elements.rs +0 -152
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/exports.rs +0 -65
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/functions.rs +0 -17
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/globals.rs +0 -49
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/imports.rs +0 -76
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/init.rs +0 -51
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/memories.rs +0 -56
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/names.rs +0 -153
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/operators.rs +0 -354
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/producers.rs +0 -83
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/tables.rs +0 -87
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/tags.rs +0 -32
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core/types.rs +0 -544
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers/core.rs +0 -37
- data/ext/cargo-vendor/wasmparser-0.116.1/src/readers.rs +0 -316
- data/ext/cargo-vendor/wasmparser-0.116.1/src/resources.rs +0 -398
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/component.rs +0 -3203
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/core.rs +0 -1341
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/func.rs +0 -348
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/names.rs +0 -859
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/operators.rs +0 -3466
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator/types.rs +0 -4011
- data/ext/cargo-vendor/wasmparser-0.116.1/src/validator.rs +0 -1603
- data/ext/cargo-vendor/wasmparser-0.116.1/tests/big-module.rs +0 -33
- data/ext/cargo-vendor/wasmtime-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-15.0.1/Cargo.toml +0 -202
- data/ext/cargo-vendor/wasmtime-15.0.1/src/compiler.rs +0 -682
- data/ext/cargo-vendor/wasmtime-15.0.1/src/component/component.rs +0 -505
- data/ext/cargo-vendor/wasmtime-15.0.1/src/component/func/typed.rs +0 -2398
- data/ext/cargo-vendor/wasmtime-15.0.1/src/config.rs +0 -2422
- data/ext/cargo-vendor/wasmtime-15.0.1/src/func.rs +0 -2428
- data/ext/cargo-vendor/wasmtime-15.0.1/src/lib.rs +0 -518
- data/ext/cargo-vendor/wasmtime-15.0.1/src/memory.rs +0 -996
- data/ext/cargo-vendor/wasmtime-15.0.1/src/module.rs +0 -1370
- data/ext/cargo-vendor/wasmtime-15.0.1/src/stack.rs +0 -73
- data/ext/cargo-vendor/wasmtime-15.0.1/src/v128.rs +0 -151
- data/ext/cargo-vendor/wasmtime-asm-macros-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-asm-macros-15.0.1/Cargo.toml +0 -22
- data/ext/cargo-vendor/wasmtime-cache-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-cache-15.0.1/Cargo.toml +0 -72
- data/ext/cargo-vendor/wasmtime-cache-15.0.1/src/lib.rs +0 -238
- data/ext/cargo-vendor/wasmtime-cache-15.0.1/src/worker.rs +0 -894
- data/ext/cargo-vendor/wasmtime-component-macro-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-component-macro-15.0.1/Cargo.toml +0 -58
- data/ext/cargo-vendor/wasmtime-component-util-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-component-util-15.0.1/Cargo.toml +0 -25
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/Cargo.toml +0 -103
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/compiler/component.rs +0 -959
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/compiler.rs +0 -1317
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/debug/transform/expression.rs +0 -1250
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/debug/transform/simulate.rs +0 -410
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/debug.rs +0 -18
- data/ext/cargo-vendor/wasmtime-cranelift-15.0.1/src/func_environ.rs +0 -2746
- data/ext/cargo-vendor/wasmtime-cranelift-shared-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-cranelift-shared-15.0.1/Cargo.toml +0 -62
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/Cargo.lock +0 -677
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/Cargo.toml +0 -116
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/compilation.rs +0 -402
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/component/compiler.rs +0 -47
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/component/translate.rs +0 -951
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/component/types.rs +0 -1870
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/lib.rs +0 -59
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/module.rs +0 -1083
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/module_environ.rs +0 -876
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/module_types.rs +0 -78
- data/ext/cargo-vendor/wasmtime-environ-15.0.1/src/scopevec.rs +0 -57
- data/ext/cargo-vendor/wasmtime-fiber-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-fiber-15.0.1/Cargo.toml +0 -54
- data/ext/cargo-vendor/wasmtime-fiber-15.0.1/src/lib.rs +0 -327
- data/ext/cargo-vendor/wasmtime-fiber-15.0.1/src/unix.rs +0 -265
- data/ext/cargo-vendor/wasmtime-fiber-15.0.1/src/windows.c +0 -9
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/Cargo.toml +0 -115
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/code_memory.rs +0 -321
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/instantiate.rs +0 -766
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/lib.rs +0 -22
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/unwind/miri.rs +0 -15
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/unwind/systemv.rs +0 -90
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/unwind/winx64.rs +0 -44
- data/ext/cargo-vendor/wasmtime-jit-15.0.1/src/unwind.rs +0 -14
- data/ext/cargo-vendor/wasmtime-jit-debug-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-jit-debug-15.0.1/Cargo.toml +0 -58
- data/ext/cargo-vendor/wasmtime-jit-icache-coherence-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-jit-icache-coherence-15.0.1/Cargo.toml +0 -37
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/Cargo.toml +0 -126
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/build.rs +0 -19
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/proptest-regressions/instance/allocator/pooling/memory_pool.txt +0 -8
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/cow.rs +0 -1060
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/helpers.c +0 -108
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling/memory_pool.rs +0 -999
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling/stack_pool.rs +0 -242
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling/table_pool.rs +0 -225
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling/unix.rs +0 -56
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling/windows.rs +0 -38
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/instance/allocator/pooling.rs +0 -708
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/lib.rs +0 -279
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/libcalls.rs +0 -775
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/mmap.rs +0 -226
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/mpk/enabled.rs +0 -201
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/mpk/pkru.rs +0 -93
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/trampolines/aarch64.rs +0 -42
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/trampolines/riscv64.rs +0 -45
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/trampolines/s390x.rs +0 -25
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/trampolines/x86_64.rs +0 -64
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/trampolines.rs +0 -19
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/backtrace/aarch64.rs +0 -55
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/backtrace/riscv64.rs +0 -18
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/backtrace/s390x.rs +0 -22
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/backtrace/x86_64.rs +0 -20
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/backtrace.rs +0 -291
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/macos.rs +0 -492
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/unix.rs +0 -402
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers/windows.rs +0 -89
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/traphandlers.rs +0 -815
- data/ext/cargo-vendor/wasmtime-runtime-15.0.1/src/vmcontext.rs +0 -1197
- data/ext/cargo-vendor/wasmtime-types-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-types-15.0.1/Cargo.toml +0 -36
- data/ext/cargo-vendor/wasmtime-types-15.0.1/src/lib.rs +0 -504
- data/ext/cargo-vendor/wasmtime-versioned-export-macros-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-versioned-export-macros-15.0.1/Cargo.toml +0 -32
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/Cargo.toml +0 -248
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/lib.rs +0 -135
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/host/io.rs +0 -368
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/host/network.rs +0 -515
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/host/tcp.rs +0 -630
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/host/udp.rs +0 -543
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/mod.rs +0 -326
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/preview1.rs +0 -2342
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/stdio.rs +0 -450
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/stream.rs +0 -182
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/src/preview2/table.rs +0 -258
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/command-extended.wit +0 -6
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/deps/cli/command.wit +0 -7
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/deps/cli/reactor.wit +0 -31
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/deps/http/proxy.wit +0 -33
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/deps/http/types.wit +0 -559
- data/ext/cargo-vendor/wasmtime-wasi-15.0.1/wit/test.wit +0 -22
- data/ext/cargo-vendor/wasmtime-winch-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-winch-15.0.1/Cargo.toml +0 -68
- data/ext/cargo-vendor/wasmtime-winch-15.0.1/src/compiler.rs +0 -242
- data/ext/cargo-vendor/wasmtime-wit-bindgen-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-wit-bindgen-15.0.1/Cargo.toml +0 -32
- data/ext/cargo-vendor/wasmtime-wmemcheck-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wasmtime-wmemcheck-15.0.1/Cargo.toml +0 -22
- data/ext/cargo-vendor/wiggle-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wiggle-15.0.1/Cargo.toml +0 -106
- data/ext/cargo-vendor/wiggle-15.0.1/src/lib.rs +0 -1198
- data/ext/cargo-vendor/wiggle-generate-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wiggle-generate-15.0.1/Cargo.toml +0 -58
- data/ext/cargo-vendor/wiggle-generate-15.0.1/LICENSE +0 -220
- data/ext/cargo-vendor/wiggle-generate-15.0.1/src/types/handle.rs +0 -84
- data/ext/cargo-vendor/wiggle-generate-15.0.1/src/types/record.rs +0 -132
- data/ext/cargo-vendor/wiggle-generate-15.0.1/src/types/variant.rs +0 -191
- data/ext/cargo-vendor/wiggle-macro-15.0.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/wiggle-macro-15.0.1/Cargo.toml +0 -55
- data/ext/cargo-vendor/wiggle-macro-15.0.1/LICENSE +0 -220
- data/ext/cargo-vendor/winch-codegen-0.13.1/.cargo-checksum.json +0 -1
- data/ext/cargo-vendor/winch-codegen-0.13.1/Cargo.toml +0 -67
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/abi/local.rs +0 -70
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/abi/mod.rs +0 -304
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/codegen/call.rs +0 -353
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/codegen/context.rs +0 -465
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/codegen/control.rs +0 -456
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/codegen/env.rs +0 -181
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/codegen/mod.rs +0 -436
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/frame/mod.rs +0 -189
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/aarch64/abi.rs +0 -267
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/aarch64/masm.rs +0 -436
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/aarch64/mod.rs +0 -136
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/mod.rs +0 -218
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/x64/abi.rs +0 -410
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/x64/asm.rs +0 -1106
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/x64/masm.rs +0 -953
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/x64/mod.rs +0 -172
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/isa/x64/regs.rs +0 -247
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/masm.rs +0 -592
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/stack.rs +0 -366
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/trampoline.rs +0 -489
- data/ext/cargo-vendor/winch-codegen-0.13.1/src/visitor.rs +0 -1339
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/src/map.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/src/node.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/src/path.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/src/pool.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-bforest-0.102.1 → cranelift-bforest-0.103.0}/src/set.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/benches/x64-evex-encoding.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/alias_analysis.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/binemit/stack_map.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/bitset.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/cfg_printer.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/constant_hash.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/context.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ctxhash.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/cursor.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/data_value.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/dbg.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/dce.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/dominator_tree.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/egraph/domtree.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/flowgraph.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/fx.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/incremental_cache.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/inst_predicates.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/atomic_rmw_op.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/builder.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/condcodes.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/constant.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/dynamic_type.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/entities.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/extfunc.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/extname.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/function.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/globalvalue.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/immediates.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/instructions.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/jumptable.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/known_symbol.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/layout.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/libcall.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/memflags.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/memtype.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/progpoint.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/sourceloc.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/stackslot.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/table.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/trapcode.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/ir/types.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/abi.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/args.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/emit.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/emit_tests.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/imms.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/regs.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/unwind/systemv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst/unwind.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/inst_neon.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/lower/isle/generated_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/lower.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/lower.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/lower_dynamic_neon.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/pcc.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/aarch64/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/call_conv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/abi.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/args.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/emit.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/emit_tests.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/encode.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/imms.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/regs.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/unwind/systemv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/unwind.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst/vector.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/inst_vector.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/lower/isle/generated_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/lower/isle.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/lower.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/riscv64/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/abi.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/args.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/emit.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/emit_tests.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/imms.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/regs.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/unwind/systemv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst/unwind.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/inst.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/lower/isle/generated_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/lower.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/lower.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/s390x/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/unwind/systemv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/unwind/winx64.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/unwind.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/abi.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/encoding/evex.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/encoding/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/encoding/rex.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/encoding/vex.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/args.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/emit.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/emit_state.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/emit_tests.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/regs.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/unwind/systemv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/unwind/winx64.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst/unwind.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/inst.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/lower/isle/generated_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/lower.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/lower.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/isa/x64/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/iterators.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/legalizer/globalvalue.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/legalizer/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/legalizer/table.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/loop_analysis.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/abi.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/blockorder.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/buffer.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/compile.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/helpers.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/inst_common.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/lower.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/pcc.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/reg.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/valueregs.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/machinst/vcode.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/nan_canonicalization.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/bitops.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/extends.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/generated_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/remat.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/shifts.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/opts/vector.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/prelude_lower.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/prelude_opt.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/print_errors.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/remove_constant_phis.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/result.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/scoped_hash_map.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/souper_harvest.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/unreachable_code.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/value_label.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/verifier/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-0.102.1 → cranelift-codegen-0.103.0}/src/write.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/formats.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/instructions.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/isa.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/operands.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/types.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/cdsl/typevar.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/constant_hash.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/gen_inst.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/gen_settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/gen_types.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/isa/arm64.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/isa/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/isa/riscv64.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/isa/s390x.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/isa/x86.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/entities.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/formats.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/immediates.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/instructions.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/settings.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/shared/types.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/srcgen.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-meta-0.102.1 → cranelift-codegen-meta-0.103.0}/src/unique_table.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-shared-0.102.1 → cranelift-codegen-shared-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-shared-0.102.1 → cranelift-codegen-shared-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-shared-0.102.1 → cranelift-codegen-shared-0.103.0}/src/constant_hash.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-codegen-shared-0.102.1 → cranelift-codegen-shared-0.103.0}/src/constants.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-control-0.102.1 → cranelift-control-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-control-0.102.1 → cranelift-control-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-control-0.102.1 → cranelift-control-0.103.0}/src/chaos.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-control-0.102.1 → cranelift-control-0.103.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-control-0.102.1 → cranelift-control-0.103.0}/src/zero_sized.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/boxed_slice.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/iter.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/keys.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/list.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/map.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/packed_option.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/set.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-entity-0.102.1 → cranelift-entity-0.103.0}/src/sparse.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/src/frontend.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/src/ssa.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/src/switch.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-frontend-0.102.1 → cranelift-frontend-0.103.0}/src/variable.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/bad_converters.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/bound_var_type_mismatch.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/converter_extractor_constructor.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/error1.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/extra_parens.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/impure_expression.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/impure_rhs.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/multi_internal_etor.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/fail/multi_prio.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/borrows.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/borrows_main.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/iflets.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/iflets_main.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/multi_constructor.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/multi_extractor.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/test.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/link/test_main.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/bound_var.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/construct_and_extract.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/conversions.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/conversions_extern.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/let.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/nodebug.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/prio_trie_bug.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/test2.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/test3.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/test4.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/pass/tutorial.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/run/iconst.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/run/iconst_main.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/run/let_shadowing.isle +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/isle_examples/run/let_shadowing_main.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/ast.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/compile.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/lexer.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/log.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/overlap.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/parser.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/sema.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/serialize.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/src/trie_again.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-isle-0.102.1 → cranelift-isle-0.103.0}/tests/run_tests.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-native-0.102.1 → cranelift-native-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-native-0.102.1 → cranelift-native-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-native-0.102.1 → cranelift-native-0.103.0}/src/riscv.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/README.md +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/code_translator/bounds_checks.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/code_translator.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/environ/mod.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/environ/spec.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/func_translator.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/heap.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/module_translator.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/sections_translator.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/src/state.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/tests/wasm_testsuite.rs +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/arith.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/br_table.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/call-simd.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/call.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/embenchen_fannkuch.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/embenchen_fasta.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/embenchen_ifs.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/embenchen_primes.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/fac-multi-value.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/fibonacci.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/globals.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/icall-simd.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/icall.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-0.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-1.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-2.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-3.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-4.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-5.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-reachability-translation-6.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-unreachable-else-params-2.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/if-unreachable-else-params.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/issue-1306-name-section-with-u32-max-function-index.wasm +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/memory.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-0.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-1.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-10.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-11.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-12.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-13.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-14.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-15.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-16.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-17.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-2.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-3.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-4.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-5.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-6.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-7.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-8.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/multi-9.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/nullref.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/passive-data.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/pr2303.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/pr2559.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/ref-func-0.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/rust_fannkuch.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/select.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/simd-store.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/simd.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/table-copy.wat +0 -0
- /data/ext/cargo-vendor/{cranelift-wasm-0.102.1 → cranelift-wasm-0.103.0}/wasmtests/unreachable_code.wat +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/clocks.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/dir.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/file.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/net.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/sched/unix.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/sched/windows.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/sched.rs +0 -0
- /data/ext/cargo-vendor/{wasi-cap-std-sync-15.0.1 → wasi-cap-std-sync-16.0.0}/src/stdio.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/docs/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/docs.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/typenames.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_args.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_clock.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_environ.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_fd.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_path.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_poll.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_proc.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_random.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_sched.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/ephemeral/witx/wasi_ephemeral_sock.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/old/snapshot_0/docs.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/old/snapshot_0/witx/typenames.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/old/snapshot_0/witx/wasi_unstable.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/snapshot/docs.html +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/snapshot/docs.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/snapshot/witx/typenames.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/phases/snapshot/witx/wasi_snapshot_preview1.witx +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/proposal-template/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/proposals/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/snapshots/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/WASI/standard/README.md +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/clocks.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/ctx.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/dir.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/file.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/pipe.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/random.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/sched/subscription.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/sched.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/snapshots/mod.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/snapshots/preview_0.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/snapshots/preview_1/error.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/string_array.rs +0 -0
- /data/ext/cargo-vendor/{wasi-common-15.0.1 → wasi-common-16.0.0}/src/table.rs +0 -0
- /data/ext/cargo-vendor/{wasm-encoder-0.36.2 → wasmtime-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/code.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/func/host.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/func/options.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/func.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/instance.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/linker.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/matching.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/mod.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/resources.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/storage.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/store.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/types.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/component/values.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/coredump.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/engine/serialization.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/engine.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/externals/global.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/externals/table.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/externals.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/func/typed.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/instance.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/limits.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/linker.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/module/registry.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/profiling.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/ref.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/resources.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/signatures.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/store/context.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/store/data.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/store/func_refs.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/store.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trampoline/func.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trampoline/global.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trampoline/memory.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trampoline/table.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trampoline.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/trap.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/types/matching.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/types.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/unix.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/values.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-16.0.0}/src/windows.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-asm-macros-15.0.1 → wasmtime-asm-macros-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmparser-0.116.1 → wasmtime-cache-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/src/config/tests.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/src/config.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/src/tests.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/src/worker/tests/system_time_stub.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/src/worker/tests.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-cache-16.0.0}/tests/cache_write_default_config.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/src/bindgen.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/src/component.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/char.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/conventions.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/direct-import.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/empty.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/flags.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/floats.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/function-new.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/integers.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/lists.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/many-arguments.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/multi-return.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/multiversion/deps/v1/root.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/multiversion/deps/v2/root.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/multiversion/root.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/records.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/rename.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/resources-export.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/resources-import.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/share-types.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/simple-functions.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/simple-lists.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/simple-wasi.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/small-anonymous.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/smoke-default.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/smoke-export.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/smoke.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/strings.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/use-paths.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/variants.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen/worlds-with-types.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-macro-15.0.1 → wasmtime-component-macro-16.0.0}/tests/codegen.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-component-util-15.0.1 → wasmtime-component-util-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-15.0.1 → wasmtime-cranelift-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/SECURITY.md +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/builder.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/gc.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/address_transform.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/attr.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/line_program.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/mod.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/range_info_builder.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/refs.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/unit.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/transform/utils.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/debug/write_debuginfo.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-cranelift-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-shared-15.0.1 → wasmtime-cranelift-shared-16.0.0}/src/compiled_function.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-shared-15.0.1 → wasmtime-cranelift-shared-16.0.0}/src/isa_builder.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-shared-15.0.1 → wasmtime-cranelift-shared-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-shared-15.0.1 → wasmtime-cranelift-shared-16.0.0}/src/obj.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cache-15.0.1 → wasmtime-environ-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/examples/factc.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/address_map.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/builtin.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/dfg.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/info.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/translate/adapt.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/translate/inline.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/types/resources.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component/vmcomponent_offsets.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/component.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact/core_types.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact/signature.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact/trampoline.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact/transcode.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact/traps.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/fact.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/obj.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/ref_bits.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/stack_map.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/trap_encoding.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/tunables.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-environ-16.0.0}/src/vmoffsets.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-cranelift-15.0.1 → wasmtime-fiber-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/aarch64.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/arm.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/riscv64.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/s390x.S +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/x86.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/unix/x86_64.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-fiber-16.0.0}/src/windows.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-environ-15.0.1 → wasmtime-jit-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/debug.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/demangling.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/profiling/jitdump.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/profiling/perfmap.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/profiling/vtune.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-jit-16.0.0}/src/profiling.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-debug-15.0.1 → wasmtime-jit-debug-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-debug-15.0.1 → wasmtime-jit-debug-16.0.0}/src/gdb_jit_int.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-debug-15.0.1 → wasmtime-jit-debug-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-debug-15.0.1 → wasmtime-jit-debug-16.0.0}/src/perf_jitdump.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-icache-coherence-15.0.1 → wasmtime-jit-icache-coherence-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-icache-coherence-15.0.1 → wasmtime-jit-icache-coherence-16.0.0}/src/libc.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-icache-coherence-15.0.1 → wasmtime-jit-icache-coherence-16.0.0}/src/miri.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-icache-coherence-15.0.1 → wasmtime-jit-icache-coherence-16.0.0}/src/win.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-fiber-15.0.1 → wasmtime-runtime-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1/src/trampolines → wasmtime-runtime-16.0.0/src/arch}/s390x.S +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/component/libcalls.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/component/resources.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/component.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/debug_builtins.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/export.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/externref.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/imports.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/instance/allocator/on_demand.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/instance/allocator/pooling/index_allocator.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/instance/allocator.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/instance.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/memory.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/mmap_vec.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/module_id.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/mpk/disabled.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/mpk/mod.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/mpk/sys.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/parking_spot.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/send_sync_ptr.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/store_box.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1/src/mmap/miri.rs → wasmtime-runtime-16.0.0/src/sys/miri/mmap.rs} +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1/src/mmap/unix.rs → wasmtime-runtime-16.0.0/src/sys/unix/mmap.rs} +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1/src/mmap/windows.rs → wasmtime-runtime-16.0.0/src/sys/windows/mmap.rs} +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/table.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/traphandlers/coredump.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-runtime-16.0.0}/src/vmcontext/vm_host_func_context.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-jit-15.0.1 → wasmtime-types-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-types-15.0.1 → wasmtime-types-16.0.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-versioned-export-macros-15.0.1 → wasmtime-versioned-export-macros-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-runtime-15.0.1 → wasmtime-wasi-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/clocks/host.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/clocks.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/command.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/ctx.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/error.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/filesystem.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/clocks.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/env.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/exit.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/filesystem/sync.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/filesystem.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/instance_network.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/mod.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/random.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/tcp_create_socket.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/host/udp_create_socket.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/ip_name_lookup.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/network.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/pipe.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/poll.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/random.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/stdio/worker_thread_stdin.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/tcp.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/udp.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/src/preview2/write_stream.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/cli/environment.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/cli/exit.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/cli/run.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/cli/stdio.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/cli/terminal.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/clocks/monotonic-clock.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/clocks/wall-clock.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/clocks/world.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/filesystem/preopens.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/filesystem/types.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/filesystem/world.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/http/handler.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/io/error.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/io/poll.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/io/streams.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/io/world.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/random/insecure-seed.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/random/insecure.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/random/random.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/random/world.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/instance-network.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/ip-name-lookup.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/network.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/tcp-create-socket.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/tcp.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/udp-create-socket.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/udp.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wasmtime-wasi-16.0.0}/wit/deps/sockets/world.wit +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1/witx → wasmtime-wasi-16.0.0/witx/preview1}/typenames.witx +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1/witx → wasmtime-wasi-16.0.0/witx/preview1}/wasi_snapshot_preview1.witx +0 -0
- /data/ext/cargo-vendor/{wasmtime-winch-15.0.1 → wasmtime-winch-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wasmtime-winch-15.0.1 → wasmtime-winch-16.0.0}/src/builder.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-winch-15.0.1 → wasmtime-winch-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wit-bindgen-15.0.1 → wasmtime-wit-bindgen-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wit-bindgen-15.0.1 → wasmtime-wit-bindgen-16.0.0}/src/rust.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wit-bindgen-15.0.1 → wasmtime-wit-bindgen-16.0.0}/src/source.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wit-bindgen-15.0.1 → wasmtime-wit-bindgen-16.0.0}/src/types.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wmemcheck-15.0.1 → wasmtime-wmemcheck-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-types-15.0.1 → wiggle-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/src/borrow.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/src/error.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/src/guest_type.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/src/region.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-16.0.0}/src/wasmtime.rs +0 -0
- /data/ext/cargo-vendor/{wasmtime-wasi-15.0.1 → wiggle-generate-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/README.md +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/codegen_settings.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/config.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/funcs.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/lifetimes.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/module_trait.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/names.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/types/error.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/types/flags.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/types/mod.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-generate-15.0.1 → wiggle-generate-16.0.0}/src/wasmtime.rs +0 -0
- /data/ext/cargo-vendor/{wiggle-15.0.1 → wiggle-macro-16.0.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{wiggle-macro-15.0.1 → wiggle-macro-16.0.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/LICENSE +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/build.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/codegen/builtin.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/isa/aarch64/address.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/isa/aarch64/asm.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/isa/aarch64/regs.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/isa/reg.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/isa/x64/address.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/lib.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/regalloc.rs +0 -0
- /data/ext/cargo-vendor/{winch-codegen-0.13.1 → winch-codegen-0.14.0}/src/regset.rs +0 -0
@@ -1,4011 +0,0 @@
|
|
1
|
-
//! Types relating to type information provided by validation.
|
2
|
-
|
3
|
-
use super::{
|
4
|
-
component::{ComponentState, ExternKind},
|
5
|
-
core::Module,
|
6
|
-
};
|
7
|
-
use crate::validator::names::KebabString;
|
8
|
-
use crate::{
|
9
|
-
BinaryReaderError, CompositeType, Export, ExternalKind, FuncType, GlobalType, Import,
|
10
|
-
MemoryType, PrimitiveValType, RefType, Result, SubType, TableType, TypeRef, ValType,
|
11
|
-
};
|
12
|
-
use indexmap::{IndexMap, IndexSet};
|
13
|
-
use std::collections::HashMap;
|
14
|
-
use std::collections::HashSet;
|
15
|
-
use std::ops::Index;
|
16
|
-
use std::sync::atomic::{AtomicU64, Ordering};
|
17
|
-
use std::{
|
18
|
-
borrow::Borrow,
|
19
|
-
hash::{Hash, Hasher},
|
20
|
-
mem,
|
21
|
-
ops::{Deref, DerefMut},
|
22
|
-
sync::Arc,
|
23
|
-
};
|
24
|
-
|
25
|
-
/// The maximum number of parameters in the canonical ABI that can be passed by value.
|
26
|
-
///
|
27
|
-
/// Functions that exceed this limit will instead pass parameters indirectly from
|
28
|
-
/// linear memory via a single pointer parameter.
|
29
|
-
const MAX_FLAT_FUNC_PARAMS: usize = 16;
|
30
|
-
/// The maximum number of results in the canonical ABI that can be returned by a function.
|
31
|
-
///
|
32
|
-
/// Functions that exceed this limit have their results written to linear memory via an
|
33
|
-
/// additional pointer parameter (imports) or return a single pointer value (exports).
|
34
|
-
const MAX_FLAT_FUNC_RESULTS: usize = 1;
|
35
|
-
|
36
|
-
/// The maximum lowered types, including a possible type for a return pointer parameter.
|
37
|
-
const MAX_LOWERED_TYPES: usize = MAX_FLAT_FUNC_PARAMS + 1;
|
38
|
-
|
39
|
-
/// A simple alloc-free list of types used for calculating lowered function signatures.
|
40
|
-
pub(crate) struct LoweredTypes {
|
41
|
-
types: [ValType; MAX_LOWERED_TYPES],
|
42
|
-
len: usize,
|
43
|
-
max: usize,
|
44
|
-
}
|
45
|
-
|
46
|
-
impl LoweredTypes {
|
47
|
-
fn new(max: usize) -> Self {
|
48
|
-
assert!(max <= MAX_LOWERED_TYPES);
|
49
|
-
Self {
|
50
|
-
types: [ValType::I32; MAX_LOWERED_TYPES],
|
51
|
-
len: 0,
|
52
|
-
max,
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
fn len(&self) -> usize {
|
57
|
-
self.len
|
58
|
-
}
|
59
|
-
|
60
|
-
fn maxed(&self) -> bool {
|
61
|
-
self.len == self.max
|
62
|
-
}
|
63
|
-
|
64
|
-
fn get_mut(&mut self, index: usize) -> Option<&mut ValType> {
|
65
|
-
if index < self.len {
|
66
|
-
Some(&mut self.types[index])
|
67
|
-
} else {
|
68
|
-
None
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
fn push(&mut self, ty: ValType) -> bool {
|
73
|
-
if self.maxed() {
|
74
|
-
return false;
|
75
|
-
}
|
76
|
-
|
77
|
-
self.types[self.len] = ty;
|
78
|
-
self.len += 1;
|
79
|
-
true
|
80
|
-
}
|
81
|
-
|
82
|
-
fn clear(&mut self) {
|
83
|
-
self.len = 0;
|
84
|
-
}
|
85
|
-
|
86
|
-
pub fn as_slice(&self) -> &[ValType] {
|
87
|
-
&self.types[..self.len]
|
88
|
-
}
|
89
|
-
|
90
|
-
pub fn iter(&self) -> impl Iterator<Item = ValType> + '_ {
|
91
|
-
self.as_slice().iter().copied()
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
/// Represents information about a component function type lowering.
|
96
|
-
pub(crate) struct LoweringInfo {
|
97
|
-
pub(crate) params: LoweredTypes,
|
98
|
-
pub(crate) results: LoweredTypes,
|
99
|
-
pub(crate) requires_memory: bool,
|
100
|
-
pub(crate) requires_realloc: bool,
|
101
|
-
}
|
102
|
-
|
103
|
-
impl LoweringInfo {
|
104
|
-
pub(crate) fn into_func_type(self) -> FuncType {
|
105
|
-
FuncType::new(
|
106
|
-
self.params.as_slice().iter().copied(),
|
107
|
-
self.results.as_slice().iter().copied(),
|
108
|
-
)
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
|
-
impl Default for LoweringInfo {
|
113
|
-
fn default() -> Self {
|
114
|
-
Self {
|
115
|
-
params: LoweredTypes::new(MAX_FLAT_FUNC_PARAMS),
|
116
|
-
results: LoweredTypes::new(MAX_FLAT_FUNC_RESULTS),
|
117
|
-
requires_memory: false,
|
118
|
-
requires_realloc: false,
|
119
|
-
}
|
120
|
-
}
|
121
|
-
}
|
122
|
-
|
123
|
-
fn push_primitive_wasm_types(ty: &PrimitiveValType, lowered_types: &mut LoweredTypes) -> bool {
|
124
|
-
match ty {
|
125
|
-
PrimitiveValType::Bool
|
126
|
-
| PrimitiveValType::S8
|
127
|
-
| PrimitiveValType::U8
|
128
|
-
| PrimitiveValType::S16
|
129
|
-
| PrimitiveValType::U16
|
130
|
-
| PrimitiveValType::S32
|
131
|
-
| PrimitiveValType::U32
|
132
|
-
| PrimitiveValType::Char => lowered_types.push(ValType::I32),
|
133
|
-
PrimitiveValType::S64 | PrimitiveValType::U64 => lowered_types.push(ValType::I64),
|
134
|
-
PrimitiveValType::Float32 => lowered_types.push(ValType::F32),
|
135
|
-
PrimitiveValType::Float64 => lowered_types.push(ValType::F64),
|
136
|
-
PrimitiveValType::String => {
|
137
|
-
lowered_types.push(ValType::I32) && lowered_types.push(ValType::I32)
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}
|
141
|
-
|
142
|
-
/// A trait shared by all type identifiers.
|
143
|
-
///
|
144
|
-
/// Any id that can be used to get a type from a `Types`.
|
145
|
-
//
|
146
|
-
// Or, internally, from a `TypeList`.
|
147
|
-
pub trait TypeIdentifier: std::fmt::Debug + Copy + Eq + Sized + 'static {
|
148
|
-
/// The data pointed to by this type of id.
|
149
|
-
type Data: TypeData<Id = Self>;
|
150
|
-
|
151
|
-
/// Create a type id from an index.
|
152
|
-
#[doc(hidden)]
|
153
|
-
fn from_index(index: u32) -> Self;
|
154
|
-
|
155
|
-
/// Get a shared reference to the list where this id's type data is stored
|
156
|
-
/// within.
|
157
|
-
#[doc(hidden)]
|
158
|
-
fn list(types: &TypeList) -> &SnapshotList<Self::Data>;
|
159
|
-
|
160
|
-
/// Get an exclusive reference to the list where this id's type data is
|
161
|
-
/// stored within.
|
162
|
-
#[doc(hidden)]
|
163
|
-
fn list_mut(types: &mut TypeList) -> &mut SnapshotList<Self::Data>;
|
164
|
-
|
165
|
-
/// The raw index of this id.
|
166
|
-
#[doc(hidden)]
|
167
|
-
fn index(&self) -> usize;
|
168
|
-
}
|
169
|
-
|
170
|
-
/// A trait shared by all types within a `Types`.
|
171
|
-
///
|
172
|
-
/// This is the data that can be retreived by indexing with the associated
|
173
|
-
/// [`TypeIdentifier`].
|
174
|
-
pub trait TypeData: std::fmt::Debug {
|
175
|
-
/// The identifier for this type data.
|
176
|
-
type Id: TypeIdentifier<Data = Self>;
|
177
|
-
|
178
|
-
/// Get the info for this type.
|
179
|
-
#[doc(hidden)]
|
180
|
-
fn type_info(&self, types: &TypeList) -> TypeInfo;
|
181
|
-
}
|
182
|
-
|
183
|
-
/// A type that can be aliased in the component model.
|
184
|
-
pub trait Aliasable {
|
185
|
-
#[doc(hidden)]
|
186
|
-
fn alias_id(&self) -> u32;
|
187
|
-
|
188
|
-
#[doc(hidden)]
|
189
|
-
fn set_alias_id(&mut self, alias_id: u32);
|
190
|
-
}
|
191
|
-
|
192
|
-
/// A fresh alias id that means the entity is not an alias of anything.
|
193
|
-
///
|
194
|
-
/// Note that the `TypeList::alias_counter` starts at zero, so we can't use that
|
195
|
-
/// as this sentinel. The implementation limits are such that we can't ever
|
196
|
-
/// generate `u32::MAX` aliases, so we don't need to worryabout running into
|
197
|
-
/// this value in practice either.
|
198
|
-
const NO_ALIAS: u32 = u32::MAX;
|
199
|
-
|
200
|
-
macro_rules! define_type_id {
|
201
|
-
($name:ident, $data:ty, $list:ident, $type_str:expr) => {
|
202
|
-
#[doc = "Represents a unique identifier for a "]
|
203
|
-
#[doc = $type_str]
|
204
|
-
#[doc = " type known to a [`crate::Validator`]."]
|
205
|
-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
206
|
-
#[repr(C)] // Use fixed field layout to ensure minimal size.
|
207
|
-
pub struct $name {
|
208
|
-
/// The index into the associated list of types.
|
209
|
-
index: u32,
|
210
|
-
}
|
211
|
-
|
212
|
-
impl TypeIdentifier for $name {
|
213
|
-
type Data = $data;
|
214
|
-
|
215
|
-
fn from_index(index: u32) -> Self {
|
216
|
-
$name { index }
|
217
|
-
}
|
218
|
-
|
219
|
-
fn list(types: &TypeList) -> &SnapshotList<Self::Data> {
|
220
|
-
&types.$list
|
221
|
-
}
|
222
|
-
|
223
|
-
fn list_mut(types: &mut TypeList) -> &mut SnapshotList<Self::Data> {
|
224
|
-
&mut types.$list
|
225
|
-
}
|
226
|
-
|
227
|
-
fn index(&self) -> usize {
|
228
|
-
usize::try_from(self.index).unwrap()
|
229
|
-
}
|
230
|
-
}
|
231
|
-
|
232
|
-
impl Aliasable for $name {
|
233
|
-
fn alias_id(&self) -> u32 {
|
234
|
-
NO_ALIAS
|
235
|
-
}
|
236
|
-
|
237
|
-
fn set_alias_id(&mut self, _: u32) {}
|
238
|
-
}
|
239
|
-
|
240
|
-
// The size of type IDs was seen to have a large-ish impact in #844, so
|
241
|
-
// this assert ensures that it stays relatively small.
|
242
|
-
const _: () = {
|
243
|
-
assert!(std::mem::size_of::<$name>() <= 4);
|
244
|
-
};
|
245
|
-
};
|
246
|
-
}
|
247
|
-
|
248
|
-
/// A core WebAssembly type, in the core WebAssembly types index space.
|
249
|
-
pub enum CoreType {
|
250
|
-
/// A sub type.
|
251
|
-
Sub(SubType),
|
252
|
-
|
253
|
-
/// A module type.
|
254
|
-
///
|
255
|
-
/// Does not actually appear in core Wasm at the moment. Only used for the
|
256
|
-
/// core types index space within components.
|
257
|
-
Module(ModuleType),
|
258
|
-
}
|
259
|
-
|
260
|
-
/// Represents a unique identifier for a core type type known to a
|
261
|
-
/// [`crate::Validator`]
|
262
|
-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
263
|
-
#[repr(C)]
|
264
|
-
pub struct CoreTypeId {
|
265
|
-
index: u32,
|
266
|
-
}
|
267
|
-
|
268
|
-
const _: () = {
|
269
|
-
assert!(std::mem::size_of::<CoreTypeId>() <= 4);
|
270
|
-
};
|
271
|
-
|
272
|
-
impl TypeIdentifier for CoreTypeId {
|
273
|
-
type Data = SubType;
|
274
|
-
|
275
|
-
fn from_index(index: u32) -> Self {
|
276
|
-
CoreTypeId { index }
|
277
|
-
}
|
278
|
-
|
279
|
-
fn list(types: &TypeList) -> &SnapshotList<Self::Data> {
|
280
|
-
&types.core_types
|
281
|
-
}
|
282
|
-
|
283
|
-
fn list_mut(types: &mut TypeList) -> &mut SnapshotList<Self::Data> {
|
284
|
-
&mut types.core_types
|
285
|
-
}
|
286
|
-
|
287
|
-
fn index(&self) -> usize {
|
288
|
-
usize::try_from(self.index).unwrap()
|
289
|
-
}
|
290
|
-
}
|
291
|
-
|
292
|
-
impl TypeData for SubType {
|
293
|
-
type Id = CoreTypeId;
|
294
|
-
|
295
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
296
|
-
// TODO(#1036): calculate actual size for func, array, struct.
|
297
|
-
let size = 1 + match &self.composite_type {
|
298
|
-
CompositeType::Func(ty) => 1 + (ty.params().len() + ty.results().len()) as u32,
|
299
|
-
CompositeType::Array(_) => 2,
|
300
|
-
CompositeType::Struct(ty) => 1 + 2 * ty.fields.len() as u32,
|
301
|
-
};
|
302
|
-
TypeInfo::core(size)
|
303
|
-
}
|
304
|
-
}
|
305
|
-
|
306
|
-
impl CoreType {
|
307
|
-
/// Get the underlying `SubType` or panic.
|
308
|
-
pub fn unwrap_sub(&self) -> &SubType {
|
309
|
-
match self {
|
310
|
-
CoreType::Sub(s) => s,
|
311
|
-
CoreType::Module(_) => panic!("`unwrap_sub` on module type"),
|
312
|
-
}
|
313
|
-
}
|
314
|
-
|
315
|
-
/// Get the underlying `FuncType` within this `SubType` or panic.
|
316
|
-
pub fn unwrap_func(&self) -> &FuncType {
|
317
|
-
match &self.unwrap_sub().composite_type {
|
318
|
-
CompositeType::Func(f) => f,
|
319
|
-
CompositeType::Array(_) | CompositeType::Struct(_) => {
|
320
|
-
panic!("`unwrap_func` on non-func composite type")
|
321
|
-
}
|
322
|
-
}
|
323
|
-
}
|
324
|
-
|
325
|
-
/// Get the underlying `ModuleType` or panic.
|
326
|
-
pub fn unwrap_module(&self) -> &ModuleType {
|
327
|
-
match self {
|
328
|
-
CoreType::Module(m) => m,
|
329
|
-
CoreType::Sub(_) => panic!("`unwrap_module` on a subtype"),
|
330
|
-
}
|
331
|
-
}
|
332
|
-
}
|
333
|
-
|
334
|
-
macro_rules! define_wrapper_id {
|
335
|
-
(
|
336
|
-
$(#[$outer_attrs:meta])*
|
337
|
-
pub enum $name:ident {
|
338
|
-
$(
|
339
|
-
#[unwrap = $unwrap:ident]
|
340
|
-
$(#[$inner_attrs:meta])*
|
341
|
-
$variant:ident ( $inner:ty ) ,
|
342
|
-
)*
|
343
|
-
}
|
344
|
-
) => {
|
345
|
-
$(#[$outer_attrs])*
|
346
|
-
pub enum $name {
|
347
|
-
$(
|
348
|
-
$(#[$inner_attrs])*
|
349
|
-
$variant ( $inner ) ,
|
350
|
-
)*
|
351
|
-
}
|
352
|
-
|
353
|
-
$(
|
354
|
-
impl From<$inner> for $name {
|
355
|
-
#[inline]
|
356
|
-
fn from(x: $inner) -> Self {
|
357
|
-
Self::$variant(x)
|
358
|
-
}
|
359
|
-
}
|
360
|
-
|
361
|
-
impl TryFrom<$name> for $inner {
|
362
|
-
type Error = ();
|
363
|
-
|
364
|
-
#[inline]
|
365
|
-
fn try_from(x: $name) -> Result<Self, Self::Error> {
|
366
|
-
match x {
|
367
|
-
$name::$variant(x) => Ok(x),
|
368
|
-
_ => Err(())
|
369
|
-
}
|
370
|
-
}
|
371
|
-
}
|
372
|
-
)*
|
373
|
-
|
374
|
-
impl $name {
|
375
|
-
$(
|
376
|
-
#[doc = "Unwrap a `"]
|
377
|
-
#[doc = stringify!($inner)]
|
378
|
-
#[doc = "` or panic."]
|
379
|
-
#[inline]
|
380
|
-
pub fn $unwrap(self) -> $inner {
|
381
|
-
<$inner>::try_from(self).unwrap()
|
382
|
-
}
|
383
|
-
)*
|
384
|
-
}
|
385
|
-
};
|
386
|
-
}
|
387
|
-
|
388
|
-
macro_rules! define_transitive_conversions {
|
389
|
-
(
|
390
|
-
$(
|
391
|
-
$outer:ty,
|
392
|
-
$middle:ty,
|
393
|
-
$inner:ty,
|
394
|
-
$unwrap:ident;
|
395
|
-
)*
|
396
|
-
) => {
|
397
|
-
$(
|
398
|
-
impl From<$inner> for $outer {
|
399
|
-
#[inline]
|
400
|
-
fn from(x: $inner) -> Self {
|
401
|
-
<$middle>::from(x).into()
|
402
|
-
}
|
403
|
-
}
|
404
|
-
|
405
|
-
impl TryFrom<$outer> for $inner {
|
406
|
-
type Error = ();
|
407
|
-
|
408
|
-
#[inline]
|
409
|
-
fn try_from(x: $outer) -> Result<Self, Self::Error> {
|
410
|
-
let middle = <$middle>::try_from(x)?;
|
411
|
-
<$inner>::try_from(middle)
|
412
|
-
}
|
413
|
-
}
|
414
|
-
|
415
|
-
impl $outer {
|
416
|
-
#[doc = "Unwrap a `"]
|
417
|
-
#[doc = stringify!($inner)]
|
418
|
-
#[doc = "` or panic."]
|
419
|
-
#[inline]
|
420
|
-
pub fn $unwrap(self) -> $inner {
|
421
|
-
<$inner>::try_from(self).unwrap()
|
422
|
-
}
|
423
|
-
}
|
424
|
-
)*
|
425
|
-
};
|
426
|
-
}
|
427
|
-
|
428
|
-
define_wrapper_id! {
|
429
|
-
/// An identifier pointing to any kind of type, component or core.
|
430
|
-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
431
|
-
pub enum AnyTypeId {
|
432
|
-
#[unwrap = unwrap_component_core_type]
|
433
|
-
/// A core type.
|
434
|
-
Core(ComponentCoreTypeId),
|
435
|
-
|
436
|
-
#[unwrap = unwrap_component_any_type]
|
437
|
-
/// A component type.
|
438
|
-
Component(ComponentAnyTypeId),
|
439
|
-
}
|
440
|
-
}
|
441
|
-
|
442
|
-
define_transitive_conversions! {
|
443
|
-
AnyTypeId, ComponentCoreTypeId, CoreTypeId, unwrap_core_type;
|
444
|
-
AnyTypeId, ComponentCoreTypeId, ComponentCoreModuleTypeId, unwrap_component_core_module_type;
|
445
|
-
AnyTypeId, ComponentAnyTypeId, AliasableResourceId, unwrap_aliasable_resource;
|
446
|
-
AnyTypeId, ComponentAnyTypeId, ComponentDefinedTypeId, unwrap_component_defined_type;
|
447
|
-
AnyTypeId, ComponentAnyTypeId, ComponentFuncTypeId, unwrap_component_func_type;
|
448
|
-
AnyTypeId, ComponentAnyTypeId, ComponentInstanceTypeId, unwrap_component_instance_type;
|
449
|
-
AnyTypeId, ComponentAnyTypeId, ComponentTypeId, unwrap_component_type;
|
450
|
-
}
|
451
|
-
|
452
|
-
impl AnyTypeId {
|
453
|
-
/// Peel off one layer of aliasing from this type and return the aliased
|
454
|
-
/// inner type, or `None` if this type is not aliasing anything.
|
455
|
-
pub fn peel_alias(&self, types: &Types) -> Option<Self> {
|
456
|
-
match *self {
|
457
|
-
Self::Core(id) => id.peel_alias(types).map(Self::Core),
|
458
|
-
Self::Component(id) => types.peel_alias(id).map(Self::Component),
|
459
|
-
}
|
460
|
-
}
|
461
|
-
}
|
462
|
-
|
463
|
-
define_wrapper_id! {
|
464
|
-
/// An identifier for a core type or a core module's type.
|
465
|
-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
466
|
-
pub enum ComponentCoreTypeId {
|
467
|
-
#[unwrap = unwrap_sub]
|
468
|
-
/// A core type.
|
469
|
-
Sub(CoreTypeId),
|
470
|
-
|
471
|
-
#[unwrap = unwrap_module]
|
472
|
-
/// A core module's type.
|
473
|
-
Module(ComponentCoreModuleTypeId),
|
474
|
-
}
|
475
|
-
}
|
476
|
-
|
477
|
-
impl ComponentCoreTypeId {
|
478
|
-
/// Peel off one layer of aliasing from this type and return the aliased
|
479
|
-
/// inner type, or `None` if this type is not aliasing anything.
|
480
|
-
pub fn peel_alias(&self, types: &Types) -> Option<Self> {
|
481
|
-
match *self {
|
482
|
-
Self::Sub(_) => None,
|
483
|
-
Self::Module(id) => types.peel_alias(id).map(Self::Module),
|
484
|
-
}
|
485
|
-
}
|
486
|
-
}
|
487
|
-
|
488
|
-
/// An aliasable resource identifier.
|
489
|
-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
490
|
-
pub struct AliasableResourceId {
|
491
|
-
id: ResourceId,
|
492
|
-
alias_id: u32,
|
493
|
-
}
|
494
|
-
|
495
|
-
impl Aliasable for AliasableResourceId {
|
496
|
-
fn alias_id(&self) -> u32 {
|
497
|
-
self.alias_id
|
498
|
-
}
|
499
|
-
|
500
|
-
fn set_alias_id(&mut self, alias_id: u32) {
|
501
|
-
self.alias_id = alias_id;
|
502
|
-
}
|
503
|
-
}
|
504
|
-
|
505
|
-
impl AliasableResourceId {
|
506
|
-
/// Get the underlying resource.
|
507
|
-
pub fn resource(&self) -> ResourceId {
|
508
|
-
self.id
|
509
|
-
}
|
510
|
-
|
511
|
-
pub(crate) fn resource_mut(&mut self) -> &mut ResourceId {
|
512
|
-
&mut self.id
|
513
|
-
}
|
514
|
-
}
|
515
|
-
|
516
|
-
define_wrapper_id! {
|
517
|
-
/// An identifier for any kind of component type.
|
518
|
-
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
|
519
|
-
pub enum ComponentAnyTypeId {
|
520
|
-
#[unwrap = unwrap_resource]
|
521
|
-
/// The type is a resource with the specified id.
|
522
|
-
Resource(AliasableResourceId),
|
523
|
-
|
524
|
-
#[unwrap = unwrap_defined]
|
525
|
-
/// The type is a defined type with the specified id.
|
526
|
-
Defined(ComponentDefinedTypeId),
|
527
|
-
|
528
|
-
#[unwrap = unwrap_func]
|
529
|
-
/// The type is a function type with the specified id.
|
530
|
-
Func(ComponentFuncTypeId),
|
531
|
-
|
532
|
-
#[unwrap = unwrap_instance]
|
533
|
-
/// The type is an instance type with the specified id.
|
534
|
-
Instance(ComponentInstanceTypeId),
|
535
|
-
|
536
|
-
#[unwrap = unwrap_component]
|
537
|
-
/// The type is a component type with the specified id.
|
538
|
-
Component(ComponentTypeId),
|
539
|
-
}
|
540
|
-
}
|
541
|
-
|
542
|
-
impl Aliasable for ComponentAnyTypeId {
|
543
|
-
fn alias_id(&self) -> u32 {
|
544
|
-
match self {
|
545
|
-
ComponentAnyTypeId::Resource(x) => x.alias_id(),
|
546
|
-
ComponentAnyTypeId::Defined(x) => x.alias_id(),
|
547
|
-
ComponentAnyTypeId::Func(x) => x.alias_id(),
|
548
|
-
ComponentAnyTypeId::Instance(x) => x.alias_id(),
|
549
|
-
ComponentAnyTypeId::Component(x) => x.alias_id(),
|
550
|
-
}
|
551
|
-
}
|
552
|
-
|
553
|
-
fn set_alias_id(&mut self, alias_id: u32) {
|
554
|
-
match self {
|
555
|
-
ComponentAnyTypeId::Resource(x) => x.set_alias_id(alias_id),
|
556
|
-
ComponentAnyTypeId::Defined(x) => x.set_alias_id(alias_id),
|
557
|
-
ComponentAnyTypeId::Func(x) => x.set_alias_id(alias_id),
|
558
|
-
ComponentAnyTypeId::Instance(x) => x.set_alias_id(alias_id),
|
559
|
-
ComponentAnyTypeId::Component(x) => x.set_alias_id(alias_id),
|
560
|
-
}
|
561
|
-
}
|
562
|
-
}
|
563
|
-
|
564
|
-
impl ComponentAnyTypeId {
|
565
|
-
pub(crate) fn info(&self, types: &TypeList) -> TypeInfo {
|
566
|
-
match *self {
|
567
|
-
Self::Resource(_) => TypeInfo::new(),
|
568
|
-
Self::Defined(id) => types[id].type_info(types),
|
569
|
-
Self::Func(id) => types[id].type_info(types),
|
570
|
-
Self::Instance(id) => types[id].type_info(types),
|
571
|
-
Self::Component(id) => types[id].type_info(types),
|
572
|
-
}
|
573
|
-
}
|
574
|
-
|
575
|
-
pub(crate) fn desc(&self) -> &'static str {
|
576
|
-
match self {
|
577
|
-
Self::Resource(_) => "resource",
|
578
|
-
Self::Defined(_) => "defined type",
|
579
|
-
Self::Func(_) => "func",
|
580
|
-
Self::Instance(_) => "instance",
|
581
|
-
Self::Component(_) => "component",
|
582
|
-
}
|
583
|
-
}
|
584
|
-
}
|
585
|
-
|
586
|
-
define_type_id!(ComponentTypeId, ComponentType, components, "component");
|
587
|
-
|
588
|
-
define_type_id!(
|
589
|
-
ComponentValueTypeId,
|
590
|
-
ComponentValType,
|
591
|
-
component_values,
|
592
|
-
"component value"
|
593
|
-
);
|
594
|
-
|
595
|
-
define_type_id!(
|
596
|
-
ComponentInstanceTypeId,
|
597
|
-
ComponentInstanceType,
|
598
|
-
component_instances,
|
599
|
-
"component instance"
|
600
|
-
);
|
601
|
-
|
602
|
-
define_type_id!(
|
603
|
-
ComponentFuncTypeId,
|
604
|
-
ComponentFuncType,
|
605
|
-
component_funcs,
|
606
|
-
"component function"
|
607
|
-
);
|
608
|
-
|
609
|
-
define_type_id!(
|
610
|
-
ComponentCoreInstanceTypeId,
|
611
|
-
InstanceType,
|
612
|
-
core_instances,
|
613
|
-
"component's core instance"
|
614
|
-
);
|
615
|
-
|
616
|
-
define_type_id!(
|
617
|
-
ComponentCoreModuleTypeId,
|
618
|
-
ModuleType,
|
619
|
-
core_modules,
|
620
|
-
"component's core module"
|
621
|
-
);
|
622
|
-
|
623
|
-
/// Represents a unique identifier for a component type type known to a
|
624
|
-
/// [`crate::Validator`].
|
625
|
-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
626
|
-
#[repr(C)]
|
627
|
-
pub struct ComponentDefinedTypeId {
|
628
|
-
index: u32,
|
629
|
-
alias_id: u32,
|
630
|
-
}
|
631
|
-
|
632
|
-
const _: () = {
|
633
|
-
assert!(std::mem::size_of::<ComponentDefinedTypeId>() <= 8);
|
634
|
-
};
|
635
|
-
|
636
|
-
impl TypeIdentifier for ComponentDefinedTypeId {
|
637
|
-
type Data = ComponentDefinedType;
|
638
|
-
|
639
|
-
fn from_index(index: u32) -> Self {
|
640
|
-
ComponentDefinedTypeId {
|
641
|
-
index,
|
642
|
-
alias_id: NO_ALIAS,
|
643
|
-
}
|
644
|
-
}
|
645
|
-
|
646
|
-
fn list(types: &TypeList) -> &SnapshotList<Self::Data> {
|
647
|
-
&types.component_defined_types
|
648
|
-
}
|
649
|
-
|
650
|
-
fn list_mut(types: &mut TypeList) -> &mut SnapshotList<Self::Data> {
|
651
|
-
&mut types.component_defined_types
|
652
|
-
}
|
653
|
-
|
654
|
-
fn index(&self) -> usize {
|
655
|
-
usize::try_from(self.index).unwrap()
|
656
|
-
}
|
657
|
-
}
|
658
|
-
|
659
|
-
impl Aliasable for ComponentDefinedTypeId {
|
660
|
-
fn alias_id(&self) -> u32 {
|
661
|
-
self.alias_id
|
662
|
-
}
|
663
|
-
|
664
|
-
fn set_alias_id(&mut self, alias_id: u32) {
|
665
|
-
self.alias_id = alias_id;
|
666
|
-
}
|
667
|
-
}
|
668
|
-
|
669
|
-
/// Metadata about a type and its transitive structure.
|
670
|
-
///
|
671
|
-
/// Currently contains two properties:
|
672
|
-
///
|
673
|
-
/// * The "size" of a type - a proxy to the recursive size of a type if
|
674
|
-
/// everything in the type were unique (e.g. no shared references). Not an
|
675
|
-
/// approximation of runtime size, but instead of type-complexity size if
|
676
|
-
/// someone were to visit each element of the type individually. For example
|
677
|
-
/// `u32` has size 1 and `(list u32)` has size 2 (roughly). Used to prevent
|
678
|
-
/// massive trees of types.
|
679
|
-
///
|
680
|
-
/// * Whether or not a type contains a "borrow" transitively inside of it. For
|
681
|
-
/// example `(borrow $t)` and `(list (borrow $t))` both contain borrows, but
|
682
|
-
/// `(list u32)` does not. Used to validate that component function results do
|
683
|
-
/// not contain borrows.
|
684
|
-
///
|
685
|
-
/// Currently this is represented as a compact 32-bit integer to ensure that
|
686
|
-
/// `TypeId`, which this is stored in, remains relatively small. The maximum
|
687
|
-
/// type size allowed in wasmparser is 1M at this time which is 20 bits of
|
688
|
-
/// information, and then one more bit is used for whether or not a borrow is
|
689
|
-
/// used. Currently this uses the low 24 bits for the type size and the MSB for
|
690
|
-
/// the borrow bit.
|
691
|
-
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
692
|
-
// Only public because it shows up in a public trait's `doc(hidden)` method.
|
693
|
-
#[doc(hidden)]
|
694
|
-
pub struct TypeInfo(u32);
|
695
|
-
|
696
|
-
impl TypeInfo {
|
697
|
-
/// Creates a new blank set of type information.
|
698
|
-
///
|
699
|
-
/// Defaults to size 1 to ensure that this consumes space in the final type
|
700
|
-
/// structure.
|
701
|
-
pub(crate) fn new() -> TypeInfo {
|
702
|
-
TypeInfo::_new(1, false)
|
703
|
-
}
|
704
|
-
|
705
|
-
/// Creates a new blank set of information about a leaf "borrow" type which
|
706
|
-
/// has size 1.
|
707
|
-
pub(crate) fn borrow() -> TypeInfo {
|
708
|
-
TypeInfo::_new(1, true)
|
709
|
-
}
|
710
|
-
|
711
|
-
/// Creates type information corresponding to a core type of the `size`
|
712
|
-
/// specified, meaning no borrows are contained within.
|
713
|
-
pub(crate) fn core(size: u32) -> TypeInfo {
|
714
|
-
TypeInfo::_new(size, false)
|
715
|
-
}
|
716
|
-
|
717
|
-
fn _new(size: u32, contains_borrow: bool) -> TypeInfo {
|
718
|
-
assert!(size < (1 << 24));
|
719
|
-
TypeInfo(size | ((contains_borrow as u32) << 31))
|
720
|
-
}
|
721
|
-
|
722
|
-
/// Combines another set of type information into this one, for example if
|
723
|
-
/// this is a record which has `other` as a field.
|
724
|
-
///
|
725
|
-
/// Updates the size of `self` and whether or not this type contains a
|
726
|
-
/// borrow based on whether `other` contains a borrow.
|
727
|
-
///
|
728
|
-
/// Returns an error if the type size would exceed this crate's static limit
|
729
|
-
/// of a type size.
|
730
|
-
pub(crate) fn combine(&mut self, other: TypeInfo, offset: usize) -> Result<()> {
|
731
|
-
*self = TypeInfo::_new(
|
732
|
-
super::combine_type_sizes(self.size(), other.size(), offset)?,
|
733
|
-
self.contains_borrow() || other.contains_borrow(),
|
734
|
-
);
|
735
|
-
Ok(())
|
736
|
-
}
|
737
|
-
|
738
|
-
pub(crate) fn size(&self) -> u32 {
|
739
|
-
self.0 & 0xffffff
|
740
|
-
}
|
741
|
-
|
742
|
-
pub(crate) fn contains_borrow(&self) -> bool {
|
743
|
-
(self.0 >> 31) != 0
|
744
|
-
}
|
745
|
-
}
|
746
|
-
|
747
|
-
/// A component value type.
|
748
|
-
#[derive(Debug, Clone, Copy)]
|
749
|
-
pub enum ComponentValType {
|
750
|
-
/// The value type is one of the primitive types.
|
751
|
-
Primitive(PrimitiveValType),
|
752
|
-
/// The type is represented with the given type identifier.
|
753
|
-
Type(ComponentDefinedTypeId),
|
754
|
-
}
|
755
|
-
|
756
|
-
impl TypeData for ComponentValType {
|
757
|
-
type Id = ComponentValueTypeId;
|
758
|
-
|
759
|
-
fn type_info(&self, types: &TypeList) -> TypeInfo {
|
760
|
-
match self {
|
761
|
-
ComponentValType::Primitive(_) => TypeInfo::new(),
|
762
|
-
ComponentValType::Type(id) => types[*id].type_info(types),
|
763
|
-
}
|
764
|
-
}
|
765
|
-
}
|
766
|
-
|
767
|
-
impl ComponentValType {
|
768
|
-
pub(crate) fn contains_ptr(&self, types: &TypeList) -> bool {
|
769
|
-
match self {
|
770
|
-
ComponentValType::Primitive(ty) => ty.contains_ptr(),
|
771
|
-
ComponentValType::Type(ty) => types[*ty].contains_ptr(types),
|
772
|
-
}
|
773
|
-
}
|
774
|
-
|
775
|
-
fn push_wasm_types(&self, types: &TypeList, lowered_types: &mut LoweredTypes) -> bool {
|
776
|
-
match self {
|
777
|
-
Self::Primitive(ty) => push_primitive_wasm_types(ty, lowered_types),
|
778
|
-
Self::Type(id) => types[*id].push_wasm_types(types, lowered_types),
|
779
|
-
}
|
780
|
-
}
|
781
|
-
|
782
|
-
pub(crate) fn info(&self, types: &TypeList) -> TypeInfo {
|
783
|
-
match self {
|
784
|
-
Self::Primitive(_) => TypeInfo::new(),
|
785
|
-
Self::Type(id) => types[*id].type_info(types),
|
786
|
-
}
|
787
|
-
}
|
788
|
-
}
|
789
|
-
|
790
|
-
/// The entity type for imports and exports of a module.
|
791
|
-
#[derive(Debug, Clone, Copy)]
|
792
|
-
pub enum EntityType {
|
793
|
-
/// The entity is a function.
|
794
|
-
Func(CoreTypeId),
|
795
|
-
/// The entity is a table.
|
796
|
-
Table(TableType),
|
797
|
-
/// The entity is a memory.
|
798
|
-
Memory(MemoryType),
|
799
|
-
/// The entity is a global.
|
800
|
-
Global(GlobalType),
|
801
|
-
/// The entity is a tag.
|
802
|
-
Tag(CoreTypeId),
|
803
|
-
}
|
804
|
-
|
805
|
-
impl EntityType {
|
806
|
-
pub(crate) fn desc(&self) -> &'static str {
|
807
|
-
match self {
|
808
|
-
Self::Func(_) => "func",
|
809
|
-
Self::Table(_) => "table",
|
810
|
-
Self::Memory(_) => "memory",
|
811
|
-
Self::Global(_) => "global",
|
812
|
-
Self::Tag(_) => "tag",
|
813
|
-
}
|
814
|
-
}
|
815
|
-
|
816
|
-
pub(crate) fn info(&self, types: &TypeList) -> TypeInfo {
|
817
|
-
match self {
|
818
|
-
Self::Func(id) | Self::Tag(id) => types[*id].type_info(types),
|
819
|
-
Self::Table(_) | Self::Memory(_) | Self::Global(_) => TypeInfo::new(),
|
820
|
-
}
|
821
|
-
}
|
822
|
-
}
|
823
|
-
|
824
|
-
trait ModuleImportKey {
|
825
|
-
fn module(&self) -> &str;
|
826
|
-
fn name(&self) -> &str;
|
827
|
-
}
|
828
|
-
|
829
|
-
impl<'a> Borrow<dyn ModuleImportKey + 'a> for (String, String) {
|
830
|
-
fn borrow(&self) -> &(dyn ModuleImportKey + 'a) {
|
831
|
-
self
|
832
|
-
}
|
833
|
-
}
|
834
|
-
|
835
|
-
impl Hash for (dyn ModuleImportKey + '_) {
|
836
|
-
fn hash<H: Hasher>(&self, state: &mut H) {
|
837
|
-
self.module().hash(state);
|
838
|
-
self.name().hash(state);
|
839
|
-
}
|
840
|
-
}
|
841
|
-
|
842
|
-
impl PartialEq for (dyn ModuleImportKey + '_) {
|
843
|
-
fn eq(&self, other: &Self) -> bool {
|
844
|
-
self.module() == other.module() && self.name() == other.name()
|
845
|
-
}
|
846
|
-
}
|
847
|
-
|
848
|
-
impl Eq for (dyn ModuleImportKey + '_) {}
|
849
|
-
|
850
|
-
impl ModuleImportKey for (String, String) {
|
851
|
-
fn module(&self) -> &str {
|
852
|
-
&self.0
|
853
|
-
}
|
854
|
-
|
855
|
-
fn name(&self) -> &str {
|
856
|
-
&self.1
|
857
|
-
}
|
858
|
-
}
|
859
|
-
|
860
|
-
impl ModuleImportKey for (&str, &str) {
|
861
|
-
fn module(&self) -> &str {
|
862
|
-
self.0
|
863
|
-
}
|
864
|
-
|
865
|
-
fn name(&self) -> &str {
|
866
|
-
self.1
|
867
|
-
}
|
868
|
-
}
|
869
|
-
|
870
|
-
/// Represents a core module type.
|
871
|
-
#[derive(Debug, Clone)]
|
872
|
-
pub struct ModuleType {
|
873
|
-
/// Metadata about this module type
|
874
|
-
pub(crate) info: TypeInfo,
|
875
|
-
/// The imports of the module type.
|
876
|
-
pub imports: IndexMap<(String, String), EntityType>,
|
877
|
-
/// The exports of the module type.
|
878
|
-
pub exports: IndexMap<String, EntityType>,
|
879
|
-
}
|
880
|
-
|
881
|
-
impl TypeData for ModuleType {
|
882
|
-
type Id = ComponentCoreModuleTypeId;
|
883
|
-
|
884
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
885
|
-
self.info
|
886
|
-
}
|
887
|
-
}
|
888
|
-
|
889
|
-
impl ModuleType {
|
890
|
-
/// Looks up an import by its module and name.
|
891
|
-
///
|
892
|
-
/// Returns `None` if the import was not found.
|
893
|
-
pub fn lookup_import(&self, module: &str, name: &str) -> Option<&EntityType> {
|
894
|
-
self.imports.get(&(module, name) as &dyn ModuleImportKey)
|
895
|
-
}
|
896
|
-
}
|
897
|
-
|
898
|
-
/// Represents the kind of module instance type.
|
899
|
-
#[derive(Debug, Clone)]
|
900
|
-
pub enum CoreInstanceTypeKind {
|
901
|
-
/// The instance type is the result of instantiating a module type.
|
902
|
-
Instantiated(ComponentCoreModuleTypeId),
|
903
|
-
|
904
|
-
/// The instance type is the result of instantiating from exported items.
|
905
|
-
Exports(IndexMap<String, EntityType>),
|
906
|
-
}
|
907
|
-
|
908
|
-
/// Represents a module instance type.
|
909
|
-
#[derive(Debug, Clone)]
|
910
|
-
pub struct InstanceType {
|
911
|
-
/// Metadata about this instance type
|
912
|
-
pub(crate) info: TypeInfo,
|
913
|
-
/// The kind of module instance type.
|
914
|
-
pub kind: CoreInstanceTypeKind,
|
915
|
-
}
|
916
|
-
|
917
|
-
impl TypeData for InstanceType {
|
918
|
-
type Id = ComponentCoreInstanceTypeId;
|
919
|
-
|
920
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
921
|
-
self.info
|
922
|
-
}
|
923
|
-
}
|
924
|
-
|
925
|
-
impl InstanceType {
|
926
|
-
/// Gets the exports of the instance type.
|
927
|
-
pub fn exports<'a>(&'a self, types: TypesRef<'a>) -> &'a IndexMap<String, EntityType> {
|
928
|
-
self.internal_exports(types.list)
|
929
|
-
}
|
930
|
-
|
931
|
-
pub(crate) fn internal_exports<'a>(
|
932
|
-
&'a self,
|
933
|
-
types: &'a TypeList,
|
934
|
-
) -> &'a IndexMap<String, EntityType> {
|
935
|
-
match &self.kind {
|
936
|
-
CoreInstanceTypeKind::Instantiated(id) => &types[*id].exports,
|
937
|
-
CoreInstanceTypeKind::Exports(exports) => exports,
|
938
|
-
}
|
939
|
-
}
|
940
|
-
}
|
941
|
-
|
942
|
-
/// The entity type for imports and exports of a component.
|
943
|
-
#[derive(Debug, Clone, Copy)]
|
944
|
-
pub enum ComponentEntityType {
|
945
|
-
/// The entity is a core module.
|
946
|
-
Module(ComponentCoreModuleTypeId),
|
947
|
-
/// The entity is a function.
|
948
|
-
Func(ComponentFuncTypeId),
|
949
|
-
/// The entity is a value.
|
950
|
-
Value(ComponentValType),
|
951
|
-
/// The entity is a type.
|
952
|
-
Type {
|
953
|
-
/// This is the identifier of the type that was referenced when this
|
954
|
-
/// entity was created.
|
955
|
-
referenced: ComponentAnyTypeId,
|
956
|
-
/// This is the identifier of the type that was created when this type
|
957
|
-
/// was imported or exported from the component.
|
958
|
-
///
|
959
|
-
/// Note that the underlying type information for the `referenced`
|
960
|
-
/// field and for this `created` field is the same, but these two types
|
961
|
-
/// will hash to different values.
|
962
|
-
created: ComponentAnyTypeId,
|
963
|
-
},
|
964
|
-
/// The entity is a component instance.
|
965
|
-
Instance(ComponentInstanceTypeId),
|
966
|
-
/// The entity is a component.
|
967
|
-
Component(ComponentTypeId),
|
968
|
-
}
|
969
|
-
|
970
|
-
impl ComponentEntityType {
|
971
|
-
/// Determines if component entity type `a` is a subtype of `b`.
|
972
|
-
pub fn is_subtype_of(a: &Self, at: TypesRef, b: &Self, bt: TypesRef) -> bool {
|
973
|
-
SubtypeCx::new(at.list, bt.list)
|
974
|
-
.component_entity_type(a, b, 0)
|
975
|
-
.is_ok()
|
976
|
-
}
|
977
|
-
|
978
|
-
pub(crate) fn desc(&self) -> &'static str {
|
979
|
-
match self {
|
980
|
-
Self::Module(_) => "module",
|
981
|
-
Self::Func(_) => "func",
|
982
|
-
Self::Value(_) => "value",
|
983
|
-
Self::Type { .. } => "type",
|
984
|
-
Self::Instance(_) => "instance",
|
985
|
-
Self::Component(_) => "component",
|
986
|
-
}
|
987
|
-
}
|
988
|
-
|
989
|
-
pub(crate) fn info(&self, types: &TypeList) -> TypeInfo {
|
990
|
-
match self {
|
991
|
-
Self::Module(ty) => types[*ty].type_info(types),
|
992
|
-
Self::Func(ty) => types[*ty].type_info(types),
|
993
|
-
Self::Type { referenced: ty, .. } => ty.info(types),
|
994
|
-
Self::Instance(ty) => types[*ty].type_info(types),
|
995
|
-
Self::Component(ty) => types[*ty].type_info(types),
|
996
|
-
Self::Value(ty) => ty.info(types),
|
997
|
-
}
|
998
|
-
}
|
999
|
-
}
|
1000
|
-
|
1001
|
-
/// Represents a type of a component.
|
1002
|
-
#[derive(Debug, Clone)]
|
1003
|
-
pub struct ComponentType {
|
1004
|
-
/// Metadata about this component type
|
1005
|
-
pub(crate) info: TypeInfo,
|
1006
|
-
|
1007
|
-
/// The imports of the component type.
|
1008
|
-
///
|
1009
|
-
/// Each import has its own kebab-name and an optional URL listed. Note that
|
1010
|
-
/// the set of import names is disjoint with the set of export names.
|
1011
|
-
pub imports: IndexMap<String, ComponentEntityType>,
|
1012
|
-
|
1013
|
-
/// The exports of the component type.
|
1014
|
-
///
|
1015
|
-
/// Each export has its own kebab-name and an optional URL listed. Note that
|
1016
|
-
/// the set of export names is disjoint with the set of import names.
|
1017
|
-
pub exports: IndexMap<String, ComponentEntityType>,
|
1018
|
-
|
1019
|
-
/// Universally quantified resources required to be provided when
|
1020
|
-
/// instantiating this component type.
|
1021
|
-
///
|
1022
|
-
/// Each resource in this map is explicitly imported somewhere in the
|
1023
|
-
/// `imports` map. The "path" to where it's imported is specified by the
|
1024
|
-
/// `Vec<usize>` payload here. For more information about the indexes see
|
1025
|
-
/// the documentation on `ComponentState::imported_resources`.
|
1026
|
-
///
|
1027
|
-
/// This should technically be inferrable from the structure of `imports`,
|
1028
|
-
/// but it's stored as an auxiliary set for subtype checking and
|
1029
|
-
/// instantiation.
|
1030
|
-
///
|
1031
|
-
/// Note that this is not a set of all resources referred to by the
|
1032
|
-
/// `imports`. Instead it's only those created, relative to the internals of
|
1033
|
-
/// this component, by the imports.
|
1034
|
-
pub imported_resources: Vec<(ResourceId, Vec<usize>)>,
|
1035
|
-
|
1036
|
-
/// The dual of the `imported_resources`, or the set of defined
|
1037
|
-
/// resources -- those created through the instantiation process which are
|
1038
|
-
/// unique to this component.
|
1039
|
-
///
|
1040
|
-
/// This set is similar to the `imported_resources` set but it's those
|
1041
|
-
/// contained within the `exports`. Instantiating this component will
|
1042
|
-
/// create fresh new versions of all of these resources. The path here is
|
1043
|
-
/// within the `exports` array.
|
1044
|
-
pub defined_resources: Vec<(ResourceId, Vec<usize>)>,
|
1045
|
-
|
1046
|
-
/// The set of all resources which are explicitly exported by this
|
1047
|
-
/// component, and where they're exported.
|
1048
|
-
///
|
1049
|
-
/// This mapping is stored separately from `defined_resources` to ensure
|
1050
|
-
/// that it contains all exported resources, not just those which are
|
1051
|
-
/// defined. That means that this can cover reexports of imported
|
1052
|
-
/// resources, exports of local resources, or exports of closed-over
|
1053
|
-
/// resources for example.
|
1054
|
-
pub explicit_resources: IndexMap<ResourceId, Vec<usize>>,
|
1055
|
-
}
|
1056
|
-
|
1057
|
-
impl TypeData for ComponentType {
|
1058
|
-
type Id = ComponentTypeId;
|
1059
|
-
|
1060
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
1061
|
-
self.info
|
1062
|
-
}
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
/// Represents a type of a component instance.
|
1066
|
-
#[derive(Debug, Clone)]
|
1067
|
-
pub struct ComponentInstanceType {
|
1068
|
-
/// Metadata about this instance type
|
1069
|
-
pub(crate) info: TypeInfo,
|
1070
|
-
|
1071
|
-
/// The list of exports, keyed by name, that this instance has.
|
1072
|
-
///
|
1073
|
-
/// An optional URL and type of each export is provided as well.
|
1074
|
-
pub exports: IndexMap<String, ComponentEntityType>,
|
1075
|
-
|
1076
|
-
/// The list of "defined resources" or those which are closed over in
|
1077
|
-
/// this instance type.
|
1078
|
-
///
|
1079
|
-
/// This list is populated, for example, when the type of an instance is
|
1080
|
-
/// declared and it contains its own resource type exports defined
|
1081
|
-
/// internally. For example:
|
1082
|
-
///
|
1083
|
-
/// ```wasm
|
1084
|
-
/// (component
|
1085
|
-
/// (type (instance
|
1086
|
-
/// (export "x" (type sub resource)) ;; one `defined_resources` entry
|
1087
|
-
/// ))
|
1088
|
-
/// )
|
1089
|
-
/// ```
|
1090
|
-
///
|
1091
|
-
/// This list is also a bit of an oddity, however, because the type of a
|
1092
|
-
/// concrete instance will always have this as empty. For example:
|
1093
|
-
///
|
1094
|
-
/// ```wasm
|
1095
|
-
/// (component
|
1096
|
-
/// (type $t (instance (export "x" (type sub resource))))
|
1097
|
-
///
|
1098
|
-
/// ;; the type of this instance has no defined resources
|
1099
|
-
/// (import "i" (instance (type $t)))
|
1100
|
-
/// )
|
1101
|
-
/// ```
|
1102
|
-
///
|
1103
|
-
/// This list ends up only being populated for instance types declared in a
|
1104
|
-
/// module which aren't yet "attached" to anything. Once something is
|
1105
|
-
/// instantiated, imported, exported, or otherwise refers to a concrete
|
1106
|
-
/// instance then this list is always empty. For concrete instances
|
1107
|
-
/// defined resources are tracked in the component state or component type.
|
1108
|
-
pub defined_resources: Vec<ResourceId>,
|
1109
|
-
|
1110
|
-
/// The list of all resources that are explicitly exported from this
|
1111
|
-
/// instance type along with the path they're exported at.
|
1112
|
-
pub explicit_resources: IndexMap<ResourceId, Vec<usize>>,
|
1113
|
-
}
|
1114
|
-
|
1115
|
-
impl TypeData for ComponentInstanceType {
|
1116
|
-
type Id = ComponentInstanceTypeId;
|
1117
|
-
|
1118
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
1119
|
-
self.info
|
1120
|
-
}
|
1121
|
-
}
|
1122
|
-
|
1123
|
-
/// Represents a type of a component function.
|
1124
|
-
#[derive(Debug, Clone)]
|
1125
|
-
pub struct ComponentFuncType {
|
1126
|
-
/// Metadata about this function type.
|
1127
|
-
pub(crate) info: TypeInfo,
|
1128
|
-
/// The function parameters.
|
1129
|
-
pub params: Box<[(KebabString, ComponentValType)]>,
|
1130
|
-
/// The function's results.
|
1131
|
-
pub results: Box<[(Option<KebabString>, ComponentValType)]>,
|
1132
|
-
}
|
1133
|
-
|
1134
|
-
impl TypeData for ComponentFuncType {
|
1135
|
-
type Id = ComponentFuncTypeId;
|
1136
|
-
|
1137
|
-
fn type_info(&self, _types: &TypeList) -> TypeInfo {
|
1138
|
-
self.info
|
1139
|
-
}
|
1140
|
-
}
|
1141
|
-
|
1142
|
-
impl ComponentFuncType {
|
1143
|
-
/// Lowers the component function type to core parameter and result types for the
|
1144
|
-
/// canonical ABI.
|
1145
|
-
pub(crate) fn lower(&self, types: &TypeList, is_lower: bool) -> LoweringInfo {
|
1146
|
-
let mut info = LoweringInfo::default();
|
1147
|
-
|
1148
|
-
for (_, ty) in self.params.iter() {
|
1149
|
-
// Check to see if `ty` has a pointer somewhere in it, needed for
|
1150
|
-
// any type that transitively contains either a string or a list.
|
1151
|
-
// In this situation lowered functions must specify `memory`, and
|
1152
|
-
// lifted functions must specify `realloc` as well. Lifted functions
|
1153
|
-
// gain their memory requirement through the final clause of this
|
1154
|
-
// function.
|
1155
|
-
if is_lower {
|
1156
|
-
if !info.requires_memory {
|
1157
|
-
info.requires_memory = ty.contains_ptr(types);
|
1158
|
-
}
|
1159
|
-
} else {
|
1160
|
-
if !info.requires_realloc {
|
1161
|
-
info.requires_realloc = ty.contains_ptr(types);
|
1162
|
-
}
|
1163
|
-
}
|
1164
|
-
|
1165
|
-
if !ty.push_wasm_types(types, &mut info.params) {
|
1166
|
-
// Too many parameters to pass directly
|
1167
|
-
// Function will have a single pointer parameter to pass the arguments
|
1168
|
-
// via linear memory
|
1169
|
-
info.params.clear();
|
1170
|
-
assert!(info.params.push(ValType::I32));
|
1171
|
-
info.requires_memory = true;
|
1172
|
-
|
1173
|
-
// We need realloc as well when lifting a function
|
1174
|
-
if !is_lower {
|
1175
|
-
info.requires_realloc = true;
|
1176
|
-
}
|
1177
|
-
break;
|
1178
|
-
}
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
for (_, ty) in self.results.iter() {
|
1182
|
-
// Results of lowered functions that contains pointers must be
|
1183
|
-
// allocated by the callee meaning that realloc is required.
|
1184
|
-
// Results of lifted function are allocated by the guest which
|
1185
|
-
// means that no realloc option is necessary.
|
1186
|
-
if is_lower && !info.requires_realloc {
|
1187
|
-
info.requires_realloc = ty.contains_ptr(types);
|
1188
|
-
}
|
1189
|
-
|
1190
|
-
if !ty.push_wasm_types(types, &mut info.results) {
|
1191
|
-
// Too many results to return directly, either a retptr parameter will be used (import)
|
1192
|
-
// or a single pointer will be returned (export)
|
1193
|
-
info.results.clear();
|
1194
|
-
if is_lower {
|
1195
|
-
info.params.max = MAX_LOWERED_TYPES;
|
1196
|
-
assert!(info.params.push(ValType::I32));
|
1197
|
-
} else {
|
1198
|
-
assert!(info.results.push(ValType::I32));
|
1199
|
-
}
|
1200
|
-
info.requires_memory = true;
|
1201
|
-
break;
|
1202
|
-
}
|
1203
|
-
}
|
1204
|
-
|
1205
|
-
// Memory is always required when realloc is required
|
1206
|
-
info.requires_memory |= info.requires_realloc;
|
1207
|
-
|
1208
|
-
info
|
1209
|
-
}
|
1210
|
-
}
|
1211
|
-
|
1212
|
-
/// Represents a variant case.
|
1213
|
-
#[derive(Debug, Clone)]
|
1214
|
-
pub struct VariantCase {
|
1215
|
-
/// The variant case type.
|
1216
|
-
pub ty: Option<ComponentValType>,
|
1217
|
-
/// The name of the variant case refined by this one.
|
1218
|
-
pub refines: Option<KebabString>,
|
1219
|
-
}
|
1220
|
-
|
1221
|
-
/// Represents a record type.
|
1222
|
-
#[derive(Debug, Clone)]
|
1223
|
-
pub struct RecordType {
|
1224
|
-
/// Metadata about this record type.
|
1225
|
-
pub(crate) info: TypeInfo,
|
1226
|
-
/// The map of record fields.
|
1227
|
-
pub fields: IndexMap<KebabString, ComponentValType>,
|
1228
|
-
}
|
1229
|
-
|
1230
|
-
/// Represents a variant type.
|
1231
|
-
#[derive(Debug, Clone)]
|
1232
|
-
pub struct VariantType {
|
1233
|
-
/// Metadata about this variant type.
|
1234
|
-
pub(crate) info: TypeInfo,
|
1235
|
-
/// The map of variant cases.
|
1236
|
-
pub cases: IndexMap<KebabString, VariantCase>,
|
1237
|
-
}
|
1238
|
-
|
1239
|
-
/// Represents a tuple type.
|
1240
|
-
#[derive(Debug, Clone)]
|
1241
|
-
pub struct TupleType {
|
1242
|
-
/// Metadata about this tuple type.
|
1243
|
-
pub(crate) info: TypeInfo,
|
1244
|
-
/// The types of the tuple.
|
1245
|
-
pub types: Box<[ComponentValType]>,
|
1246
|
-
}
|
1247
|
-
|
1248
|
-
/// Represents a component defined type.
|
1249
|
-
#[derive(Debug, Clone)]
|
1250
|
-
pub enum ComponentDefinedType {
|
1251
|
-
/// The type is a primitive value type.
|
1252
|
-
Primitive(PrimitiveValType),
|
1253
|
-
/// The type is a record.
|
1254
|
-
Record(RecordType),
|
1255
|
-
/// The type is a variant.
|
1256
|
-
Variant(VariantType),
|
1257
|
-
/// The type is a list.
|
1258
|
-
List(ComponentValType),
|
1259
|
-
/// The type is a tuple.
|
1260
|
-
Tuple(TupleType),
|
1261
|
-
/// The type is a set of flags.
|
1262
|
-
Flags(IndexSet<KebabString>),
|
1263
|
-
/// The type is an enumeration.
|
1264
|
-
Enum(IndexSet<KebabString>),
|
1265
|
-
/// The type is an `option`.
|
1266
|
-
Option(ComponentValType),
|
1267
|
-
/// The type is a `result`.
|
1268
|
-
Result {
|
1269
|
-
/// The `ok` type.
|
1270
|
-
ok: Option<ComponentValType>,
|
1271
|
-
/// The `error` type.
|
1272
|
-
err: Option<ComponentValType>,
|
1273
|
-
},
|
1274
|
-
/// The type is an owned handle to the specified resource.
|
1275
|
-
Own(AliasableResourceId),
|
1276
|
-
/// The type is a borrowed handle to the specified resource.
|
1277
|
-
Borrow(AliasableResourceId),
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
impl TypeData for ComponentDefinedType {
|
1281
|
-
type Id = ComponentDefinedTypeId;
|
1282
|
-
|
1283
|
-
fn type_info(&self, types: &TypeList) -> TypeInfo {
|
1284
|
-
match self {
|
1285
|
-
Self::Primitive(_) | Self::Flags(_) | Self::Enum(_) | Self::Own(_) => TypeInfo::new(),
|
1286
|
-
Self::Borrow(_) => TypeInfo::borrow(),
|
1287
|
-
Self::Record(r) => r.info,
|
1288
|
-
Self::Variant(v) => v.info,
|
1289
|
-
Self::Tuple(t) => t.info,
|
1290
|
-
Self::List(ty) | Self::Option(ty) => ty.info(types),
|
1291
|
-
Self::Result { ok, err } => {
|
1292
|
-
let default = TypeInfo::new();
|
1293
|
-
let mut info = ok.map(|ty| ty.type_info(types)).unwrap_or(default);
|
1294
|
-
info.combine(err.map(|ty| ty.type_info(types)).unwrap_or(default), 0)
|
1295
|
-
.unwrap();
|
1296
|
-
info
|
1297
|
-
}
|
1298
|
-
}
|
1299
|
-
}
|
1300
|
-
}
|
1301
|
-
|
1302
|
-
impl ComponentDefinedType {
|
1303
|
-
pub(crate) fn contains_ptr(&self, types: &TypeList) -> bool {
|
1304
|
-
match self {
|
1305
|
-
Self::Primitive(ty) => ty.contains_ptr(),
|
1306
|
-
Self::Record(r) => r.fields.values().any(|ty| ty.contains_ptr(types)),
|
1307
|
-
Self::Variant(v) => v
|
1308
|
-
.cases
|
1309
|
-
.values()
|
1310
|
-
.any(|case| case.ty.map(|ty| ty.contains_ptr(types)).unwrap_or(false)),
|
1311
|
-
Self::List(_) => true,
|
1312
|
-
Self::Tuple(t) => t.types.iter().any(|ty| ty.contains_ptr(types)),
|
1313
|
-
Self::Flags(_) | Self::Enum(_) | Self::Own(_) | Self::Borrow(_) => false,
|
1314
|
-
Self::Option(ty) => ty.contains_ptr(types),
|
1315
|
-
Self::Result { ok, err } => {
|
1316
|
-
ok.map(|ty| ty.contains_ptr(types)).unwrap_or(false)
|
1317
|
-
|| err.map(|ty| ty.contains_ptr(types)).unwrap_or(false)
|
1318
|
-
}
|
1319
|
-
}
|
1320
|
-
}
|
1321
|
-
|
1322
|
-
fn push_wasm_types(&self, types: &TypeList, lowered_types: &mut LoweredTypes) -> bool {
|
1323
|
-
match self {
|
1324
|
-
Self::Primitive(ty) => push_primitive_wasm_types(ty, lowered_types),
|
1325
|
-
Self::Record(r) => r
|
1326
|
-
.fields
|
1327
|
-
.iter()
|
1328
|
-
.all(|(_, ty)| ty.push_wasm_types(types, lowered_types)),
|
1329
|
-
Self::Variant(v) => Self::push_variant_wasm_types(
|
1330
|
-
v.cases.iter().filter_map(|(_, case)| case.ty.as_ref()),
|
1331
|
-
types,
|
1332
|
-
lowered_types,
|
1333
|
-
),
|
1334
|
-
Self::List(_) => lowered_types.push(ValType::I32) && lowered_types.push(ValType::I32),
|
1335
|
-
Self::Tuple(t) => t
|
1336
|
-
.types
|
1337
|
-
.iter()
|
1338
|
-
.all(|ty| ty.push_wasm_types(types, lowered_types)),
|
1339
|
-
Self::Flags(names) => {
|
1340
|
-
(0..(names.len() + 31) / 32).all(|_| lowered_types.push(ValType::I32))
|
1341
|
-
}
|
1342
|
-
Self::Enum(_) | Self::Own(_) | Self::Borrow(_) => lowered_types.push(ValType::I32),
|
1343
|
-
Self::Option(ty) => {
|
1344
|
-
Self::push_variant_wasm_types([ty].into_iter(), types, lowered_types)
|
1345
|
-
}
|
1346
|
-
Self::Result { ok, err } => {
|
1347
|
-
Self::push_variant_wasm_types(ok.iter().chain(err.iter()), types, lowered_types)
|
1348
|
-
}
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
|
1352
|
-
fn push_variant_wasm_types<'a>(
|
1353
|
-
cases: impl Iterator<Item = &'a ComponentValType>,
|
1354
|
-
types: &TypeList,
|
1355
|
-
lowered_types: &mut LoweredTypes,
|
1356
|
-
) -> bool {
|
1357
|
-
// Push the discriminant
|
1358
|
-
if !lowered_types.push(ValType::I32) {
|
1359
|
-
return false;
|
1360
|
-
}
|
1361
|
-
|
1362
|
-
let start = lowered_types.len();
|
1363
|
-
|
1364
|
-
for ty in cases {
|
1365
|
-
let mut temp = LoweredTypes::new(lowered_types.max);
|
1366
|
-
|
1367
|
-
if !ty.push_wasm_types(types, &mut temp) {
|
1368
|
-
return false;
|
1369
|
-
}
|
1370
|
-
|
1371
|
-
for (i, ty) in temp.iter().enumerate() {
|
1372
|
-
match lowered_types.get_mut(start + i) {
|
1373
|
-
Some(prev) => *prev = Self::join_types(*prev, ty),
|
1374
|
-
None => {
|
1375
|
-
if !lowered_types.push(ty) {
|
1376
|
-
return false;
|
1377
|
-
}
|
1378
|
-
}
|
1379
|
-
}
|
1380
|
-
}
|
1381
|
-
}
|
1382
|
-
|
1383
|
-
true
|
1384
|
-
}
|
1385
|
-
|
1386
|
-
fn join_types(a: ValType, b: ValType) -> ValType {
|
1387
|
-
use ValType::*;
|
1388
|
-
|
1389
|
-
match (a, b) {
|
1390
|
-
(I32, I32) | (I64, I64) | (F32, F32) | (F64, F64) => a,
|
1391
|
-
(I32, F32) | (F32, I32) => I32,
|
1392
|
-
(_, I64 | F64) | (I64 | F64, _) => I64,
|
1393
|
-
_ => panic!("unexpected wasm type for canonical ABI"),
|
1394
|
-
}
|
1395
|
-
}
|
1396
|
-
|
1397
|
-
fn desc(&self) -> &'static str {
|
1398
|
-
match self {
|
1399
|
-
ComponentDefinedType::Record(_) => "record",
|
1400
|
-
ComponentDefinedType::Primitive(_) => "primitive",
|
1401
|
-
ComponentDefinedType::Variant(_) => "variant",
|
1402
|
-
ComponentDefinedType::Tuple(_) => "tuple",
|
1403
|
-
ComponentDefinedType::Enum(_) => "enum",
|
1404
|
-
ComponentDefinedType::Flags(_) => "flags",
|
1405
|
-
ComponentDefinedType::Option(_) => "option",
|
1406
|
-
ComponentDefinedType::List(_) => "list",
|
1407
|
-
ComponentDefinedType::Result { .. } => "result",
|
1408
|
-
ComponentDefinedType::Own(_) => "own",
|
1409
|
-
ComponentDefinedType::Borrow(_) => "borrow",
|
1410
|
-
}
|
1411
|
-
}
|
1412
|
-
}
|
1413
|
-
|
1414
|
-
/// An opaque identifier intended to be used to distinguish whether two
|
1415
|
-
/// resource types are equivalent or not.
|
1416
|
-
#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Copy)]
|
1417
|
-
#[repr(packed(4))] // try to not waste 4 bytes in padding
|
1418
|
-
pub struct ResourceId {
|
1419
|
-
// This is a globally unique identifier which is assigned once per
|
1420
|
-
// `TypeAlloc`. This ensures that resource identifiers from different
|
1421
|
-
// instances of `Types`, for example, are considered unique.
|
1422
|
-
//
|
1423
|
-
// Technically 64-bits should be enough for all resource ids ever, but
|
1424
|
-
// they're allocated so often it's predicted that an atomic increment
|
1425
|
-
// per resource id is probably too expensive. To amortize that cost each
|
1426
|
-
// top-level wasm component gets a single globally unique identifier, and
|
1427
|
-
// then within a component contextually unique identifiers are handed out.
|
1428
|
-
globally_unique_id: u64,
|
1429
|
-
|
1430
|
-
// A contextually unique id within the globally unique id above. This is
|
1431
|
-
// allocated within a `TypeAlloc` with its own counter, and allocations of
|
1432
|
-
// this are cheap as nothing atomic is required.
|
1433
|
-
//
|
1434
|
-
// The 32-bit storage here should ideally be enough for any component
|
1435
|
-
// containing resources. If memory usage becomes an issue (this struct is
|
1436
|
-
// 12 bytes instead of 8 or 4) then this coudl get folded into the globally
|
1437
|
-
// unique id with everything using an atomic increment perhaps.
|
1438
|
-
contextually_unique_id: u32,
|
1439
|
-
}
|
1440
|
-
|
1441
|
-
#[allow(clippy::large_enum_variant)]
|
1442
|
-
enum TypesKind {
|
1443
|
-
Module(Arc<Module>),
|
1444
|
-
Component(ComponentState),
|
1445
|
-
}
|
1446
|
-
|
1447
|
-
/// Represents the types known to a [`crate::Validator`] once validation has completed.
|
1448
|
-
///
|
1449
|
-
/// The type information is returned via the [`crate::Validator::end`] method.
|
1450
|
-
pub struct Types {
|
1451
|
-
list: TypeList,
|
1452
|
-
kind: TypesKind,
|
1453
|
-
}
|
1454
|
-
|
1455
|
-
#[derive(Clone, Copy)]
|
1456
|
-
enum TypesRefKind<'a> {
|
1457
|
-
Module(&'a Module),
|
1458
|
-
Component(&'a ComponentState),
|
1459
|
-
}
|
1460
|
-
|
1461
|
-
/// Represents the types known to a [`crate::Validator`] during validation.
|
1462
|
-
///
|
1463
|
-
/// Retrieved via the [`crate::Validator::types`] method.
|
1464
|
-
#[derive(Clone, Copy)]
|
1465
|
-
pub struct TypesRef<'a> {
|
1466
|
-
list: &'a TypeList,
|
1467
|
-
kind: TypesRefKind<'a>,
|
1468
|
-
}
|
1469
|
-
|
1470
|
-
impl<'a> TypesRef<'a> {
|
1471
|
-
pub(crate) fn from_module(types: &'a TypeList, module: &'a Module) -> Self {
|
1472
|
-
Self {
|
1473
|
-
list: types,
|
1474
|
-
kind: TypesRefKind::Module(module),
|
1475
|
-
}
|
1476
|
-
}
|
1477
|
-
|
1478
|
-
pub(crate) fn from_component(types: &'a TypeList, component: &'a ComponentState) -> Self {
|
1479
|
-
Self {
|
1480
|
-
list: types,
|
1481
|
-
kind: TypesRefKind::Component(component),
|
1482
|
-
}
|
1483
|
-
}
|
1484
|
-
|
1485
|
-
/// Gets a type based on its type id.
|
1486
|
-
///
|
1487
|
-
/// Returns `None` if the type id is unknown.
|
1488
|
-
pub fn get<T>(&self, id: T) -> Option<&'a T::Data>
|
1489
|
-
where
|
1490
|
-
T: TypeIdentifier,
|
1491
|
-
{
|
1492
|
-
self.list.get(id)
|
1493
|
-
}
|
1494
|
-
|
1495
|
-
/// Gets a core WebAssembly type id from a type index.
|
1496
|
-
///
|
1497
|
-
/// Note that this is in contrast to [`TypesRef::component_type_at`] which
|
1498
|
-
/// gets a component type from its index.
|
1499
|
-
///
|
1500
|
-
/// # Panics
|
1501
|
-
///
|
1502
|
-
/// This will panic if the `index` provided is out of bounds.
|
1503
|
-
pub fn core_type_at(&self, index: u32) -> ComponentCoreTypeId {
|
1504
|
-
match &self.kind {
|
1505
|
-
TypesRefKind::Module(module) => ComponentCoreTypeId::Sub(module.types[index as usize]),
|
1506
|
-
TypesRefKind::Component(component) => component.core_types[index as usize],
|
1507
|
-
}
|
1508
|
-
}
|
1509
|
-
|
1510
|
-
/// Gets a type id from a type index.
|
1511
|
-
///
|
1512
|
-
/// # Panics
|
1513
|
-
///
|
1514
|
-
/// Panics if `index` is not a valid type index or if this type information
|
1515
|
-
/// represents a core module.
|
1516
|
-
pub fn component_any_type_at(&self, index: u32) -> ComponentAnyTypeId {
|
1517
|
-
match &self.kind {
|
1518
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1519
|
-
TypesRefKind::Component(component) => component.types[index as usize],
|
1520
|
-
}
|
1521
|
-
}
|
1522
|
-
|
1523
|
-
/// Gets a component type id from a type index.
|
1524
|
-
///
|
1525
|
-
/// # Panics
|
1526
|
-
///
|
1527
|
-
/// Panics if `index` is not a valid component type index or if this type
|
1528
|
-
/// information represents a core module.
|
1529
|
-
pub fn component_type_at(&self, index: u32) -> ComponentTypeId {
|
1530
|
-
match self.component_any_type_at(index) {
|
1531
|
-
ComponentAnyTypeId::Component(id) => id,
|
1532
|
-
_ => panic!("not a component type"),
|
1533
|
-
}
|
1534
|
-
}
|
1535
|
-
|
1536
|
-
/// Gets a type id from a type index.
|
1537
|
-
///
|
1538
|
-
/// # Panics
|
1539
|
-
///
|
1540
|
-
/// Panics if `index` is not a valid function index or if this type
|
1541
|
-
/// information represents a core module.
|
1542
|
-
pub fn component_defined_type_at(&self, index: u32) -> ComponentDefinedTypeId {
|
1543
|
-
match self.component_any_type_at(index) {
|
1544
|
-
ComponentAnyTypeId::Defined(id) => id,
|
1545
|
-
_ => panic!("not a defined type"),
|
1546
|
-
}
|
1547
|
-
}
|
1548
|
-
|
1549
|
-
/// Returns the number of core types defined so far.
|
1550
|
-
pub fn core_type_count(&self) -> u32 {
|
1551
|
-
match &self.kind {
|
1552
|
-
TypesRefKind::Module(module) => module.types.len() as u32,
|
1553
|
-
TypesRefKind::Component(component) => component.core_types.len() as u32,
|
1554
|
-
}
|
1555
|
-
}
|
1556
|
-
|
1557
|
-
/// Returns the number of component types defined so far.
|
1558
|
-
pub fn component_type_count(&self) -> u32 {
|
1559
|
-
match &self.kind {
|
1560
|
-
TypesRefKind::Module(_module) => 0,
|
1561
|
-
TypesRefKind::Component(component) => component.types.len() as u32,
|
1562
|
-
}
|
1563
|
-
}
|
1564
|
-
|
1565
|
-
/// Gets the type of a table at the given table index.
|
1566
|
-
///
|
1567
|
-
/// # Panics
|
1568
|
-
///
|
1569
|
-
/// This will panic if the `index` provided is out of bounds.
|
1570
|
-
pub fn table_at(&self, index: u32) -> TableType {
|
1571
|
-
let tables = match &self.kind {
|
1572
|
-
TypesRefKind::Module(module) => &module.tables,
|
1573
|
-
TypesRefKind::Component(component) => &component.core_tables,
|
1574
|
-
};
|
1575
|
-
tables[index as usize]
|
1576
|
-
}
|
1577
|
-
|
1578
|
-
/// Returns the number of tables defined so far.
|
1579
|
-
pub fn table_count(&self) -> u32 {
|
1580
|
-
match &self.kind {
|
1581
|
-
TypesRefKind::Module(module) => module.tables.len() as u32,
|
1582
|
-
TypesRefKind::Component(component) => component.core_tables.len() as u32,
|
1583
|
-
}
|
1584
|
-
}
|
1585
|
-
|
1586
|
-
/// Gets the type of a memory at the given memory index.
|
1587
|
-
///
|
1588
|
-
/// # Panics
|
1589
|
-
///
|
1590
|
-
/// This will panic if the `index` provided is out of bounds.
|
1591
|
-
pub fn memory_at(&self, index: u32) -> MemoryType {
|
1592
|
-
let memories = match &self.kind {
|
1593
|
-
TypesRefKind::Module(module) => &module.memories,
|
1594
|
-
TypesRefKind::Component(component) => &component.core_memories,
|
1595
|
-
};
|
1596
|
-
|
1597
|
-
memories[index as usize]
|
1598
|
-
}
|
1599
|
-
|
1600
|
-
/// Returns the number of memories defined so far.
|
1601
|
-
pub fn memory_count(&self) -> u32 {
|
1602
|
-
match &self.kind {
|
1603
|
-
TypesRefKind::Module(module) => module.memories.len() as u32,
|
1604
|
-
TypesRefKind::Component(component) => component.core_memories.len() as u32,
|
1605
|
-
}
|
1606
|
-
}
|
1607
|
-
|
1608
|
-
/// Gets the type of a global at the given global index.
|
1609
|
-
///
|
1610
|
-
/// # Panics
|
1611
|
-
///
|
1612
|
-
/// This will panic if the `index` provided is out of bounds.
|
1613
|
-
pub fn global_at(&self, index: u32) -> GlobalType {
|
1614
|
-
let globals = match &self.kind {
|
1615
|
-
TypesRefKind::Module(module) => &module.globals,
|
1616
|
-
TypesRefKind::Component(component) => &component.core_globals,
|
1617
|
-
};
|
1618
|
-
|
1619
|
-
globals[index as usize]
|
1620
|
-
}
|
1621
|
-
|
1622
|
-
/// Returns the number of globals defined so far.
|
1623
|
-
pub fn global_count(&self) -> u32 {
|
1624
|
-
match &self.kind {
|
1625
|
-
TypesRefKind::Module(module) => module.globals.len() as u32,
|
1626
|
-
TypesRefKind::Component(component) => component.core_globals.len() as u32,
|
1627
|
-
}
|
1628
|
-
}
|
1629
|
-
|
1630
|
-
/// Gets the type of a tag at the given tag index.
|
1631
|
-
///
|
1632
|
-
/// # Panics
|
1633
|
-
///
|
1634
|
-
/// This will panic if the `index` provided is out of bounds.
|
1635
|
-
pub fn tag_at(&self, index: u32) -> CoreTypeId {
|
1636
|
-
let tags = match &self.kind {
|
1637
|
-
TypesRefKind::Module(module) => &module.tags,
|
1638
|
-
TypesRefKind::Component(component) => &component.core_tags,
|
1639
|
-
};
|
1640
|
-
tags[index as usize]
|
1641
|
-
}
|
1642
|
-
|
1643
|
-
/// Returns the number of tags defined so far.
|
1644
|
-
pub fn tag_count(&self) -> u32 {
|
1645
|
-
match &self.kind {
|
1646
|
-
TypesRefKind::Module(module) => module.tags.len() as u32,
|
1647
|
-
TypesRefKind::Component(component) => component.core_tags.len() as u32,
|
1648
|
-
}
|
1649
|
-
}
|
1650
|
-
|
1651
|
-
/// Gets the type of a core function at the given function index.
|
1652
|
-
///
|
1653
|
-
/// # Panics
|
1654
|
-
///
|
1655
|
-
/// This will panic if the `index` provided is out of bounds.
|
1656
|
-
pub fn core_function_at(&self, index: u32) -> CoreTypeId {
|
1657
|
-
match &self.kind {
|
1658
|
-
TypesRefKind::Module(module) => module.types[module.functions[index as usize] as usize],
|
1659
|
-
TypesRefKind::Component(component) => component.core_funcs[index as usize],
|
1660
|
-
}
|
1661
|
-
}
|
1662
|
-
|
1663
|
-
/// Gets the count of core functions defined so far.
|
1664
|
-
///
|
1665
|
-
/// Note that this includes imported functions, defined functions, and for
|
1666
|
-
/// components lowered/aliased functions.
|
1667
|
-
pub fn function_count(&self) -> u32 {
|
1668
|
-
match &self.kind {
|
1669
|
-
TypesRefKind::Module(module) => module.functions.len() as u32,
|
1670
|
-
TypesRefKind::Component(component) => component.core_funcs.len() as u32,
|
1671
|
-
}
|
1672
|
-
}
|
1673
|
-
|
1674
|
-
/// Gets the type of an element segment at the given element segment index.
|
1675
|
-
///
|
1676
|
-
/// # Panics
|
1677
|
-
///
|
1678
|
-
/// This will panic if the `index` provided is out of bounds.
|
1679
|
-
pub fn element_at(&self, index: u32) -> RefType {
|
1680
|
-
match &self.kind {
|
1681
|
-
TypesRefKind::Module(module) => module.element_types[index as usize],
|
1682
|
-
TypesRefKind::Component(_) => {
|
1683
|
-
panic!("no elements on a component")
|
1684
|
-
}
|
1685
|
-
}
|
1686
|
-
}
|
1687
|
-
|
1688
|
-
/// Returns the number of elements defined so far.
|
1689
|
-
pub fn element_count(&self) -> u32 {
|
1690
|
-
match &self.kind {
|
1691
|
-
TypesRefKind::Module(module) => module.element_types.len() as u32,
|
1692
|
-
TypesRefKind::Component(_) => 0,
|
1693
|
-
}
|
1694
|
-
}
|
1695
|
-
|
1696
|
-
/// Gets the type of a component function at the given function index.
|
1697
|
-
///
|
1698
|
-
/// # Panics
|
1699
|
-
///
|
1700
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1701
|
-
/// information represents a core module.
|
1702
|
-
pub fn component_function_at(&self, index: u32) -> ComponentFuncTypeId {
|
1703
|
-
match &self.kind {
|
1704
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1705
|
-
TypesRefKind::Component(component) => component.funcs[index as usize],
|
1706
|
-
}
|
1707
|
-
}
|
1708
|
-
|
1709
|
-
/// Returns the number of component functions defined so far.
|
1710
|
-
pub fn component_function_count(&self) -> u32 {
|
1711
|
-
match &self.kind {
|
1712
|
-
TypesRefKind::Module(_module) => 0,
|
1713
|
-
TypesRefKind::Component(component) => component.funcs.len() as u32,
|
1714
|
-
}
|
1715
|
-
}
|
1716
|
-
|
1717
|
-
/// Gets the type of a module at the given module index.
|
1718
|
-
///
|
1719
|
-
/// # Panics
|
1720
|
-
///
|
1721
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1722
|
-
/// information represents a core module.
|
1723
|
-
pub fn module_at(&self, index: u32) -> ComponentCoreModuleTypeId {
|
1724
|
-
match &self.kind {
|
1725
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1726
|
-
TypesRefKind::Component(component) => component.core_modules[index as usize],
|
1727
|
-
}
|
1728
|
-
}
|
1729
|
-
|
1730
|
-
/// Returns the number of core wasm modules defined so far.
|
1731
|
-
pub fn module_count(&self) -> u32 {
|
1732
|
-
match &self.kind {
|
1733
|
-
TypesRefKind::Module(_module) => 0,
|
1734
|
-
TypesRefKind::Component(component) => component.core_modules.len() as u32,
|
1735
|
-
}
|
1736
|
-
}
|
1737
|
-
|
1738
|
-
/// Gets the type of a module instance at the given module instance index.
|
1739
|
-
///
|
1740
|
-
/// # Panics
|
1741
|
-
///
|
1742
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1743
|
-
/// information represents a core module.
|
1744
|
-
pub fn core_instance_at(&self, index: u32) -> ComponentCoreInstanceTypeId {
|
1745
|
-
match &self.kind {
|
1746
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1747
|
-
TypesRefKind::Component(component) => component.core_instances[index as usize],
|
1748
|
-
}
|
1749
|
-
}
|
1750
|
-
|
1751
|
-
/// Returns the number of core wasm instances defined so far.
|
1752
|
-
pub fn core_instance_count(&self) -> u32 {
|
1753
|
-
match &self.kind {
|
1754
|
-
TypesRefKind::Module(_module) => 0,
|
1755
|
-
TypesRefKind::Component(component) => component.core_instances.len() as u32,
|
1756
|
-
}
|
1757
|
-
}
|
1758
|
-
|
1759
|
-
/// Gets the type of a component at the given component index.
|
1760
|
-
///
|
1761
|
-
/// # Panics
|
1762
|
-
///
|
1763
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1764
|
-
/// information represents a core module.
|
1765
|
-
pub fn component_at(&self, index: u32) -> ComponentTypeId {
|
1766
|
-
match &self.kind {
|
1767
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1768
|
-
TypesRefKind::Component(component) => component.components[index as usize],
|
1769
|
-
}
|
1770
|
-
}
|
1771
|
-
|
1772
|
-
/// Returns the number of components defined so far.
|
1773
|
-
pub fn component_count(&self) -> u32 {
|
1774
|
-
match &self.kind {
|
1775
|
-
TypesRefKind::Module(_module) => 0,
|
1776
|
-
TypesRefKind::Component(component) => component.components.len() as u32,
|
1777
|
-
}
|
1778
|
-
}
|
1779
|
-
|
1780
|
-
/// Gets the type of an component instance at the given component instance index.
|
1781
|
-
///
|
1782
|
-
/// # Panics
|
1783
|
-
///
|
1784
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1785
|
-
/// information represents a core module.
|
1786
|
-
pub fn component_instance_at(&self, index: u32) -> ComponentInstanceTypeId {
|
1787
|
-
match &self.kind {
|
1788
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1789
|
-
TypesRefKind::Component(component) => component.instances[index as usize],
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
|
1793
|
-
/// Returns the number of component instances defined so far.
|
1794
|
-
pub fn component_instance_count(&self) -> u32 {
|
1795
|
-
match &self.kind {
|
1796
|
-
TypesRefKind::Module(_module) => 0,
|
1797
|
-
TypesRefKind::Component(component) => component.instances.len() as u32,
|
1798
|
-
}
|
1799
|
-
}
|
1800
|
-
|
1801
|
-
/// Gets the type of a value at the given value index.
|
1802
|
-
///
|
1803
|
-
/// # Panics
|
1804
|
-
///
|
1805
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
1806
|
-
/// information represents a core module.
|
1807
|
-
pub fn value_at(&self, index: u32) -> ComponentValType {
|
1808
|
-
match &self.kind {
|
1809
|
-
TypesRefKind::Module(_) => panic!("not a component"),
|
1810
|
-
TypesRefKind::Component(component) => component.values[index as usize].0,
|
1811
|
-
}
|
1812
|
-
}
|
1813
|
-
|
1814
|
-
/// Gets the entity type for the given import.
|
1815
|
-
pub fn entity_type_from_import(&self, import: &Import) -> Option<EntityType> {
|
1816
|
-
match &self.kind {
|
1817
|
-
TypesRefKind::Module(module) => Some(match import.ty {
|
1818
|
-
TypeRef::Func(idx) => EntityType::Func(*module.types.get(idx as usize)?),
|
1819
|
-
TypeRef::Table(ty) => EntityType::Table(ty),
|
1820
|
-
TypeRef::Memory(ty) => EntityType::Memory(ty),
|
1821
|
-
TypeRef::Global(ty) => EntityType::Global(ty),
|
1822
|
-
TypeRef::Tag(ty) => EntityType::Tag(*module.types.get(ty.func_type_idx as usize)?),
|
1823
|
-
}),
|
1824
|
-
TypesRefKind::Component(_) => None,
|
1825
|
-
}
|
1826
|
-
}
|
1827
|
-
|
1828
|
-
/// Gets the entity type from the given export.
|
1829
|
-
pub fn entity_type_from_export(&self, export: &Export) -> Option<EntityType> {
|
1830
|
-
match &self.kind {
|
1831
|
-
TypesRefKind::Module(module) => Some(match export.kind {
|
1832
|
-
ExternalKind::Func => EntityType::Func(
|
1833
|
-
module.types[*module.functions.get(export.index as usize)? as usize],
|
1834
|
-
),
|
1835
|
-
ExternalKind::Table => {
|
1836
|
-
EntityType::Table(*module.tables.get(export.index as usize)?)
|
1837
|
-
}
|
1838
|
-
ExternalKind::Memory => {
|
1839
|
-
EntityType::Memory(*module.memories.get(export.index as usize)?)
|
1840
|
-
}
|
1841
|
-
ExternalKind::Global => {
|
1842
|
-
EntityType::Global(*module.globals.get(export.index as usize)?)
|
1843
|
-
}
|
1844
|
-
ExternalKind::Tag => EntityType::Tag(
|
1845
|
-
module.types[*module.functions.get(export.index as usize)? as usize],
|
1846
|
-
),
|
1847
|
-
}),
|
1848
|
-
TypesRefKind::Component(_) => None,
|
1849
|
-
}
|
1850
|
-
}
|
1851
|
-
|
1852
|
-
/// Gets the component entity type for the given component import.
|
1853
|
-
pub fn component_entity_type_of_import(&self, name: &str) -> Option<ComponentEntityType> {
|
1854
|
-
match &self.kind {
|
1855
|
-
TypesRefKind::Module(_) => None,
|
1856
|
-
TypesRefKind::Component(component) => Some(*component.imports.get(name)?),
|
1857
|
-
}
|
1858
|
-
}
|
1859
|
-
|
1860
|
-
/// Gets the component entity type for the given component export.
|
1861
|
-
pub fn component_entity_type_of_export(&self, name: &str) -> Option<ComponentEntityType> {
|
1862
|
-
match &self.kind {
|
1863
|
-
TypesRefKind::Module(_) => None,
|
1864
|
-
TypesRefKind::Component(component) => Some(*component.exports.get(name)?),
|
1865
|
-
}
|
1866
|
-
}
|
1867
|
-
|
1868
|
-
/// Attempts to lookup the type id that `ty` is an alias of.
|
1869
|
-
///
|
1870
|
-
/// Returns `None` if `ty` wasn't listed as aliasing a prior type.
|
1871
|
-
pub fn peel_alias<T>(&self, ty: T) -> Option<T>
|
1872
|
-
where
|
1873
|
-
T: Aliasable,
|
1874
|
-
{
|
1875
|
-
self.list.peel_alias(ty)
|
1876
|
-
}
|
1877
|
-
}
|
1878
|
-
|
1879
|
-
impl<T> Index<T> for TypesRef<'_>
|
1880
|
-
where
|
1881
|
-
T: TypeIdentifier,
|
1882
|
-
{
|
1883
|
-
type Output = T::Data;
|
1884
|
-
|
1885
|
-
fn index(&self, index: T) -> &Self::Output {
|
1886
|
-
&self.list[index]
|
1887
|
-
}
|
1888
|
-
}
|
1889
|
-
|
1890
|
-
impl Types {
|
1891
|
-
pub(crate) fn from_module(types: TypeList, module: Arc<Module>) -> Self {
|
1892
|
-
Self {
|
1893
|
-
list: types,
|
1894
|
-
kind: TypesKind::Module(module),
|
1895
|
-
}
|
1896
|
-
}
|
1897
|
-
|
1898
|
-
pub(crate) fn from_component(types: TypeList, component: ComponentState) -> Self {
|
1899
|
-
Self {
|
1900
|
-
list: types,
|
1901
|
-
kind: TypesKind::Component(component),
|
1902
|
-
}
|
1903
|
-
}
|
1904
|
-
|
1905
|
-
/// Gets a reference to this validation type information.
|
1906
|
-
pub fn as_ref(&self) -> TypesRef {
|
1907
|
-
TypesRef {
|
1908
|
-
list: &self.list,
|
1909
|
-
kind: match &self.kind {
|
1910
|
-
TypesKind::Module(module) => TypesRefKind::Module(module),
|
1911
|
-
TypesKind::Component(component) => TypesRefKind::Component(component),
|
1912
|
-
},
|
1913
|
-
}
|
1914
|
-
}
|
1915
|
-
|
1916
|
-
/// Gets a type based on its type id.
|
1917
|
-
///
|
1918
|
-
/// Returns `None` if the type id is unknown.
|
1919
|
-
pub fn get<T>(&self, id: T) -> Option<&T::Data>
|
1920
|
-
where
|
1921
|
-
T: TypeIdentifier,
|
1922
|
-
{
|
1923
|
-
self.as_ref().get(id)
|
1924
|
-
}
|
1925
|
-
|
1926
|
-
/// Gets a core WebAssembly type at the given type index.
|
1927
|
-
///
|
1928
|
-
/// Note that this is in contrast to [`TypesRef::component_type_at`] which
|
1929
|
-
/// gets a component type from its index.
|
1930
|
-
///
|
1931
|
-
/// # Panics
|
1932
|
-
///
|
1933
|
-
/// Panics if `index` is not a valid function index.
|
1934
|
-
pub fn core_type_at(&self, index: u32) -> ComponentCoreTypeId {
|
1935
|
-
self.as_ref().core_type_at(index)
|
1936
|
-
}
|
1937
|
-
|
1938
|
-
/// Gets a component WebAssembly type at the given type index.
|
1939
|
-
///
|
1940
|
-
/// Note that this is in contrast to [`TypesRef::core_type_at`] which gets a
|
1941
|
-
/// core type from its index.
|
1942
|
-
///
|
1943
|
-
/// # Panics
|
1944
|
-
///
|
1945
|
-
/// Panics if `index` is not a valid type index.
|
1946
|
-
pub fn component_any_type_at(&self, index: u32) -> ComponentAnyTypeId {
|
1947
|
-
self.as_ref().component_any_type_at(index)
|
1948
|
-
}
|
1949
|
-
|
1950
|
-
/// Gets a component type at the given type index.
|
1951
|
-
///
|
1952
|
-
/// # Panics
|
1953
|
-
///
|
1954
|
-
/// Panics if `index` is not a valid component type index.
|
1955
|
-
pub fn component_type_at(&self, index: u32) -> ComponentTypeId {
|
1956
|
-
self.as_ref().component_type_at(index)
|
1957
|
-
}
|
1958
|
-
|
1959
|
-
/// Gets a component type from the given component type index.
|
1960
|
-
///
|
1961
|
-
/// # Panics
|
1962
|
-
///
|
1963
|
-
/// Panics if `index` is not a valid defined type index or if this type
|
1964
|
-
/// information represents a core module.
|
1965
|
-
pub fn component_defined_type_at(&self, index: u32) -> ComponentDefinedTypeId {
|
1966
|
-
self.as_ref().component_defined_type_at(index)
|
1967
|
-
}
|
1968
|
-
|
1969
|
-
/// Gets the count of core types.
|
1970
|
-
pub fn type_count(&self) -> usize {
|
1971
|
-
match &self.kind {
|
1972
|
-
TypesKind::Module(module) => module.types.len(),
|
1973
|
-
TypesKind::Component(component) => component.core_types.len(),
|
1974
|
-
}
|
1975
|
-
}
|
1976
|
-
|
1977
|
-
/// Gets the type of a table at the given table index.
|
1978
|
-
///
|
1979
|
-
/// # Panics
|
1980
|
-
///
|
1981
|
-
/// Panics if `index` is not a valid function index.
|
1982
|
-
pub fn table_at(&self, index: u32) -> TableType {
|
1983
|
-
self.as_ref().table_at(index)
|
1984
|
-
}
|
1985
|
-
|
1986
|
-
/// Gets the count of imported and defined tables.
|
1987
|
-
pub fn table_count(&self) -> usize {
|
1988
|
-
match &self.kind {
|
1989
|
-
TypesKind::Module(module) => module.tables.len(),
|
1990
|
-
TypesKind::Component(component) => component.core_tables.len(),
|
1991
|
-
}
|
1992
|
-
}
|
1993
|
-
|
1994
|
-
/// Gets the type of a memory at the given memory index.
|
1995
|
-
///
|
1996
|
-
/// # Panics
|
1997
|
-
///
|
1998
|
-
/// Panics if `index` is not a valid function index.
|
1999
|
-
pub fn memory_at(&self, index: u32) -> MemoryType {
|
2000
|
-
self.as_ref().memory_at(index)
|
2001
|
-
}
|
2002
|
-
|
2003
|
-
/// Gets the count of imported and defined memories.
|
2004
|
-
pub fn memory_count(&self) -> u32 {
|
2005
|
-
self.as_ref().memory_count()
|
2006
|
-
}
|
2007
|
-
|
2008
|
-
/// Gets the type of a global at the given global index.
|
2009
|
-
///
|
2010
|
-
/// # Panics
|
2011
|
-
///
|
2012
|
-
/// Panics if `index` is not a valid function index.
|
2013
|
-
pub fn global_at(&self, index: u32) -> GlobalType {
|
2014
|
-
self.as_ref().global_at(index)
|
2015
|
-
}
|
2016
|
-
|
2017
|
-
/// Gets the count of imported and defined globals.
|
2018
|
-
pub fn global_count(&self) -> u32 {
|
2019
|
-
self.as_ref().global_count()
|
2020
|
-
}
|
2021
|
-
|
2022
|
-
/// Gets the type of a tag at the given tag index.
|
2023
|
-
///
|
2024
|
-
/// # Panics
|
2025
|
-
///
|
2026
|
-
/// Panics if `index` is not a valid function index.
|
2027
|
-
pub fn tag_at(&self, index: u32) -> CoreTypeId {
|
2028
|
-
self.as_ref().tag_at(index)
|
2029
|
-
}
|
2030
|
-
|
2031
|
-
/// Gets the count of imported and defined tags.
|
2032
|
-
pub fn tag_count(&self) -> u32 {
|
2033
|
-
self.as_ref().tag_count()
|
2034
|
-
}
|
2035
|
-
|
2036
|
-
/// Gets the type of a core function at the given function index.
|
2037
|
-
///
|
2038
|
-
/// # Panics
|
2039
|
-
///
|
2040
|
-
/// Panics if `index` is not a valid function index.
|
2041
|
-
pub fn core_function_at(&self, index: u32) -> CoreTypeId {
|
2042
|
-
self.as_ref().core_function_at(index)
|
2043
|
-
}
|
2044
|
-
|
2045
|
-
/// Gets the count of core functions defined so far.
|
2046
|
-
///
|
2047
|
-
/// Note that this includes imported functions, defined functions, and for
|
2048
|
-
/// components lowered/aliased functions.
|
2049
|
-
pub fn core_function_count(&self) -> u32 {
|
2050
|
-
self.as_ref().function_count()
|
2051
|
-
}
|
2052
|
-
|
2053
|
-
/// Gets the type of an element segment at the given element segment index.
|
2054
|
-
///
|
2055
|
-
/// # Panics
|
2056
|
-
///
|
2057
|
-
/// This will panic if the `index` provided is out of bounds.
|
2058
|
-
pub fn element_at(&self, index: u32) -> RefType {
|
2059
|
-
self.as_ref().element_at(index)
|
2060
|
-
}
|
2061
|
-
|
2062
|
-
/// Gets the count of element segments.
|
2063
|
-
pub fn element_count(&self) -> u32 {
|
2064
|
-
self.as_ref().element_count()
|
2065
|
-
}
|
2066
|
-
|
2067
|
-
/// Gets the type of a component function at the given function index.
|
2068
|
-
///
|
2069
|
-
/// # Panics
|
2070
|
-
///
|
2071
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2072
|
-
/// information represents a core module.
|
2073
|
-
pub fn component_function_at(&self, index: u32) -> ComponentFuncTypeId {
|
2074
|
-
self.as_ref().component_function_at(index)
|
2075
|
-
}
|
2076
|
-
|
2077
|
-
/// Gets the count of imported, exported, or aliased component functions.
|
2078
|
-
pub fn component_function_count(&self) -> u32 {
|
2079
|
-
self.as_ref().component_function_count()
|
2080
|
-
}
|
2081
|
-
|
2082
|
-
/// Gets the type of a module at the given module index.
|
2083
|
-
///
|
2084
|
-
/// # Panics
|
2085
|
-
///
|
2086
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2087
|
-
/// information represents a core module.
|
2088
|
-
pub fn module_at(&self, index: u32) -> ComponentCoreModuleTypeId {
|
2089
|
-
self.as_ref().module_at(index)
|
2090
|
-
}
|
2091
|
-
|
2092
|
-
/// Gets the count of imported, exported, or aliased modules.
|
2093
|
-
pub fn module_count(&self) -> usize {
|
2094
|
-
match &self.kind {
|
2095
|
-
TypesKind::Module(_) => 0,
|
2096
|
-
TypesKind::Component(component) => component.core_modules.len(),
|
2097
|
-
}
|
2098
|
-
}
|
2099
|
-
|
2100
|
-
/// Gets the type of a module instance at the given module instance index.
|
2101
|
-
///
|
2102
|
-
/// # Panics
|
2103
|
-
///
|
2104
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2105
|
-
/// information represents a core module.
|
2106
|
-
pub fn core_instance_at(&self, index: u32) -> ComponentCoreInstanceTypeId {
|
2107
|
-
self.as_ref().core_instance_at(index)
|
2108
|
-
}
|
2109
|
-
|
2110
|
-
/// Gets the count of imported, exported, or aliased core module instances.
|
2111
|
-
pub fn core_instance_count(&self) -> usize {
|
2112
|
-
match &self.kind {
|
2113
|
-
TypesKind::Module(_) => 0,
|
2114
|
-
TypesKind::Component(component) => component.core_instances.len(),
|
2115
|
-
}
|
2116
|
-
}
|
2117
|
-
|
2118
|
-
/// Gets the type of a component at the given component index.
|
2119
|
-
///
|
2120
|
-
/// # Panics
|
2121
|
-
///
|
2122
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2123
|
-
/// information represents a core module.
|
2124
|
-
pub fn component_at(&self, index: u32) -> ComponentTypeId {
|
2125
|
-
self.as_ref().component_at(index)
|
2126
|
-
}
|
2127
|
-
|
2128
|
-
/// Gets the count of imported, exported, or aliased components.
|
2129
|
-
pub fn component_count(&self) -> usize {
|
2130
|
-
match &self.kind {
|
2131
|
-
TypesKind::Module(_) => 0,
|
2132
|
-
TypesKind::Component(component) => component.components.len(),
|
2133
|
-
}
|
2134
|
-
}
|
2135
|
-
|
2136
|
-
/// Gets the type of an component instance at the given component instance index.
|
2137
|
-
///
|
2138
|
-
/// # Panics
|
2139
|
-
///
|
2140
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2141
|
-
/// information represents a core module.
|
2142
|
-
pub fn component_instance_at(&self, index: u32) -> ComponentInstanceTypeId {
|
2143
|
-
self.as_ref().component_instance_at(index)
|
2144
|
-
}
|
2145
|
-
|
2146
|
-
/// Gets the count of imported, exported, or aliased component instances.
|
2147
|
-
pub fn component_instance_count(&self) -> usize {
|
2148
|
-
match &self.kind {
|
2149
|
-
TypesKind::Module(_) => 0,
|
2150
|
-
TypesKind::Component(component) => component.instances.len(),
|
2151
|
-
}
|
2152
|
-
}
|
2153
|
-
|
2154
|
-
/// Gets the type of a value at the given value index.
|
2155
|
-
///
|
2156
|
-
/// # Panics
|
2157
|
-
///
|
2158
|
-
/// This will panic if the `index` provided is out of bounds or if this type
|
2159
|
-
/// information represents a core module.
|
2160
|
-
pub fn value_at(&self, index: u32) -> ComponentValType {
|
2161
|
-
self.as_ref().value_at(index)
|
2162
|
-
}
|
2163
|
-
|
2164
|
-
/// Gets the count of imported, exported, or aliased values.
|
2165
|
-
pub fn value_count(&self) -> usize {
|
2166
|
-
match &self.kind {
|
2167
|
-
TypesKind::Module(_) => 0,
|
2168
|
-
TypesKind::Component(component) => component.values.len(),
|
2169
|
-
}
|
2170
|
-
}
|
2171
|
-
|
2172
|
-
/// Gets the entity type from the given import.
|
2173
|
-
pub fn entity_type_from_import(&self, import: &Import) -> Option<EntityType> {
|
2174
|
-
self.as_ref().entity_type_from_import(import)
|
2175
|
-
}
|
2176
|
-
|
2177
|
-
/// Gets the entity type from the given export.
|
2178
|
-
pub fn entity_type_from_export(&self, export: &Export) -> Option<EntityType> {
|
2179
|
-
self.as_ref().entity_type_from_export(export)
|
2180
|
-
}
|
2181
|
-
|
2182
|
-
/// Gets the component entity type for the given component import name.
|
2183
|
-
pub fn component_entity_type_of_import(&self, name: &str) -> Option<ComponentEntityType> {
|
2184
|
-
self.as_ref().component_entity_type_of_import(name)
|
2185
|
-
}
|
2186
|
-
|
2187
|
-
/// Gets the component entity type for the given component export name.
|
2188
|
-
pub fn component_entity_type_of_export(&self, name: &str) -> Option<ComponentEntityType> {
|
2189
|
-
self.as_ref().component_entity_type_of_export(name)
|
2190
|
-
}
|
2191
|
-
|
2192
|
-
/// Attempts to lookup the type id that `ty` is an alias of.
|
2193
|
-
///
|
2194
|
-
/// Returns `None` if `ty` wasn't listed as aliasing a prior type.
|
2195
|
-
pub fn peel_alias<T>(&self, ty: T) -> Option<T>
|
2196
|
-
where
|
2197
|
-
T: Aliasable,
|
2198
|
-
{
|
2199
|
-
self.list.peel_alias(ty)
|
2200
|
-
}
|
2201
|
-
}
|
2202
|
-
|
2203
|
-
impl<T> Index<T> for Types
|
2204
|
-
where
|
2205
|
-
T: TypeIdentifier,
|
2206
|
-
{
|
2207
|
-
type Output = T::Data;
|
2208
|
-
|
2209
|
-
fn index(&self, id: T) -> &Self::Output {
|
2210
|
-
&self.list[id]
|
2211
|
-
}
|
2212
|
-
}
|
2213
|
-
|
2214
|
-
/// This is a type which mirrors a subset of the `Vec<T>` API, but is intended
|
2215
|
-
/// to be able to be cheaply snapshotted and cloned.
|
2216
|
-
///
|
2217
|
-
/// When each module's code sections start we "commit" the current list of types
|
2218
|
-
/// in the global list of types. This means that the temporary `cur` vec here is
|
2219
|
-
/// pushed onto `snapshots` and wrapped up in an `Arc`. At that point we clone
|
2220
|
-
/// this entire list (which is then O(modules), not O(types in all modules)) and
|
2221
|
-
/// pass out as a context to each function validator.
|
2222
|
-
///
|
2223
|
-
/// Otherwise, though, this type behaves as if it were a large `Vec<T>`, but
|
2224
|
-
/// it's represented by lists of contiguous chunks.
|
2225
|
-
//
|
2226
|
-
// Only public because it shows up in a public trait's `doc(hidden)` method.
|
2227
|
-
#[doc(hidden)]
|
2228
|
-
pub struct SnapshotList<T> {
|
2229
|
-
// All previous snapshots, the "head" of the list that this type represents.
|
2230
|
-
// The first entry in this pair is the starting index for all elements
|
2231
|
-
// contained in the list, and the second element is the list itself. Note
|
2232
|
-
// the `Arc` wrapper around sub-lists, which makes cloning time for this
|
2233
|
-
// `SnapshotList` O(snapshots) rather than O(snapshots_total), which for
|
2234
|
-
// us in this context means the number of modules, not types.
|
2235
|
-
//
|
2236
|
-
// Note that this list is sorted least-to-greatest in order of the index for
|
2237
|
-
// binary searching.
|
2238
|
-
snapshots: Vec<Arc<Snapshot<T>>>,
|
2239
|
-
|
2240
|
-
// This is the total length of all lists in the `snapshots` array.
|
2241
|
-
snapshots_total: usize,
|
2242
|
-
|
2243
|
-
// The current list of types for the current snapshot that are being built.
|
2244
|
-
cur: Vec<T>,
|
2245
|
-
}
|
2246
|
-
|
2247
|
-
struct Snapshot<T> {
|
2248
|
-
prior_types: usize,
|
2249
|
-
items: Vec<T>,
|
2250
|
-
}
|
2251
|
-
|
2252
|
-
impl<T> SnapshotList<T> {
|
2253
|
-
/// Same as `<&[T]>::get`
|
2254
|
-
pub(crate) fn get(&self, index: usize) -> Option<&T> {
|
2255
|
-
// Check to see if this index falls on our local list
|
2256
|
-
if index >= self.snapshots_total {
|
2257
|
-
return self.cur.get(index - self.snapshots_total);
|
2258
|
-
}
|
2259
|
-
// ... and failing that we do a binary search to figure out which bucket
|
2260
|
-
// it's in. Note the `i-1` in the `Err` case because if we don't find an
|
2261
|
-
// exact match the type is located in the previous bucket.
|
2262
|
-
let i = match self
|
2263
|
-
.snapshots
|
2264
|
-
.binary_search_by_key(&index, |snapshot| snapshot.prior_types)
|
2265
|
-
{
|
2266
|
-
Ok(i) => i,
|
2267
|
-
Err(i) => i - 1,
|
2268
|
-
};
|
2269
|
-
let snapshot = &self.snapshots[i];
|
2270
|
-
Some(&snapshot.items[index - snapshot.prior_types])
|
2271
|
-
}
|
2272
|
-
|
2273
|
-
/// Same as `Vec::push`
|
2274
|
-
pub(crate) fn push(&mut self, val: T) {
|
2275
|
-
self.cur.push(val);
|
2276
|
-
}
|
2277
|
-
|
2278
|
-
/// Same as `<[T]>::len`
|
2279
|
-
pub(crate) fn len(&self) -> usize {
|
2280
|
-
self.cur.len() + self.snapshots_total
|
2281
|
-
}
|
2282
|
-
|
2283
|
-
/// Same as `Vec::truncate` but can only truncate uncommitted elements.
|
2284
|
-
pub(crate) fn truncate(&mut self, len: usize) {
|
2285
|
-
assert!(len >= self.snapshots_total);
|
2286
|
-
self.cur.truncate(len - self.snapshots_total);
|
2287
|
-
}
|
2288
|
-
|
2289
|
-
/// Commits previously pushed types into this snapshot vector, and returns a
|
2290
|
-
/// clone of this list.
|
2291
|
-
///
|
2292
|
-
/// The returned `SnapshotList` can be used to access all the same types as
|
2293
|
-
/// this list itself. This list also is not changed (from an external
|
2294
|
-
/// perspective) and can continue to access all the same types.
|
2295
|
-
pub(crate) fn commit(&mut self) -> SnapshotList<T> {
|
2296
|
-
// If the current chunk has new elements, commit them in to an
|
2297
|
-
// `Arc`-wrapped vector in the snapshots list. Note the `shrink_to_fit`
|
2298
|
-
// ahead of time to hopefully keep memory usage lower than it would
|
2299
|
-
// otherwise be.
|
2300
|
-
let len = self.cur.len();
|
2301
|
-
if len > 0 {
|
2302
|
-
self.cur.shrink_to_fit();
|
2303
|
-
self.snapshots.push(Arc::new(Snapshot {
|
2304
|
-
prior_types: self.snapshots_total,
|
2305
|
-
items: mem::take(&mut self.cur),
|
2306
|
-
}));
|
2307
|
-
self.snapshots_total += len;
|
2308
|
-
}
|
2309
|
-
SnapshotList {
|
2310
|
-
snapshots: self.snapshots.clone(),
|
2311
|
-
snapshots_total: self.snapshots_total,
|
2312
|
-
cur: Vec::new(),
|
2313
|
-
}
|
2314
|
-
}
|
2315
|
-
}
|
2316
|
-
|
2317
|
-
impl<T> Index<usize> for SnapshotList<T> {
|
2318
|
-
type Output = T;
|
2319
|
-
|
2320
|
-
#[inline]
|
2321
|
-
fn index(&self, index: usize) -> &T {
|
2322
|
-
self.get(index).unwrap()
|
2323
|
-
}
|
2324
|
-
}
|
2325
|
-
|
2326
|
-
impl<T, U> Index<U> for SnapshotList<T>
|
2327
|
-
where
|
2328
|
-
U: TypeIdentifier<Data = T>,
|
2329
|
-
{
|
2330
|
-
type Output = T;
|
2331
|
-
|
2332
|
-
#[inline]
|
2333
|
-
fn index(&self, id: U) -> &T {
|
2334
|
-
self.get(id.index()).unwrap()
|
2335
|
-
}
|
2336
|
-
}
|
2337
|
-
|
2338
|
-
impl<T> Default for SnapshotList<T> {
|
2339
|
-
fn default() -> SnapshotList<T> {
|
2340
|
-
SnapshotList {
|
2341
|
-
snapshots: Vec::new(),
|
2342
|
-
snapshots_total: 0,
|
2343
|
-
cur: Vec::new(),
|
2344
|
-
}
|
2345
|
-
}
|
2346
|
-
}
|
2347
|
-
|
2348
|
-
/// A snapshot list of types.
|
2349
|
-
///
|
2350
|
-
/// Note that the snapshot lists below do not correspond with index spaces. Many
|
2351
|
-
/// different kinds of types are in the same index space (e.g. all of the
|
2352
|
-
/// component model's {component, instance, defined, func} types are in the same
|
2353
|
-
/// index space). However, we store each of them in their own type-specific
|
2354
|
-
/// snapshot list and give each of them their own identifier type.
|
2355
|
-
#[derive(Default)]
|
2356
|
-
// Only public because it shows up in a public trait's `doc(hidden)` method.
|
2357
|
-
#[doc(hidden)]
|
2358
|
-
pub struct TypeList {
|
2359
|
-
// Keeps track of which `alias_id` is an alias of which other `alias_id`.
|
2360
|
-
alias_mappings: HashMap<u32, u32>,
|
2361
|
-
// Counter for generating new `alias_id`s.
|
2362
|
-
alias_counter: u32,
|
2363
|
-
// Snapshots of previously committed `TypeList`s' aliases.
|
2364
|
-
alias_snapshots: Vec<TypeListAliasSnapshot>,
|
2365
|
-
|
2366
|
-
// Core Wasm types.
|
2367
|
-
core_types: SnapshotList<SubType>,
|
2368
|
-
|
2369
|
-
// Component model types.
|
2370
|
-
components: SnapshotList<ComponentType>,
|
2371
|
-
component_defined_types: SnapshotList<ComponentDefinedType>,
|
2372
|
-
component_values: SnapshotList<ComponentValType>,
|
2373
|
-
component_instances: SnapshotList<ComponentInstanceType>,
|
2374
|
-
component_funcs: SnapshotList<ComponentFuncType>,
|
2375
|
-
core_modules: SnapshotList<ModuleType>,
|
2376
|
-
core_instances: SnapshotList<InstanceType>,
|
2377
|
-
}
|
2378
|
-
|
2379
|
-
#[derive(Clone, Debug)]
|
2380
|
-
struct TypeListAliasSnapshot {
|
2381
|
-
// The `alias_counter` at the time that this snapshot was taken.
|
2382
|
-
alias_counter: u32,
|
2383
|
-
|
2384
|
-
// The alias mappings in this snapshot.
|
2385
|
-
alias_mappings: HashMap<u32, u32>,
|
2386
|
-
}
|
2387
|
-
|
2388
|
-
struct TypeListCheckpoint {
|
2389
|
-
core_types: usize,
|
2390
|
-
components: usize,
|
2391
|
-
component_defined_types: usize,
|
2392
|
-
component_values: usize,
|
2393
|
-
component_instances: usize,
|
2394
|
-
component_funcs: usize,
|
2395
|
-
core_modules: usize,
|
2396
|
-
core_instances: usize,
|
2397
|
-
}
|
2398
|
-
|
2399
|
-
impl TypeList {
|
2400
|
-
pub fn get<T>(&self, id: T) -> Option<&T::Data>
|
2401
|
-
where
|
2402
|
-
T: TypeIdentifier,
|
2403
|
-
{
|
2404
|
-
T::list(self).get(id.index())
|
2405
|
-
}
|
2406
|
-
|
2407
|
-
pub fn push<T>(&mut self, ty: T) -> T::Id
|
2408
|
-
where
|
2409
|
-
T: TypeData,
|
2410
|
-
{
|
2411
|
-
let index = u32::try_from(T::Id::list(self).len()).unwrap();
|
2412
|
-
let id = T::Id::from_index(index);
|
2413
|
-
T::Id::list_mut(self).push(ty);
|
2414
|
-
id
|
2415
|
-
}
|
2416
|
-
|
2417
|
-
fn checkpoint(&self) -> TypeListCheckpoint {
|
2418
|
-
let TypeList {
|
2419
|
-
alias_mappings: _,
|
2420
|
-
alias_counter: _,
|
2421
|
-
alias_snapshots: _,
|
2422
|
-
core_types,
|
2423
|
-
components,
|
2424
|
-
component_defined_types,
|
2425
|
-
component_values,
|
2426
|
-
component_instances,
|
2427
|
-
component_funcs,
|
2428
|
-
core_modules,
|
2429
|
-
core_instances,
|
2430
|
-
} = self;
|
2431
|
-
|
2432
|
-
TypeListCheckpoint {
|
2433
|
-
core_types: core_types.len(),
|
2434
|
-
components: components.len(),
|
2435
|
-
component_defined_types: component_defined_types.len(),
|
2436
|
-
component_values: component_values.len(),
|
2437
|
-
component_instances: component_instances.len(),
|
2438
|
-
component_funcs: component_funcs.len(),
|
2439
|
-
core_modules: core_modules.len(),
|
2440
|
-
core_instances: core_instances.len(),
|
2441
|
-
}
|
2442
|
-
}
|
2443
|
-
|
2444
|
-
fn reset_to_checkpoint(&mut self, checkpoint: TypeListCheckpoint) {
|
2445
|
-
let TypeList {
|
2446
|
-
alias_mappings: _,
|
2447
|
-
alias_counter: _,
|
2448
|
-
alias_snapshots: _,
|
2449
|
-
core_types,
|
2450
|
-
components,
|
2451
|
-
component_defined_types,
|
2452
|
-
component_values,
|
2453
|
-
component_instances,
|
2454
|
-
component_funcs,
|
2455
|
-
core_modules,
|
2456
|
-
core_instances,
|
2457
|
-
} = self;
|
2458
|
-
|
2459
|
-
core_types.truncate(checkpoint.core_types);
|
2460
|
-
components.truncate(checkpoint.components);
|
2461
|
-
component_defined_types.truncate(checkpoint.component_defined_types);
|
2462
|
-
component_values.truncate(checkpoint.component_values);
|
2463
|
-
component_instances.truncate(checkpoint.component_instances);
|
2464
|
-
component_funcs.truncate(checkpoint.component_funcs);
|
2465
|
-
core_modules.truncate(checkpoint.core_modules);
|
2466
|
-
core_instances.truncate(checkpoint.core_instances);
|
2467
|
-
}
|
2468
|
-
|
2469
|
-
pub fn commit(&mut self) -> TypeList {
|
2470
|
-
// Note that the `alias_counter` is bumped here to ensure that the
|
2471
|
-
// previous value of the unique counter is never used for an actual type
|
2472
|
-
// so it's suitable for lookup via a binary search.
|
2473
|
-
let alias_counter = self.alias_counter;
|
2474
|
-
self.alias_counter += 1;
|
2475
|
-
|
2476
|
-
self.alias_snapshots.push(TypeListAliasSnapshot {
|
2477
|
-
alias_counter,
|
2478
|
-
alias_mappings: mem::take(&mut self.alias_mappings),
|
2479
|
-
});
|
2480
|
-
|
2481
|
-
TypeList {
|
2482
|
-
alias_mappings: HashMap::new(),
|
2483
|
-
alias_counter: self.alias_counter,
|
2484
|
-
alias_snapshots: self.alias_snapshots.clone(),
|
2485
|
-
core_types: self.core_types.commit(),
|
2486
|
-
components: self.components.commit(),
|
2487
|
-
component_defined_types: self.component_defined_types.commit(),
|
2488
|
-
component_values: self.component_values.commit(),
|
2489
|
-
component_instances: self.component_instances.commit(),
|
2490
|
-
component_funcs: self.component_funcs.commit(),
|
2491
|
-
core_modules: self.core_modules.commit(),
|
2492
|
-
core_instances: self.core_instances.commit(),
|
2493
|
-
}
|
2494
|
-
}
|
2495
|
-
|
2496
|
-
/// See `SnapshotList::with_unique`.
|
2497
|
-
pub fn with_unique<T>(&mut self, mut ty: T) -> T
|
2498
|
-
where
|
2499
|
-
T: Aliasable,
|
2500
|
-
{
|
2501
|
-
self.alias_mappings
|
2502
|
-
.insert(self.alias_counter, ty.alias_id());
|
2503
|
-
ty.set_alias_id(self.alias_counter);
|
2504
|
-
self.alias_counter += 1;
|
2505
|
-
ty
|
2506
|
-
}
|
2507
|
-
|
2508
|
-
/// Attempts to lookup the type id that `ty` is an alias of.
|
2509
|
-
///
|
2510
|
-
/// Returns `None` if `ty` wasn't listed as aliasing a prior type.
|
2511
|
-
pub fn peel_alias<T>(&self, mut ty: T) -> Option<T>
|
2512
|
-
where
|
2513
|
-
T: Aliasable,
|
2514
|
-
{
|
2515
|
-
let alias_id = ty.alias_id();
|
2516
|
-
|
2517
|
-
// The unique counter in each snapshot is the unique counter at the
|
2518
|
-
// time of the snapshot so it's guaranteed to never be used, meaning
|
2519
|
-
// that `Ok` should never show up here. With an `Err` it's where the
|
2520
|
-
// index would be placed meaning that the index in question is the
|
2521
|
-
// smallest value over the unique id's value, meaning that slot has the
|
2522
|
-
// mapping we're interested in.
|
2523
|
-
let i = match self
|
2524
|
-
.alias_snapshots
|
2525
|
-
.binary_search_by_key(&alias_id, |snapshot| snapshot.alias_counter)
|
2526
|
-
{
|
2527
|
-
Ok(_) => unreachable!(),
|
2528
|
-
Err(i) => i,
|
2529
|
-
};
|
2530
|
-
|
2531
|
-
// If the `i` index is beyond the snapshot array then lookup in the
|
2532
|
-
// current mappings instead since it may refer to a type not snapshot
|
2533
|
-
// yet.
|
2534
|
-
ty.set_alias_id(match self.alias_snapshots.get(i) {
|
2535
|
-
Some(snapshot) => *snapshot.alias_mappings.get(&alias_id)?,
|
2536
|
-
None => *self.alias_mappings.get(&alias_id)?,
|
2537
|
-
});
|
2538
|
-
Some(ty)
|
2539
|
-
}
|
2540
|
-
}
|
2541
|
-
|
2542
|
-
impl<T> Index<T> for TypeList
|
2543
|
-
where
|
2544
|
-
T: TypeIdentifier,
|
2545
|
-
{
|
2546
|
-
type Output = T::Data;
|
2547
|
-
|
2548
|
-
fn index(&self, id: T) -> &Self::Output {
|
2549
|
-
let arena = T::list(self);
|
2550
|
-
&arena[id.index()]
|
2551
|
-
}
|
2552
|
-
}
|
2553
|
-
|
2554
|
-
/// Thin wrapper around `TypeList` which provides an allocator of unique ids for
|
2555
|
-
/// types contained within this list.
|
2556
|
-
pub(crate) struct TypeAlloc {
|
2557
|
-
list: TypeList,
|
2558
|
-
|
2559
|
-
// This is assigned at creation of a `TypeAlloc` and then never changed.
|
2560
|
-
// It's used in one entry for all `ResourceId`s contained within.
|
2561
|
-
globally_unique_id: u64,
|
2562
|
-
|
2563
|
-
// This is a counter that's incremeneted each time `alloc_resource_id` is
|
2564
|
-
// called.
|
2565
|
-
next_resource_id: u32,
|
2566
|
-
}
|
2567
|
-
|
2568
|
-
impl Default for TypeAlloc {
|
2569
|
-
fn default() -> TypeAlloc {
|
2570
|
-
static NEXT_GLOBAL_ID: AtomicU64 = AtomicU64::new(0);
|
2571
|
-
TypeAlloc {
|
2572
|
-
list: TypeList::default(),
|
2573
|
-
globally_unique_id: NEXT_GLOBAL_ID.fetch_add(1, Ordering::Relaxed),
|
2574
|
-
next_resource_id: 0,
|
2575
|
-
}
|
2576
|
-
}
|
2577
|
-
}
|
2578
|
-
|
2579
|
-
impl Deref for TypeAlloc {
|
2580
|
-
type Target = TypeList;
|
2581
|
-
fn deref(&self) -> &TypeList {
|
2582
|
-
&self.list
|
2583
|
-
}
|
2584
|
-
}
|
2585
|
-
|
2586
|
-
impl DerefMut for TypeAlloc {
|
2587
|
-
fn deref_mut(&mut self) -> &mut TypeList {
|
2588
|
-
&mut self.list
|
2589
|
-
}
|
2590
|
-
}
|
2591
|
-
|
2592
|
-
impl TypeAlloc {
|
2593
|
-
/// Pushes a new type into this list, returning an identifier which can be
|
2594
|
-
/// used to later retrieve it.
|
2595
|
-
///
|
2596
|
-
/// The returned identifier is unique within this `TypeAlloc` and won't be
|
2597
|
-
/// hash-equivalent to anything else.
|
2598
|
-
pub fn push_ty<T>(&mut self, ty: T) -> T::Id
|
2599
|
-
where
|
2600
|
-
T: TypeData,
|
2601
|
-
{
|
2602
|
-
self.list.push(ty)
|
2603
|
-
}
|
2604
|
-
|
2605
|
-
/// Allocates a new unique resource identifier.
|
2606
|
-
///
|
2607
|
-
/// Note that uniqueness is only a property within this `TypeAlloc`.
|
2608
|
-
pub fn alloc_resource_id(&mut self) -> AliasableResourceId {
|
2609
|
-
let contextually_unique_id = self.next_resource_id;
|
2610
|
-
self.next_resource_id = self.next_resource_id.checked_add(1).unwrap();
|
2611
|
-
AliasableResourceId {
|
2612
|
-
id: ResourceId {
|
2613
|
-
globally_unique_id: self.globally_unique_id,
|
2614
|
-
contextually_unique_id,
|
2615
|
-
},
|
2616
|
-
alias_id: NO_ALIAS,
|
2617
|
-
}
|
2618
|
-
}
|
2619
|
-
|
2620
|
-
/// Adds the set of "free variables" of the `id` provided to the `set`
|
2621
|
-
/// provided.
|
2622
|
-
///
|
2623
|
-
/// Free variables are defined as resources. Any resource, perhaps
|
2624
|
-
/// transitively, referred to but not defined by `id` is added to the `set`
|
2625
|
-
/// and returned.
|
2626
|
-
pub fn free_variables_any_type_id(
|
2627
|
-
&self,
|
2628
|
-
id: ComponentAnyTypeId,
|
2629
|
-
set: &mut IndexSet<ResourceId>,
|
2630
|
-
) {
|
2631
|
-
match id {
|
2632
|
-
ComponentAnyTypeId::Resource(r) => {
|
2633
|
-
set.insert(r.resource());
|
2634
|
-
}
|
2635
|
-
ComponentAnyTypeId::Defined(id) => {
|
2636
|
-
self.free_variables_component_defined_type_id(id, set)
|
2637
|
-
}
|
2638
|
-
ComponentAnyTypeId::Func(id) => self.free_variables_component_func_type_id(id, set),
|
2639
|
-
ComponentAnyTypeId::Instance(id) => {
|
2640
|
-
self.free_variables_component_instance_type_id(id, set)
|
2641
|
-
}
|
2642
|
-
ComponentAnyTypeId::Component(id) => self.free_variables_component_type_id(id, set),
|
2643
|
-
}
|
2644
|
-
}
|
2645
|
-
|
2646
|
-
pub fn free_variables_component_defined_type_id(
|
2647
|
-
&self,
|
2648
|
-
id: ComponentDefinedTypeId,
|
2649
|
-
set: &mut IndexSet<ResourceId>,
|
2650
|
-
) {
|
2651
|
-
match &self[id] {
|
2652
|
-
ComponentDefinedType::Primitive(_)
|
2653
|
-
| ComponentDefinedType::Flags(_)
|
2654
|
-
| ComponentDefinedType::Enum(_) => {}
|
2655
|
-
ComponentDefinedType::Record(r) => {
|
2656
|
-
for ty in r.fields.values() {
|
2657
|
-
self.free_variables_valtype(ty, set);
|
2658
|
-
}
|
2659
|
-
}
|
2660
|
-
ComponentDefinedType::Tuple(r) => {
|
2661
|
-
for ty in r.types.iter() {
|
2662
|
-
self.free_variables_valtype(ty, set);
|
2663
|
-
}
|
2664
|
-
}
|
2665
|
-
ComponentDefinedType::Variant(r) => {
|
2666
|
-
for ty in r.cases.values() {
|
2667
|
-
if let Some(ty) = &ty.ty {
|
2668
|
-
self.free_variables_valtype(ty, set);
|
2669
|
-
}
|
2670
|
-
}
|
2671
|
-
}
|
2672
|
-
ComponentDefinedType::List(ty) | ComponentDefinedType::Option(ty) => {
|
2673
|
-
self.free_variables_valtype(ty, set);
|
2674
|
-
}
|
2675
|
-
ComponentDefinedType::Result { ok, err } => {
|
2676
|
-
if let Some(ok) = ok {
|
2677
|
-
self.free_variables_valtype(ok, set);
|
2678
|
-
}
|
2679
|
-
if let Some(err) = err {
|
2680
|
-
self.free_variables_valtype(err, set);
|
2681
|
-
}
|
2682
|
-
}
|
2683
|
-
ComponentDefinedType::Own(id) | ComponentDefinedType::Borrow(id) => {
|
2684
|
-
set.insert(id.resource());
|
2685
|
-
}
|
2686
|
-
}
|
2687
|
-
}
|
2688
|
-
|
2689
|
-
pub fn free_variables_component_type_id(
|
2690
|
-
&self,
|
2691
|
-
id: ComponentTypeId,
|
2692
|
-
set: &mut IndexSet<ResourceId>,
|
2693
|
-
) {
|
2694
|
-
let i = &self[id];
|
2695
|
-
// Recurse on the imports/exports of components, but remove the
|
2696
|
-
// imported and defined resources within the component itself.
|
2697
|
-
//
|
2698
|
-
// Technically this needs to add all the free variables of the
|
2699
|
-
// exports, remove the defined resources, then add the free
|
2700
|
-
// variables of imports, then remove the imported resources. Given
|
2701
|
-
// prior validation of component types, however, the defined
|
2702
|
-
// and imported resources are disjoint and imports can't refer to
|
2703
|
-
// defined resources, so doing this all in one go should be
|
2704
|
-
// equivalent.
|
2705
|
-
for ty in i.imports.values().chain(i.exports.values()) {
|
2706
|
-
self.free_variables_component_entity(ty, set);
|
2707
|
-
}
|
2708
|
-
for (id, _path) in i.imported_resources.iter().chain(&i.defined_resources) {
|
2709
|
-
set.remove(id);
|
2710
|
-
}
|
2711
|
-
}
|
2712
|
-
|
2713
|
-
pub fn free_variables_component_instance_type_id(
|
2714
|
-
&self,
|
2715
|
-
id: ComponentInstanceTypeId,
|
2716
|
-
set: &mut IndexSet<ResourceId>,
|
2717
|
-
) {
|
2718
|
-
let i = &self[id];
|
2719
|
-
// Like components, add in all the free variables of referenced
|
2720
|
-
// types but then remove those defined by this component instance
|
2721
|
-
// itself.
|
2722
|
-
for ty in i.exports.values() {
|
2723
|
-
self.free_variables_component_entity(ty, set);
|
2724
|
-
}
|
2725
|
-
for id in i.defined_resources.iter() {
|
2726
|
-
set.remove(id);
|
2727
|
-
}
|
2728
|
-
}
|
2729
|
-
|
2730
|
-
pub fn free_variables_component_func_type_id(
|
2731
|
-
&self,
|
2732
|
-
id: ComponentFuncTypeId,
|
2733
|
-
set: &mut IndexSet<ResourceId>,
|
2734
|
-
) {
|
2735
|
-
let i = &self[id];
|
2736
|
-
for ty in i
|
2737
|
-
.params
|
2738
|
-
.iter()
|
2739
|
-
.map(|(_, ty)| ty)
|
2740
|
-
.chain(i.results.iter().map(|(_, ty)| ty))
|
2741
|
-
{
|
2742
|
-
self.free_variables_valtype(ty, set);
|
2743
|
-
}
|
2744
|
-
}
|
2745
|
-
|
2746
|
-
/// Same as `free_variables_type_id`, but for `ComponentEntityType`.
|
2747
|
-
pub fn free_variables_component_entity(
|
2748
|
-
&self,
|
2749
|
-
ty: &ComponentEntityType,
|
2750
|
-
set: &mut IndexSet<ResourceId>,
|
2751
|
-
) {
|
2752
|
-
match ty {
|
2753
|
-
ComponentEntityType::Module(_) => {}
|
2754
|
-
ComponentEntityType::Func(id) => self.free_variables_component_func_type_id(*id, set),
|
2755
|
-
ComponentEntityType::Instance(id) => {
|
2756
|
-
self.free_variables_component_instance_type_id(*id, set)
|
2757
|
-
}
|
2758
|
-
ComponentEntityType::Component(id) => self.free_variables_component_type_id(*id, set),
|
2759
|
-
ComponentEntityType::Type { created, .. } => {
|
2760
|
-
self.free_variables_any_type_id(*created, set);
|
2761
|
-
}
|
2762
|
-
ComponentEntityType::Value(ty) => self.free_variables_valtype(ty, set),
|
2763
|
-
}
|
2764
|
-
}
|
2765
|
-
|
2766
|
-
/// Same as `free_variables_type_id`, but for `ComponentValType`.
|
2767
|
-
fn free_variables_valtype(&self, ty: &ComponentValType, set: &mut IndexSet<ResourceId>) {
|
2768
|
-
match ty {
|
2769
|
-
ComponentValType::Primitive(_) => {}
|
2770
|
-
ComponentValType::Type(id) => self.free_variables_component_defined_type_id(*id, set),
|
2771
|
-
}
|
2772
|
-
}
|
2773
|
-
|
2774
|
-
/// Returns whether the type `id` is "named" where named types are presented
|
2775
|
-
/// via the provided `set`.
|
2776
|
-
///
|
2777
|
-
/// This requires that `id` is a `Defined` type.
|
2778
|
-
pub(crate) fn type_named_type_id(
|
2779
|
-
&self,
|
2780
|
-
id: ComponentDefinedTypeId,
|
2781
|
-
set: &HashSet<ComponentAnyTypeId>,
|
2782
|
-
) -> bool {
|
2783
|
-
let ty = &self[id];
|
2784
|
-
match ty {
|
2785
|
-
// Primitives are always considered named
|
2786
|
-
ComponentDefinedType::Primitive(_) => true,
|
2787
|
-
|
2788
|
-
// These structures are never allowed to be anonymous, so they
|
2789
|
-
// themselves must be named.
|
2790
|
-
ComponentDefinedType::Flags(_)
|
2791
|
-
| ComponentDefinedType::Enum(_)
|
2792
|
-
| ComponentDefinedType::Record(_)
|
2793
|
-
| ComponentDefinedType::Variant(_) => set.contains(&id.into()),
|
2794
|
-
|
2795
|
-
// All types below here are allowed to be anonymous, but their
|
2796
|
-
// own components must be appropriately named.
|
2797
|
-
ComponentDefinedType::Tuple(r) => {
|
2798
|
-
r.types.iter().all(|t| self.type_named_valtype(t, set))
|
2799
|
-
}
|
2800
|
-
ComponentDefinedType::Result { ok, err } => {
|
2801
|
-
ok.as_ref()
|
2802
|
-
.map(|t| self.type_named_valtype(t, set))
|
2803
|
-
.unwrap_or(true)
|
2804
|
-
&& err
|
2805
|
-
.as_ref()
|
2806
|
-
.map(|t| self.type_named_valtype(t, set))
|
2807
|
-
.unwrap_or(true)
|
2808
|
-
}
|
2809
|
-
ComponentDefinedType::List(ty) | ComponentDefinedType::Option(ty) => {
|
2810
|
-
self.type_named_valtype(ty, set)
|
2811
|
-
}
|
2812
|
-
|
2813
|
-
// own/borrow themselves don't have to be named, but the resource
|
2814
|
-
// they refer to must be named.
|
2815
|
-
ComponentDefinedType::Own(id) | ComponentDefinedType::Borrow(id) => {
|
2816
|
-
set.contains(&(*id).into())
|
2817
|
-
}
|
2818
|
-
}
|
2819
|
-
}
|
2820
|
-
|
2821
|
-
pub(crate) fn type_named_valtype(
|
2822
|
-
&self,
|
2823
|
-
ty: &ComponentValType,
|
2824
|
-
set: &HashSet<ComponentAnyTypeId>,
|
2825
|
-
) -> bool {
|
2826
|
-
match ty {
|
2827
|
-
ComponentValType::Primitive(_) => true,
|
2828
|
-
ComponentValType::Type(id) => self.type_named_type_id(*id, set),
|
2829
|
-
}
|
2830
|
-
}
|
2831
|
-
}
|
2832
|
-
|
2833
|
-
/// A helper trait to provide the functionality necessary to resources within a
|
2834
|
-
/// type.
|
2835
|
-
///
|
2836
|
-
/// This currently exists to abstract over `TypeAlloc` and `SubtypeArena` which
|
2837
|
-
/// both need to perform remapping operations.
|
2838
|
-
pub(crate) trait Remap
|
2839
|
-
where
|
2840
|
-
Self: Index<ComponentTypeId, Output = ComponentType>,
|
2841
|
-
Self: Index<ComponentDefinedTypeId, Output = ComponentDefinedType>,
|
2842
|
-
Self: Index<ComponentInstanceTypeId, Output = ComponentInstanceType>,
|
2843
|
-
Self: Index<ComponentFuncTypeId, Output = ComponentFuncType>,
|
2844
|
-
{
|
2845
|
-
/// Pushes a new anonymous type within this object, returning an identifier
|
2846
|
-
/// which can be used to refer to it.
|
2847
|
-
fn push_ty<T>(&mut self, ty: T) -> T::Id
|
2848
|
-
where
|
2849
|
-
T: TypeData;
|
2850
|
-
|
2851
|
-
fn map_map(
|
2852
|
-
tmp: &mut IndexMap<ResourceId, Vec<usize>>,
|
2853
|
-
any_changed: &mut bool,
|
2854
|
-
map: &mut Remapping,
|
2855
|
-
) {
|
2856
|
-
for (id, path) in mem::take(tmp) {
|
2857
|
-
let id = match map.resources.get(&id) {
|
2858
|
-
Some(id) => {
|
2859
|
-
*any_changed = true;
|
2860
|
-
*id
|
2861
|
-
}
|
2862
|
-
None => id,
|
2863
|
-
};
|
2864
|
-
tmp.insert(id, path);
|
2865
|
-
}
|
2866
|
-
}
|
2867
|
-
|
2868
|
-
fn insert_if_any_changed<T>(
|
2869
|
-
&mut self,
|
2870
|
-
map: &mut Remapping,
|
2871
|
-
any_changed: bool,
|
2872
|
-
id: &mut T::Id,
|
2873
|
-
ty: T,
|
2874
|
-
) -> bool
|
2875
|
-
where
|
2876
|
-
T: TypeData,
|
2877
|
-
T::Id: Into<ComponentAnyTypeId>,
|
2878
|
-
{
|
2879
|
-
let new = if any_changed { self.push_ty(ty) } else { *id };
|
2880
|
-
map.types.insert((*id).into(), new.into());
|
2881
|
-
let changed = *id != new;
|
2882
|
-
*id = new;
|
2883
|
-
changed
|
2884
|
-
}
|
2885
|
-
|
2886
|
-
fn remap_component_any_type_id(
|
2887
|
-
&mut self,
|
2888
|
-
id: &mut ComponentAnyTypeId,
|
2889
|
-
map: &mut Remapping,
|
2890
|
-
) -> bool {
|
2891
|
-
match id {
|
2892
|
-
ComponentAnyTypeId::Resource(id) => self.remap_resource_id(id, map),
|
2893
|
-
ComponentAnyTypeId::Defined(id) => self.remap_component_defined_type_id(id, map),
|
2894
|
-
ComponentAnyTypeId::Func(id) => self.remap_component_func_type_id(id, map),
|
2895
|
-
ComponentAnyTypeId::Instance(id) => self.remap_component_instance_type_id(id, map),
|
2896
|
-
ComponentAnyTypeId::Component(id) => self.remap_component_type_id(id, map),
|
2897
|
-
}
|
2898
|
-
}
|
2899
|
-
|
2900
|
-
fn remap_resource_id(&mut self, id: &mut AliasableResourceId, map: &mut Remapping) -> bool {
|
2901
|
-
if let Some(changed) = map.remap_id(id) {
|
2902
|
-
return changed;
|
2903
|
-
}
|
2904
|
-
|
2905
|
-
match map.resources.get(&id.resource()) {
|
2906
|
-
None => false,
|
2907
|
-
Some(new_id) => {
|
2908
|
-
*id.resource_mut() = *new_id;
|
2909
|
-
true
|
2910
|
-
}
|
2911
|
-
}
|
2912
|
-
}
|
2913
|
-
|
2914
|
-
fn remap_component_type_id(&mut self, id: &mut ComponentTypeId, map: &mut Remapping) -> bool {
|
2915
|
-
if let Some(changed) = map.remap_id(id) {
|
2916
|
-
return changed;
|
2917
|
-
}
|
2918
|
-
|
2919
|
-
let mut any_changed = false;
|
2920
|
-
let mut ty = self[*id].clone();
|
2921
|
-
for ty in ty.imports.values_mut().chain(ty.exports.values_mut()) {
|
2922
|
-
any_changed |= self.remap_component_entity(ty, map);
|
2923
|
-
}
|
2924
|
-
for (id, _) in ty
|
2925
|
-
.imported_resources
|
2926
|
-
.iter_mut()
|
2927
|
-
.chain(&mut ty.defined_resources)
|
2928
|
-
{
|
2929
|
-
if let Some(new) = map.resources.get(id) {
|
2930
|
-
*id = *new;
|
2931
|
-
any_changed = true;
|
2932
|
-
}
|
2933
|
-
}
|
2934
|
-
Self::map_map(&mut ty.explicit_resources, &mut any_changed, map);
|
2935
|
-
self.insert_if_any_changed(map, any_changed, id, ty)
|
2936
|
-
}
|
2937
|
-
|
2938
|
-
fn remap_component_defined_type_id(
|
2939
|
-
&mut self,
|
2940
|
-
id: &mut ComponentDefinedTypeId,
|
2941
|
-
map: &mut Remapping,
|
2942
|
-
) -> bool {
|
2943
|
-
if let Some(changed) = map.remap_id(id) {
|
2944
|
-
return changed;
|
2945
|
-
}
|
2946
|
-
|
2947
|
-
let mut any_changed = false;
|
2948
|
-
let mut tmp = self[*id].clone();
|
2949
|
-
match &mut tmp {
|
2950
|
-
ComponentDefinedType::Primitive(_)
|
2951
|
-
| ComponentDefinedType::Flags(_)
|
2952
|
-
| ComponentDefinedType::Enum(_) => {}
|
2953
|
-
ComponentDefinedType::Record(r) => {
|
2954
|
-
for ty in r.fields.values_mut() {
|
2955
|
-
any_changed |= self.remap_valtype(ty, map);
|
2956
|
-
}
|
2957
|
-
}
|
2958
|
-
ComponentDefinedType::Tuple(r) => {
|
2959
|
-
for ty in r.types.iter_mut() {
|
2960
|
-
any_changed |= self.remap_valtype(ty, map);
|
2961
|
-
}
|
2962
|
-
}
|
2963
|
-
ComponentDefinedType::Variant(r) => {
|
2964
|
-
for ty in r.cases.values_mut() {
|
2965
|
-
if let Some(ty) = &mut ty.ty {
|
2966
|
-
any_changed |= self.remap_valtype(ty, map);
|
2967
|
-
}
|
2968
|
-
}
|
2969
|
-
}
|
2970
|
-
ComponentDefinedType::List(ty) | ComponentDefinedType::Option(ty) => {
|
2971
|
-
any_changed |= self.remap_valtype(ty, map);
|
2972
|
-
}
|
2973
|
-
ComponentDefinedType::Result { ok, err } => {
|
2974
|
-
if let Some(ok) = ok {
|
2975
|
-
any_changed |= self.remap_valtype(ok, map);
|
2976
|
-
}
|
2977
|
-
if let Some(err) = err {
|
2978
|
-
any_changed |= self.remap_valtype(err, map);
|
2979
|
-
}
|
2980
|
-
}
|
2981
|
-
ComponentDefinedType::Own(id) | ComponentDefinedType::Borrow(id) => {
|
2982
|
-
any_changed |= self.remap_resource_id(id, map);
|
2983
|
-
}
|
2984
|
-
}
|
2985
|
-
self.insert_if_any_changed(map, any_changed, id, tmp)
|
2986
|
-
}
|
2987
|
-
|
2988
|
-
fn remap_component_instance_type_id(
|
2989
|
-
&mut self,
|
2990
|
-
id: &mut ComponentInstanceTypeId,
|
2991
|
-
map: &mut Remapping,
|
2992
|
-
) -> bool {
|
2993
|
-
if let Some(changed) = map.remap_id(id) {
|
2994
|
-
return changed;
|
2995
|
-
}
|
2996
|
-
|
2997
|
-
let mut any_changed = false;
|
2998
|
-
let mut tmp = self[*id].clone();
|
2999
|
-
for ty in tmp.exports.values_mut() {
|
3000
|
-
any_changed |= self.remap_component_entity(ty, map);
|
3001
|
-
}
|
3002
|
-
for id in tmp.defined_resources.iter_mut() {
|
3003
|
-
if let Some(new) = map.resources.get(id) {
|
3004
|
-
*id = *new;
|
3005
|
-
any_changed = true;
|
3006
|
-
}
|
3007
|
-
}
|
3008
|
-
Self::map_map(&mut tmp.explicit_resources, &mut any_changed, map);
|
3009
|
-
self.insert_if_any_changed(map, any_changed, id, tmp)
|
3010
|
-
}
|
3011
|
-
|
3012
|
-
fn remap_component_func_type_id(
|
3013
|
-
&mut self,
|
3014
|
-
id: &mut ComponentFuncTypeId,
|
3015
|
-
map: &mut Remapping,
|
3016
|
-
) -> bool {
|
3017
|
-
if let Some(changed) = map.remap_id(id) {
|
3018
|
-
return changed;
|
3019
|
-
}
|
3020
|
-
|
3021
|
-
let mut any_changed = false;
|
3022
|
-
let mut tmp = self[*id].clone();
|
3023
|
-
for ty in tmp
|
3024
|
-
.params
|
3025
|
-
.iter_mut()
|
3026
|
-
.map(|(_, ty)| ty)
|
3027
|
-
.chain(tmp.results.iter_mut().map(|(_, ty)| ty))
|
3028
|
-
{
|
3029
|
-
any_changed |= self.remap_valtype(ty, map);
|
3030
|
-
}
|
3031
|
-
self.insert_if_any_changed(map, any_changed, id, tmp)
|
3032
|
-
}
|
3033
|
-
|
3034
|
-
/// Same as `remap_type_id`, but works with `ComponentEntityType`.
|
3035
|
-
fn remap_component_entity(
|
3036
|
-
&mut self,
|
3037
|
-
ty: &mut ComponentEntityType,
|
3038
|
-
map: &mut Remapping,
|
3039
|
-
) -> bool {
|
3040
|
-
match ty {
|
3041
|
-
ComponentEntityType::Module(_) => {
|
3042
|
-
// Can't reference resources.
|
3043
|
-
false
|
3044
|
-
}
|
3045
|
-
ComponentEntityType::Func(id) => self.remap_component_func_type_id(id, map),
|
3046
|
-
ComponentEntityType::Instance(id) => self.remap_component_instance_type_id(id, map),
|
3047
|
-
ComponentEntityType::Component(id) => self.remap_component_type_id(id, map),
|
3048
|
-
ComponentEntityType::Type {
|
3049
|
-
referenced,
|
3050
|
-
created,
|
3051
|
-
} => {
|
3052
|
-
let mut changed = self.remap_component_any_type_id(referenced, map);
|
3053
|
-
if *referenced == *created {
|
3054
|
-
*created = *referenced;
|
3055
|
-
} else {
|
3056
|
-
changed |= self.remap_component_any_type_id(created, map);
|
3057
|
-
}
|
3058
|
-
changed
|
3059
|
-
}
|
3060
|
-
ComponentEntityType::Value(ty) => self.remap_valtype(ty, map),
|
3061
|
-
}
|
3062
|
-
}
|
3063
|
-
|
3064
|
-
/// Same as `remap_type_id`, but works with `ComponentValType`.
|
3065
|
-
fn remap_valtype(&mut self, ty: &mut ComponentValType, map: &mut Remapping) -> bool {
|
3066
|
-
match ty {
|
3067
|
-
ComponentValType::Primitive(_) => false,
|
3068
|
-
ComponentValType::Type(id) => self.remap_component_defined_type_id(id, map),
|
3069
|
-
}
|
3070
|
-
}
|
3071
|
-
}
|
3072
|
-
|
3073
|
-
#[derive(Debug, Default)]
|
3074
|
-
pub(crate) struct Remapping {
|
3075
|
-
/// A mapping from old resource ID to new resource ID.
|
3076
|
-
pub(crate) resources: HashMap<ResourceId, ResourceId>,
|
3077
|
-
|
3078
|
-
/// A mapping filled in during the remapping process which records how a
|
3079
|
-
/// type was remapped, if applicable. This avoids remapping multiple
|
3080
|
-
/// references to the same type and instead only processing it once.
|
3081
|
-
types: HashMap<ComponentAnyTypeId, ComponentAnyTypeId>,
|
3082
|
-
}
|
3083
|
-
|
3084
|
-
impl Remap for TypeAlloc {
|
3085
|
-
fn push_ty<T>(&mut self, ty: T) -> T::Id
|
3086
|
-
where
|
3087
|
-
T: TypeData,
|
3088
|
-
{
|
3089
|
-
<TypeList>::push(self, ty)
|
3090
|
-
}
|
3091
|
-
}
|
3092
|
-
|
3093
|
-
impl<T> Index<T> for TypeAlloc
|
3094
|
-
where
|
3095
|
-
T: TypeIdentifier,
|
3096
|
-
{
|
3097
|
-
type Output = T::Data;
|
3098
|
-
|
3099
|
-
#[inline]
|
3100
|
-
fn index(&self, id: T) -> &T::Data {
|
3101
|
-
&self.list[id]
|
3102
|
-
}
|
3103
|
-
}
|
3104
|
-
|
3105
|
-
impl Remapping {
|
3106
|
-
fn remap_id<T>(&self, id: &mut T) -> Option<bool>
|
3107
|
-
where
|
3108
|
-
T: Copy + Into<ComponentAnyTypeId> + TryFrom<ComponentAnyTypeId>,
|
3109
|
-
T::Error: std::fmt::Debug,
|
3110
|
-
{
|
3111
|
-
let old: ComponentAnyTypeId = (*id).into();
|
3112
|
-
let new = self.types.get(&old)?;
|
3113
|
-
if *new == old {
|
3114
|
-
Some(false)
|
3115
|
-
} else {
|
3116
|
-
*id = T::try_from(*new).expect("should never remap across different kinds");
|
3117
|
-
Some(true)
|
3118
|
-
}
|
3119
|
-
}
|
3120
|
-
}
|
3121
|
-
|
3122
|
-
/// Helper structure used to perform subtyping computations.
|
3123
|
-
///
|
3124
|
-
/// This type is used whenever a subtype needs to be tested in one direction or
|
3125
|
-
/// the other. The methods of this type are the various entry points for
|
3126
|
-
/// subtyping.
|
3127
|
-
///
|
3128
|
-
/// Internally this contains arenas for two lists of types. The `a` arena is
|
3129
|
-
/// intended to be used for lookup of the first argument to all of the methods
|
3130
|
-
/// below, and the `b` arena is used for lookup of the second argument.
|
3131
|
-
///
|
3132
|
-
/// Arenas here are used specifically for component-based subtyping queries. In
|
3133
|
-
/// these situations new types must be created based on substitution mappings,
|
3134
|
-
/// but the types all have temporary lifetimes. Everything in these arenas is
|
3135
|
-
/// thrown away once the subtyping computation has finished.
|
3136
|
-
///
|
3137
|
-
/// Note that this subtyping context also explicitly supports being created
|
3138
|
-
/// from to different lists `a` and `b` originally, for testing subtyping
|
3139
|
-
/// between two different components for example.
|
3140
|
-
pub(crate) struct SubtypeCx<'a> {
|
3141
|
-
pub(crate) a: SubtypeArena<'a>,
|
3142
|
-
pub(crate) b: SubtypeArena<'a>,
|
3143
|
-
}
|
3144
|
-
|
3145
|
-
impl<'a> SubtypeCx<'a> {
|
3146
|
-
pub(crate) fn new(a: &'a TypeList, b: &'a TypeList) -> SubtypeCx<'a> {
|
3147
|
-
SubtypeCx {
|
3148
|
-
a: SubtypeArena::new(a),
|
3149
|
-
b: SubtypeArena::new(b),
|
3150
|
-
}
|
3151
|
-
}
|
3152
|
-
|
3153
|
-
fn swap(&mut self) {
|
3154
|
-
mem::swap(&mut self.a, &mut self.b);
|
3155
|
-
}
|
3156
|
-
|
3157
|
-
/// Executes the closure `f`, resetting the internal arenas to their
|
3158
|
-
/// original size after the closure finishes.
|
3159
|
-
///
|
3160
|
-
/// This enables `f` to modify the internal arenas while relying on all
|
3161
|
-
/// changes being discarded after the closure finishes.
|
3162
|
-
fn with_checkpoint<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T {
|
3163
|
-
let a = self.a.list.checkpoint();
|
3164
|
-
let b = self.b.list.checkpoint();
|
3165
|
-
let result = f(self);
|
3166
|
-
self.a.list.reset_to_checkpoint(a);
|
3167
|
-
self.b.list.reset_to_checkpoint(b);
|
3168
|
-
result
|
3169
|
-
}
|
3170
|
-
|
3171
|
-
/// Tests whether `a` is a subtype of `b`.
|
3172
|
-
///
|
3173
|
-
/// Errors are reported at the `offset` specified.
|
3174
|
-
pub fn component_entity_type(
|
3175
|
-
&mut self,
|
3176
|
-
a: &ComponentEntityType,
|
3177
|
-
b: &ComponentEntityType,
|
3178
|
-
offset: usize,
|
3179
|
-
) -> Result<()> {
|
3180
|
-
use ComponentEntityType::*;
|
3181
|
-
|
3182
|
-
match (a, b) {
|
3183
|
-
(Module(a), Module(b)) => self.module_type(*a, *b, offset),
|
3184
|
-
(Module(_), b) => bail!(offset, "expected {}, found module", b.desc()),
|
3185
|
-
|
3186
|
-
(Func(a), Func(b)) => self.component_func_type(*a, *b, offset),
|
3187
|
-
(Func(_), b) => bail!(offset, "expected {}, found func", b.desc()),
|
3188
|
-
|
3189
|
-
(Value(a), Value(b)) => self.component_val_type(a, b, offset),
|
3190
|
-
(Value(_), b) => bail!(offset, "expected {}, found value", b.desc()),
|
3191
|
-
|
3192
|
-
(Type { referenced: a, .. }, Type { referenced: b, .. }) => {
|
3193
|
-
self.component_any_type_id(*a, *b, offset)
|
3194
|
-
}
|
3195
|
-
(Type { .. }, b) => bail!(offset, "expected {}, found type", b.desc()),
|
3196
|
-
|
3197
|
-
(Instance(a), Instance(b)) => self.component_instance_type(*a, *b, offset),
|
3198
|
-
(Instance(_), b) => bail!(offset, "expected {}, found instance", b.desc()),
|
3199
|
-
|
3200
|
-
(Component(a), Component(b)) => self.component_type(*a, *b, offset),
|
3201
|
-
(Component(_), b) => bail!(offset, "expected {}, found component", b.desc()),
|
3202
|
-
}
|
3203
|
-
}
|
3204
|
-
|
3205
|
-
pub fn component_type(
|
3206
|
-
&mut self,
|
3207
|
-
a: ComponentTypeId,
|
3208
|
-
b: ComponentTypeId,
|
3209
|
-
offset: usize,
|
3210
|
-
) -> Result<()> {
|
3211
|
-
// Components are ... tricky. They follow the same basic
|
3212
|
-
// structure as core wasm modules, but they also have extra
|
3213
|
-
// logic to handle resource types. Resources are effectively
|
3214
|
-
// abstract types so this is sort of where an ML module system
|
3215
|
-
// in the component model becomes a reality.
|
3216
|
-
//
|
3217
|
-
// This also leverages the `open_instance_type` method below
|
3218
|
-
// heavily which internally has its own quite large suite of
|
3219
|
-
// logic. More-or-less what's happening here is:
|
3220
|
-
//
|
3221
|
-
// 1. Pretend that the imports of B are given as values to the
|
3222
|
-
// imports of A. If A didn't import anything, for example,
|
3223
|
-
// that's great and the subtyping definitely passes there.
|
3224
|
-
// This operation produces a mapping of all the resources of
|
3225
|
-
// A's imports to resources in B's imports.
|
3226
|
-
//
|
3227
|
-
// 2. This mapping is applied to all of A's exports. This means
|
3228
|
-
// that all exports of A referring to A's imported resources
|
3229
|
-
// now instead refer to B's. Note, though that A's exports
|
3230
|
-
// still refer to its own defined resources.
|
3231
|
-
//
|
3232
|
-
// 3. The same `open_instance_type` method used during the
|
3233
|
-
// first step is used again, but this time on the exports
|
3234
|
-
// in the reverse direction. This performs a similar
|
3235
|
-
// operation, though, by creating a mapping from B's
|
3236
|
-
// defined resources to A's defined resources. The map
|
3237
|
-
// itself is discarded as it's not needed.
|
3238
|
-
//
|
3239
|
-
// The order that everything passed here is intentional, but
|
3240
|
-
// also subtle. I personally think of it as
|
3241
|
-
// `open_instance_type` takes a list of things to satisfy a
|
3242
|
-
// signature and produces a mapping of resources in the
|
3243
|
-
// signature to those provided in the list of things. The
|
3244
|
-
// order of operations then goes:
|
3245
|
-
//
|
3246
|
-
// * Someone thinks they have a component of type B, but they
|
3247
|
-
// actually have a component of type A (e.g. due to this
|
3248
|
-
// subtype check passing).
|
3249
|
-
// * This person provides the imports of B and that must be
|
3250
|
-
// sufficient to satisfy the imports of A. This is the first
|
3251
|
-
// `open_instance_type` check.
|
3252
|
-
// * Now though the resources provided by B are substituted
|
3253
|
-
// into A's exports since that's what was provided.
|
3254
|
-
// * A's exports are then handed back to the original person,
|
3255
|
-
// and these exports must satisfy the signature required by B
|
3256
|
-
// since that's what they're expecting.
|
3257
|
-
// * This is the second `open_instance_type` which, to get
|
3258
|
-
// resource types to line up, will map from A's defined
|
3259
|
-
// resources to B's defined resources.
|
3260
|
-
//
|
3261
|
-
// If all that passes then the resources should all line up
|
3262
|
-
// perfectly. Any misalignment is reported as a subtyping
|
3263
|
-
// error.
|
3264
|
-
let b_imports = self.b[b]
|
3265
|
-
.imports
|
3266
|
-
.iter()
|
3267
|
-
.map(|(name, ty)| (name.clone(), ty.clone()))
|
3268
|
-
.collect();
|
3269
|
-
self.swap();
|
3270
|
-
let mut import_mapping =
|
3271
|
-
self.open_instance_type(&b_imports, a, ExternKind::Import, offset)?;
|
3272
|
-
self.swap();
|
3273
|
-
self.with_checkpoint(|this| {
|
3274
|
-
let mut a_exports = this.a[a]
|
3275
|
-
.exports
|
3276
|
-
.iter()
|
3277
|
-
.map(|(name, ty)| (name.clone(), ty.clone()))
|
3278
|
-
.collect::<IndexMap<_, _>>();
|
3279
|
-
for ty in a_exports.values_mut() {
|
3280
|
-
this.a.remap_component_entity(ty, &mut import_mapping);
|
3281
|
-
}
|
3282
|
-
this.open_instance_type(&a_exports, b, ExternKind::Export, offset)?;
|
3283
|
-
Ok(())
|
3284
|
-
})
|
3285
|
-
}
|
3286
|
-
|
3287
|
-
pub fn component_instance_type(
|
3288
|
-
&mut self,
|
3289
|
-
a_id: ComponentInstanceTypeId,
|
3290
|
-
b_id: ComponentInstanceTypeId,
|
3291
|
-
offset: usize,
|
3292
|
-
) -> Result<()> {
|
3293
|
-
// For instance type subtyping, all exports in the other
|
3294
|
-
// instance type must be present in this instance type's
|
3295
|
-
// exports (i.e. it can export *more* than what this instance
|
3296
|
-
// type needs).
|
3297
|
-
let a = &self.a[a_id];
|
3298
|
-
let b = &self.b[b_id];
|
3299
|
-
|
3300
|
-
let mut exports = Vec::with_capacity(b.exports.len());
|
3301
|
-
for (k, b) in b.exports.iter() {
|
3302
|
-
match a.exports.get(k) {
|
3303
|
-
Some(a) => exports.push((*a, *b)),
|
3304
|
-
None => bail!(offset, "missing expected export `{k}`"),
|
3305
|
-
}
|
3306
|
-
}
|
3307
|
-
for (i, (a, b)) in exports.iter().enumerate() {
|
3308
|
-
let err = match self.component_entity_type(a, b, offset) {
|
3309
|
-
Ok(()) => continue,
|
3310
|
-
Err(e) => e,
|
3311
|
-
};
|
3312
|
-
// On failure attach the name of this export as context to
|
3313
|
-
// the error message to leave a breadcrumb trail.
|
3314
|
-
let (name, _) = self.b[b_id].exports.get_index(i).unwrap();
|
3315
|
-
return Err(err.with_context(|| format!("type mismatch in instance export `{name}`")));
|
3316
|
-
}
|
3317
|
-
Ok(())
|
3318
|
-
}
|
3319
|
-
|
3320
|
-
pub fn component_func_type(
|
3321
|
-
&mut self,
|
3322
|
-
a: ComponentFuncTypeId,
|
3323
|
-
b: ComponentFuncTypeId,
|
3324
|
-
offset: usize,
|
3325
|
-
) -> Result<()> {
|
3326
|
-
let a = &self.a[a];
|
3327
|
-
let b = &self.b[b];
|
3328
|
-
|
3329
|
-
// Note that this intentionally diverges from the upstream
|
3330
|
-
// specification in terms of subtyping. This is a full
|
3331
|
-
// type-equality check which ensures that the structure of `a`
|
3332
|
-
// exactly matches the structure of `b`. The rationale for this
|
3333
|
-
// is:
|
3334
|
-
//
|
3335
|
-
// * Primarily in Wasmtime subtyping based on function types is
|
3336
|
-
// not implemented. This includes both subtyping a host
|
3337
|
-
// import and additionally handling subtyping as functions
|
3338
|
-
// cross component boundaries. The host import subtyping (or
|
3339
|
-
// component export subtyping) is not clear how to handle at
|
3340
|
-
// all at this time. The subtyping of functions between
|
3341
|
-
// components can more easily be handled by extending the
|
3342
|
-
// `fact` compiler, but that hasn't been done yet.
|
3343
|
-
//
|
3344
|
-
// * The upstream specification is currently pretty
|
3345
|
-
// intentionally vague precisely what subtyping is allowed.
|
3346
|
-
// Implementing a strict check here is intended to be a
|
3347
|
-
// conservative starting point for the component model which
|
3348
|
-
// can be extended in the future if necessary.
|
3349
|
-
//
|
3350
|
-
// * The interaction with subtyping on bindings generation, for
|
3351
|
-
// example, is a tricky problem that doesn't have a clear
|
3352
|
-
// answer at this time. Effectively this is more rationale
|
3353
|
-
// for being conservative in the first pass of the component
|
3354
|
-
// model.
|
3355
|
-
//
|
3356
|
-
// So, in conclusion, the test here (and other places that
|
3357
|
-
// reference this comment) is for exact type equality with no
|
3358
|
-
// differences.
|
3359
|
-
if a.params.len() != b.params.len() {
|
3360
|
-
bail!(
|
3361
|
-
offset,
|
3362
|
-
"expected {} parameters, found {}",
|
3363
|
-
b.params.len(),
|
3364
|
-
a.params.len(),
|
3365
|
-
);
|
3366
|
-
}
|
3367
|
-
if a.results.len() != b.results.len() {
|
3368
|
-
bail!(
|
3369
|
-
offset,
|
3370
|
-
"expected {} results, found {}",
|
3371
|
-
b.results.len(),
|
3372
|
-
a.results.len(),
|
3373
|
-
);
|
3374
|
-
}
|
3375
|
-
for ((an, a), (bn, b)) in a.params.iter().zip(b.params.iter()) {
|
3376
|
-
if an != bn {
|
3377
|
-
bail!(offset, "expected parameter named `{bn}`, found `{an}`");
|
3378
|
-
}
|
3379
|
-
self.component_val_type(a, b, offset)
|
3380
|
-
.with_context(|| format!("type mismatch in function parameter `{an}`"))?;
|
3381
|
-
}
|
3382
|
-
for ((an, a), (bn, b)) in a.results.iter().zip(b.results.iter()) {
|
3383
|
-
if an != bn {
|
3384
|
-
bail!(offset, "mismatched result names");
|
3385
|
-
}
|
3386
|
-
self.component_val_type(a, b, offset)
|
3387
|
-
.with_context(|| "type mismatch with result type")?;
|
3388
|
-
}
|
3389
|
-
Ok(())
|
3390
|
-
}
|
3391
|
-
|
3392
|
-
pub fn module_type(
|
3393
|
-
&mut self,
|
3394
|
-
a: ComponentCoreModuleTypeId,
|
3395
|
-
b: ComponentCoreModuleTypeId,
|
3396
|
-
offset: usize,
|
3397
|
-
) -> Result<()> {
|
3398
|
-
// For module type subtyping, all exports in the other module
|
3399
|
-
// type must be present in this module type's exports (i.e. it
|
3400
|
-
// can export *more* than what this module type needs).
|
3401
|
-
// However, for imports, the check is reversed (i.e. it is okay
|
3402
|
-
// to import *less* than what this module type needs).
|
3403
|
-
self.swap();
|
3404
|
-
let a_imports = &self.b[a].imports;
|
3405
|
-
let b_imports = &self.a[b].imports;
|
3406
|
-
for (k, a) in a_imports {
|
3407
|
-
match b_imports.get(k) {
|
3408
|
-
Some(b) => self
|
3409
|
-
.entity_type(b, a, offset)
|
3410
|
-
.with_context(|| format!("type mismatch in import `{}::{}`", k.0, k.1))?,
|
3411
|
-
None => bail!(offset, "missing expected import `{}::{}`", k.0, k.1),
|
3412
|
-
}
|
3413
|
-
}
|
3414
|
-
self.swap();
|
3415
|
-
let a = &self.a[a];
|
3416
|
-
let b = &self.b[b];
|
3417
|
-
for (k, b) in b.exports.iter() {
|
3418
|
-
match a.exports.get(k) {
|
3419
|
-
Some(a) => self
|
3420
|
-
.entity_type(a, b, offset)
|
3421
|
-
.with_context(|| format!("type mismatch in export `{k}`"))?,
|
3422
|
-
None => bail!(offset, "missing expected export `{k}`"),
|
3423
|
-
}
|
3424
|
-
}
|
3425
|
-
Ok(())
|
3426
|
-
}
|
3427
|
-
|
3428
|
-
pub fn component_any_type_id(
|
3429
|
-
&mut self,
|
3430
|
-
a: ComponentAnyTypeId,
|
3431
|
-
b: ComponentAnyTypeId,
|
3432
|
-
offset: usize,
|
3433
|
-
) -> Result<()> {
|
3434
|
-
match (a, b) {
|
3435
|
-
(ComponentAnyTypeId::Resource(a), ComponentAnyTypeId::Resource(b)) => {
|
3436
|
-
if a.resource() == b.resource() {
|
3437
|
-
Ok(())
|
3438
|
-
} else {
|
3439
|
-
bail!(offset, "resource types are not the same")
|
3440
|
-
}
|
3441
|
-
}
|
3442
|
-
(ComponentAnyTypeId::Resource(_), b) => {
|
3443
|
-
bail!(offset, "expected {}, found resource", b.desc())
|
3444
|
-
}
|
3445
|
-
(ComponentAnyTypeId::Defined(a), ComponentAnyTypeId::Defined(b)) => {
|
3446
|
-
self.component_defined_type(a, b, offset)
|
3447
|
-
}
|
3448
|
-
(ComponentAnyTypeId::Defined(_), b) => {
|
3449
|
-
bail!(offset, "expected {}, found defined type", b.desc())
|
3450
|
-
}
|
3451
|
-
|
3452
|
-
(ComponentAnyTypeId::Func(a), ComponentAnyTypeId::Func(b)) => {
|
3453
|
-
self.component_func_type(a, b, offset)
|
3454
|
-
}
|
3455
|
-
(ComponentAnyTypeId::Func(_), b) => {
|
3456
|
-
bail!(offset, "expected {}, found func type", b.desc())
|
3457
|
-
}
|
3458
|
-
|
3459
|
-
(ComponentAnyTypeId::Instance(a), ComponentAnyTypeId::Instance(b)) => {
|
3460
|
-
self.component_instance_type(a, b, offset)
|
3461
|
-
}
|
3462
|
-
(ComponentAnyTypeId::Instance(_), b) => {
|
3463
|
-
bail!(offset, "expected {}, found instance type", b.desc())
|
3464
|
-
}
|
3465
|
-
|
3466
|
-
(ComponentAnyTypeId::Component(a), ComponentAnyTypeId::Component(b)) => {
|
3467
|
-
self.component_type(a, b, offset)
|
3468
|
-
}
|
3469
|
-
(ComponentAnyTypeId::Component(_), b) => {
|
3470
|
-
bail!(offset, "expected {}, found component type", b.desc())
|
3471
|
-
}
|
3472
|
-
}
|
3473
|
-
}
|
3474
|
-
|
3475
|
-
/// The building block for subtyping checks when components are
|
3476
|
-
/// instantiated and when components are tested if they're subtypes of each
|
3477
|
-
/// other.
|
3478
|
-
///
|
3479
|
-
/// This method takes a number of arguments:
|
3480
|
-
///
|
3481
|
-
/// * `a` - this is a list of typed items which can be thought of as
|
3482
|
-
/// concrete values to test against `b`.
|
3483
|
-
/// * `b` - this `TypeId` must point to `Type::Component`.
|
3484
|
-
/// * `kind` - indicates whether the `imports` or `exports` of `b` are
|
3485
|
-
/// being tested against for the values in `a`.
|
3486
|
-
/// * `offset` - the binary offset at which to report errors if one happens.
|
3487
|
-
///
|
3488
|
-
/// This will attempt to determine if the items in `a` satisfy the
|
3489
|
-
/// signature required by the `kind` items of `b`. For example component
|
3490
|
-
/// instantiation will have `a` as the list of arguments provided to
|
3491
|
-
/// instantiation, `b` is the component being instantiated, and `kind` is
|
3492
|
-
/// `ExternKind::Import`.
|
3493
|
-
///
|
3494
|
-
/// This function, if successful, will return a mapping of the resources in
|
3495
|
-
/// `b` to the resources in `a` provided. This mapping is guaranteed to
|
3496
|
-
/// contain all the resources for `b` (all imported resources for
|
3497
|
-
/// `ExternKind::Import` or all defined resources for `ExternKind::Export`).
|
3498
|
-
pub fn open_instance_type(
|
3499
|
-
&mut self,
|
3500
|
-
a: &IndexMap<String, ComponentEntityType>,
|
3501
|
-
b: ComponentTypeId,
|
3502
|
-
kind: ExternKind,
|
3503
|
-
offset: usize,
|
3504
|
-
) -> Result<Remapping> {
|
3505
|
-
// First, determine the mapping from resources in `b` to those supplied
|
3506
|
-
// by arguments in `a`.
|
3507
|
-
//
|
3508
|
-
// This loop will iterate over all the appropriate resources in `b`
|
3509
|
-
// and find the corresponding resource in `args`. The exact lists
|
3510
|
-
// in use here depend on the `kind` provided. This necessarily requires
|
3511
|
-
// a sequence of string lookups to find the corresponding items in each
|
3512
|
-
// list.
|
3513
|
-
//
|
3514
|
-
// The path to each resource in `resources` is precomputed as a list of
|
3515
|
-
// indexes. The first index is into `b`'s list of `entities`, and gives
|
3516
|
-
// the name that `b` assigns to the resource. Each subsequent index,
|
3517
|
-
// if present, means that this resource was present through a layer of
|
3518
|
-
// an instance type, and the index is into the instance type's exports.
|
3519
|
-
// More information about this can be found on
|
3520
|
-
// `ComponentState::imported_resources`.
|
3521
|
-
//
|
3522
|
-
// This loop will follow the list of indices for each resource and, at
|
3523
|
-
// the same time, walk through the arguments supplied to instantiating
|
3524
|
-
// the `component_type`. This means that within `component_type`
|
3525
|
-
// index-based lookups are performed while in `args` name-based
|
3526
|
-
// lookups are performed.
|
3527
|
-
//
|
3528
|
-
// Note that here it's possible that `args` doesn't actually supply the
|
3529
|
-
// correct type of import for each item since argument checking has
|
3530
|
-
// not proceeded yet. These type errors, however, aren't handled by
|
3531
|
-
// this loop and are deferred below to the main subtyping check. That
|
3532
|
-
// means that `mapping` won't necessarily have a mapping for all
|
3533
|
-
// imported resources into `component_type`, but that should be ok.
|
3534
|
-
let component_type = &self.b[b];
|
3535
|
-
let entities = match kind {
|
3536
|
-
ExternKind::Import => &component_type.imports,
|
3537
|
-
ExternKind::Export => &component_type.exports,
|
3538
|
-
};
|
3539
|
-
let resources = match kind {
|
3540
|
-
ExternKind::Import => &component_type.imported_resources,
|
3541
|
-
ExternKind::Export => &component_type.defined_resources,
|
3542
|
-
};
|
3543
|
-
let mut mapping = Remapping::default();
|
3544
|
-
'outer: for (resource, path) in resources.iter() {
|
3545
|
-
// Lookup the first path item in `imports` and the corresponding
|
3546
|
-
// entry in `args` by name.
|
3547
|
-
let (name, ty) = entities.get_index(path[0]).unwrap();
|
3548
|
-
let mut ty = *ty;
|
3549
|
-
let mut arg = a.get(name);
|
3550
|
-
|
3551
|
-
// Lookup all the subsequent `path` entries, if any, by index in
|
3552
|
-
// `ty` and by name in `arg`. Type errors in `arg` are skipped over
|
3553
|
-
// entirely.
|
3554
|
-
for i in path.iter().skip(1).copied() {
|
3555
|
-
let id = match ty {
|
3556
|
-
ComponentEntityType::Instance(id) => id,
|
3557
|
-
_ => unreachable!(),
|
3558
|
-
};
|
3559
|
-
let (name, next_ty) = self.b[id].exports.get_index(i).unwrap();
|
3560
|
-
ty = *next_ty;
|
3561
|
-
arg = match arg {
|
3562
|
-
Some(ComponentEntityType::Instance(id)) => self.a[*id].exports.get(name),
|
3563
|
-
_ => continue 'outer,
|
3564
|
-
};
|
3565
|
-
}
|
3566
|
-
|
3567
|
-
// Double-check that `ty`, the leaf type of `component_type`, is
|
3568
|
-
// indeed the expected resource.
|
3569
|
-
if cfg!(debug_assertions) {
|
3570
|
-
let id = match ty {
|
3571
|
-
ComponentEntityType::Type { created, .. } => match created {
|
3572
|
-
ComponentAnyTypeId::Resource(id) => id.resource(),
|
3573
|
-
_ => unreachable!(),
|
3574
|
-
},
|
3575
|
-
_ => unreachable!(),
|
3576
|
-
};
|
3577
|
-
assert_eq!(id, *resource);
|
3578
|
-
}
|
3579
|
-
|
3580
|
-
// The leaf of `arg` should be a type which is a resource. If not
|
3581
|
-
// it's skipped and this'll wind up generating an error later on in
|
3582
|
-
// subtype checking below.
|
3583
|
-
if let Some(ComponentEntityType::Type { created, .. }) = arg {
|
3584
|
-
if let ComponentAnyTypeId::Resource(r) = created {
|
3585
|
-
mapping.resources.insert(*resource, r.resource());
|
3586
|
-
}
|
3587
|
-
}
|
3588
|
-
}
|
3589
|
-
|
3590
|
-
// Now that a mapping from the resources in `b` to the resources in `a`
|
3591
|
-
// has been determined it's possible to perform the actual subtype
|
3592
|
-
// check.
|
3593
|
-
//
|
3594
|
-
// This subtype check notably needs to ensure that all resource types
|
3595
|
-
// line up. To achieve this the `mapping` previously calculated is used
|
3596
|
-
// to perform a substitution on each component entity type.
|
3597
|
-
//
|
3598
|
-
// The first loop here performs a name lookup to create a list of
|
3599
|
-
// values from `a` to expected items in `b`. Once the list is created
|
3600
|
-
// the substitution check is performed on each element.
|
3601
|
-
let mut to_typecheck = Vec::new();
|
3602
|
-
for (name, expected) in entities.iter() {
|
3603
|
-
match a.get(name) {
|
3604
|
-
Some(arg) => to_typecheck.push((arg.clone(), expected.clone())),
|
3605
|
-
None => bail!(offset, "missing {} named `{name}`", kind.desc()),
|
3606
|
-
}
|
3607
|
-
}
|
3608
|
-
let mut type_map = HashMap::default();
|
3609
|
-
for (i, (actual, expected)) in to_typecheck.into_iter().enumerate() {
|
3610
|
-
let result = self.with_checkpoint(|this| {
|
3611
|
-
let mut expected = expected;
|
3612
|
-
this.b.remap_component_entity(&mut expected, &mut mapping);
|
3613
|
-
mapping.types.clear();
|
3614
|
-
this.component_entity_type(&actual, &expected, offset)
|
3615
|
-
});
|
3616
|
-
let err = match result {
|
3617
|
-
Ok(()) => {
|
3618
|
-
// On a successful type-check record a mapping of
|
3619
|
-
// type-to-type in `type_map` for any type imports that were
|
3620
|
-
// satisfied. This is then used afterwards when performing
|
3621
|
-
// type substitution to remap all component-local types to
|
3622
|
-
// those that were provided in the imports.
|
3623
|
-
self.register_type_renamings(actual, expected, &mut type_map);
|
3624
|
-
continue;
|
3625
|
-
}
|
3626
|
-
Err(e) => e,
|
3627
|
-
};
|
3628
|
-
|
3629
|
-
// If an error happens then attach the name of the entity to the
|
3630
|
-
// error message using the `i` iteration counter.
|
3631
|
-
let component_type = &self.b[b];
|
3632
|
-
let entities = match kind {
|
3633
|
-
ExternKind::Import => &component_type.imports,
|
3634
|
-
ExternKind::Export => &component_type.exports,
|
3635
|
-
};
|
3636
|
-
let (name, _) = entities.get_index(i).unwrap();
|
3637
|
-
return Err(err.with_context(|| format!("type mismatch for {} `{name}`", kind.desc())));
|
3638
|
-
}
|
3639
|
-
mapping.types = type_map;
|
3640
|
-
Ok(mapping)
|
3641
|
-
}
|
3642
|
-
|
3643
|
-
pub(crate) fn entity_type(&self, a: &EntityType, b: &EntityType, offset: usize) -> Result<()> {
|
3644
|
-
macro_rules! limits_match {
|
3645
|
-
($a:expr, $b:expr) => {{
|
3646
|
-
let a = $a;
|
3647
|
-
let b = $b;
|
3648
|
-
a.initial >= b.initial
|
3649
|
-
&& match b.maximum {
|
3650
|
-
Some(b_max) => match a.maximum {
|
3651
|
-
Some(a_max) => a_max <= b_max,
|
3652
|
-
None => false,
|
3653
|
-
},
|
3654
|
-
None => true,
|
3655
|
-
}
|
3656
|
-
}};
|
3657
|
-
}
|
3658
|
-
|
3659
|
-
match (a, b) {
|
3660
|
-
(EntityType::Func(a), EntityType::Func(b)) => {
|
3661
|
-
self.core_func_type(self.a[*a].unwrap_func(), self.b[*b].unwrap_func(), offset)
|
3662
|
-
}
|
3663
|
-
(EntityType::Func(_), b) => bail!(offset, "expected {}, found func", b.desc()),
|
3664
|
-
(EntityType::Table(a), EntityType::Table(b)) => {
|
3665
|
-
if a.element_type != b.element_type {
|
3666
|
-
bail!(
|
3667
|
-
offset,
|
3668
|
-
"expected table element type {}, found {}",
|
3669
|
-
b.element_type,
|
3670
|
-
a.element_type,
|
3671
|
-
)
|
3672
|
-
}
|
3673
|
-
if limits_match!(a, b) {
|
3674
|
-
Ok(())
|
3675
|
-
} else {
|
3676
|
-
bail!(offset, "mismatch in table limits")
|
3677
|
-
}
|
3678
|
-
}
|
3679
|
-
(EntityType::Table(_), b) => bail!(offset, "expected {}, found table", b.desc()),
|
3680
|
-
(EntityType::Memory(a), EntityType::Memory(b)) => {
|
3681
|
-
if a.shared != b.shared {
|
3682
|
-
bail!(offset, "mismatch in the shared flag for memories")
|
3683
|
-
}
|
3684
|
-
if a.memory64 != b.memory64 {
|
3685
|
-
bail!(offset, "mismatch in index type used for memories")
|
3686
|
-
}
|
3687
|
-
if limits_match!(a, b) {
|
3688
|
-
Ok(())
|
3689
|
-
} else {
|
3690
|
-
bail!(offset, "mismatch in memory limits")
|
3691
|
-
}
|
3692
|
-
}
|
3693
|
-
(EntityType::Memory(_), b) => bail!(offset, "expected {}, found memory", b.desc()),
|
3694
|
-
(EntityType::Global(a), EntityType::Global(b)) => {
|
3695
|
-
if a.mutable != b.mutable {
|
3696
|
-
bail!(offset, "global types differ in mutability")
|
3697
|
-
}
|
3698
|
-
if a.content_type == b.content_type {
|
3699
|
-
Ok(())
|
3700
|
-
} else {
|
3701
|
-
bail!(
|
3702
|
-
offset,
|
3703
|
-
"expected global type {}, found {}",
|
3704
|
-
b.content_type,
|
3705
|
-
a.content_type,
|
3706
|
-
)
|
3707
|
-
}
|
3708
|
-
}
|
3709
|
-
(EntityType::Global(_), b) => bail!(offset, "expected {}, found global", b.desc()),
|
3710
|
-
(EntityType::Tag(a), EntityType::Tag(b)) => {
|
3711
|
-
self.core_func_type(self.a[*a].unwrap_func(), self.b[*b].unwrap_func(), offset)
|
3712
|
-
}
|
3713
|
-
(EntityType::Tag(_), b) => bail!(offset, "expected {}, found tag", b.desc()),
|
3714
|
-
}
|
3715
|
-
}
|
3716
|
-
|
3717
|
-
fn core_func_type(&self, a: &FuncType, b: &FuncType, offset: usize) -> Result<()> {
|
3718
|
-
if a == b {
|
3719
|
-
Ok(())
|
3720
|
-
} else {
|
3721
|
-
bail!(
|
3722
|
-
offset,
|
3723
|
-
"expected: {}\n\
|
3724
|
-
found: {}",
|
3725
|
-
b.desc(),
|
3726
|
-
a.desc(),
|
3727
|
-
)
|
3728
|
-
}
|
3729
|
-
}
|
3730
|
-
|
3731
|
-
pub(crate) fn component_val_type(
|
3732
|
-
&self,
|
3733
|
-
a: &ComponentValType,
|
3734
|
-
b: &ComponentValType,
|
3735
|
-
offset: usize,
|
3736
|
-
) -> Result<()> {
|
3737
|
-
match (a, b) {
|
3738
|
-
(ComponentValType::Primitive(a), ComponentValType::Primitive(b)) => {
|
3739
|
-
self.primitive_val_type(*a, *b, offset)
|
3740
|
-
}
|
3741
|
-
(ComponentValType::Type(a), ComponentValType::Type(b)) => {
|
3742
|
-
self.component_defined_type(*a, *b, offset)
|
3743
|
-
}
|
3744
|
-
(ComponentValType::Primitive(a), ComponentValType::Type(b)) => match &self.b[*b] {
|
3745
|
-
ComponentDefinedType::Primitive(b) => self.primitive_val_type(*a, *b, offset),
|
3746
|
-
b => bail!(offset, "expected {}, found {a}", b.desc()),
|
3747
|
-
},
|
3748
|
-
(ComponentValType::Type(a), ComponentValType::Primitive(b)) => match &self.a[*a] {
|
3749
|
-
ComponentDefinedType::Primitive(a) => self.primitive_val_type(*a, *b, offset),
|
3750
|
-
a => bail!(offset, "expected {b}, found {}", a.desc()),
|
3751
|
-
},
|
3752
|
-
}
|
3753
|
-
}
|
3754
|
-
|
3755
|
-
fn component_defined_type(
|
3756
|
-
&self,
|
3757
|
-
a: ComponentDefinedTypeId,
|
3758
|
-
b: ComponentDefinedTypeId,
|
3759
|
-
offset: usize,
|
3760
|
-
) -> Result<()> {
|
3761
|
-
use ComponentDefinedType::*;
|
3762
|
-
|
3763
|
-
// Note that the implementation of subtyping here diverges from the
|
3764
|
-
// upstream specification intentionally, see the documentation on
|
3765
|
-
// function subtyping for more information.
|
3766
|
-
match (&self.a[a], &self.b[b]) {
|
3767
|
-
(Primitive(a), Primitive(b)) => self.primitive_val_type(*a, *b, offset),
|
3768
|
-
(Primitive(a), b) => bail!(offset, "expected {}, found {a}", b.desc()),
|
3769
|
-
(Record(a), Record(b)) => {
|
3770
|
-
if a.fields.len() != b.fields.len() {
|
3771
|
-
bail!(
|
3772
|
-
offset,
|
3773
|
-
"expected {} fields, found {}",
|
3774
|
-
b.fields.len(),
|
3775
|
-
a.fields.len(),
|
3776
|
-
);
|
3777
|
-
}
|
3778
|
-
|
3779
|
-
for ((aname, a), (bname, b)) in a.fields.iter().zip(b.fields.iter()) {
|
3780
|
-
if aname != bname {
|
3781
|
-
bail!(offset, "expected field name `{bname}`, found `{aname}`");
|
3782
|
-
}
|
3783
|
-
self.component_val_type(a, b, offset)
|
3784
|
-
.with_context(|| format!("type mismatch in record field `{aname}`"))?;
|
3785
|
-
}
|
3786
|
-
Ok(())
|
3787
|
-
}
|
3788
|
-
(Record(_), b) => bail!(offset, "expected {}, found record", b.desc()),
|
3789
|
-
(Variant(a), Variant(b)) => {
|
3790
|
-
if a.cases.len() != b.cases.len() {
|
3791
|
-
bail!(
|
3792
|
-
offset,
|
3793
|
-
"expected {} cases, found {}",
|
3794
|
-
b.cases.len(),
|
3795
|
-
a.cases.len(),
|
3796
|
-
);
|
3797
|
-
}
|
3798
|
-
for ((aname, a), (bname, b)) in a.cases.iter().zip(b.cases.iter()) {
|
3799
|
-
if aname != bname {
|
3800
|
-
bail!(offset, "expected case named `{bname}`, found `{aname}`");
|
3801
|
-
}
|
3802
|
-
match (&a.ty, &b.ty) {
|
3803
|
-
(Some(a), Some(b)) => self
|
3804
|
-
.component_val_type(a, b, offset)
|
3805
|
-
.with_context(|| format!("type mismatch in variant case `{aname}`"))?,
|
3806
|
-
(None, None) => {}
|
3807
|
-
(None, Some(_)) => {
|
3808
|
-
bail!(offset, "expected case `{aname}` to have a type, found none")
|
3809
|
-
}
|
3810
|
-
(Some(_), None) => bail!(offset, "expected case `{aname}` to have no type"),
|
3811
|
-
}
|
3812
|
-
}
|
3813
|
-
Ok(())
|
3814
|
-
}
|
3815
|
-
(Variant(_), b) => bail!(offset, "expected {}, found variant", b.desc()),
|
3816
|
-
(List(a), List(b)) | (Option(a), Option(b)) => self.component_val_type(a, b, offset),
|
3817
|
-
(List(_), b) => bail!(offset, "expected {}, found list", b.desc()),
|
3818
|
-
(Option(_), b) => bail!(offset, "expected {}, found option", b.desc()),
|
3819
|
-
(Tuple(a), Tuple(b)) => {
|
3820
|
-
if a.types.len() != b.types.len() {
|
3821
|
-
bail!(
|
3822
|
-
offset,
|
3823
|
-
"expected {} types, found {}",
|
3824
|
-
b.types.len(),
|
3825
|
-
a.types.len(),
|
3826
|
-
);
|
3827
|
-
}
|
3828
|
-
for (i, (a, b)) in a.types.iter().zip(b.types.iter()).enumerate() {
|
3829
|
-
self.component_val_type(a, b, offset)
|
3830
|
-
.with_context(|| format!("type mismatch in tuple field {i}"))?;
|
3831
|
-
}
|
3832
|
-
Ok(())
|
3833
|
-
}
|
3834
|
-
(Tuple(_), b) => bail!(offset, "expected {}, found tuple", b.desc()),
|
3835
|
-
(at @ Flags(a), Flags(b)) | (at @ Enum(a), Enum(b)) => {
|
3836
|
-
let desc = match at {
|
3837
|
-
Flags(_) => "flags",
|
3838
|
-
_ => "enum",
|
3839
|
-
};
|
3840
|
-
if a.len() == b.len() && a.iter().eq(b.iter()) {
|
3841
|
-
Ok(())
|
3842
|
-
} else {
|
3843
|
-
bail!(offset, "mismatch in {desc} elements")
|
3844
|
-
}
|
3845
|
-
}
|
3846
|
-
(Flags(_), b) => bail!(offset, "expected {}, found flags", b.desc()),
|
3847
|
-
(Enum(_), b) => bail!(offset, "expected {}, found enum", b.desc()),
|
3848
|
-
(Result { ok: ao, err: ae }, Result { ok: bo, err: be }) => {
|
3849
|
-
match (ao, bo) {
|
3850
|
-
(None, None) => {}
|
3851
|
-
(Some(a), Some(b)) => self
|
3852
|
-
.component_val_type(a, b, offset)
|
3853
|
-
.with_context(|| "type mismatch in ok variant")?,
|
3854
|
-
(None, Some(_)) => bail!(offset, "expected ok type, but found none"),
|
3855
|
-
(Some(_), None) => bail!(offset, "expected ok type to not be present"),
|
3856
|
-
}
|
3857
|
-
match (ae, be) {
|
3858
|
-
(None, None) => {}
|
3859
|
-
(Some(a), Some(b)) => self
|
3860
|
-
.component_val_type(a, b, offset)
|
3861
|
-
.with_context(|| "type mismatch in err variant")?,
|
3862
|
-
(None, Some(_)) => bail!(offset, "expected err type, but found none"),
|
3863
|
-
(Some(_), None) => bail!(offset, "expected err type to not be present"),
|
3864
|
-
}
|
3865
|
-
Ok(())
|
3866
|
-
}
|
3867
|
-
(Result { .. }, b) => bail!(offset, "expected {}, found result", b.desc()),
|
3868
|
-
(Own(a), Own(b)) | (Borrow(a), Borrow(b)) => {
|
3869
|
-
if a.resource() == b.resource() {
|
3870
|
-
Ok(())
|
3871
|
-
} else {
|
3872
|
-
bail!(offset, "resource types are not the same")
|
3873
|
-
}
|
3874
|
-
}
|
3875
|
-
(Own(_), b) => bail!(offset, "expected {}, found own", b.desc()),
|
3876
|
-
(Borrow(_), b) => bail!(offset, "expected {}, found borrow", b.desc()),
|
3877
|
-
}
|
3878
|
-
}
|
3879
|
-
|
3880
|
-
fn primitive_val_type(
|
3881
|
-
&self,
|
3882
|
-
a: PrimitiveValType,
|
3883
|
-
b: PrimitiveValType,
|
3884
|
-
offset: usize,
|
3885
|
-
) -> Result<()> {
|
3886
|
-
// Note that this intentionally diverges from the upstream specification
|
3887
|
-
// at this time and only considers exact equality for subtyping
|
3888
|
-
// relationships.
|
3889
|
-
//
|
3890
|
-
// More information can be found in the subtyping implementation for
|
3891
|
-
// component functions.
|
3892
|
-
if a == b {
|
3893
|
-
Ok(())
|
3894
|
-
} else {
|
3895
|
-
bail!(offset, "expected primitive `{b}` found primitive `{a}`")
|
3896
|
-
}
|
3897
|
-
}
|
3898
|
-
|
3899
|
-
fn register_type_renamings(
|
3900
|
-
&self,
|
3901
|
-
actual: ComponentEntityType,
|
3902
|
-
expected: ComponentEntityType,
|
3903
|
-
type_map: &mut HashMap<ComponentAnyTypeId, ComponentAnyTypeId>,
|
3904
|
-
) {
|
3905
|
-
match (expected, actual) {
|
3906
|
-
(
|
3907
|
-
ComponentEntityType::Type {
|
3908
|
-
created: expected, ..
|
3909
|
-
},
|
3910
|
-
ComponentEntityType::Type {
|
3911
|
-
created: actual, ..
|
3912
|
-
},
|
3913
|
-
) => {
|
3914
|
-
let prev = type_map.insert(expected, actual);
|
3915
|
-
assert!(prev.is_none());
|
3916
|
-
}
|
3917
|
-
(ComponentEntityType::Instance(expected), ComponentEntityType::Instance(actual)) => {
|
3918
|
-
let actual = &self.a[actual];
|
3919
|
-
for (name, expected) in self.b[expected].exports.iter() {
|
3920
|
-
let actual = actual.exports[name];
|
3921
|
-
self.register_type_renamings(actual, *expected, type_map);
|
3922
|
-
}
|
3923
|
-
}
|
3924
|
-
_ => {}
|
3925
|
-
}
|
3926
|
-
}
|
3927
|
-
}
|
3928
|
-
|
3929
|
-
/// A helper typed used purely during subtyping as part of `SubtypeCx`.
|
3930
|
-
///
|
3931
|
-
/// This takes a `types` list as input which is the "base" of the ids that can
|
3932
|
-
/// be indexed through this arena. All future types pushed into this, if any,
|
3933
|
-
/// are stored in `self.list`.
|
3934
|
-
///
|
3935
|
-
/// This is intended to have arena-like behavior where everything pushed onto
|
3936
|
-
/// `self.list` is thrown away after a subtyping computation is performed. All
|
3937
|
-
/// new types pushed into this arena are purely temporary.
|
3938
|
-
pub(crate) struct SubtypeArena<'a> {
|
3939
|
-
types: &'a TypeList,
|
3940
|
-
list: TypeList,
|
3941
|
-
}
|
3942
|
-
|
3943
|
-
impl<'a> SubtypeArena<'a> {
|
3944
|
-
fn new(types: &'a TypeList) -> SubtypeArena<'a> {
|
3945
|
-
SubtypeArena {
|
3946
|
-
types,
|
3947
|
-
list: TypeList::default(),
|
3948
|
-
}
|
3949
|
-
}
|
3950
|
-
}
|
3951
|
-
|
3952
|
-
impl<T> Index<T> for SubtypeArena<'_>
|
3953
|
-
where
|
3954
|
-
T: TypeIdentifier,
|
3955
|
-
{
|
3956
|
-
type Output = T::Data;
|
3957
|
-
|
3958
|
-
fn index(&self, id: T) -> &T::Data {
|
3959
|
-
let index = id.index();
|
3960
|
-
if index < T::list(self.types).len() {
|
3961
|
-
&self.types[id]
|
3962
|
-
} else {
|
3963
|
-
let temp_index = index - T::list(self.types).len();
|
3964
|
-
let temp_index = u32::try_from(temp_index).unwrap();
|
3965
|
-
let temp_id = T::from_index(temp_index);
|
3966
|
-
&self.list[temp_id]
|
3967
|
-
}
|
3968
|
-
}
|
3969
|
-
}
|
3970
|
-
|
3971
|
-
impl Remap for SubtypeArena<'_> {
|
3972
|
-
fn push_ty<T>(&mut self, ty: T) -> T::Id
|
3973
|
-
where
|
3974
|
-
T: TypeData,
|
3975
|
-
{
|
3976
|
-
let index = T::Id::list(&self.list).len() + T::Id::list(self.types).len();
|
3977
|
-
let index = u32::try_from(index).unwrap();
|
3978
|
-
self.list.push(ty);
|
3979
|
-
T::Id::from_index(index)
|
3980
|
-
}
|
3981
|
-
}
|
3982
|
-
|
3983
|
-
/// Helper trait for adding contextual information to an error, modeled after
|
3984
|
-
/// `anyhow::Context`.
|
3985
|
-
pub(crate) trait Context {
|
3986
|
-
fn with_context<S>(self, context: impl FnOnce() -> S) -> Self
|
3987
|
-
where
|
3988
|
-
S: Into<String>;
|
3989
|
-
}
|
3990
|
-
|
3991
|
-
impl<T> Context for Result<T> {
|
3992
|
-
fn with_context<S>(self, context: impl FnOnce() -> S) -> Self
|
3993
|
-
where
|
3994
|
-
S: Into<String>,
|
3995
|
-
{
|
3996
|
-
match self {
|
3997
|
-
Ok(val) => Ok(val),
|
3998
|
-
Err(e) => Err(e.with_context(context)),
|
3999
|
-
}
|
4000
|
-
}
|
4001
|
-
}
|
4002
|
-
|
4003
|
-
impl Context for BinaryReaderError {
|
4004
|
-
fn with_context<S>(mut self, context: impl FnOnce() -> S) -> Self
|
4005
|
-
where
|
4006
|
-
S: Into<String>,
|
4007
|
-
{
|
4008
|
-
self.add_context(context().into());
|
4009
|
-
self
|
4010
|
-
}
|
4011
|
-
}
|