From 64519b15813c9e37393cd4549a815a8957230507 Mon Sep 17 00:00:00 2001 From: Jordan Danford Date: Tue, 19 Feb 2019 17:01:44 -0700 Subject: [PATCH] Fix formatting and grammar in documentation --- ARCHITECTURE.md | 33 +++-- ATTRIBUTIONS.md | 22 ++-- LICENSE | 4 +- README.md | 64 +++++----- integration_tests/lua/README.md | 4 +- integration_tests/nginx/README.md | 6 +- lib/README.md | 18 +-- lib/spectests/spectests/README.md | 199 +++++++++++++++--------------- 8 files changed, 177 insertions(+), 173 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index b2f30f753..e3d87738d 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -2,19 +2,19 @@ Wasmer uses the following components: -- [Cranelift](https://github.com/cranestation/cranelift): for compiling WASM function binaries into Machine IR -- [wabt](https://github.com/pepyakin/wabt-rs): for transforming `.wast` files to `.wasm` and also to run WebAssembly spectests -- [wasmparser](https://github.com/yurydelendik/wasmparser.rs): for parsing the `.wasm` files and translating them into WebAssembly Modules +- [Cranelift](https://github.com/cranestation/cranelift): for compiling Wasm binaries to machine code +- [wabt](https://github.com/pepyakin/wabt-rs): for transforming `.wast` files to `.wasm` and running WebAssembly spec tests +- [wasmparser](https://github.com/yurydelendik/wasmparser.rs): for parsing the `.wasm` files and translating them into WebAssembly modules -## How Wasmer works? +## How Wasmer works -The first time you run `wasmer run myfile.wasm`, wasmer will: +The first time you run `wasmer run myfile.wasm`, Wasmer will: -- Check if is a `.wast` file. If so, transform it to `.wasm` -- Check that the provided binary is a valid WebAssembly one. That means, that its binary format starts with `\0asm`. -- If it looks like a WebAssembly file, try to parse it with `wasmparser` and generate a `Module` from it -- Once a `Module` is generated, an `Instance` is created with the proper `import_object` (that means, if is detected as an emscripten file, it will add the emscripten expected imports) -- Try to call the WebAssembly start function, or if unexistent try to search for the one that is exported as `main`. +- Check if is a `.wast` file, and if so, transform it to `.wasm` +- Check that the provided binary is a valid WebAssembly one, i.e. its binary format starts with `\0asm`. +- Parse it with `wasmparser` and generate a `Module` from it +- Generate an `Instance` with the proper `import_object` (that means, if is detected to be an Emscripten file, it will add the Emscripten expected imports) +- Try to call the WebAssembly `start` function, or if it does not exist, try to search for the function that is exported as `main` Find a more detailed explanation of the process below: @@ -22,7 +22,7 @@ Find a more detailed explanation of the process below: As the WebAssembly file is being parsed, it will read the sections in the WebAssembly file (memory, table, function, global and element definitions) using the `Module` (or `ModuleEnvironment`) as the structure to hold this information. -However, the real IR initialization happens while a function body is being parsed/created. That means, when the parser reads the section `(func ...)`. +However, the real IR initialization happens while a function body is being parsed/created, i.e. when the parser reads the section `(func ...)`. While the function body is being parsed the corresponding `FuncEnvironment` methods will be called. So for example, if the function is using a table, the `make_table` method within that `FuncEnvironment` will be called. @@ -41,15 +41,14 @@ Once we have the compiled values, we will push them to memory and mark them as e #### Relocations -Sometimes the functions that we generated will need to call other functions. -However the generated code have no idea how to link this functions together. +Sometimes the functions that we generate will need to call other functions, but the generated code has no idea how to link these functions together. -For example, if a function `A` is calling function `B` (that means is having a `(call b)` on it's body) while compiling `A` we will have no idea where the function `B` lives on memory (as `B` is not yet compiled nor pushed into memory). +For example, if a function `A` is calling function `B` (that means is having a `(call b)` on its body) while compiling `A` we will have no idea where the function `B` lives on memory (as `B` is not yet compiled nor pushed into memory). For that reason, we will start collecting all the calls that function `A` will need to do under the hood, and save it's offsets. We do that, so we can patch the function calls after compilation, to point to the correct memory address. -Note: Sometimes this functions rather than living in the same WebAssembly module, they will be provided as import values. +Note: sometimes this functions rather than living in the same WebAssembly module, they will be provided as import values. #### Traps @@ -66,5 +65,5 @@ Once that's finished, we will have a `Instance` function that will be ready to e ## Emscripten -The Wasmer Emscripten integration tries to wrap (and emulate) all the different syscalls that Emscripten needs. -We provide this integration by filling the `import_object` with the emscripten functions, while instantiating the WebAssembly Instance. +Wasmer's Emscripten integration tries to wrap (and emulate) all the different syscalls that Emscripten needs. +We provide this integration by filling the `import_object` with the Emscripten functions, while instantiating the WebAssembly Instance. diff --git a/ATTRIBUTIONS.md b/ATTRIBUTIONS.md index eff1434ab..54e0eed02 100644 --- a/ATTRIBUTIONS.md +++ b/ATTRIBUTIONS.md @@ -2,7 +2,7 @@ Wasmer is a community effort. In order to build the best WebAssembly runtime it's our duty to see how other runtimes are approaching the same space -and get inspired from them on the things that they got right, so wasmer and its community can benefit from a solid +and get inspired from them on the things that they got right, so Wasmer and its community can benefit from a solid foundation. These are the different project that we used as inspiration: @@ -10,9 +10,9 @@ These are the different project that we used as inspiration: - [Nebulet](https://github.com/nebulet/nebulet): as the base for creating a great Rust WebAssembly runtime - [WAVM](https://github.com/wavm/wavm): for their great integration and testing framework - [greenwasm](https://github.com/Kimundi/greenwasm): for their [spectests framework](https://github.com/Kimundi/greenwasm/tree/master/greenwasm-spectest) -- [wasmtime](/wasmtime): on their [mmap implementation](https://github.com/CraneStation/wasmtime/blob/3f24098edc81cd9bf0f877fb7fba018cad0f039e/lib/runtime/src/mmap.rs). -- [stackoverflow](https://stackoverflow.com/a/45795699/1072990): to create an efficient HashMap with pair keys. -- [Emscripten](https://github.com/kripken/emscripten): for emtests test sources to ensure compatibility. +- [wasmtime](https://github.com/CraneStation/wasmtime): for their [mmap implementation](https://github.com/CraneStation/wasmtime/blob/3f24098edc81cd9bf0f877fb7fba018cad0f039e/lib/runtime/src/mmap.rs) +- [stackoverflow](https://stackoverflow.com/a/45795699/1072990): to create an efficient HashMap with pair keys +- [Emscripten](https://github.com/kripken/emscripten): for emtests test sources to ensure compatibility We would love to hear from you if you think we can take inspiration from other projects that we haven't covered here. 😊 @@ -21,10 +21,10 @@ We would love to hear from you if you think we can take inspiration from other p ### Nebulet -``` +```text MIT License -Copyright (c) 2018 +Copyright (c) 2018 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ SOFTWARE. ### WAVM -``` +```text Copyright (c) 2018, Andrew Scheidecker All rights reserved. @@ -69,7 +69,7 @@ The contents of [Test/spec](Test/spec) is covered by the license in [Test/spec/L ### Greenwasm -``` +```text Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -275,7 +275,7 @@ limitations under the License. ### Wasmtime -``` +```text Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -497,7 +497,7 @@ Software. ``` ### Emscripten -``` +```text Emscripten is available under 2 licenses, the MIT license and the University of Illinois/NCSA Open Source License. @@ -557,7 +557,7 @@ the following conditions: Neither the names of Mozilla, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior - written permission. + written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF diff --git a/LICENSE b/LICENSE index 689596400..7e40523b0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,4 @@ -The MIT License (MIT) - -Copyright (c) 2018-Present Syrus Akbary +Copyright (c) 2019 Syrus Akbary Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index df4ac0186..bdb921afd 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ -

Wasmer logo

+

+ + Wasmer logo + +

- Build Status - License + + Build Status + + + License + - Join the Wasmer Community + Join the Wasmer Community

## Introduction -[Wasmer](https://wasmer.io/) is a Standalone JIT WebAssembly runtime, aiming to be fully compatible with Emscripten, Rust and Go. +[Wasmer](https://wasmer.io/) is a standalone JIT WebAssembly runtime, aiming to be fully compatible with Emscripten, Rust and Go. Install Wasmer with: @@ -18,20 +26,20 @@ Install Wasmer with: curl https://get.wasmer.io -sSfL | sh ``` -_**NEW ✨**: Now you can also embed Wasmer in your Rust application, check our [example repo](https://github.com/wasmerio/wasmer-rust-example) to see how to do it!_ +_**NEW ✨**: You can now embed Wasmer in your Rust application, check our [example repo](https://github.com/wasmerio/wasmer-rust-example) to see how!_ ### Usage -`wasmer` can execute both the standard binary format (`.wasm`) and the text +Wasmer can execute both the standard binary format (`.wasm`) and the text format defined by the WebAssembly reference interpreter (`.wat`). -Once installed, you will be able to run any WebAssembly files (_including Nginx, and Lua!_): +Once installed, you will be able to run any WebAssembly files (_including nginx and Lua!_): ```sh # Run Lua wasmer run examples/lua.wasm -# Run Nginx +# Run nginx wasmer run examples/nginx/nginx.wasm -- -p examples/nginx -c nginx.conf ``` @@ -39,13 +47,13 @@ wasmer run examples/nginx/nginx.wasm -- -p examples/nginx -c nginx.conf Wasmer is structured into different directories: -- [`src`](./src): code related to the wasmer excutable binary itself +- [`src`](./src): code related to the Wasmer executable itself - [`lib`](./lib): modularized libraries that Wasmer uses under the hood -- [`examples`](./examples): some useful examples to getting started with wasmer +- [`examples`](./examples): some useful examples to getting started with Wasmer ## Dependencies -Building wasmer requires [rustup](https://rustup.rs/). +Building Wasmer requires [rustup](https://rustup.rs/). To build on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/) then follow the onscreen instructions. @@ -66,13 +74,13 @@ Please select your operating system: #### macOS -If you have [homebrew](https://brew.sh/) installed: +If you have [Homebrew](https://brew.sh/) installed: ```sh brew install cmake ``` -Or, in case you have [ports](https://www.macports.org/install.php): +Or, in case you have [MacPorts](https://www.macports.org/install.php): ```sh sudo port install cmake @@ -86,16 +94,16 @@ sudo apt install cmake #### Windows (MSVC) -Windows support is _highly experimental_. Only simple wasm programs may be run, and no syscalls are allowed. This means -nginx and lua do not work on Windows. See [this issue for ongoing Emscripten syscall polyfills for Windows](https://github.com/wasmerio/wasmer/pull/176). +Windows support is _highly experimental_. Only simple Wasm programs may be run, and no syscalls are allowed. This means +nginx and Lua do not work on Windows. See [this issue](https://github.com/wasmerio/wasmer/issues/176) regarding Emscripten syscall polyfills for Windows. -1. Install Python for Windows (https://www.python.org/downloads/release/python-2714/). The Windows x86-64 MSI installer is fine. - You should change the installation to install the "Add python.exe to Path" feature. +1. Install [Python for Windows](https://www.python.org/downloads/release/python-2714/). The Windows x86-64 MSI installer is fine. + Make sure to enable "Add python.exe to Path" during installation. -2. Install Git for Windows (https://git-scm.com/download/win). DO allow it to add git.exe to the PATH (default +2. Install [Git for Windows](https://git-scm.com/download/win). Allow it to add `git.exe` to your PATH (default settings for the installer are fine). -3. Install CMake (https://cmake.org/download/). Ensure CMake is in the PATH. +3. Install [CMake](https://cmake.org/download/). Ensure CMake is in your PATH. ## Building @@ -113,7 +121,7 @@ cargo install --path . ## Testing -Thanks to [spectests](https://github.com/wasmerio/wasmer/tree/master/lib/runtime-core/spectests) we can assure 100% compatibility with the WebAssembly spec test suite. +Thanks to [spec tests](https://github.com/wasmerio/wasmer/tree/master/lib/spectests/spectests) we can ensure 100% compatibility with the WebAssembly spec test suite. Tests can be run with: @@ -121,7 +129,7 @@ Tests can be run with: make test ``` -If you need to re-generate the Rust tests from the spectests +If you need to regenerate the Rust tests from the spec tests you can run: ```sh @@ -138,20 +146,20 @@ make integration-tests Wasmer is an open project guided by strong principles, aiming to be modular, flexible and fast. It is open to the community to help set its direction. -Below are some of the goals (written with order) of this project: +Below are some of the goals of this project (in order of priority): -- [x] It should be 100% compatible with the [WebAssembly Spectest](https://github.com/wasmerio/wasmer/tree/master/spectests) +- [x] It should be 100% compatible with the [WebAssembly spec tests](https://github.com/wasmerio/wasmer/tree/master/lib/spectests/spectests) - [x] It should be fast _(partially achieved)_ - [ ] Support Emscripten calls _(in the works)_ - [ ] Support Rust ABI calls -- [ ] Support GO ABI calls +- [ ] Support Go ABI calls ## Architecture -If you would like to know how Wasmer works under the hood, please visit our [ARCHITECTURE](https://github.com/wasmerio/wasmer/blob/master/ARCHITECTURE.md) document. +If you would like to know how Wasmer works under the hood, please see [ARCHITECTURE.md](./ARCHITECTURE.md). ## License -MIT/Apache-2.0 +Wasmer is primarily distributed under the terms of the [MIT license](http://opensource.org/licenses/MIT) ([LICENSE](./LICENSE)). -[Attributions](./ATTRIBUTIONS.md). +[ATTRIBUTIONS](./ATTRIBUTIONS.md) diff --git a/integration_tests/lua/README.md b/integration_tests/lua/README.md index ce2b03f6f..208e3438d 100644 --- a/integration_tests/lua/README.md +++ b/integration_tests/lua/README.md @@ -1,8 +1,8 @@ # `lua` integration test -This starts wasmer with the lua wasm file. The test asserts on -the output of wasmer. Run test with: +This starts Wasmer with the Lua Wasm file. The test makes assertions on +the output of Wasmer. Run test with: ``` > ./integration_tests/lua/test.sh diff --git a/integration_tests/nginx/README.md b/integration_tests/nginx/README.md index 9df8af773..3e9e46d8b 100644 --- a/integration_tests/nginx/README.md +++ b/integration_tests/nginx/README.md @@ -1,11 +1,11 @@ # `nginx` integration test -This starts wasmer with the nginx wasm file and serves an html -file with some simple text to assert on. The test script does +This starts Wasmer with the nginx Wasm file and serves an HTML +file with some simple text to assert on. The test script does the assertion. -Run test with: +Run test with: ``` > ./integration_tests/nginx/test.sh diff --git a/lib/README.md b/lib/README.md index 44b316865..79ae446d3 100644 --- a/lib/README.md +++ b/lib/README.md @@ -2,34 +2,34 @@ Wasmer is modularized into different libraries, separated into three main sections: -- [Runtime](#Runtime) -- [Integrations](#Integrations) -- [Backends](#Backends) +- [Runtime](#runtime) +- [Integrations](#integrations) +- [Backends](#backends) ## Runtime The core of Wasmer is the runtime, which provides the necessary -abstractions to create a good user-experience when embedding. +abstractions to create a good user experience when embedding. The runtime is divided into two main libraries: - [runtime-core](./runtime-core/): The main implementation of the runtime. -- [runtime](./runtime/): Easy-to-use api on top of runtime-core. +- [runtime](./runtime/): Easy-to-use API on top of `runtime-core`. ## Integrations -The intergration run on-top of the Wasmer runtime and allow us to run WebAssembly files compiled for different environments. +The integration builds on the Wasmer runtime and allow us to run WebAssembly files compiled for different environments. Wasmer intends to support different integrations: -- [emscripten](./emscripten): run emscripten-generated WebAssembly files, such as [Lua](../examples/lua.wasm) or [Nginx](../examples/nginx/nginx.wasm). +- [emscripten](./emscripten): run Emscripten-generated WebAssembly files, such as [Lua](../examples/lua.wasm) or [nginx](../examples/nginx/nginx.wasm). - Go ABI: _we will work on this soon! Want to give us a hand? ✋_ -- Blazor: _researching period, see [tracking issue](https://github.com/wasmerio/wasmer/issues/97)_ +- Blazor: _research period, see [tracking issue](https://github.com/wasmerio/wasmer/issues/97)_ ## Backends The Wasmer [runtime](./runtime) is designed to support multiple compiler backends, allowing the user -to tune the codegen properties (compile speed, performance, etc) to fit your usecase best. +to tune the codegen properties (compile speed, performance, etc) to best fit their use case. Currently, we support a Cranelift compiler backend: diff --git a/lib/spectests/spectests/README.md b/lib/spectests/spectests/README.md index b9c26d864..669246528 100644 --- a/lib/spectests/spectests/README.md +++ b/lib/spectests/spectests/README.md @@ -1,136 +1,135 @@ This directory contains tests for the core WebAssembly semantics, as described in [Semantics.md](https://github.com/WebAssembly/design/blob/master/Semantics.md) and specified by the [spec interpreter](https://github.com/WebAssembly/spec/blob/master/interpreter/spec). -This files should be a direct copy of the original [WebAssembly spec tests](https://github.com/WebAssembly/spec/tree/master/test/core). +These files should be a direct copy of the original [WebAssembly spec tests](/test/core). Tests are written in the [S-Expression script format](https://github.com/WebAssembly/spec/blob/master/interpreter/README.md#s-expression-syntax) defined by the interpreter. ## Autogenerated Rust test cases -This files will serve as base for autogenerating Rust testcases +These files will serve as a base for autogenerating Rust testcases when `WASM_GENERATE_SPECTESTS=1 cargo build` is executed -([src/build_spectests.rs](https://github.com/wasmerio/wasmer/blob/master/src/build_spectests.rs)). +([src/build_spectests.rs](/src/build_spectests.rs)). -The result autogenerated spectests live in the [src/spectests](https://github.com/wasmerio/wasmer/tree/master/src/spectests) -directory. +The resulting autogenerated spec tests live in the [src/spectests](/src/spectests). ## Testcases Currently supported command assertions: -- [x] Module _mostly implemented_ (it should support named modules `(module $Xx)`). -- [x] AssertReturn _mostly implemented_ (it should support calls to named modules `(invoke $Xx "call")`). -- [x] AssertReturnCanonicalNan _fully implemented_ -- [x] AssertReturnArithmeticNan _fully implemented_ -- [x] AssertTrap _fully implemented_ -- [x] AssertInvalid _Fully implemented_ (it should not require to do validation separate from compilation) -- [x] AssertMalformed _Fully implemented_ -- [ ] AssertUninstantiable _not implemented yet_ -- [ ] AssertExhaustion _not implemented yet_ -- [ ] Register _not implemented yet_ -- [x] PerformAction _partially implemented, only function invokations for now_ +- [x] `module` _mostly implemented_ (it should support named modules `(module $Xx)`). +- [x] `assert_return` _mostly implemented_ (it should support calls to named modules `(invoke $Xx "call")`). +- [x] `assert_return_canonical_nan` _fully implemented_ +- [x] `assert_return_arithmetic_nan` _fully implemented_ +- [x] `assert_trap` _fully implemented_ +- [x] `assert_invalid` _fully implemented_ (it should not require validation to be performed separate from compilation) +- [x] `assert_malformed` _fully implemented_ +- [ ] `assert_uninstantiable` _not implemented yet_ +- [ ] `assert_exhaustion` _not implemented yet_ +- [ ] `register` _not implemented yet_ +- [x] `perform_action` _partially implemented, only function invocations for now_ -### Covered spectests +### Covered spec tests -This spectests are currently covered: +The following spec tests are currently covered: -- address.wast ✅ -- align.wast ✅ -- binary.wast ✅ -- block.wast ✅ -- br.wast ✅ -- br_if.wast ✅ -- br_table.wast ✅ -- break-drop.wast ✅ -- call.wast ✅ -- call_indirect.wast ✅ -- comments.wast ✅ -- const.wast ✅ -- conversions.wast ✅ -- custom.wast ✅ -- data.wast ✅ -- elem.wast -- endianness.wast ✅ -- exports.wast ✅ -- f32.wast ✅ -- f32_bitwise.wast ✅ -- f32_cmp.wast ✅ -- f64.wast ✅ -- f64_bitwise.wast ✅ -- f64_cmp.wast ✅ -- fac.wast ✅ -- float_exprs.wast ✅ -- float_literals.wast ✅ -- float_memory.wast ✅ -- float_misc.wast ✅ -- forward.wast ✅ -- func.wast ✅ -- func_ptrs.wast ✅ -- get_local.wast ✅ -- globals.wast ✅ -- i32.wast ✅ -- i64.wast ✅ -- if.wast ✅ -- imports.wast -- inline-module.wast -- int_exprs.wast ✅ -- int_literals.wast ✅ -- labels.wast ✅ -- left-to-right.wast ✅ -- linking.wast -- loop.wast ✅ -- memory.wast ✅ -- memory_grow.wast ✅ -- memory_redundancy.wast ✅ -- memory_trap.wast ✅ -- names.wast ✅ -- nop.wast ✅ -- return.wast ✅ -- select.wast ✅ -- set_local.wast ✅ -- skip-stack-guard-page.wast -- stack.wast ✅ -- start.wast ✅ -- store_retval.wast ✅ -- switch.wast ✅ -- tee_local.wast ✅ -- token.wast ✅ -- traps.wast ✅ -- type.wast ✅ -- typecheck.wast ✅ -- unreachable.wast -- unreached-invalid.wast -- unwind.wast ✅ -- utf8-custom-section-id.wast -- utf8-import-field.wast -- utf8-import-module.wast -- utf8-invalid-encoding.wast +- [x] address.wast +- [x] align.wast +- [x] binary.wast +- [x] block.wast +- [x] br.wast +- [x] br_if.wast +- [x] br_table.wast +- [x] break-drop.wast +- [x] call.wast +- [x] call_indirect.wast +- [x] comments.wast +- [x] const.wast +- [x] conversions.wast +- [x] custom.wast +- [x] data.wast +- [ ] elem.wast +- [x] endianness.wast +- [x] exports.wast +- [x] f32.wast +- [x] f32_bitwise.wast +- [x] f32_cmp.wast +- [x] f64.wast +- [x] f64_bitwise.wast +- [x] f64_cmp.wast +- [x] fac.wast +- [x] float_exprs.wast +- [x] float_literals.wast +- [x] float_memory.wast +- [x] float_misc.wast +- [x] forward.wast +- [x] func.wast +- [x] func_ptrs.wast +- [x] get_local.wast +- [x] globals.wast +- [x] i32.wast +- [x] i64.wast +- [x] if.wast +- [ ] imports.wast +- [ ] inline-module.wast +- [x] int_exprs.wast +- [x] int_literals.wast +- [x] labels.wast +- [x] left-to-right.wast +- [ ] linking.wast +- [x] loop.wast +- [x] memory.wast +- [x] memory_grow.wast +- [x] memory_redundancy.wast +- [x] memory_trap.wast +- [x] names.wast +- [x] nop.wast +- [x] return.wast +- [x] select.wast +- [x] set_local.wast +- [ ] skip-stack-guard-page.wast +- [x] stack.wast +- [x] start.wast +- [x] store_retval.wast +- [x] switch.wast +- [x] tee_local.wast +- [x] token.wast +- [x] traps.wast +- [x] type.wast +- [x] typecheck.wast +- [ ] unreachable.wast +- [ ] unreached-invalid.wast +- [x] unwind.wast +- [ ] utf8-custom-section-id.wast +- [ ] utf8-import-field.wast +- [ ] utf8-import-module.wast +- [ ] utf8-invalid-encoding.wast ### Specific non-supported cases -There are some cases that we decided to skip for now to fasten the time to release: +There are some cases that we decided to skip for now to accelerate the release schedule: -- `SKIP_MUTABLE_GLOBALS`: Right now the WASM parser can't validate a module with imported/exported mut globals. We decided to skip the tests until Cranelift and wasmparser can handle this (original spec proposal: https://github.com/WebAssembly/mutable-global). Spectests affected: +- `SKIP_MUTABLE_GLOBALS`: Right now the Wasm parser can't validate a module with imported/exported `mut` globals. We decided to skip the tests until Cranelift and wasmparser can handle this (see [original spec proposal](https://github.com/WebAssembly/mutable-global)). Spec tests affected: - `globals.wast` -- `SKIP_CALL_INDIRECT_TYPE_MISMATCH`: we implemented traps in a fast way. We haven't covered yet the type mismatch on `call_indirect`. Specs affected: +- `SKIP_CALL_INDIRECT_TYPE_MISMATCH`: we implemented traps in a fast way. We haven't yet covered the type mismatch on `call_indirect`. Specs affected: - `call_indirect.wast` - `SKIP_CALL_UNDEFINED_ELEMENT` - Tables are imported into every spec module, even for modules that don't expect it. We need to figure out a way to prevent import of objects that are not explicitly imported into the module. + Tables are imported into every spec module, even for modules that don't expect it. We need to figure out a way to prevent importing of objects that are not explicitly imported into the module. -Currently cranelift_wasm::ModuleEnvironment does not provide `declare_table_import`, etc. so there is no meaningful way of fixing this yet. +Currently `cranelift_wasm::ModuleEnvironment` does not provide `declare_table_import`, etc. so there is no meaningful way of fixing this yet. - `call_indirect.wast` - `SKIP_SHARED_TABLE` [elem.wast] - Currently sharing tables between instances/modules does not work. Below are some of the reasons it is hard to achieve. + Currently sharing tables between instances/modules does not work. Below are some of the reasons it is hard to achieve: - Rust naturally prevents such because of the possibility of race conditions - - ImportObject is just a wrapper, what we really care about is references to its content. - - Instance::new contains a mutation points, the part where after getting the object (memory or table) we push values to it - table[table_element_index] = func_addr - - Instance has its own created memories and tables and references to them must outlive Instance::new() - - Possible strategy + - `ImportObject` is just a wrapper, what we really care about is references to its content. + - `Instance::new` contains a mutation points, the part where after getting the object (memory or table) we push values to it + `table[table_element_index] = func_addr` + - Instance has its own created memories and tables and references to them must outlive `Instance::new()` + - Possible strategy: ```rust // ImportObject should be passed by ref