summaryrefslogtreecommitdiff
path: root/Tests/LibWasm
AgeCommit message (Collapse)Author
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-10Tests: Port test-wasm to Core::StreamSam Atkins
2022-02-08LibJS: Convert ArrayBuffer construction to ThrowCompletionOrdavidot
This also allows us to create TypedArrays with an existing buffer thus clearing up an additional FIXME in TextEncoder.
2021-12-31test-wasm: Convert WebAssemblyModule::create() to ThrowCompletionOrLinus Groh
This exposed a missing exception check in parseWebAssemblyModule(), which could throw but still return a normal completion (which currently works as we check VM::exception() at the right point, but breaks when moving everything to exceptions).
2021-11-08LibCore: Use ErrorOr<T> for Core::File::open()Andreas Kling
2021-10-31Tests: Convert test-wasm functions to ThrowCompletionOrIdan Horowitz
2021-10-20LibJS: Convert test-js/test-web/test-wasm to ThrowCompletionOrIdan Horowitz
2021-10-20LibJS: Rename define_native_function => define_old_native_functionIdan Horowitz
This method will eventually be removed once all native functions are converted to ThrowCompletionOr
2021-10-20LibJS: Add ThrowCompletionOr versions of the JS native function macrosIdan Horowitz
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all native functions were converted to the new format.
2021-10-17LibJS: Convert to_double() to ThrowCompletionOrIdan Horowitz
2021-10-17LibJS: Convert to_bigint_int64() to ThrowCompletionOrIdan Horowitz
2021-10-13LibJS: Convert to_object() to ThrowCompletionOrLinus Groh
2021-10-13LibJS: Convert to_string() to ThrowCompletionOrLinus Groh
Also update get_function_name() to use ThrowCompletionOr, but this is not a standard AO and should be refactored out of existence eventually.
2021-10-01Tests: Fix typosNico Weber
2021-08-30Tests/LibWasm: Handle all stream errors in parse_webassembly_moduleAli Mohammad Pur
2021-08-30Tests/LibWasm: Add support for javascript bigint valuesAli Mohammad Pur
Some i64 values will not fit in normal doubles, and these values _are_ tested by the test suite, this makes the test runtime capable of handling them correctly.
2021-08-20LibCore: Make Core::File::open() return OSError in case of failureAndreas Kling
2021-07-17LibWasm+Everywhere: Make the instruction count limit configurableAli Mohammad Pur
...and enable it for LibWeb and test-wasm. Note that `wasm` will not be limited by this.
2021-07-17Revert "LibWasm: Some more performance stuff (#8812)"Ali Mohammad Pur
This reverts commit 35394dbfaa23b44a293da85b20a63a10f73572c3. I pushed the wrong button again, hopefully this will be the last of such incidents.
2021-07-17LibWasm: Some more performance stuff (#8812)Ali Mohammad Pur
* wasm: Don't try to print the function results if it traps * LibWasm: Inline some very hot functions These are mostly pretty small functions too, and they were about ~10% of runtime. * LibWasm+Everywhere: Make the instruction count limit configurable ...and enable it for LibWeb and test-wasm. Note that `wasm` will not be limited by this. * LibWasm: Remove a useless use of ScopeGuard There are no multiple exit paths in that function, so we can just put the ending logic right at the end of the function instead.
2021-07-06LibJS: Remove the default length & attributes from define_native_*Idan Horowitz
These are usually incorrect, and people sometimes forget to add the correct values as a result of them being optional, so they should just be specified explicitly.
2021-07-04LibWeb/WebAssembly+test-wasm: Use get_without_side_effects() moreLinus Groh
2021-07-02LibWasm: Give traps a reason and display it when neededAli Mohammad Pur
This makes debugging wasm code a bit easier, as we now know what fails instead of just "too bad, something went wrong".
2021-06-22Meta+LibWasm: Add support for module linking testsAli Mohammad Pur
This commit makes the linking tests in the wasm spec test run.
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-05LibWasm: Move Wasm::BytecodeInterpreter into its own headerSahan Fernando
2021-06-04LibWasm: Load and instantiate tablesAli Mohammad Pur
This commit is a fairly large refactor, mainly because it unified the two different ways that existed to represent references. Now Reference values are also a kind of value. It also implements a printer for values/references instead of copying the implementation everywhere.
2021-06-02LibWasm: Ensure that value signs are preserved when castingAli Mohammad Pur
Also makes normal arithmetic operations more spec-compliant by actually ignoring overflow on them.
2021-06-02LibWasm: Implement reference instructions (ref.{null,func,is_null})Ali Mohammad Pur
2021-05-21LibWasm: Make the instantiation process produce an OwnPtrAli Mohammad Pur
Managing the instantiated modules becomes a pain if they're on the stack, since an instantiated module will eventually reference itself. To make using this simpler, just avoid copying the instance.
2021-05-21LibWasm: Decouple ModuleInstance from the AbstractMachineAli Mohammad Pur
This fixes a FIXME and will allow linking only select modules together, instead of linking every instantiated module into a big mess of exported entities :P
2021-05-21LibWasm+Meta: Implement instantiation/execution primitives in test-wasmAli Mohammad Pur
This also optionally generates a test suite from the WebAssembly testsuite, which can be enabled via passing `INCLUDE_WASM_SPEC_TESTS` to cmake, which will generate test-wasm-compatible tests and the required fixtures. The generated directories are excluded from git since there's no point in committing them.
2021-05-21LibWasm+Meta: Add test-wasm and optionally test the conformance testsAli Mohammad Pur
This only tests "can it be parsed", but the goal of this commit is to provide a test framework that can be built upon :) The conformance tests are downloaded, compiled* and installed only if the INCLUDE_WASM_SPEC_TESTS cmake option is enabled. (*) Since we do not yet have a wast parser, the compilation is delegated to an external tool from binaryen, `wasm-as`, which is required for the test suite download/install to succeed. This *does* run the tests in CI, but it currently does not include the spec conformance tests.