Bo Yao
dadc81296a
cargo fmt
2021-04-21 16:06:12 -07:00
Bo Yao
24bcc9349e
cargo fmt
2021-04-21 15:42:47 -07:00
Nick Lewycky
91d399e8f4
Apply cleanups proposed by clippy.
2021-01-26 16:02:22 -08:00
Mark McCaskey
62d15fae36
Merge branch 'master' into fix/host-func-env-memory-leak
2020-12-15 08:37:18 -08:00
Ivan Enderlin
facd41412a
feat(vm) Rename the instance_allocator fields to instance_ref.
2020-12-14 10:28:38 +01:00
jubianchi
c81ea9e4bb
chore: Remove some warnings
2020-12-10 15:25:56 +01:00
Mark McCaskey
be3c381169
Make NativeFunc Clone
2020-12-09 12:26:53 -08:00
Mark McCaskey
99e035711c
Merge branch 'master' into fix/host-func-env-memory-leak
2020-12-09 11:55:50 -08:00
Mark McCaskey
eb8b486388
Fix use-after free with NativeFunc
2020-12-08 12:13:17 -08:00
Mark McCaskey
6e95c50dc2
Address feedback
2020-12-08 11:02:26 -08:00
Mark McCaskey
4ec8c9e71a
Fix issue with dynamic host env
2020-12-04 17:07:01 -08:00
Mark McCaskey
e43d9d2732
Experimental: clone host envs during construction
2020-12-04 16:04:03 -08:00
Mark McCaskey
1eaea6ecf1
Fix memory leak in host function envs
2020-12-02 16:56:05 -08:00
Ivan Enderlin
7973a965fb
Merge branch 'master' into fix-vm-leak
2020-12-01 10:08:21 +01:00
Mark McCaskey
03410c15a1
Rename EngineExport to Export
2020-11-30 12:32:53 -08:00
Mark McCaskey
9e0cfcebbb
Rename vm::Export to vm::VMExport
2020-11-30 11:38:14 -08:00
Mark McCaskey
8669e92ed4
Move EngineExport to engine
2020-11-25 16:44:21 -08:00
Mark McCaskey
7013163829
WIP attempt to make an Export wrapper type
...
I can't figure out how we can ever use the non-wrapped type though
2020-11-25 10:59:04 -08:00
Ivan Enderlin
e77afea383
big patch: Start injecting InstanceAllocator everywhere.
2020-11-23 17:25:09 +01:00
Mark McCaskey
2690e5e8f6
Merge branch 'master' into feature/host-env-prototype
2020-11-16 15:13:29 -08:00
bors[bot]
a5281eaab8
Merge #1753
...
1753: Use a union for VMContext for functions r=MarkMcCaskey a=MarkMcCaskey
This makes the code more self documenting and correctly uses `unsafe`
to communicate that it's the caller's responsibility to ensure that the
code paths that can lead to the access can only write the value they
expect to be there.
spun off of #1739
- [x] There's still some inconsistent use of `vmctx` and `extra_data` might be good to unify this more.
- [x] Improve docs on the new type
Co-authored-by: Mark McCaskey <mark@wasmer.io >
2020-10-31 00:48:30 +00:00
Mark McCaskey
e3dfcf8b6f
Rename VMFunctionExtraData to VMFunctionEnvironment
2020-10-30 17:31:52 -07:00
Mark McCaskey
be3ab95688
Add error handling to host init logic
2020-10-28 17:39:37 -07:00
Mark McCaskey
8b87526d9d
Create single interface to get exports from Instance.exports
...
This adds a method that takes generic arguments as well so that
NativeFunc<Args, Rets> can also be `got` even though it has generic
parameters
2020-10-28 13:32:27 -07:00
Mark McCaskey
5b67b2f3dc
Merge branch 'master' into feature/host-env-prototype
2020-10-27 16:24:00 -07:00
Mark McCaskey
608fbdca2a
Remove lifetime parameter from NativeFunc
...
It wasn't doing anything anyways.
2020-10-27 14:37:24 -07:00
Mark McCaskey
1b7188769c
Remove VMContext port to union, split into #1753
2020-10-22 12:00:44 -07:00
Mark McCaskey
b124ea2032
Use a union for VMContext for functions
...
This makes the code more self documenting and correctly uses `unsafe`
to communicate that it's the user's responsibility to ensure that the
code paths that can lead to the access can only write the value they
expect to be there.
2020-10-22 11:46:42 -07:00
Mark McCaskey
011ec22d43
Merge branch 'master' into feature/host-env-prototype
2020-10-20 15:46:50 -07:00
Mark McCaskey
ed1202181e
Clean up code a bit
2020-10-20 12:21:16 -07:00
Nick Lewycky
29c9cb1471
Rename trampoline to call_trampoline, part 2.
2020-10-20 11:11:32 -07:00
Mark McCaskey
3c7dfe29f3
Add hacked together vertical slice of host env updating idea
2020-10-19 17:19:46 -07:00
Nick Lewycky
5d147f8236
WIP checkpoint. Code that builds.
...
Use Option<VMTrampoline> which should be ffi-compatible.
Put the register_signature and lookup_signature functions back on the Engine.
2020-10-08 15:09:37 -07:00
Mark McCaskey
5049c543dc
Rename wasm-common crate to wasmer-types
2020-08-13 17:59:26 -07:00
Syrus
a732159514
Use better naming for module functions
2020-07-26 12:02:45 -07:00
Syrus
7bf6b9efc9
Added spec docs to app API public objects
2020-07-15 17:40:35 -07:00
Syrus
6816bb5a4b
Remove unused owned_by_store
2020-07-08 01:00:18 -07:00
Syrus
92f8651312
Renamed wasmer_runtime to wasmer_vm
2020-07-07 21:26:06 -07:00
Ivan Enderlin
3f924dbb45
feat(api,emscritpen,wasi) Update WasmExternType to FromToNativeWasmType.
2020-06-30 12:10:27 +02:00
Ivan Enderlin
2d025c24ea
feat(api) Remove the WasmExternTypeInner trait.
...
I believe this trait is no longer necessary since `WasmExternType` has
been moved inside the `wasmer` crate itself (this crate).
See https://github.com/wasmerio/wasmer-reborn/pull/121 .
`cargo check` and `cargo test` agrees.
Also, this trait is annoying to implement abstraction over
`NativeFunc` since it is not re-exported outside of the crate.
2020-06-25 16:55:36 +02:00
Ivan Enderlin
07aff22c30
feat(api/wasm-common) Move WasmExternType from wasm-common to wasmer.
...
Because there is a trait implementation conflicts for the
implementations `WasmTypeList` for `$x*` where `$x: WasmExternType`.
2020-06-22 11:10:18 +02:00
Ivan Enderlin
5e26d9a74b
!temp Move HostFunction, Func & co. into wasmer.
...
Because `Func` needs an access to the runtime API (`wasmer-runtime`)
to trap properly, either we move parts of `wasmer-runtime` to
`wasm-common`, or we move parts of `wasm-common` into `wasmer`. I
decided to go with the second approach since `wasmer` is the only
crate to use `HostFunction` & co. It's not “common” by definition, and
it's way easier (for the moment).
2020-06-19 15:20:28 +02:00
Syrus
93024cccc8
Last round of feedback
2020-06-15 15:16:23 -07:00
Syrus
0ae7982931
Re-enabled non-optimized function trampolines approach
2020-06-15 14:53:34 -07:00
Syrus
050493e354
Fixed lint issue
2020-06-15 13:58:57 -07:00
Syrus
58cc08e37a
Inline further to optimize native calls
2020-06-15 13:48:07 -07:00
Syrus
24077fb919
Added tests for host functions calls
2020-06-15 13:33:46 -07:00
Syrus
99ed3e889e
Simplified has_env structure
2020-06-15 13:22:20 -07:00
Syrus
fca0d0c9fe
Fixed feedback
2020-06-15 12:59:07 -07:00
Syrus
e5838d8ccb
Added full support for dynamic functions with env
2020-06-13 15:52:42 -07:00