Commit Graph

449 Commits

Author SHA1 Message Date
ptitSeb
7fb7c09080 Release 3.2.0 2023-04-18 16:30:03 +02:00
Christoph Herzog
61a32177d9 deps: Upgrade memoffset
Removes a duplicate dependency.
2023-04-13 23:11:53 +00:00
ptitSeb
b2170e3e4f Fix Wait/Notify opcode, the waiters hashmap is now on the Memory itself (#3723)
* Fix Wait/Notify opcode, the waiters hashmap is now on the Memory itself

* Refactored for clarity

* Use WAIT_ERROR everywhere

* Change from WAIT_ERROR to Option

* Added some unit test for threadconditions

* Switch from `Mutex<HashMap<...>>` to `DashMap<...>` for the NotifyMap

* Use FnvHasher for Dashmap

* Change timeout value in unit test to leave more margin to the system to react.

* Consolidate code, avoid duplication

* Put test in a test module

* Use an Result with custom error instead of an option for waiter
2023-04-13 15:36:41 +00:00
ptitSeb
e40c6a4177 Release 3.2.0-beta.2 2023-04-05 13:25:40 +02:00
ptitSeb
d58d158897 Release 3.2.0-beta.1 2023-03-22 19:14:57 +01:00
Johnathan Sharratt
46a03880d4 Merge branch 'master' into deploy 2023-03-15 03:22:44 +11:00
ptitSeb
20ca8befd3 Fixed a nasty typo 2023-03-13 13:53:52 +01:00
Johnathan Sharratt
beadf18c07 Fixed a memory corruption issue due to an incorrectly implemented memory duplicate method and added more integration tests 2023-03-12 01:27:11 +11:00
Syrus Akbary
cbdf356c0b Merge branch 'std-api' into wasix-fixes-for-web-with-unification
# Conflicts:
#	lib/api/src/js/externals/global.rs
#	lib/api/src/js/vm.rs
#	lib/wasi/src/bin_factory/exec.rs
#	lib/wasi/src/bin_factory/module_cache.rs
#	lib/wasi/src/runtime/task_manager/mod.rs
2023-03-01 21:16:18 -08:00
Johnathan Sharratt
06524345c7 Last fixes to restore web functionality 2023-03-02 10:57:44 +11:00
Johnathan Sharratt
5fa6f90b44 Fixed an issue where the globals were not being properly captured and restored for JS 2023-03-02 07:33:02 +11:00
Syrus Akbary
30f4589f23 Move StoreId to common wasmer_types 2023-02-09 19:22:33 +01:00
Syrus Akbary
8c456334cb Remove deprecated/unused TrapHandler
Note: wasmer_vm::TrapHandler was never exposed via the `wasmer` crate, so it’s safe to remove
2023-02-09 18:58:43 +01:00
ptitSeb
f831e1c846 VMInstance cannot be Clone 2023-01-25 17:12:15 +01:00
ptitSeb
420cde0224 Merge branch 'master' into fix_instancehandle_memoryleak 2023-01-25 14:19:19 +01:00
ptitSeb
df6bc6ba3b Fixed the remaining memory leaks 2023-01-25 14:06:43 +01:00
ptitSeb
ec368e7c08 Removed a warning 2023-01-25 13:43:37 +01:00
ptitSeb
51eff32294 Added InstanceHandle as a deprecated alias to VMInstance, to avoid API-breaking change 2023-01-25 13:28:34 +01:00
ptitSeb
0dc0ce1f0d Renamed InstanceHandle to VMinstance, and InstanceAllocator::write_instance to into_vminstance 2023-01-25 12:06:09 +01:00
Felix Schütt
4b9389cdaa Release 3.2.0-alpha.1 2023-01-23 12:52:43 +01:00
ptitSeb
488b21ccef Fixed some memory leak issue with InstanceHandle (some more leak are still present) 2023-01-18 12:47:59 +01:00
Christoph Herzog
3f14b00602 Fix Mmap creation on Windows
Forgot to update field names...
2022-12-28 17:27:07 +01:00
Christoph Herzog
4a71dbd81c Revert Mmap FD implementation
Revert the FD backed mmap implementation to the previous plain memory
functionality.

This preserves current performance characteristics for users.

Wasix will use a custom memory implementation which uses FD backing.

Also adds a duplicate() method.
2022-12-27 13:54:07 +01:00
Christoph Herzog
de443dcf15 Remove StoreSnapshot functionality
The StoreSnapshot isn't necessary in the public API.
Thanks to the new global accessors on StoreObjects, it is possible to
implement this externally instead.
2022-12-22 11:23:46 +01:00
ptitSeb
6eba960593 Rename to and fixed assert 2022-12-21 12:25:27 +01:00
ptitSeb
6149733f56 Added iter_globals and set_global to StoreObjects 2022-12-21 10:55:37 +01:00
Christoph Herzog
9c12b87eb0 Rename fork() to duplicate()
Renames all the memory fork() functions to duplicate(),
since this is what they actually do.

They enable forking, but that is a seprate functionality.
2022-12-19 18:04:00 +01:00
Christoph Herzog
11774ee5b4 Gate copy_file_range test on unix envs 2022-12-19 15:32:54 +01:00
Christoph Herzog
7940dd7115 Re-implement copy_file_range function + add test 2022-12-19 12:35:11 +01:00
Christoph Herzog
7884891ec1 Feature gate copy_file_range_impl on unix
Only available there...
2022-12-16 11:47:05 +01:00
Christoph Herzog
283e53f5b9 Fix musl build
Musl libc does not have a libc::copy_file_range.

Since apple does not have it either, we factor out the implementation
into a separate function.

This also fixes up the copy code so it actually works correctly...
2022-12-16 11:47:05 +01:00
Christoph Herzog
5109a407c4 WASIX Preparation
This commit extracts changes to core libraries made in the WASIX branch.

It is not reasonable to extract the partial commit history, so this is
just a batch commit.

The history will make a bit more sense again if we decide to merge the
WASIX branch with full commit history.
2022-12-16 11:47:04 +01:00
Felix Schütt
d45850733e Release 3.1.0 2022-12-12 13:38:00 +01:00
ptitSeb
30a7d61943 Merge branch 'master' into feat_sharedmemory 2022-11-29 14:39:45 +01:00
Felix Schütt
b70f6e9052 Release 3.0.2 2022-11-25 21:30:20 +01:00
ptitSeb
32137b4562 Merge branch 'master' into feat_sharedmemory 2022-11-25 13:07:37 +01:00
ptitSeb
68b8995355 Refactor atomic_notify with a new funciton to avoid duplication 2022-11-25 13:06:53 +01:00
ptitSeb
f26e9ba202 Added a Trap for unaligned waiter access 2022-11-25 12:18:42 +01:00
ptitSeb
4329e39404 Added Trap when more the 2^32 waiters are in queue 2022-11-25 11:59:01 +01:00
ptitSeb
23029d8941 Refactore the Wait/Notify HashMap for more clarity 2022-11-25 10:55:27 +01:00
ptitSeb
dba6a6a0ff Update lib/vm/src/instance/mod.rs
Co-authored-by: Christoph Herzog <a.github@omega-id.com>
2022-11-24 18:11:58 +01:00
ptitSeb
fce0ac907d Update lib/vm/src/instance/mod.rs
Co-authored-by: Christoph Herzog <a.github@omega-id.com>
2022-11-24 18:11:00 +01:00
ptitSeb
ffd6d6b140 Merge branch 'master' into feat_sharedmemory 2022-11-24 15:56:32 +01:00
Mallory Adams
40403fed73 Add preliminary FreeBSD support
- Update `traphandlers.rs` to use the same `pc`/`sp` values for amd64 as
  are used for x86
- Ensure amd64 is treated the same as x86_64 in the Makefile
- Add an `IS_FREEBSD` variable to the Makefile which is pretty much the
  same as `IS_DARWIN`
- Update CHANGELOG.md

wasmer partially works on FreeBSD/amd64 with these few tiny changes.
However, after printing the output of cowsay.wasm, it hangs for a long
time (55 seconds in this example).

Using rust toolchain `1.63-x86_64-apple-darwin` (correct behavior):

```
% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  0.01s user 0.01s system 41% cpu 0.061 total
```

Using rust toolchain `1.63-x86_64-unknown-freebsd` (incorrect behavior):

```
% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  55.14s user 0.05s system 100% cpu 55.183 total
```

cowsay.wasm is https://registry-cdn.wapm.io/contents/syrusakbary/cowsay/0.2.0/target/wasm32-wasi/release/cowsay.wasm
2022-11-23 23:51:37 -05:00
Felix Schütt
27f3300fef Release 3.0.1 2022-11-23 01:14:06 +01:00
ptitSeb
8a0bd4b331 Added some aarch64 atomic access emitter (not finished)
Removed public Imports::import_shared_memory and try to auto-initialize shared memory directly

Fixed clippy

Added Atomic Add/Sub/And/Or/Xor operator to Singlepass/AArch64 backend

Added atomic_xchg support for Singlepass/AArch64 backend

Finished all atomic access operator for Singlepass/Aarch64 backend
2022-11-22 15:43:06 +01:00
ptitSeb
04a03fc524 Fixed clippy warning on using Self 2022-11-22 14:38:25 +01:00
ptitSeb
bb69903c51 Fixed Notify helper funciton and opcode (for #3155 and #3158) 2022-11-22 14:38:25 +01:00
ptitSeb
9bbcc8a3b2 Added helper functions for WaitNotify opcodes (for #3155) 2022-11-22 14:38:25 +01:00
John Sharratt's Shared Account
a5f641b4b0 Implemented shared memory for Wasmer in preparation for multithreading
Fixed linter

Fixed clippy

Cleaned up some merge leftover
2022-11-22 14:11:32 +01:00