Commit Graph

23 Commits

Author SHA1 Message Date
Dan Gohman
c7d0eb22d1 Update to wasmparser 0.29.2 and the latest spec_testsuite. 2019-02-21 20:25:00 -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
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
73b2c45313 Add a host_state field to Instance.
This allows hosts to embed arbitrary state along with instances.
2019-01-04 17:15:22 -08:00
Dan Gohman
e876f0fb1d Add some Cargo.toml keywords. 2019-01-03 14:25:33 -08:00
Dan Gohman
40acc1f340 Add crate version identifiers. 2019-01-03 14:16:48 -08:00
Dan Gohman
585bdac91e Use vec![0; size] instead of creating an empty Vec and resizing. 2019-01-03 14:16:48 -08:00
Dan Gohman
a41bc1fe1e Fix unused use warnings. 2019-01-03 14:16:48 -08:00
Dan Gohman
ca2fdc5ccb Update no_std support.
This `no_std` support isn't complete though, as some dependencies
don't support it.
2019-01-03 14:16:48 -08:00
Dan Gohman
f6c2fe7d2d Update to Rust 2018 Edition. 2019-01-03 12:58:11 -08:00
Dan Gohman
701b1998e9 Avoid creating slices with null pointers. 2019-01-03 12:05:17 -08:00
Dan Gohman
df7724ce2b Update Cargo.toml authors fields. 2019-01-03 12:04:37 -08:00
Dan Gohman
529de7ca60 Tidy up unneeded '&'s. 2019-01-03 12:03:52 -08:00
Dan Gohman
3270369a69 Restructure VMContext to eliminate a level of indirection. 2019-01-03 12:02:35 -08:00
Dan Gohman
087b5b4dff Implement cross-instance indirect calls. 2019-01-03 11:48:53 -08:00
Dan Gohman
b646f9b4e0 Clarify a comment. 2019-01-03 11:48:43 -08:00
Dan Gohman
7592c99f3b Refactor the compilation and instantiation pipeline.
wasmtime-execute is now wasmtime-jit. Move `JITCode` and the TargetIsa
into a new `Compiler` type. `InstancePlus` is no more, with trampoline
functionality now handled by `Compiler`.
2019-01-03 11:47:55 -08:00