Library restructure (#104)

* Move wasmer-runtime to wasmer-runtime-core

* Add the runtime library

* Fix issue with macros using wasmer_runtime, fmt

* Make default compiler dependency optional

* Add instantiate and validate functions
This commit is contained in:
Brandon Fish
2019-01-22 13:02:06 -06:00
committed by Lachlan Sneff
parent 62b8e7cc2d
commit 74875ed554
129 changed files with 218 additions and 130 deletions

View File

@ -7,7 +7,7 @@ use crate::call::recovery::call_protected;
use hashbrown::HashSet;
use libffi::high::{arg as libffi_arg, call as libffi_call, CodePtr};
use std::iter;
use wasmer_runtime::{
use wasmer_runtime_core::{
backend::{ProtectedCaller, Token},
error::RuntimeResult,
export::Context,

View File

@ -12,7 +12,7 @@ use nix::sys::signal::{Signal, SIGBUS, SIGFPE, SIGILL, SIGSEGV};
use std::cell::{Cell, UnsafeCell};
use std::ptr;
use std::sync::Once;
use wasmer_runtime::{
use wasmer_runtime_core::{
error::{RuntimeError, RuntimeResult},
structures::TypedIndex,
types::{MemoryIndex, TableIndex},

View File

@ -16,7 +16,7 @@ use cranelift_wasm::{
use hashbrown::HashMap;
use std::mem;
use target_lexicon;
use wasmer_runtime::{
use wasmer_runtime_core::{
backend::SigRegistry,
memory::LinearMemory,
module::{

View File

@ -5,7 +5,7 @@ use cranelift_codegen::{
isa,
};
use cranelift_wasm::{self, FuncEnvironment, ModuleEnvironment};
use wasmer_runtime::{
use wasmer_runtime_core::{
memory::LinearMemory,
structures::TypedIndex,
types::{FuncIndex, GlobalIndex, LocalOrImport, MemoryIndex, TableIndex},

View File

@ -12,7 +12,7 @@ use cranelift_codegen::{
settings::{self, Configurable},
};
use target_lexicon::Triple;
use wasmer_runtime::{
use wasmer_runtime_core::{
backend::{Compiler, Token},
error::{CompileError, CompileResult},
module::ModuleInner,

View File

@ -7,7 +7,7 @@ use std::{
ops::{Deref, DerefMut},
ptr::NonNull,
};
use wasmer_runtime::{
use wasmer_runtime_core::{
backend::SigRegistry,
backend::{FuncResolver, ProtectedCaller, Token},
error::{CompileResult, RuntimeResult},

View File

@ -4,7 +4,7 @@ use crate::{
};
use cranelift_codegen::{ir, isa};
use cranelift_wasm::{self, translate_module, FuncTranslator, ModuleEnvironment};
use wasmer_runtime::{
use wasmer_runtime_core::{
error::{CompileError, CompileResult},
module::{DataInitializer, ExportIndex, ImportName, TableInitializer},
structures::{Map, TypedIndex},

View File

@ -6,7 +6,7 @@ use cranelift_codegen::binemit;
pub use cranelift_codegen::binemit::Reloc;
use cranelift_codegen::ir::{self, ExternalName, LibCall, SourceLoc, TrapCode};
use hashbrown::HashMap;
use wasmer_runtime::{structures::TypedIndex, types::LocalFuncIndex};
use wasmer_runtime_core::{structures::TypedIndex, types::LocalFuncIndex};
#[derive(Debug, Clone)]
pub struct Relocation {

View File

@ -7,7 +7,7 @@ use byteorder::{ByteOrder, LittleEndian};
use cranelift_codegen::{ir, isa, Context};
use std::mem;
use std::ptr::{write_unaligned, NonNull};
use wasmer_runtime::{
use wasmer_runtime_core::{
self,
backend::{
self,
@ -206,7 +206,7 @@ impl FuncResolver {
impl backend::FuncResolver for FuncResolver {
fn get(
&self,
_module: &wasmer_runtime::module::ModuleInner,
_module: &wasmer_runtime_core::module::ModuleInner,
index: LocalFuncIndex,
) -> Option<NonNull<vm::Func>> {
self.lookup(index)