Commit Graph

10927 Commits

Author SHA1 Message Date
Jakub Konka
f95af95d87 Update README 2019-05-18 15:43:58 -07:00
Jakub Konka
14ba585edf Reorganise hostcalls into submodules 2019-05-18 15:43:58 -07:00
Jakub Konka
b9871648b2 Import all changes from lucet-wasi 2019-05-18 15:43:58 -07:00
Dan Gohman
106c8c4cb6 Remove the polyfill from the master branch.
The polyfill now lives on the polyfill branch. Add a README.md file
pointing to the new location.
2019-05-18 15:40:30 -07:00
Will Scott
1320b111eb fix guest iovs pointer mapping 2019-05-18 15:31:14 -07:00
Julian Seward
91ec44acbf Add extensive test cases for integer division-by-constant magic number generation.
This adds test cases to ensure, to a reasonably high degree of certainty, that
the magic-number generators `magic_u32`, `magic_s32`, `magic_u64` and
`magic_s64` work correctly.  This is done by iterating through a large number
of `(n, d)` pairs, generating the magic numbers for `d`, interpreting the
magic numbers so as to perform the division, and comparing against the result
produced directly by the hardware.  The distribution of numbers is arranged so
that particular emphasis is given to corner cases -- the range ends and
midpoints -- but also so that there is at least some cover for values away
from those areas.  In total 50,148,000 tests are performed.
2019-05-17 12:33:07 +02:00
Jakub Konka
bbdaf7b686 Re-enable cargo cache in travis ci 2019-05-16 06:10:23 -07:00
Jakub Konka
5ff4f57f97 Disable cargo cache in travis ci temporarily 2019-05-15 13:57:06 -07:00
Jakub Konka
5aa598520c Rename C prefix from __wasi to wasi_common_ 2019-05-15 13:57:06 -07:00
Jakub Konka
52eda1498a Correctly unpack &mut [T] into *mut T and usize 2019-05-15 13:57:06 -07:00
Jakub Konka
006198eb92 Generate C bindings for all hostcalls 2019-05-15 13:57:06 -07:00
Jakub Konka
9ad16cc702 Add sanity tests 2019-05-15 13:57:06 -07:00
Jakub Konka
7f3c325cdf Dereference pointers and call the hostcall fn 2019-05-15 13:57:06 -07:00
Jakub Konka
4a5910b4a3 Capture correct return type 2019-05-15 13:57:06 -07:00
Jakub Konka
7791166859 Generate C fn name prefixed with __wasi_ 2019-05-15 13:57:06 -07:00
Jakub Konka
e552b19dfe Add placeholder for cbindgen proc_macro_attribute 2019-05-15 13:57:06 -07:00
Dan Gohman
67edb00f29 Use getrandom rather than getentropy on Linux for random_get.
getentropy is limited to 256 bytes, so switch to getrandom.
2019-05-15 11:44:45 -07:00
afinch7
2563dc53a1 fixed registry leak and literal casts 2019-05-15 08:20:23 -04:00
afinch7
6e9cff13a2 revert .gitignore changes 2019-05-15 08:01:43 -04:00
bjorn3
c27b0a0c3e Add note about needing to call func.dfg.collect_debug_info for set_val_label to have any effect 2019-05-15 09:26:16 +02:00
bjorn3
edd2bf12fd Export ValueLocRange and DisplayFunctionAnnotations::default() 2019-05-15 09:18:45 +02:00
Dan Gohman
eb1cf8b0a1 Make users of dec_slice_of safe.
Make `dec_slice_of` return a slice rather than a pointer-length pair,
freeing its users from having to call the unsafe `slice::from_raw_parts`.

This requires splitting `dec_slice_of` and `dec_ptr` into mut and
non-mut versions, and reorganizing poll_oneoff a little to avoid
borrow-checker errors -- decoded slices do alias the main memory, so
make sure functions only need one or the other.
2019-05-14 16:14:22 -07:00
Yury Delendik
6740704b74 Expose Module reference from InstanceHandle 2019-05-14 15:02:06 -07:00
afinch7
a5fa03abb2 fix for ctz and clz 2019-05-14 16:14:00 -04:00
Benjamin Bouvier
a0ddbf403c [wasm] Have the WasmError::User member be a String; 2019-05-14 18:34:16 +02:00
Jakub Konka
8a68375f89 Move TODO about proc_exit from wasmtime 2019-05-14 06:17:35 -07:00
Dan Gohman
2b5be77fa5 "wasm32-unknown-wasi" is now "wasm32-wasi". 2019-05-13 21:40:56 -07:00
Jakub Konka
8b09f321ac Make memory fns safe wherever possible 2019-05-13 14:27:56 -07:00
Dan Gohman
251504e8a7 Merge pull request #11 from CraneStation/docs
Clean up docs; specify minimum Rust version
2019-05-13 13:28:40 -07:00
Jef
680473c50c Fix param names 2019-05-13 15:23:33 +02:00
Alan Foster
1c0efd03b3 Add example of compiling wat and running with wasmtime 2019-05-12 15:12:54 +02:00
Jakub Konka
66559e5702 Cleanup docs; specify minimum Rust version 2019-05-12 11:49:09 +02:00
Dan Gohman
a200b2133e Merge pull request #10 from CraneStation/api
Add experimental struct with views into memory and ctx
2019-05-11 08:31:59 -07:00
Jakub Konka
75ad92b0f3 Insulate API from intricacies of memory mgmt of calling runtimes 2019-05-11 16:50:52 +02:00
Zhuowei Zhang
ca8c8b3370 js-polyfill: support Safari, which doesn't have instantiateStreaming 2019-05-10 14:24:59 -07:00
Jakub Konka
751a1a1f7b Add experimental struct with views memory and ctxs
This struct is heavily taking from Lucet's Vmctx struct.
2019-05-10 22:23:35 +02:00
Jakub Konka
328b8f3d91 Merge pull request #8 from afinch7/gitignore
add .gitignore
2019-05-10 07:39:15 +02:00
Jakub Konka
6b3b3d818b Merge branch 'master' into gitignore 2019-05-10 07:34:59 +02:00
andy finch
1a478e8eff remove rustfmt file from .gitignore 2019-05-09 18:59:58 -04:00
andy finch
3001a8b078 updated .gitignore to be compatible with cargo defaults 2019-05-09 14:24:27 -04:00
Dan Gohman
15ad680e58 Merge pull request #9 from CraneStation/code-conduct
Add contributing guide and code of conduct
2019-05-09 10:15:10 -07:00
Jakub Konka
696525cf58 Add contributing guide and code of conduct 2019-05-09 19:02:32 +02:00
afinch7
2c681f3130 add .gitignore 2019-05-09 12:35:39 -04:00
Yury Delendik
8f95c51730 Reconstruct locations of the original source variable 2019-05-09 00:35:44 -07:00
Dan Gohman
574b885656 Merge pull request #7 from CraneStation/missing-hostcalls
Add stubs for unimplemented hostcalls
2019-05-09 00:34:02 -07:00
Jakub Konka
8090f8791f Add stubs for unimplemented hostcalls 2019-05-08 08:04:16 +02:00
Dan Gohman
c6db9f3dff Merge pull request #6 from kubkon/dev-ops
Set up CI, add format and test scripts.
2019-05-07 22:44:39 -07:00
Jakub Konka
19a4f00752 Set up CI, add format and test scripts.
Remove unused Cargo dependencies.
2019-05-08 07:39:54 +02:00
Jef
b67514bd11 Merge pull request #20 from tiborvass/fix-brif-typo
microwasm: fix comment typo for BrIf
2019-05-08 07:29:36 +02:00
Jakub Konka
072b2e8697 Update .rustfmt.toml 2019-05-07 13:56:04 -07:00