Commit Graph

1375 Commits

Author SHA1 Message Date
Dan Gohman
002a61c32b Fix a missing close paren. 2019-03-27 11:33:04 -07:00
Dan Gohman
d8242bc612 Add a blurb explaining the capability mapping support in WASI libc. 2019-03-27 11:29:19 -07:00
bjorn3
3ae7c60b13 Update src/wasmtime.rs
Fix spelling error.

Co-Authored-By: sunfishcode <sunfish@mozilla.com>
2019-03-27 10:58:43 -07:00
Dan Gohman
a4515a01e3 Add a proposed CG subgroup charter document. 2019-03-27 10:58:43 -07:00
Matthias Prechtl
3cb76f15da Update README.md
Fix a missing comma.

Co-Authored-By: sunfishcode <sunfish@mozilla.com>
2019-03-27 10:58:43 -07:00
Dan Gohman
b2fefe7714 WASI prototype design, implementation, and documentation.
This adds documents describing the WASI Core API, and an implementation in
Wasmtime.
2019-03-27 10:58:43 -07:00
Dan Gohman
b0243b212f Update the minimum Rust version to 1.32. 2019-03-27 02:25:13 -07:00
Yury Delendik
2353be95e6 update cranelift deps to 0.30.0 2019-03-27 02:24:51 -07:00
Yury Delendik
94ca967d0a Update faerie to 0.9.1 2019-03-27 02:24:51 -07:00
Dan Gohman
db0abe8431 Move the wasmtime crate directories form lib/* to wasmtime-*.
This follows a similar change to Cranelift made here:

https://github.com/CraneStation/cranelift/pull/660
2019-03-20 11:30:28 -07:00
Yury Delendik
7b9761f4a2 Update cranelift dependencies to 0.29.0 (#59) 2019-03-06 18:55:24 -08:00
Yury Delendik
ddbc00752e Generate debug info for LLDB/GDB (#50)
* Transform DWARF sections into native format for wasm2obj and wasmtime.

Generate DWARF sections based on WASM DWARF.
Ignore some of debug_info/debug_line for dead code.

* Fix test
2019-03-06 16:03:32 -08:00
Max McDonnell
6eb09d9edd Parallelize the compilation loop with Rayon (#58) 2019-03-04 17:27:57 -08:00
Dan Gohman
04d4b20df4 Fix clippy.toml paths and a few clippy lints. 2019-03-01 15:49:29 -08:00
Dan Gohman
e2f79ae405 Do more Vec reserving. 2019-03-01 14:27:40 -08:00
Dan Gohman
538ef20f50 Use with_capacity to minimize reallocation. 2019-03-01 14:27:40 -08:00
Dan Gohman
cd21efd88a Tidy up an unnecessary lambda. 2019-03-01 14:27:40 -08:00
Dan Gohman
e5f7da2e22 Tidy up redundant conversions. 2019-03-01 14:27:40 -08:00
Dan Gohman
fb7c1b7795 Self struct constructors are unstable. 2019-02-26 08:54:36 -08:00
Dan Gohman
3827bc7a04 Avoid struct name repetitions. 2019-02-26 08:54:36 -08:00
Dan Gohman
601057ec42 Tidy up a redundant field name. 2019-02-26 08:54:36 -08:00
Dan Gohman
d7dc36e752 Reorder the fields of Export::Function for consistency. 2019-02-26 08:54:36 -08:00
Dan Gohman
cadead6a86 Use code quotes around VMContext in comments. 2019-02-26 08:54:36 -08:00
Dan Gohman
3cc113482d Rename InstanceContents to Instance. 2019-02-26 08:54:36 -08:00
Dan Gohman
5f201f6d73 Rename Instance to InstanceHandle. 2019-02-26 08:54:36 -08:00
Dan Gohman
21abecb158 Remove an unneeded mut. 2019-02-26 08:54:36 -08:00
Dan Gohman
077ee717a8 Make Instance a refcounting handle around InstanceContents. 2019-02-26 08:54:36 -08:00
Dan Gohman
a8cd5ef613 Refactor Instance's methods to just be wrappers around InstanceContents methods. 2019-02-26 08:54:36 -08:00
Dan Gohman
1ab9e17517 Move Instance's module field into InstanceContents. 2019-02-26 08:54:36 -08:00
Dan Gohman
c91ca1b10c Reorganize ModuleEnvironment's contents to more closely reflect cranelift-wasm. 2019-02-21 20:41:36 -08:00
Dan Gohman
78f89f67a3 Update to Cranelift 0.28.0.
Also region 2.0.0 and bindgen 0.47.1.
2019-02-21 20:35:45 -08:00
Dan Gohman
2ac0ceda14 Update to faerie 0.7.1. 2019-02-21 20:28:15 -08:00
Dan Gohman
c7d0eb22d1 Update to wasmparser 0.29.2 and the latest spec_testsuite. 2019-02-21 20:25:00 -08:00
Dan Gohman
a94d3587e6 Add vmctx parameters to the spectest implementation functions.
This fixes a mismatch with the change to pass the VMContext parameter
as the first argument.
2019-02-06 06:12:53 -08:00
Dan Gohman
602e81a895 Minor code reorganization. 2019-02-01 18:20:59 -08:00
Dan Gohman
ddb8453b0d Move wasmtime's instantiation test into a separate file. 2019-02-01 18:20:59 -08:00
Dan Gohman
72ee874986 Factor out a function for reading a wasm file. 2019-02-01 18:20:59 -08:00
Dan Gohman
8b140cc748 Create a Context class to group together various state objects. 2019-02-01 18:20:59 -08:00
Dan Gohman
4675948c2a Switch to passing the vmctx hidden argument at the beginning.
This switches to passing the vmctx hidden argument at the beginning of
the argument list, rather than the end.
2019-02-01 18:20:28 -08:00
Yury Delendik
e66f01b923 Update cranelift libraries to 0.28.0 2019-01-29 16:45:41 -08:00
Joel Martin
fdcb2184a8 Support 32-bit build. (#44)
* Support 32-bit build.

Signatures/functions/imports/exports etc are defined as varuint32 in
the WebAssembly specification so use u32 rather than u64.

Decrease the static memory constants for 32-bit addressing mode so
that they fit within 32-bit memory constraints.

Conditionalize cmake compile of SignalHandlers.cpp so that -m32 is
passed when building 32-bit.

Add a no-op match for Reloc::X86CallPCRel4 during linking. This is
probably the wrong thing, but it allows the tests to pass. Using the
same logic from the Reloc::X86PCRel4 case did not work.
2019-01-24 13:40:25 -08:00
Dan Gohman
00a4e93bcd Add a concept of "global exports".
This adds a feature which allows one to look up an export by name
without knowing what module it's in -- `lookup_global_export` on an
`InstanceContents`.

The main expected use for this is to support APIs where module A
imports a function from module B, and module B needs to access module
A's memory. B can't import it from A in the normal way, because that
would create a dependency cycle. So for now, allow B to look up A's
exported memory dynamically with `lookup_global_export`.

In the future, with reference types and possibly host bindings, we'll be
able to pass references to memory as arguments, which will obviate the
need for this mechanism.
2019-01-22 16:32:07 -08:00
Dan Gohman
dae04be948 Switch from hashmap_core to hashbrown.
As suggested
[here](https://github.com/Amanieu/hashmap_core/pull/10#issuecomment-455866083).

This also allows us to re-enable the basic compile fuzz target.
2019-01-22 13:41:04 -08:00
Dan Gohman
8769febdbd Formest with latest stable rustfmt. 2019-01-20 10:42:50 -08:00
buckle2000
01ed463c7a Change SignalHandlers.h to SignalHandlers.hpp 2019-01-14 21:30:25 -08:00
Dan Gohman
9fe08c9341 Tidy up pointer casting to avoid casts that change mutability. 2019-01-08 10:31:58 -08:00
Dan Gohman
0a2b0ee9b0 Mmap API tidying.
Establish more clear expectations for who is expected to page-align what
and when.
2019-01-06 10:08:40 -08:00
Dan Gohman
0826e32c9a Tidy up unnecessary return statements. 2019-01-05 16:23:04 -08:00
Dan Gohman
3143e22566 Move the creation of linear-memory guard pages into the mmap module.
Create linear-memory pages as PROT_NONE and then make them accessible on
demand.
2019-01-05 16:23:04 -08:00
Dan Gohman
3ac4269dc5 Add host_state() accessors to InstanceContents and VMContext too. 2019-01-04 17:24:14 -08:00