Commit Graph

547 Commits

Author SHA1 Message Date
Ivan Enderlin
0775d496d3 feat(runtime-core) Replace the field-offset crate by a custom offset_of! macro.
The `field-offset` crate is unmaintained. When using its `offset_of!`
macro on a struct with a field of type `std::ptr::NonNull`, in release
mode, it generates a sigill.

This patch removes the `field-offset` crate, and implements a custom
`offset_of!` macro.
2019-11-12 15:12:31 +01:00
Mark McCaskey
69950d9e5f Prepare for 0.10.1 release 2019-11-11 16:22:37 -08:00
Mark McCaskey
0a216c0779 Prepare for 0.10.0 release 2019-11-11 12:13:53 -08:00
Brandon Fish
a74acb7a8a Add missing rustdoc for macro debug 2019-11-10 16:28:33 -06:00
Brandon Fish
ea3b6fa6d7 Add missing rustdocs for Windows code 2019-11-10 16:03:43 -06:00
Brandon Fish
82ec5e970a Add additional rustdocs for missing docs found during CI 2019-11-10 15:16:07 -06:00
Brandon Fish
2d00b2589e Update with PR review suggestions 2019-11-10 14:37:36 -06:00
Brandon Fish
1f9316b5ae Update Protect enum with suggestions 2019-11-10 14:31:36 -06:00
Brandon Fish
328ab0a93b Remove macro identifiers which don't work in rustdoc comments 2019-11-10 13:43:39 -06:00
Brandon Fish
aad390d09d Deny missing docs in runtime core and add missing docs 2019-11-10 13:13:18 -06:00
nlewycky
dc437bb4e7
Fix typo in comment. 2019-11-05 11:31:14 -08:00
Ivan Enderlin
2703d48098 Merge branch 'master' into feat-runtime-core-host-function-without-vmctx 2019-10-31 10:59:16 +01:00
Ivan Enderlin
6a1d490a30 doc(runtimecore) Explain ExternalFunctionKind with more details. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
7eef49be12 test(runtime-core) Test host functions without a vm::Ctx argument. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
95e1b85c56 feat(runtime-core) Allow host functions without an explicit vm::Ctx argument.
This patch allows host functions to get a signature without an
explicit `vm::Ctx` argument.

It is for Rust only. The C API receives a function pointer and has no
clue whether a `vm::Ctx` argument is present or not, so it assumes it
is always declared.

From the backend point of view, the pointer to `vm::Ctx` is always
inserted in the stack, but it is not used by the function when the
argument is absent.
2019-10-30 19:34:04 +01:00
Ivan Enderlin
bd9d4d9cc8 test(runtime-core) Add tests for the Func structure. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
77e01f01bd chore(runtime-core) Use vm::Ctx to access it.
Just to be consistent with the rest of the code.
2019-10-30 19:34:04 +01:00
Ivan Enderlin
edb6cbefca fix(runtime-core) Share the definition of Trampoline across all the backends.
This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).

This patch also formats the `use` statements in the updated files.
2019-10-30 13:10:34 +01:00
Mark McCaskey
82f258b888 Prepare for 0.9.0 release 2019-10-23 13:40:35 -07:00
Mark McCaskey
0fd0ab6e58
Merge branch 'master' into ventuzelo/add-detail-unimplemented-calls-runtime 2019-10-23 12:30:14 -07:00
bors[bot]
77527c23ce
Merge #877
877: Reimplement F32Min, F32Max, F64Min and F64Max. r=nlewycky a=nlewycky

# Description
Reimplement F32Min, F32Max, F64Min and F64Max.

Adds XMM8--15 registers. Adds VMOVA, VBLEND and VXORP, and the VCMPUNORD and VCMPORD comparisons.

Fixes 419 test failures.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-22 17:33:44 +00:00
Nick Lewycky
88dc613385 Save and restore the additional XMM registers in OSR too. 2019-10-21 19:44:16 -07:00
Nick Lewycky
961684a8e0 Adjust comment rulers. 2019-10-18 16:33:49 -07:00
Nick Lewycky
8424b61444 Fix typo in comment. 2019-10-18 16:33:49 -07:00
Nick Lewycky
f99d0360d2 Add registers XMM8--15 to from_dwarf_regnum and invoke_call_return_on_stack. 2019-10-16 10:34:37 -07:00
Ivan Enderlin
81be25d970 feat(runtime-core) Add documentation and make macros more readable.
After a long time, the macros are easy to read, but not at first
glance. I hope this PR will improve the situation: Same syntax used
everywhere, more spaces…
2019-10-16 16:07:50 +02:00
Nick Lewycky
765e1d3b9e Add XMM8--XMM15. These were added in x64. 2019-10-14 13:46:55 -07:00
Nick Lewycky
4d99963640 Replace "be the i32 type" with "be an i32" in error messages. 2019-10-07 12:11:10 -07:00
Patrick Ventuzelo
4b3880c88b add details when calling unimplemented! 2019-10-03 11:26:54 +02:00
Mark McCaskey
c77cbc1f40 Prepare for 0.8.0 release 2019-10-02 15:40:35 -07:00
Mark McCaskey
871310a851 Improve docs from feedback 2019-09-27 10:15:40 -07:00
Mark McCaskey
dc1744560c Add lots of rustdocs and clean up one line of code 2019-09-26 17:17:50 -07:00
Brandon Fish
c69cdeca9b Update cranelift backend to fork version 0.44.0 2019-09-25 23:37:39 -05:00
Mark McCaskey
4266926e90 Add ImportObject maybe_with_namespace example 2019-09-25 12:37:27 -07:00
Patrick Ventuzelo
b45a228e84
Merge branch 'master' into ventuzelo/fix-800-index-oob-backing 2019-09-25 09:30:33 +02:00
Syrus
7bf306eb27 Use flat-square style in downloads button 2019-09-24 13:42:17 -07:00
Syrus
621ef56ab6 lmproved READMEs to use Azure Pipelines badges and better lgo 2019-09-24 13:36:31 -07:00
Syrus Akbary
588a77d2af
Merge branch 'master' into feature/merge-cranelift-0-43-1 2019-09-24 11:41:14 -07:00
Patrick Ventuzelo
ac321846e3
Merge branch 'master' into ventuzelo/fix-653-panic-memorydescriptor 2019-09-24 09:10:45 +02:00
bors[bot]
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
Mark McCaskey
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
Mark McCaskey
c4818f12dc Update spectests to work with new Instance; use Arc<Mutex<>> 2019-09-23 13:43:01 -07:00
Syrus Akbary
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
Mark McCaskey
705287c317
Merge branch 'master' into feature/make-instance-send 2019-09-23 11:06:00 -07:00
Mark McCaskey
1e637badc4 Merge remote-tracking branch 'origin/master' into feature/make-instance-send 2019-09-23 11:05:00 -07:00
Mark McCaskey
05ad1aaea4 Add test for Instance, fix tests for ImportObject 2019-09-23 11:04:31 -07:00
Ivan Enderlin
f289cb2ba9 doc(runtime-core) Replace map(|cell| cell.get()) by map(Cell::get).
Because it's simpler :-p.
2019-09-23 15:15:06 +02:00
Patrick Ventuzelo
5ace7a0af3 fix failing test 2019-09-23 11:17:02 +02:00
Syrus
9942d3ae98 Improved Emscripten / WASI autodetection 2019-09-22 18:23:22 -07:00
Brandon Fish
a1a88c6eb8 Use the default features for wasmparser 2019-09-21 13:59:08 -05:00