Commit Graph

60 Commits

Author SHA1 Message Date
ptitSeb
6cf99a63f6 Removed from_vm_export in favor of from_vm_extern 2022-08-19 12:15:55 +02:00
ptitSeb
f599df0240 Fix linter 2022-08-18 16:58:04 +02:00
John Sharratt's Shared Account
c7c1507b8b Implemented LinearMemory trait 2022-08-18 16:53:37 +02:00
Wolfgang Silbermayr
dcb34971ad Seal HostFunctionKind trait 2022-08-05 14:27:44 +02:00
Wolfgang Silbermayr
9c7b4343ea rustfmt 2022-08-05 14:27:44 +02:00
Wolfgang Silbermayr
89bba319a9 No longer require FunctionEnvMut for new_typed(…) callback function 2022-08-05 14:27:44 +02:00
Wolfgang Silbermayr
6582db9ba4 Add missing doc 2022-08-05 14:27:44 +02:00
Wolfgang Silbermayr
566c897e57 Remove FunctionEnvMut for Function::new(…) 2022-08-05 14:27:44 +02:00
Wolfgang Silbermayr
7df3e3ca23 Rename {native,typed} functions, reintroduce *_with_env variants 2022-08-05 14:27:44 +02:00
John Sharratt's Shared Account
8ff164036d Removed uint8view() from the memory API and redundant FunctionEnv in tests 2022-08-02 11:33:49 +10:00
John Sharratt's Shared Account
5aa356f222 Fixed a memory corruption issue with JS memory operations that were reusing invalid views 2022-07-31 20:31:41 +10:00
Manos Pitsidianakis
a02ff59a0f cli: re-introduce create-exe functionality 2022-07-29 10:40:23 +03:00
Syrus Akbary
abed65f074 Added hashing to the StoreHandle and Funciton env in wasmer-js 2022-07-26 09:54:58 -07:00
Syrus Akbary
43138b569c Rename all mentions from ctx to store
Updated tests and examples

Improved a bit the function types and results
2022-07-20 01:55:04 +03:00
Syrus Akbary
a419ccdf52 Move Webassembly objects to Store and remove Context
Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
Co-authored-by: Manos Pitsidianakis <manos@wasmer.io>
2022-07-19 15:31:51 +03:00
Manos Pitsidianakis
6c089bbc45 Port JS API to new Context API 2022-07-19 15:31:51 +03:00
Manos Pitsidianakis
168e330260 Renamed get_native_function to get_typed_function, marked former as deprecated. 2022-07-19 15:31:51 +03:00
Amanieu d'Antras
738a66f719 Implement the new Context API for the core API
Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
2022-07-19 15:31:51 +03:00
Felix Schütt
220751a035 Remove RuntimeError::raise from public API 2022-07-05 14:12:58 +03:00
Manos Pitsidianakis
a6173f9746 Remove wasmer-{artifact,engine} and merge it into wasmer-compiler and wasmer-vm 2022-06-16 16:57:45 +03:00
ptitSeb
68e98e216d Put back uint8view as hidden public instead of private 2022-06-15 19:26:57 +03:00
ptitSeb
3e9de243a5 Fix lint warnings/errors 2022-06-15 19:26:57 +03:00
Johnathan Sharratt
62de9c5aad Implemented functionality needed for WASIX and Networking within Web Assembly
- Introduced the virtual BUS interface used for RPC between web assembly apps
- Introduced the virtual networking interface used to implement networking
  for web assembly apps
- Implemented a local implementation of the virtual networking
  (available behind the feature toggle 'host-net' on the 'wasi' package)
- Fixed up some of the examples from the wasmer3 branch
- Refactored the WASI implementations so they support wasm64-wasi
- WASIX is behind its own namespaces for both 32bit and 64bit implementations
- Fixed the wasi_pipes unit test which was using internals that are no longer exposed - instead made the pipes clonable
2022-06-15 19:24:40 +03:00
Johnathan Sharratt
7c532813e7 Multiple changes required to implement the wasmer terminal on the browser
- Split functionality out of WasiEnv so that it can support multi-threading
- Added methods to the VFS File Trait that supporting polling
- Implemented basic time functionality for WASI
- Incorported a yield callback for when WASI processes idle
- Improved the error handling on WASI IO calls
- Reduce the verbose logging on some critical WASI calls (write/read)
- Implemented the missing poll functionality for WASI processes
- Moved the syspoll functionality behind a feature flag to default to WASI method
- Refactored the thread sleeping functionality for WASI processes
- Fixed the files system benchmark which was not compiling
- Modified the file system trait so that it is SYNC and thus can handle multiple threads
- Removed the large mutex around filesystem state and implemented granular locks instead
  (this is needed to fix a deadlock scenario on the terminal)
- Split the inodes object apart from the state to fix the deadlock scenario.
- Few minor fixes to some warnings when not using certain features
- Sleeping will now call a callback that can be used by the runtime operator when
  a WASI thread goes to sleep (for instance to do other work)
- Fixed a bug where paths that exist on the real file system are leaking into VFS
- Timing functions now properly return a time precision on WASI
- Some improved macros for error handling within syscalls (wasi_try_ok!)
- Refactored the remove_directory WASI function which was not working properly
- Refactored the unlink WASI function which was not working properly
- Refactored the poll WASI function which was not working properly
- Updates some of the tests to make them compile again
- Rewrote the OutputCapturer so that it does leak into the internals
2022-06-15 12:00:24 +02:00
Wolfgang Silbermayr
5339f7cdae Fix clippy lints
Fixes: #2926
2022-06-09 16:05:53 +02:00
Wolfgang Silbermayr
da4e9fe617 Rename NativeFunc to TypedFunction
Closes: #2915
2022-06-08 14:12:51 +03:00
Manos Pitsidianakis
92b7cb01b5 api/js: Replace ImportObject with new type Imports 2022-06-08 14:09:40 +03:00
Manos Pitsidianakis
8aa225a192 api/sys: Replace ImportObject with new type Imports 2022-06-08 14:09:40 +03:00
Amanieu d'Antras
dd7808b534 Use thiserror for MemoryAccessError 2022-06-08 14:09:40 +03:00
Amanieu d'Antras
d94745c9fc Cache the JS memory view 2022-06-08 14:09:40 +03:00
Amanieu d'Antras
714bac5650 Redesign the API for accessing the contents of a Wasm memory 2022-06-08 14:09:38 +03:00
ptitSeb
63538477f2 Moved is_wasm function from api to types crate 2022-05-03 09:32:34 +02:00
Amanieu d'Antras
3ad9552e2e Update wasmparser to 0.83 2022-04-06 16:23:32 +01:00
Syrus Akbary
a446f4c8ad Merge branch 'master' into katei/improve-js-error-message 2022-03-27 17:54:43 -07:00
Yuta Saito
e09cf07176 Fix JsImportObject resolver 2022-03-27 16:34:40 +00:00
Yuta Saito
7adcfef4e7 Improve error message oriented from JS object
`JsValue.as_string` converts the value to String iff the value is a
String itself, so the error message always failovers to empty string.
`JsValue` impls `Debug` using `JSON.stringify`, and it gives better
description of the error.
2022-03-27 16:33:40 +00:00
OJ Kwon
5de43d557e refactor(wasmer): apply fmt 2022-03-18 14:33:23 -07:00
OJ Kwon
160d4ad008 feat(wasmer/js): preliminary de/serialize support 2022-03-17 13:14:36 -07:00
Amanieu d'Antras
fe025cdd3c Fix potential integer overflows in WasmPtr memory access methods 2022-02-10 15:57:08 +00:00
Amanieu d'Antras
3a67783fd1 Rename RuntimeError::custom to RuntimeError::user 2021-12-20 17:16:31 +01:00
Amanieu d'Antras
4924a7c22a Update examples that use RuntimeError::custom to use return a custom
error type directly.
2021-12-20 16:27:24 +01:00
Amanieu d'Antras
17c0834abf Replace RuntimeError::raise with RuntimeError::custom 2021-12-18 00:34:44 +01:00
Syrus Akbary
dcb2490d91 Added access to the raw Wasm instance 2021-12-14 12:25:52 +01:00
Amanieu d'Antras
7b8d4b1c8e Remove internal Arc from Exports
This is useless and prevents cloned Exports from being modified.
2021-12-09 18:18:12 +00:00
Syrus Akbary
d848a430cf Fixed linting 2021-11-25 13:02:57 +01:00
Syrus Akbary
c6d2a08d0d Improved docs and fixed comments 2021-11-25 10:35:26 +01:00
Syrus Akbary
c0bcef9feb Improved naming 2021-11-25 00:11:44 +01:00
Syrus Akbary
d09553fc1b Merge branch 'master' into js-api-improvement 2021-11-24 23:58:00 +01:00
Syrus Akbary
c0913fa913 Added jsobjectresolver 2021-11-24 23:57:43 +01:00
Amanieu d'Antras
54b4495b3f Fix build 2021-11-22 19:33:02 +00:00