Add separated runtime crate

This commit is contained in:
Lachlan Sneff
2019-01-08 12:09:47 -05:00
parent 231ed37127
commit 8a73ff71af
18 changed files with 2393 additions and 1 deletions

29
lib/runtime/src/lib.rs Normal file
View File

@ -0,0 +1,29 @@
#[macro_use]
mod macros;
mod backend;
mod backing;
mod instance;
mod memory;
mod module;
mod sig_registry;
mod table;
mod recovery;
mod sighandler;
mod mmap;
pub mod types;
pub mod vm;
pub mod vmcalls;
pub use self::backend::{Compiler, FuncResolver};
pub use self::instance::{Import, ImportResolver, Imports, Instance};
pub use self::module::Module;
pub use self::sig_registry::SigRegistry;
pub use self::memory::LinearMemory;
/// Compile a webassembly module using the provided compiler.
pub fn compile(
wasm: &[u8],
compiler: &dyn Compiler,
) -> Result<Module, String> {
compiler.compile(wasm)
}