Commit Graph

70 Commits

Author SHA1 Message Date
3653a448f5 Clean up code, add documentation, implement pieces properly 2020-02-18 16:51:02 -08:00
e34e0bb897 Clean up, everything works 2020-02-12 17:09:30 -08:00
0564000da3 Add wip debugging code 2020-02-11 09:52:21 -08:00
0a02f3bb97 Clean up misc. bits of runtime-core 2020-01-24 15:31:52 -08:00
1a960a01ae Improved lint 2019-12-20 20:45:10 -08:00
c4d70a6b75 Use Arc instead of Rc 2019-12-20 20:37:47 -08:00
294cc28135 Move inline breakpoint outside of runtime backend
There was some code smell leaking inline breakpoint implementation into the runtime core backend instead of the compiler itself
2019-12-20 18:26:56 -08:00
95706160ee Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 00:55:40 +01:00
aad390d09d Deny missing docs in runtime core and add missing docs 2019-11-10 13:13:18 -06:00
ba87af5b1a feat(runtime-core) Ability for an export function to get a func env. 2019-11-07 20:44:17 +01:00
2e05104d45 fix(runtime-core) Introduce Context::ExternalWithEnv.
Host functions use `Context::External` with a `*mut vm::FuncCtx`
pointer, casted to `*mut vm::Ctx`. It creates a conflict with exports
that also use `Context::External`.

This patch introduces `Context::ExternalWithEnv` to create a specific
path in the code for an external context with `*mut vm::FuncEnv`.

This patch fixes all the `linking.wast` tests in the spectests.
2019-11-07 14:32:19 +01:00
e002c377ef feat(runtime-core) vm::ImportedFunc and vm::FuncCtx have NonNull pointers. 2019-11-06 14:48:46 +01:00
177c507a4e feat(runtime-core) Introduce vm::FuncCtx.
`vm::FuncCtx` replaces `vm::Ctx` as first argument passed to host
functions (aka imported functions).
2019-11-06 14:48:46 +01:00
c4818f12dc Update spectests to work with new Instance; use Arc<Mutex<>> 2019-09-23 13:43:01 -07:00
1e637badc4 Merge remote-tracking branch 'origin/master' into feature/make-instance-send 2019-09-23 11:05:00 -07:00
05ad1aaea4 Add test for Instance, fix tests for ImportObject 2019-09-23 11:04:31 -07:00
5741a2cf70 Implement function lookups using the table 2019-09-18 16:06:46 -07:00
9c205e05a2 Add comments explaining the unsafe impls and simplify the code, too 2019-09-17 18:35:12 -07:00
83c3909b00 Implement it for memory and make Instance Send 2019-09-17 14:58:26 -07:00
b35a522d28 Add method to call function at index on Ctx 2019-09-16 15:01:18 -07:00
228d562a3b Re-use registered module instances in spectests 2019-08-10 15:56:25 -06:00
5d9aa1f986 Return link error instead of assertion failure for bad data initialization 2019-08-07 15:40:42 -06:00
f6240721ea Merge branch 'master' into simd 2019-07-24 14:08:24 -07:00
3c952f307e fix Drop of uninit Ctx; use MaybeUninit 2019-07-24 11:29:16 -07:00
18307bb79c Improve panic/unreachable/unimplemented usage. Refactor a little. 2019-07-22 12:15:56 -07:00
3e009c5971 Reformat. 2019-07-18 13:40:24 -07:00
3be6a024aa Fix bugs in V128 support based on results from testing against simd spec test.
These is one test failure remaining with V128 global variables.

* Fix trunc_sat. We need both the largest float that can be converted to an int
  and the largest int, they are not the same number.
* Implement calling of functions that take V128 by passing in two i64's.
* Improve support for V128 in spectests. Parse binary modules with the same
  features as the outer spectest. Fix compilation error involving Result in
  emitted .rs file. Handle V128 in more cases when producing .rs file. Parse
  the wast script with SIMD enabled.
* Adjust the WAVM spectest so that it parses with WABT and mostly passes with
  wasmer. Wabt is particular about ints not having decimal places and floats
  having decimal places. Wasmer does not support mutable globals or shared
  memory. Tests of shuffles are disabled. Some assert_invalid tests that wabt
  won't even parse are disabled.
2019-07-18 12:52:59 -07:00
df5c12cbe1 Add V128 to wasmer runtime. Unimplemented in clif-backend. Other backends don't build. 2019-07-10 13:48:12 -07:00
0867208e0c Implement {get,set}_points_used. 2019-06-05 02:28:19 +08:00
32f9aee6fe Cargo fmt 2019-05-14 16:04:08 +08:00
db9705f00c Merge remote-tracking branch 'origin/master' into feature/remote-code-load 2019-05-14 15:46:15 +08:00
8218e550fc Improved docs and fixed few typos 2019-05-13 11:18:57 -07:00
0bbd6e6970 Fix function offset. 2019-05-07 08:25:46 -07:00
a590d7cd07 Tables 2019-05-04 09:56:52 -07:00
14bfd75ac9 Code loader framework. 2019-05-03 00:23:41 +08:00
389c6a015d Remove unused function memory offset addr 2019-04-24 02:00:07 -05:00
706ddabf61 Hook up error propagation 2019-04-22 15:06:40 -07:00
051d435423 Warnings and unused code cleanup 2019-04-12 10:27:14 -07:00
d8c6f76846 Redesign the interface between the runtime and the backends.
This removes the ProtectedCaller and FuncResolver traits, simplifying call implementations and improving dynamic call throughput.
2019-04-11 18:01:54 -07:00
870faf9838 Merge #341
341: feat(runtime-core) `Instance.exports` takes `&self` instead of `&mut self` r=lachlansneff a=Hywan

There is no reason for `exports` to take a mutable reference. This patch rewrites the `Instance.export` signature a little bit.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-04-10 19:22:12 +00:00
20297d1751 feat(runtime-core) Instance.exports takes &self instead of &mut self.
There is no reason for `exports` to take a mutable reference.
2019-04-10 12:17:16 -07:00
c212ba3619 Add implementations for typed func errors to cranelift and llvm 2019-04-09 15:53:01 -07:00
5e1a67d835 Initial typed func rewrite 2019-04-09 12:48:41 -07:00
7b0992e44f Instance now pulls state from the ImportObject 2019-03-28 11:56:31 -07:00
5e39a7b3d9 rewrite extending imports 2019-03-22 17:11:30 -07:00
7ef2c0dece Fix execute after free issue with llvm (and presumably cranelift?) 2019-03-04 14:41:56 -08:00
3717c5720d Get control flow (at least according to the llvm verifier) working.
Next up:
- Importing vm intrinsics.
2019-03-01 15:48:43 -08:00
327e3a4a1a Implement many wasm instructions 2019-02-09 15:53:40 -08:00
aa90a33501 Make module info store FuncSig, not Arc<FuncSig> 2019-02-08 14:19:58 -08:00
1886b3d3c1 Naive short circuiting implementation for user panics and results. (#167)
* Add panic and result catching

* exit process on panic and user runtime error

* Complete initial implementation
2019-02-08 13:08:03 -08:00