Before C++17, throw() was equivalent to wrapping the function in a try {} catch
{ std::unexpected(); }. In C++17 throw() was made equivalent to noexcept and
in C++20 throw() was removed.
618: Implement InternalEvent::Breakpoint in the llvm backend. r=nlewycky a=nlewycky
Enable now-working metering unit tests when run with the llvm backend.
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
The feed_event() function is called for every wasm binary instruction.
Let's optimize it by storing FunctionEnvironment object in
CraneliftFunctionCodeGenerator, rather than constructing it for every
feed_event() invocation.
This change reduces the time to run "ngix compile" benchmark by 68%:
Before:
nginx compile time: [1.4152 s 1.4186 s 1.4222 s]
Found 1 outliers among 10 measurements (10.00%)
1 (10.00%) high mild
After:
nginx compile time: [447.76 ms 448.32 ms 448.80 ms]
change: [-68.542% -68.440% -68.352%] (p = 0.00 < 0.05)
Performance has improved.
I assume some of the clone() calls are very expensive (Vec::clone(),
likely). I did see libc malloc()/free() high up in "perf top" profiles,
which are eliminted by this change.
I also looked into eliminating FunctionBuilder construction from
feed_event(). That turns out to be painful on lifetime rules because it
borrows bunch of other objects, so I am leaving it for someone who knows
the code better than I do.
609: Update dependencies r=syrusakbary a=syrusakbary
This PR does:
* Update dependencies (to explicitly use only one version of a package, in all the places we use it)
* Remove explicit dependency on `hashbrown` since it's already adopted as the default algorithm for `HashMap`
* Small fixes on code to use latest versions
Co-authored-by: Syrus <me@syrusakbary.com>
606: Cleanup Wasmer r=syrusakbary a=syrusakbary
This PR moves a few things around trying to make Wasmer more compelling to use:
* Two less directories on the root (`fuzz` is moved to the `lib/` folder, `media` is moved to `src/installer` folder)
* Improved README
* Moved `ARCHITECTURE.md` into the `docs` folder.
Co-authored-by: Syrus <me@syrusakbary.com>
590: wasmer-c-api: error visibility changes r=bjfish a=YaronWittenstein
I've changed the visibility to `public` in order to support code like here:
https://github.com/spacemeshos/svm/blob/52f04b52cc/crates/svm-wasmer-c-api/src/macros.rs#L150
@syrusakbary @bjfish @Hywan
Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
589: wasmer-c-api-changes: making `wasmer_byte_array` fields `public` r=bjfish a=YaronWittenstein
I've added this PR since I've tests that need access to `wasmer_byte_array` field.
Here is an example:
52f04b52cc/crates/svm-wasmer-c-api/tests/c_api.rs (L96)
```rust
unsafe fn cast_wasmer_byte_array_to_string(wasmer_bytes: &wasmer_byte_array) -> String {
let slice: &[u8] =
std::slice::from_raw_parts(wasmer_bytes.bytes, wasmer_bytes.bytes_len as usize);
if let Ok(s) = std::str::from_utf8(slice) {
s.to_string()
} else {
panic!("error converting `wasmer_byte_array` to string")
}
}
```
@syrusakbary @bjfish @Hywan
Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>