Commit Graph

6452 Commits

Author SHA1 Message Date
Jakub Konka
b1764e18eb Add appveyor for automated Win testing 2019-05-24 11:02:03 -07:00
Jakub Konka
9ae766db2f Add convenience batch script for Win 2019-05-24 11:02:03 -07:00
Jakub Konka
c3ff3cf075 Add template for Windows impl 2019-05-24 11:02:03 -07:00
Jakub Konka
7605584691 Move *nix specific implementation to separate module 2019-05-24 11:02:03 -07:00
Jef
dc3a4d7f4a Fix register cycles, fix a minor issue in pushing 2019-05-24 13:21:52 +02:00
Benjamin Bouvier
6935033c9e [meta] Have bind() be a method of {Bound,}Instruction instead of a static method; 2019-05-23 14:31:00 +02:00
Benjamin Bouvier
724d1cd2a1 [meta] Rename ApplyTarget to InstSpec; 2019-05-23 14:31:00 +02:00
Benjamin Bouvier
a46b2d7173 [meta] Move ApplyTarget/bind to cdsl/inst; 2019-05-23 14:31:00 +02:00
Van der Auwermeulen Grégoire
60807c5e54 Update README.md 2019-05-22 22:42:31 +02:00
Jef
8578a1b07f Merge pull request #23 from afinch7/ctz_clz_fix
Fix for ctz and clz
2019-05-22 18:54:31 +02:00
afinch7
9b6abc1497 fmt 2019-05-22 09:47:04 -04:00
Benjamin Bouvier
cbbb7a220e [meta] Move x86 registers generation to their own file; 2019-05-22 10:55:02 +02:00
Benjamin Bouvier
92109f664c [meta] Move x86 settings generation to their own file; 2019-05-22 10:55:02 +02:00
afinch7
48b7f8e443 detect lzcnt/tzcnt support and use if available 2019-05-21 10:50:40 -04:00
Van der Auwermeulen Grégoire
658b5aabcc Update WASI-tutorial.md 2019-05-21 06:45:28 -07:00
Nicolas B. Pierron
72b5487563 Add x86 encoding for rotr_imm and rotl_imm. 2019-05-20 11:56:56 +02:00
Benjamin Bouvier
97ebaa6f37 Add Rust implementation and address review comments of #742; 2019-05-20 11:52:43 +02:00
bjorn3
71a345e813 Legalize fcvt_from_u/sint.f32/f64.i8/i16 2019-05-20 11:52:43 +02:00
Dan Gohman
3372e47e5a Fix fd_fdstat_set_rights to set the rights.
After checking that no new rights are being added, actually set the
rights, which may be a subset of the original rights.
2019-05-20 10:22:07 +02:00
Dan Gohman
c5bda1f4e1 Fix symlink resolution on Linux and FreeBSD.
Linux's open returns ENOTDIR when used with O_DIRECTORY|O_NOFOLLOW and
the path is a symlink. Update the code to expect this.

FreeBSD's open returns EMLINK instead of ELOOP when using O_NOFOLLOW on
symlink. Update the code to expect this.
2019-05-20 10:22:07 +02:00
Dan Gohman
9823bf6196 Change path_open to not create files with execute privleges.
WASI currently lacks the ability to specify the full UNIX access control
information when creating files and directories, so for now just avoid
creating executable files and rely on the umask.
2019-05-20 10:22:07 +02:00
Dan Gohman
32da43f600 Handle set-size rights correctly when truncating a file.
If a path_open call is requesting __WASI_RIGHT_FD_FILESTAT_SET_SIZE,
interpret that as a request for write privleges. If it is requesting
O_TRUNC, require __WASI_RIGHT_PATH_FILESTAT_SET_SIZE, since this is
a path operation rather than a FD operation.
2019-05-20 10:22:07 +02:00
Dan Gohman
d20d787bb7 Don't grant __WASI_RIGHT_FD_FILESTAT_SET_SIZE for directories.
RIGHTS_DIRECTORY_BASE should not include
__WASI_RIGHT_FD_FILESTAT_SET_SIZE, because that would imply the ability
to set the size of a directory.
2019-05-20 10:22:07 +02:00
Dan Gohman
6b2eee21b9 Update the description of Cargo.toml. 2019-05-18 21:01:14 -07:00
Dan Gohman
eb2b51353e Rename the top-level crate from wasmtime-tools to wasmtime.
This is a binary application crate which contains the wasmtime
command-line application.
2019-05-18 20:25:08 -07:00
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