Commit Graph

2449 Commits

Author SHA1 Message Date
f63c706abc Merge branch 'master' into feature/singlepass-atomicops 2019-10-02 16:46:59 -07:00
ab76c2357f Delete dead (commented out) code. NFC. 2019-10-02 16:31:11 -07:00
8e63d54fdb cargo fmt 2019-10-02 16:31:11 -07:00
83b678bc36 Give this function a better name. 2019-10-02 16:31:11 -07:00
11c5e0d71d Make the panics a bit more descriptive. 2019-10-02 16:31:11 -07:00
ba68cfc2c6 Finish atomic operations for singlepass, excluding wait and notify. 2019-10-02 16:31:11 -07:00
bc7e017188 Add atomic.rmw operations, excluding xchg and cmpxchg.
Sizes are now ordered, to facilitate an assertion that one size is less (smaller) than another.

panic! error messages are provided for remaining emitter functions.
2019-10-02 16:31:11 -07:00
f021d59a0b Refactor out a compare-and-swap loop function. 2019-10-02 16:31:11 -07:00
cd1d06f5a5 Initial working implementation of I32AtomicRmwAnd!
Adds the ability to reserve a specific temp-gpr register. Needed for CMPXCHG which always uses RAX.
2019-10-02 16:31:11 -07:00
6937019b65 Use a compare-and-swap loop for AND.
BUG: This might allocate RAX twice.
2019-10-02 16:31:10 -07:00
81895830f0 Add emitter for LOCK CMPXCHG so that we can emit compare-and-swap loops. 2019-10-02 16:31:10 -07:00
efc89e829d Add i32 rmw add and sub. 2019-10-02 16:31:10 -07:00
98f35ef84a Initial implementation of atomic load/store and i32 atomic rmw add. 2019-10-02 16:31:10 -07:00
c77cbc1f40 Prepare for 0.8.0 release 2019-10-02 15:40:35 -07:00
38078173d3 Merge #850
850: Add builder API for WasiState r=MarkMcCaskey a=MarkMcCaskey

Nicer to use and it checks for errors!

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-10-02 20:17:29 +00:00
afbde49d1f Update stub wasi generate import object fn
Fix typo

Fix debug issue
2019-10-02 13:16:47 -07:00
b45b1c12f1 Add WASI support to runtime-c-api 2019-10-02 12:06:17 -07:00
5185f120f4 Update some from feedback, fix tests
format with 1.37
2019-10-02 11:25:55 -07:00
0d997c332f Fix example in runtime readme 2019-10-01 13:45:44 -07:00
75286b580b Merge branch 'master' into feature/builder-api-for-wasi-state 2019-10-01 09:32:25 -07:00
9be72e6808 Fix some other files too 2019-09-30 22:50:04 -07:00
4660bc6652 Update API to be more cleann 2019-09-30 17:52:53 -07:00
38602b257b Move validation to end of Builder 2019-09-30 16:32:18 -07:00
2e860e589a Add builder API for WasiState 2019-09-30 15:26:04 -07:00
b304317682 More mov variants. 2019-09-30 01:01:15 +08:00
dfb8989280 Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-29 12:52:26 +08:00
89d8b5a41c Fixes for aarch64. 2019-09-28 17:31:10 +08:00
871310a851 Improve docs from feedback 2019-09-27 10:15:40 -07:00
dc1744560c Add lots of rustdocs and clean up one line of code 2019-09-26 17:17:50 -07:00
008a1d7369 Update to published cranelift fork version 0.44.0 2019-09-26 08:43:12 -05:00
c69cdeca9b Update cranelift backend to fork version 0.44.0 2019-09-25 23:37:39 -05:00
4266926e90 Add ImportObject maybe_with_namespace example 2019-09-25 12:37:27 -07:00
fdc486c53d Merge branch 'master' into feature/runtime-abi-delete 2019-09-25 10:21:20 -07:00
b45a228e84 Merge branch 'master' into ventuzelo/fix-800-index-oob-backing 2019-09-25 09:30:33 +02:00
fec90b570b Delete unused runtime-abi 2019-09-24 22:10:03 -07:00
392a61ff12 Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-24 13:58:27 -07:00
7bf306eb27 Use flat-square style in downloads button 2019-09-24 13:42:17 -07:00
621ef56ab6 lmproved READMEs to use Azure Pipelines badges and better lgo 2019-09-24 13:36:31 -07:00
588a77d2af Merge branch 'master' into feature/merge-cranelift-0-43-1 2019-09-24 11:41:14 -07:00
b6d55b0b85 Update to published fork version 2019-09-24 13:30:52 -05:00
d7562c17ef Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-24 10:57:57 -07:00
be181f9119 Correct this test and simplify. 2019-09-24 10:54:23 -07:00
ac321846e3 Merge branch 'master' into ventuzelo/fix-653-panic-memorydescriptor 2019-09-24 09:10:45 +02:00
79ff3709cc fix cargo check fail build 2019-09-24 09:08:55 +02:00
07b5991080 No need to emit add of constant zero. 2019-09-23 15:01:19 -07:00
8c5ccdb497 Merge #807
807: Implement Send for Instance r=MarkMcCaskey a=MarkMcCaskey

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file

Resolves #748 

WIP

## List of changes
### Commit 1
- `Global`s use Arc instead of RC
- Export `Context` and `FuncPointer` manually implement Send
- `ImportObject` uses `Arc<Mutex<HashMap<...>>>` Instead of `Rc<RefCell<HashMap<...>>>`; removed `get_namespace` method in favor of continuation style to deal with locking the Mutex
- `Func` manually implements `Send` (TODO: this change needs to be checked in depth)
### Commit 2
- `unsafe impl Send for Export {}` (temporary to allow Memory to be not Send)
- RefCell -> Mutex in Global and Table
- Rc -> Arc in Table
- Namespace's `IsExport`s must be `Send` (Done to avoid touching much more of the code (i.e. `trait IsExport: Send` requires a lot -- maybe this is what we should do though)
- Make `Host` and `Wasm` `Func`s Send (manual implementation)
- Manual implementation for `LocalTable` and `AnyFunc`
### Commit 3
- rm placeholder `unsafe impl Send for Export {}`
- Manual implementation for `LocalBacking` and `ImportBacking` (both seemed to be not Send due to direct ownership of mutable pointers in their containers)
- ImportObject's state creator Fn trait object is now ` + Send + Sync + 'static` (required because it's in an Arc)
- Manually implement Send for `InstanceInner` because it holds a raw pointer, `LocalBacking` and `ImportBacking` are marked Send separately 
- Memory: All Rc -> Arc (including unshared memory); All RefCell -> Mutex (including unshared memory)
- Manual implementation of Send and Sync on `UnsharedMemoryInternal`
- Manual implementation of Send and Sync on `SharedMemoryInternal`
- Change `runtime-core::unix::memory::Memory.fd` from `Option<Rc<Rawfd>>` to `Option<Arc<Rawfd>>` (not strictly required for this change because Memory has manual implementations of Send and Sync, but Arc seems more correct here and there's no comment justifying the use of Rc)
- Manual implementation of Send for `ImportedFunc`

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-09-23 21:20:01 +00:00
9cab6d721f Merge branch 'feature/make-instance-send' of github.com:wasmerio/wasmer into feature/make-instance-send 2019-09-23 13:43:48 -07:00
c4818f12dc Update spectests to work with new Instance; use Arc<Mutex<>> 2019-09-23 13:43:01 -07:00
eed033021b Merge pull request #825 from Hywan/doc-runtime-core-memory-view
doc(runtime-core) Replace `map(|cell| cell.get())` by `map(Cell::get)`.
2019-09-23 11:34:00 -07:00
705287c317 Merge branch 'master' into feature/make-instance-send 2019-09-23 11:06:00 -07:00