Commit Graph

104 Commits

Author SHA1 Message Date
d12759f150 Migrated internal samples to new Context API 2022-07-19 15:31:51 +03:00
267a09ce8e Migrate compiler tests to the new Context API 2022-07-19 15:31:51 +03:00
6c089bbc45 Port JS API to new Context API 2022-07-19 15:31:51 +03:00
168e330260 Renamed get_native_function to get_typed_function, marked former as deprecated. 2022-07-19 15:31:51 +03:00
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
0cd9dfe3e0 Fixed linter warnings/errors 2022-06-15 19:26:57 +03:00
da4e9fe617 Rename NativeFunc to TypedFunction
Closes: #2915
2022-06-08 14:12:51 +03:00
92b7cb01b5 api/js: Replace ImportObject with new type Imports 2022-06-08 14:09:40 +03:00
8aa225a192 api/sys: Replace ImportObject with new type Imports 2022-06-08 14:09:40 +03:00
4924a7c22a Update examples that use RuntimeError::custom to use return a custom
error type directly.
2021-12-20 16:27:24 +01:00
17c0834abf Replace RuntimeError::raise with RuntimeError::custom 2021-12-18 00:34:44 +01:00
3319e0f893 Added support for calling dynamic functions defined on the host 2021-08-10 11:07:32 -07:00
b30284897e feat(api) Merge js-api into api.
This patch takes the entire `wasmer-js` crate and merges it into the
`wasmer` crate.

Inside the `lib/api/src/` directory, there are 2 new directories:

1. a new `sys` directory, which contains the usual `wasmer` crate
   implementation,
2. a new directory `js`, which contains the implementation of
   `wasmer-js`.

The `Cargo.toml` file is still compatible. The `default` feature
fallbacks to `sys-default`, which enables the `sys` feature. All
features related to compilers or engines or anything else prior this
patch, activates the `sys` feature.

Parallel to that, there is a `js-default` and `js` features.

The `Cargo.toml` file is extensively documented to explain what are
dependencies, dev-dependencies, features and other sections related to
`sys` or to `js`.

There is a bug with `wasm_bindgen_test` where it doesn't compile or
look for tests in `tests/*/<test>.rs`. The hack is to name files
`tests/js_<test>.rs`. Ugly, but it works.
2021-07-23 12:10:49 +02:00
9b216cc5e5 Address testing related feedback
Expose inner VM externals as an unsafe method and move logic into the tests
2021-05-28 11:41:57 -07:00
dea2abb4fc Add tests, implement for all externs 2021-05-20 10:38:07 -07:00
97c4a03e67 Recompute Memory::ty, make it return by value
This is a requirement of the updated `imports.wast` spectest
2021-05-05 07:50:35 -07:00
dadc81296a cargo fmt 2021-04-21 16:06:12 -07:00
24bcc9349e cargo fmt 2021-04-21 15:42:47 -07:00
92af25a585 resolve conflict, replace two primary map to hash map 2021-04-20 16:50:05 -07:00
6a2116917f Fix up tests, make WasmerEnv: Send 2020-12-15 13:35:19 -08:00
69f834a9e8 Accept Into<FunctionType> as signatures 2020-12-14 13:08:15 +01:00
7973a965fb Merge branch 'master' into fix-vm-leak 2020-12-01 10:08:21 +01:00
7621991a9a test(api) Test that exports work after the instance has been freed. 2020-11-27 10:25:50 +01:00
de6cb9c4c4 Merge branch 'master' into feature/host-env-prototype 2020-11-20 15:54:35 -08:00
84370c7930 Merge branch 'master' into feature/make-env-immutable 2020-11-18 15:40:11 -08:00
655ac093a2 Fix up helpers generated by WasmerEnv; add unchecked variant 2020-11-17 11:19:42 -08:00
75707106d9 Add test initializing and calling host function manually 2020-11-16 17:04:08 -08:00
5b67b2f3dc Merge branch 'master' into feature/host-env-prototype 2020-10-27 16:24:00 -07:00
962f3be626 Merge #1772
1772: Remove lifetime parameter from `NativeFunc` r=MarkMcCaskey a=MarkMcCaskey

Ran into this as an annoyance on #1739 ; will need to account for this when we fix the memory leak in `InstanceHandle`.

Note: the lifetime wasn't doing anything useful for us, this change doesn't make anything new possible (other than not having to deal with the lifetime parameter)

# Review

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


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-10-27 22:13:57 +00:00
608fbdca2a Remove lifetime parameter from NativeFunc
It wasn't doing anything anyways.
2020-10-27 14:37:24 -07:00
c9181e39c7 Enable these tests now that they pass.
Also fix a syntax error, use assert_eq! instead of assert! to compare two values for equality.

Also in passing, convert a comment about something not being done into a TODO.
2020-10-27 12:25:12 -07:00
a7abee6fb7 Add lazy abstraction, improve macro, use macro internally 2020-10-23 12:50:36 -07:00
d64908dc83 Fix package tests 2020-10-20 18:03:22 -07:00
e7ba7c1154 Fix remaining tests 2020-10-01 17:25:13 -07:00
dbc1b4e477 Add tests for smaller sizes, change logic to truncate parameters 2020-09-10 16:17:17 -07:00
d23cebfbfa Remove use of unsafe, add tests for func param conversion 2020-09-08 14:25:27 -07:00
b06f021612 Improved Function API 2020-07-21 20:02:01 -07:00
80ad395441 Fixed code linting 2020-07-16 12:33:00 -07:00
296f0969f0 Fixed tests 2020-07-16 12:28:42 -07:00
ffc1e28aa2 Remove all nightly dependencies 2020-07-01 15:11:41 -07:00
ef285aae6c Merge pull request #110 from wasmerio/feature/functions-own-their-envs
Change functions to own their `env`s
2020-06-16 13:36:05 -07:00
b00f899913 Update to Cranelift 0.65, wasmparser 0.57 2020-06-15 18:00:48 -07:00
b232b237b5 Fix API tests 2020-06-12 16:56:15 -07:00
5f5c7d6725 Clean up and comment out some NativeFunc tests for now 2020-06-09 12:36:07 -07:00
eb928e739c Implement host functions in 1 case, optimize NativeFunc::call
`NativeFunc::call` is about 8% faster in the case we're benchmarking
by avoiding allocating a vector for the params / returns, instead we
do logic to determine which is larger and use that, conditionally
copying it back to the rets array if needed.
2020-06-09 11:35:58 -07:00
87a28b057e Move NativeFunc test from api to test/compilers 2020-06-08 16:37:33 -07:00
3c76999925 Implement Exportable for &Ts too (for some T) 2020-06-08 16:26:47 -07:00
e70828eb37 Fix up tests and benchmark to use new get 2020-06-08 16:10:05 -07:00
b46ea5b9cb Get NativeFunc passing basic tests 2020-06-08 12:53:00 -07:00
62fb4f79c1 Moved misc test into api test 2020-05-27 11:55:21 -07:00