Commit Graph

9 Commits

Author SHA1 Message Date
Dan Gohman
e2f79ae405 Do more Vec reserving. 2019-03-01 14:27:40 -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
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
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
f6c2fe7d2d Update to Rust 2018 Edition. 2019-01-03 12:58:11 -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
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