Renamed wasmer_runtime to wasmer_vm

This commit is contained in:
Syrus
2020-07-07 21:26:06 -07:00
parent 69aea929c5
commit 92f8651312
80 changed files with 107 additions and 109 deletions

20
Cargo.lock generated
View File

@ -2073,7 +2073,7 @@ dependencies = [
"wasmer-engine-dummy", "wasmer-engine-dummy",
"wasmer-engine-jit", "wasmer-engine-jit",
"wasmer-engine-native", "wasmer-engine-native",
"wasmer-runtime", "wasmer-vm",
"wat", "wat",
"winapi", "winapi",
] ]
@ -2161,7 +2161,7 @@ dependencies = [
"target-lexicon", "target-lexicon",
"thiserror", "thiserror",
"wasm-common", "wasm-common",
"wasmer-runtime", "wasmer-vm",
"wasmparser", "wasmparser",
] ]
@ -2181,7 +2181,7 @@ dependencies = [
"tracing", "tracing",
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-runtime", "wasmer-vm",
] ]
[[package]] [[package]]
@ -2203,7 +2203,7 @@ dependencies = [
"target-lexicon", "target-lexicon",
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-runtime", "wasmer-vm",
] ]
[[package]] [[package]]
@ -2221,7 +2221,7 @@ dependencies = [
"smallvec", "smallvec",
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-runtime", "wasmer-vm",
] ]
[[package]] [[package]]
@ -2253,7 +2253,7 @@ dependencies = [
"thiserror", "thiserror",
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-runtime", "wasmer-vm",
"winapi", "winapi",
] ]
@ -2267,7 +2267,7 @@ dependencies = [
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-engine", "wasmer-engine",
"wasmer-runtime", "wasmer-vm",
] ]
[[package]] [[package]]
@ -2282,7 +2282,7 @@ dependencies = [
"wasm-common", "wasm-common",
"wasmer-compiler", "wasmer-compiler",
"wasmer-engine", "wasmer-engine",
"wasmer-runtime", "wasmer-vm",
"winapi", "winapi",
] ]
@ -2302,7 +2302,7 @@ dependencies = [
"wasmer-compiler", "wasmer-compiler",
"wasmer-engine", "wasmer-engine",
"wasmer-object", "wasmer-object",
"wasmer-runtime", "wasmer-vm",
] ]
[[package]] [[package]]
@ -2316,7 +2316,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "wasmer-runtime" name = "wasmer-vm"
version = "1.0.0-alpha.1" version = "1.0.0-alpha.1"
dependencies = [ dependencies = [
"backtrace", "backtrace",

View File

@ -109,7 +109,7 @@ test-llvm:
test-packages: test-packages:
cargo test -p wasmer --release cargo test -p wasmer --release
cargo test -p wasmer-runtime --release cargo test -p wasmer-vm --release
cargo test -p wasm-common --release cargo test -p wasm-common --release
cargo test -p wasmer-wasi --release cargo test -p wasmer-wasi --release
@ -181,8 +181,8 @@ package-docs: build-docs build-docs-capi
mkdir -p "package/docs/c" mkdir -p "package/docs/c"
cp -R target/doc package/docs/crates cp -R target/doc package/docs/crates
cp -R lib/c-api/doc/html package/docs/c-api cp -R lib/c-api/doc/html package/docs/c-api
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=rust/wasmer_runtime/index.html">' > package/docs/index.html echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=rust/wasmer_vm/index.html">' > package/docs/index.html
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=wasmer_runtime/index.html">' > package/docs/crates/index.html echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=wasmer_vm/index.html">' > package/docs/crates/index.html
package: package-wapm package-wasmer package-capi package: package-wapm package-wasmer package-capi
cp LICENSE package/LICENSE cp LICENSE package/LICENSE

View File

@ -88,7 +88,7 @@ Wasmer runtime can be used as a library embedded in different languages, so you
| &nbsp; | Language | Docs | Author(s) | Maintenance | Release | Stars | | &nbsp; | Language | Docs | Author(s) | Maintenance | Release | Stars |
|-|-|-|-|-|-|-| |-|-|-|-|-|-|-|
| ![Rust logo](./assets/languages/rust.svg) | [**Rust**](https://github.com/wasmerio/wasmer-rust-example) | [Docs](https://wasmerio.github.io/wasmer/crates/wasmer_runtime/) | Wasmer | actively developed | <a href="https://crates.io/crates/wasmer-runtime/" target="_blank">![last release](https://img.shields.io/crates/v/wasmer-runtime?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) | | ![Rust logo](./assets/languages/rust.svg) | [**Rust**](https://github.com/wasmerio/wasmer-rust-example) | [Docs](https://wasmerio.github.io/wasmer/crates/wasmer_vm/) | Wasmer | actively developed | <a href="https://crates.io/crates/wasmer-vm/" target="_blank">![last release](https://img.shields.io/crates/v/wasmer-vm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) |
| ![C logo](./assets/languages/c.svg) | [**C/C++**](https://github.com/wasmerio/wasmer-c-api) | [Docs](https://wasmerio.github.io/wasmer/c/runtime-c-api/) | Wasmer | actively developed | <a href="https://github.com/wasmerio/wasmer-c-api/" target="_blank">![last release](https://img.shields.io/github/v/release/wasmerio/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) | | ![C logo](./assets/languages/c.svg) | [**C/C++**](https://github.com/wasmerio/wasmer-c-api) | [Docs](https://wasmerio.github.io/wasmer/c/runtime-c-api/) | Wasmer | actively developed | <a href="https://github.com/wasmerio/wasmer-c-api/" target="_blank">![last release](https://img.shields.io/github/v/release/wasmerio/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) |
| ![Python logo](./assets/languages/python.svg) | [**Python**](https://github.com/wasmerio/python-ext-wasm) | [Docs](https://github.com/wasmerio/python-ext-wasm#api-of-the-wasmer-extensionmodule) | Wasmer | actively developed | <a href="https://pypi.org/project/wasmer/" target="_blank">![last release](https://img.shields.io/pypi/v/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/python-ext-wasm?style=flat-square) | | ![Python logo](./assets/languages/python.svg) | [**Python**](https://github.com/wasmerio/python-ext-wasm) | [Docs](https://github.com/wasmerio/python-ext-wasm#api-of-the-wasmer-extensionmodule) | Wasmer | actively developed | <a href="https://pypi.org/project/wasmer/" target="_blank">![last release](https://img.shields.io/pypi/v/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/python-ext-wasm?style=flat-square) |
| ![Go logo](./assets/languages/go.svg) | [**Go**](https://github.com/wasmerio/go-ext-wasm) | [Docs](https://github.com/wasmerio/go-ext-wasm#basic-example-exported-function) | Wasmer | actively developed | <a href="https://github.com/wasmerio/go-ext-wasm" target="_blank">![last release](https://img.shields.io/github/v/release/wasmerio/go-ext-wasm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/go-ext-wasm?style=flat-square) | | ![Go logo](./assets/languages/go.svg) | [**Go**](https://github.com/wasmerio/go-ext-wasm) | [Docs](https://github.com/wasmerio/go-ext-wasm#basic-example-exported-function) | Wasmer | actively developed | <a href="https://github.com/wasmerio/go-ext-wasm" target="_blank">![last release](https://img.shields.io/github/v/release/wasmerio/go-ext-wasm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/go-ext-wasm?style=flat-square) |

View File

@ -9,7 +9,7 @@ readme = "README.md"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "1.0.0-alpha.1", optional = true } wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "1.0.0-alpha.1", optional = true }
wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "1.0.0-alpha.1", optional = true } wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "1.0.0-alpha.1", optional = true }
wasmer-compiler-llvm = { path = "../compiler-llvm", version = "1.0.0-alpha.1", optional = true } wasmer-compiler-llvm = { path = "../compiler-llvm", version = "1.0.0-alpha.1", optional = true }

View File

@ -8,7 +8,7 @@ use std::{
sync::Arc, sync::Arc,
}; };
use thiserror::Error; use thiserror::Error;
use wasmer_runtime::Export; use wasmer_vm::Export;
/// The `ExportError` can happen when trying to get a specific /// The `ExportError` can happen when trying to get a specific
/// export [`Extern`] from the [`Instance`] exports. /// export [`Extern`] from the [`Instance`] exports.

View File

@ -8,7 +8,7 @@ use crate::RuntimeError;
pub use inner::{FromToNativeWasmType, HostFunction, WasmTypeList, WithEnv, WithoutEnv}; pub use inner::{FromToNativeWasmType, HostFunction, WasmTypeList, WithEnv, WithoutEnv};
use std::cell::RefCell; use std::cell::RefCell;
use std::cmp::max; use std::cmp::max;
use wasmer_runtime::{ use wasmer_vm::{
raise_user_trap, resume_panic, wasmer_call_trampoline, Export, ExportFunction, raise_user_trap, resume_panic, wasmer_call_trampoline, Export, ExportFunction,
VMCallerCheckedAnyfunc, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, VMCallerCheckedAnyfunc, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind,
VMTrampoline, VMTrampoline,
@ -503,7 +503,7 @@ mod inner {
use std::marker::PhantomData; use std::marker::PhantomData;
use std::panic::{self, AssertUnwindSafe}; use std::panic::{self, AssertUnwindSafe};
use wasm_common::{FunctionType, NativeWasmType, Type}; use wasm_common::{FunctionType, NativeWasmType, Type};
use wasmer_runtime::{raise_user_trap, resume_panic, VMFunctionBody}; use wasmer_vm::{raise_user_trap, resume_panic, VMFunctionBody};
/// A trait to convert a Rust value to a `WasmNativeType` value, /// A trait to convert a Rust value to a `WasmNativeType` value,
/// or to convert `WasmNativeType` value to a Rust value. /// or to convert `WasmNativeType` value to a Rust value.

View File

@ -6,7 +6,7 @@ use crate::GlobalType;
use crate::Mutability; use crate::Mutability;
use crate::RuntimeError; use crate::RuntimeError;
use std::fmt; use std::fmt;
use wasmer_runtime::{Export, ExportGlobal, VMGlobalDefinition}; use wasmer_vm::{Export, ExportGlobal, VMGlobalDefinition};
#[derive(Clone)] #[derive(Clone)]
pub struct Global { pub struct Global {

View File

@ -5,7 +5,7 @@ use crate::{MemoryType, MemoryView};
use std::slice; use std::slice;
use std::sync::Arc; use std::sync::Arc;
use wasm_common::{Pages, ValueType}; use wasm_common::{Pages, ValueType};
use wasmer_runtime::{Export, ExportMemory, Memory as RuntimeMemory, MemoryError}; use wasmer_vm::{Export, ExportMemory, Memory as RuntimeMemory, MemoryError};
#[derive(Clone)] #[derive(Clone)]
pub struct Memory { pub struct Memory {

View File

@ -13,7 +13,7 @@ pub use self::table::Table;
use crate::exports::{ExportError, Exportable}; use crate::exports::{ExportError, Exportable};
use crate::store::{Store, StoreObject}; use crate::store::{Store, StoreObject};
use crate::ExternType; use crate::ExternType;
use wasmer_runtime::Export; use wasmer_vm::Export;
#[derive(Clone)] #[derive(Clone)]
pub enum Extern { pub enum Extern {

View File

@ -5,7 +5,7 @@ use crate::types::{Val, ValFuncRef};
use crate::RuntimeError; use crate::RuntimeError;
use crate::TableType; use crate::TableType;
use std::sync::Arc; use std::sync::Arc;
use wasmer_runtime::{Export, ExportTable, Table as RuntimeTable, VMCallerCheckedAnyfunc}; use wasmer_vm::{Export, ExportTable, Table as RuntimeTable, VMCallerCheckedAnyfunc};
/// The `Table` struct is an array-like structure representing a WebAssembly Table, /// The `Table` struct is an array-like structure representing a WebAssembly Table,
/// which stores function references. /// which stores function references.

View File

@ -9,7 +9,7 @@ use std::{
sync::{Arc, Mutex}, sync::{Arc, Mutex},
}; };
use wasmer_engine::NamedResolver; use wasmer_engine::NamedResolver;
use wasmer_runtime::Export; use wasmer_vm::Export;
/// The `LikeNamespace` trait represents objects that act as a namespace for imports. /// The `LikeNamespace` trait represents objects that act as a namespace for imports.
/// For example, an `Instance` or `Namespace` could be /// For example, an `Instance` or `Namespace` could be
@ -62,7 +62,7 @@ impl ImportObject {
/// ///
/// # Usage /// # Usage
/// ```ignore /// ```ignore
/// # use wasmer_runtime::{ImportObject, Instance, Namespace}; /// # use wasmer_vm::{ImportObject, Instance, Namespace};
/// let mut import_object = ImportObject::new(); /// let mut import_object = ImportObject::new();
/// import_object.get_export("module", "name"); /// import_object.get_export("module", "name");
/// ``` /// ```
@ -103,7 +103,7 @@ impl ImportObject {
/// ///
/// # Usage: /// # Usage:
/// ```ignore /// ```ignore
/// # use wasmer_runtime::{ImportObject, Instance, Namespace}; /// # use wasmer_vm::{ImportObject, Instance, Namespace};
/// let mut import_object = ImportObject::new(); /// let mut import_object = ImportObject::new();
/// ///
/// import_object.register("namespace0", instance); /// import_object.register("namespace0", instance);
@ -250,7 +250,7 @@ mod test {
use crate::{Global, Store, Val}; use crate::{Global, Store, Val};
use wasm_common::Type; use wasm_common::Type;
use wasmer_engine::ChainableNamedResolver; use wasmer_engine::ChainableNamedResolver;
use wasmer_runtime::Export; use wasmer_vm::Export;
#[test] #[test]
fn chaining_works() { fn chaining_works() {

View File

@ -4,7 +4,7 @@ use crate::module::Module;
use crate::store::Store; use crate::store::Store;
use crate::InstantiationError; use crate::InstantiationError;
use wasmer_engine::Resolver; use wasmer_engine::Resolver;
use wasmer_runtime::InstanceHandle; use wasmer_vm::InstanceHandle;
/// A WebAssembly Instance is a stateful, executable /// A WebAssembly Instance is a stateful, executable
/// instance of a WebAssembly [`Module`]. /// instance of a WebAssembly [`Module`].

View File

@ -17,7 +17,7 @@ mod utils;
pub mod internals { pub mod internals {
//! We use the internals module for exporting types that are only //! We use the internals module for exporting types that are only
//! intended to use in internal crates such as the compatibility crate //! intended to use in internal crates such as the compatibility crate
//! `wasmer-runtime`. Please don't use any of this types directly, as //! `wasmer-vm`. Please don't use any of this types directly, as
//! they might change frequently or be removed in the future. //! they might change frequently or be removed in the future.
pub use crate::externals::{WithEnv, WithoutEnv}; pub use crate::externals::{WithEnv, WithoutEnv};
@ -56,7 +56,7 @@ pub use wasmer_engine::{
ChainableNamedResolver, DeserializeError, Engine, InstantiationError, LinkError, NamedResolver, ChainableNamedResolver, DeserializeError, Engine, InstantiationError, LinkError, NamedResolver,
NamedResolverChain, Resolver, RuntimeError, SerializeError, NamedResolverChain, Resolver, RuntimeError, SerializeError,
}; };
pub use wasmer_runtime::{raise_user_trap, MemoryError}; pub use wasmer_vm::{raise_user_trap, MemoryError};
#[cfg(feature = "wat")] #[cfg(feature = "wat")]
pub use wat::parse_bytes as wat2wasm; pub use wat::parse_bytes as wat2wasm;

View File

@ -9,7 +9,7 @@ use wasmer_compiler::CompileError;
#[cfg(feature = "wat")] #[cfg(feature = "wat")]
use wasmer_compiler::WasmError; use wasmer_compiler::WasmError;
use wasmer_engine::{Artifact, DeserializeError, Resolver, SerializeError}; use wasmer_engine::{Artifact, DeserializeError, Resolver, SerializeError};
use wasmer_runtime::{ExportsIterator, ImportsIterator, InstanceHandle, ModuleInfo}; use wasmer_vm::{ExportsIterator, ImportsIterator, InstanceHandle, ModuleInfo};
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum IoCompileError { pub enum IoCompileError {

View File

@ -16,7 +16,7 @@ use crate::externals::function::{
use crate::{FromToNativeWasmType, Function, FunctionType, RuntimeError, Store, WasmTypeList}; use crate::{FromToNativeWasmType, Function, FunctionType, RuntimeError, Store, WasmTypeList};
use std::panic::{catch_unwind, AssertUnwindSafe}; use std::panic::{catch_unwind, AssertUnwindSafe};
use wasm_common::NativeWasmType; use wasm_common::NativeWasmType;
use wasmer_runtime::{ use wasmer_vm::{
ExportFunction, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, ExportFunction, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind,
}; };
@ -123,7 +123,7 @@ macro_rules! impl_native_traits {
rets_list.as_mut() rets_list.as_mut()
}; };
unsafe { unsafe {
wasmer_runtime::wasmer_call_trampoline( wasmer_vm::wasmer_call_trampoline(
self.vmctx, self.vmctx,
trampoline, trampoline,
self.address, self.address,
@ -147,7 +147,7 @@ macro_rules! impl_native_traits {
// but we can't currently detect whether that's safe. // but we can't currently detect whether that's safe.
// //
// let results = unsafe { // let results = unsafe {
// wasmer_runtime::catch_traps_with_result(self.vmctx, || { // wasmer_vm::catch_traps_with_result(self.vmctx, || {
// let f = std::mem::transmute::<_, unsafe extern "C" fn( *mut VMContext, $( $x, )*) -> Rets::CStruct>(self.address); // let f = std::mem::transmute::<_, unsafe extern "C" fn( *mut VMContext, $( $x, )*) -> Rets::CStruct>(self.address);
// // We always pass the vmctx // // We always pass the vmctx
// f( self.vmctx, $( $x, )* ) // f( self.vmctx, $( $x, )* )

View File

@ -9,7 +9,7 @@ use wasmer_engine::Resolver;
use crate::exports::Exportable; use crate::exports::Exportable;
use crate::Extern; use crate::Extern;
use wasmer_runtime::Export; use wasmer_vm::Export;
/// An `OrderedResolver` stores all the `externs` provided to an Instance /// An `OrderedResolver` stores all the `externs` provided to an Instance
/// in a Vec, so we can retrieve them later based on index. /// in a Vec, so we can retrieve them later based on index.

View File

@ -5,8 +5,8 @@ use std::sync::Arc;
use target_lexicon::{OperatingSystem, PointerWidth}; use target_lexicon::{OperatingSystem, PointerWidth};
use wasmer_compiler::Target; use wasmer_compiler::Target;
use wasmer_engine::Tunables as BaseTunables; use wasmer_engine::Tunables as BaseTunables;
use wasmer_runtime::MemoryError; use wasmer_vm::MemoryError;
use wasmer_runtime::{LinearMemory, LinearTable, Memory, MemoryStyle, Table, TableStyle}; use wasmer_vm::{LinearMemory, LinearTable, Memory, MemoryStyle, Table, TableStyle};
/// Tunable parameters for WebAssembly compilation. /// Tunable parameters for WebAssembly compilation.
#[derive(Clone)] #[derive(Clone)]

View File

@ -33,23 +33,23 @@ pub trait ValFuncRef {
fn into_checked_anyfunc( fn into_checked_anyfunc(
&self, &self,
store: &Store, store: &Store,
) -> Result<wasmer_runtime::VMCallerCheckedAnyfunc, RuntimeError>; ) -> Result<wasmer_vm::VMCallerCheckedAnyfunc, RuntimeError>;
fn from_checked_anyfunc(item: wasmer_runtime::VMCallerCheckedAnyfunc, store: &Store) -> Self; fn from_checked_anyfunc(item: wasmer_vm::VMCallerCheckedAnyfunc, store: &Store) -> Self;
} }
impl ValFuncRef for Val { impl ValFuncRef for Val {
fn into_checked_anyfunc( fn into_checked_anyfunc(
&self, &self,
store: &Store, store: &Store,
) -> Result<wasmer_runtime::VMCallerCheckedAnyfunc, RuntimeError> { ) -> Result<wasmer_vm::VMCallerCheckedAnyfunc, RuntimeError> {
if !self.comes_from_same_store(store) { if !self.comes_from_same_store(store) {
return Err(RuntimeError::new("cross-`Store` values are not supported")); return Err(RuntimeError::new("cross-`Store` values are not supported"));
} }
Ok(match self { Ok(match self {
Val::ExternRef(ExternRef::Null) => wasmer_runtime::VMCallerCheckedAnyfunc { Val::ExternRef(ExternRef::Null) => wasmer_vm::VMCallerCheckedAnyfunc {
func_ptr: ptr::null(), func_ptr: ptr::null(),
type_index: wasmer_runtime::VMSharedSignatureIndex::default(), type_index: wasmer_vm::VMSharedSignatureIndex::default(),
vmctx: ptr::null_mut(), vmctx: ptr::null_mut(),
}, },
Val::FuncRef(f) => f.checked_anyfunc(), Val::FuncRef(f) => f.checked_anyfunc(),
@ -57,20 +57,20 @@ impl ValFuncRef for Val {
}) })
} }
fn from_checked_anyfunc(item: wasmer_runtime::VMCallerCheckedAnyfunc, store: &Store) -> Val { fn from_checked_anyfunc(item: wasmer_vm::VMCallerCheckedAnyfunc, store: &Store) -> Val {
if item.type_index == wasmer_runtime::VMSharedSignatureIndex::default() { if item.type_index == wasmer_vm::VMSharedSignatureIndex::default() {
return Val::ExternRef(ExternRef::Null); return Val::ExternRef(ExternRef::Null);
} }
let signature = store let signature = store
.engine() .engine()
.lookup_signature(item.type_index) .lookup_signature(item.type_index)
.expect("Signature not found in store"); .expect("Signature not found in store");
let export = wasmer_runtime::ExportFunction { let export = wasmer_vm::ExportFunction {
address: item.func_ptr, address: item.func_ptr,
signature, signature,
// All functions in tables are already Static (as dynamic functions // All functions in tables are already Static (as dynamic functions
// are converted to use the trampolines with static signatures). // are converted to use the trampolines with static signatures).
kind: wasmer_runtime::VMFunctionKind::Static, kind: wasmer_vm::VMFunctionKind::Static,
vmctx: item.vmctx, vmctx: item.vmctx,
}; };
let f = Function::from_export(store, export); let f = Function::from_export(store, export);

View File

@ -41,7 +41,7 @@ pub(crate) struct CAPIInstance {
pub(crate) ctx_data: Option<NonNull<c_void>>, pub(crate) ctx_data: Option<NonNull<c_void>>,
} }
/// Opaque pointer to a `wasmer_runtime::Ctx` value in Rust. /// Opaque pointer to a `wasmer_vm::Ctx` value in Rust.
/// ///
/// An instance context is passed to any host function (aka imported /// An instance context is passed to any host function (aka imported
/// function) as the first argument. It is necessary to read the /// function) as the first argument. It is necessary to read the

View File

@ -7,9 +7,9 @@ use crate::{
use std::{cell::Cell, ptr}; use std::{cell::Cell, ptr};
use wasmer::{Bytes, Memory, MemoryType, Pages}; use wasmer::{Bytes, Memory, MemoryType, Pages};
/// Opaque pointer to a `wasmer_runtime::Memory` value in Rust. /// Opaque pointer to a `wasmer_vm::Memory` value in Rust.
/// ///
/// A `wasmer_runtime::Memory` represents a WebAssembly memory. It is /// A `wasmer_vm::Memory` represents a WebAssembly memory. It is
/// possible to create one with `wasmer_memory_new()` and pass it as /// possible to create one with `wasmer_memory_new()` and pass it as
/// imports of an instance, or to read it from exports of an instance /// imports of an instance, or to read it from exports of an instance
/// with `wasmer_export_to_memory()`. /// with `wasmer_export_to_memory()`.

View File

@ -2,7 +2,7 @@
use std::ffi::c_void; use std::ffi::c_void;
use std::mem; use std::mem;
use wasmer_runtime_core::trampoline::*; use wasmer_vm_core::trampoline::*;
#[repr(C)] #[repr(C)]
pub struct wasmer_trampoline_buffer_builder_t; pub struct wasmer_trampoline_buffer_builder_t;

View File

@ -243,9 +243,9 @@ typedef struct {
} wasmer_export_t; } wasmer_export_t;
/** /**
* Opaque pointer to a `wasmer_runtime::Memory` value in Rust. * Opaque pointer to a `wasmer_vm::Memory` value in Rust.
* *
* A `wasmer_runtime::Memory` represents a WebAssembly memory. It is * A `wasmer_vm::Memory` represents a WebAssembly memory. It is
* possible to create one with `wasmer_memory_new()` and pass it as * possible to create one with `wasmer_memory_new()` and pass it as
* imports of an instance, or to read it from exports of an instance * imports of an instance, or to read it from exports of an instance
* with `wasmer_export_to_memory()`. * with `wasmer_export_to_memory()`.
@ -312,7 +312,7 @@ typedef struct {
} wasmer_import_object_iter_t; } wasmer_import_object_iter_t;
/** /**
* Opaque pointer to a `wasmer_runtime::Ctx` value in Rust. * Opaque pointer to a `wasmer_vm::Ctx` value in Rust.
* *
* An instance context is passed to any host function (aka imported * An instance context is passed to any host function (aka imported
* function) as the first argument. It is necessary to read the * function) as the first argument. It is necessary to read the

View File

@ -185,9 +185,9 @@ struct wasmer_export_t {
}; };
/// Opaque pointer to a `wasmer_runtime::Memory` value in Rust. /// Opaque pointer to a `wasmer_vm::Memory` value in Rust.
/// ///
/// A `wasmer_runtime::Memory` represents a WebAssembly memory. It is /// A `wasmer_vm::Memory` represents a WebAssembly memory. It is
/// possible to create one with `wasmer_memory_new()` and pass it as /// possible to create one with `wasmer_memory_new()` and pass it as
/// imports of an instance, or to read it from exports of an instance /// imports of an instance, or to read it from exports of an instance
/// with `wasmer_export_to_memory()`. /// with `wasmer_export_to_memory()`.
@ -248,7 +248,7 @@ struct wasmer_import_object_iter_t {
}; };
/// Opaque pointer to a `wasmer_runtime::Ctx` value in Rust. /// Opaque pointer to a `wasmer_vm::Ctx` value in Rust.
/// ///
/// An instance context is passed to any host function (aka imported /// An instance context is passed to any host function (aka imported
/// function) as the first argument. It is necessary to read the /// function) as the first argument. It is necessary to read the

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"], default-features = false } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"], default-features = false }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1", default-features = false } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1", default-features = false }
cranelift-codegen = { version = "0.65", default-features = false } cranelift-codegen = { version = "0.65", default-features = false }
cranelift-frontend = { version = "0.65", default-features = false } cranelift-frontend = { version = "0.65", default-features = false }

View File

@ -219,7 +219,7 @@ impl Compiler for CraneliftCompiler {
.into_iter() .into_iter()
.collect::<PrimaryMap<SignatureIndex, FunctionBody>>(); .collect::<PrimaryMap<SignatureIndex, FunctionBody>>();
use wasmer_runtime::VMOffsets; use wasmer_vm::VMOffsets;
let offsets = VMOffsets::new_for_trampolines(frontend_config.pointer_bytes()); let offsets = VMOffsets::new_for_trampolines(frontend_config.pointer_bytes());
// dynamic function trampolines (only for imported functions) // dynamic function trampolines (only for imported functions)
let dynamic_function_trampolines = module let dynamic_function_trampolines = module

View File

@ -16,9 +16,9 @@ use wasm_common::entity::EntityRef;
use wasm_common::entity::PrimaryMap; use wasm_common::entity::PrimaryMap;
use wasm_common::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; use wasm_common::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex};
use wasmer_compiler::{WasmError, WasmResult}; use wasmer_compiler::{WasmError, WasmResult};
use wasmer_runtime::VMBuiltinFunctionIndex; use wasmer_vm::VMBuiltinFunctionIndex;
use wasmer_runtime::VMOffsets; use wasmer_vm::VMOffsets;
use wasmer_runtime::{MemoryStyle, ModuleInfo, TableStyle}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle};
/// Compute an `ir::ExternalName` for a given wasm function index. /// Compute an `ir::ExternalName` for a given wasm function index.
pub fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName { pub fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName {

View File

@ -6,7 +6,7 @@ use cranelift_codegen::ir::{self, ExternalName};
use wasm_common::entity::EntityRef; use wasm_common::entity::EntityRef;
use wasm_common::{FunctionIndex, LocalFunctionIndex}; use wasm_common::{FunctionIndex, LocalFunctionIndex};
use wasmer_compiler::{JumpTable, Relocation, RelocationTarget, SourceLoc, TrapInformation}; use wasmer_compiler::{JumpTable, Relocation, RelocationTarget, SourceLoc, TrapInformation};
use wasmer_runtime::{ModuleInfo, TrapCode}; use wasmer_vm::{ModuleInfo, TrapCode};
/// Implementation of a relocation sink that just saves all the information for later /// Implementation of a relocation sink that just saves all the information for later
pub(crate) struct RelocSink<'a> { pub(crate) struct RelocSink<'a> {

View File

@ -18,7 +18,7 @@ use std::mem;
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
use wasm_common::FunctionType; use wasm_common::FunctionType;
use wasmer_compiler::{CompileError, FunctionBody}; use wasmer_compiler::{CompileError, FunctionBody};
use wasmer_runtime::VMOffsets; use wasmer_vm::VMOffsets;
/// Create a trampoline for invoking a WebAssembly function. /// Create a trampoline for invoking a WebAssembly function.
pub fn make_trampoline_dynamic_function( pub fn make_trampoline_dynamic_function(

View File

@ -13,7 +13,7 @@ use wasmer_compiler::wasm_unsupported;
use wasmer_compiler::wasmparser; use wasmer_compiler::wasmparser;
use wasmer_compiler::{JumpTable, RelocationKind}; use wasmer_compiler::{JumpTable, RelocationKind};
use wasmer_compiler::{WasmError, WasmResult}; use wasmer_compiler::{WasmError, WasmResult};
use wasmer_runtime::libcalls::LibCall; use wasmer_vm::libcalls::LibCall;
/// Helper function translate a Function signature into Cranelift Ir /// Helper function translate a Function signature into Cranelift Ir
pub fn signature_to_cranelift_ir( pub fn signature_to_cranelift_ir(

View File

@ -11,7 +11,7 @@ readme = "README.md"
[dependencies] [dependencies]
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"] } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"] }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" }
target-lexicon = { version = "0.10", default-features = false } target-lexicon = { version = "0.10", default-features = false }
smallvec = "1" smallvec = "1"

View File

@ -7,7 +7,7 @@ use wasmer_compiler::{
CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, Relocation, CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, Relocation,
RelocationKind, RelocationTarget, SectionBody, SectionIndex, SourceLoc, RelocationKind, RelocationTarget, SectionBody, SectionIndex, SourceLoc,
}; };
use wasmer_runtime::libcalls::LibCall; use wasmer_vm::libcalls::LibCall;
use wasm_common::entity::entity_impl; use wasm_common::entity::entity_impl;
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]

View File

@ -34,7 +34,7 @@ use wasmer_compiler::{
to_wasm_error, wptype_to_type, CompileError, FunctionBodyData, GenerateMiddlewareChain, to_wasm_error, wptype_to_type, CompileError, FunctionBodyData, GenerateMiddlewareChain,
MiddlewareBinaryReader, ModuleTranslationState, RelocationTarget, MiddlewareBinaryReader, ModuleTranslationState, RelocationTarget,
}; };
use wasmer_runtime::{MemoryStyle, ModuleInfo, TableStyle}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle};
fn to_compile_error(err: impl std::error::Error) -> CompileError { fn to_compile_error(err: impl std::error::Error) -> CompileError {
CompileError::Codegen(format!("{}", err)) CompileError::Codegen(format!("{}", err))

View File

@ -26,8 +26,8 @@ use wasm_common::{
TableIndex, Type, TableIndex, Type,
}; };
use wasmer_compiler::CompileError; use wasmer_compiler::CompileError;
use wasmer_runtime::ModuleInfo as WasmerCompilerModule; use wasmer_vm::ModuleInfo as WasmerCompilerModule;
use wasmer_runtime::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; use wasmer_vm::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets};
pub fn type_to_llvm_ptr<'ctx>( pub fn type_to_llvm_ptr<'ctx>(
intrinsics: &Intrinsics<'ctx>, intrinsics: &Intrinsics<'ctx>,

View File

@ -2,8 +2,8 @@
use byteorder::{LittleEndian, ReadBytesExt}; use byteorder::{LittleEndian, ReadBytesExt};
use std::io::{self, Cursor}; use std::io::{self, Cursor};
use wasmer_runtime_core::vm::Ctx; use wasmer_vm_core::vm::Ctx;
use wasmer_runtime_core::{ use wasmer_vm_core::{
module::Module, module::Module,
structures::TypedIndex, structures::TypedIndex,
types::{GlobalIndex, LocalOrImport, TableIndex}, types::{GlobalIndex, LocalOrImport, TableIndex},
@ -65,15 +65,15 @@ impl StackmapEntry {
size_record: &StkSizeRecord, size_record: &StkSizeRecord,
map_record: &StkMapRecord, map_record: &StkMapRecord,
end: Option<(&StackmapEntry, &StkMapRecord)>, end: Option<(&StackmapEntry, &StkMapRecord)>,
msm: &mut wasmer_runtime_core::state::ModuleStateMap, msm: &mut wasmer_vm_core::state::ModuleStateMap,
) { ) {
use std::collections::{BTreeMap, HashMap}; use std::collections::{BTreeMap, HashMap};
use wasmer_runtime_core::state::{ use wasmer_vm_core::state::{
x64::{new_machine_state, X64Register, GPR}, x64::{new_machine_state, X64Register, GPR},
FunctionStateMap, MachineStateDiff, MachineValue, OffsetInfo, RegisterIndex, FunctionStateMap, MachineStateDiff, MachineValue, OffsetInfo, RegisterIndex,
SuspendOffset, WasmAbstractValue, SuspendOffset, WasmAbstractValue,
}; };
use wasmer_runtime_core::vm; use wasmer_vm_core::vm;
let func_base_addr = (size_record.function_address as usize) let func_base_addr = (size_record.function_address as usize)
.checked_sub(code_addr) .checked_sub(code_addr)

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"], default-features = false } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", features = ["translator"], default-features = false }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1", default-features = false } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1", default-features = false }
rayon = "1.3" rayon = "1.3"
hashbrown = { version = "0.7", optional = true } hashbrown = { version = "0.7", optional = true }

View File

@ -19,9 +19,7 @@ use wasmer_compiler::{
FunctionBody, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex, FunctionBody, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex,
TrapInformation, TrapInformation,
}; };
use wasmer_runtime::{ use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets};
MemoryStyle, ModuleInfo, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets,
};
/// The singlepass per-function code generator. /// The singlepass per-function code generator.
pub struct FuncGen<'a> { pub struct FuncGen<'a> {

View File

@ -19,7 +19,7 @@ use wasmer_compiler::{
ModuleTranslationState, Target, ModuleTranslationState, Target,
}; };
use wasmer_compiler::{FunctionBody, FunctionBodyData}; use wasmer_compiler::{FunctionBody, FunctionBodyData};
use wasmer_runtime::{ModuleInfo, TrapCode, VMOffsets}; use wasmer_vm::{ModuleInfo, TrapCode, VMOffsets};
/// A compiler that compiles a WebAssembly module with Singlepass. /// A compiler that compiles a WebAssembly module with Singlepass.
/// It does the compilation in one pass /// It does the compilation in one pass

View File

@ -11,7 +11,7 @@ keywords = ["webassembly", "wasm", "compiler"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" }
wasmparser = { version = "0.57", optional = true, default-features = false } wasmparser = { version = "0.57", optional = true, default-features = false }
target-lexicon = { version = "0.10", default-features = false } target-lexicon = { version = "0.10", default-features = false }

View File

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use std::sync::Arc; use std::sync::Arc;
use wasm_common::entity::PrimaryMap; use wasm_common::entity::PrimaryMap;
use wasm_common::{Features, MemoryIndex, TableIndex}; use wasm_common::{Features, MemoryIndex, TableIndex};
use wasmer_runtime::{MemoryStyle, ModuleInfo, TableStyle}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle};
/// The required info for compiling a module. /// The required info for compiling a module.
/// ///

View File

@ -17,7 +17,7 @@ use crate::{Addend, CodeOffset, JumpTable};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use wasm_common::entity::PrimaryMap; use wasm_common::entity::PrimaryMap;
use wasm_common::LocalFunctionIndex; use wasm_common::LocalFunctionIndex;
use wasmer_runtime::libcalls::LibCall; use wasmer_vm::libcalls::LibCall;
/// Relocation kinds for every ISA. /// Relocation kinds for every ISA.
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]

View File

@ -16,7 +16,7 @@ use wasm_common::{
ExportIndex, FunctionIndex, GlobalIndex, GlobalInit, GlobalType, ImportIndex, ExportIndex, FunctionIndex, GlobalIndex, GlobalInit, GlobalType, ImportIndex,
LocalFunctionIndex, MemoryIndex, MemoryType, SignatureIndex, TableIndex, TableType, LocalFunctionIndex, MemoryIndex, MemoryType, SignatureIndex, TableIndex, TableType,
}; };
use wasmer_runtime::{ModuleInfo, TableElements}; use wasmer_vm::{ModuleInfo, TableElements};
/// Contains function data: bytecode and its offset in the module. /// Contains function data: bytecode and its offset in the module.
#[derive(Hash)] #[derive(Hash)]

View File

@ -2,7 +2,7 @@ use crate::sourceloc::SourceLoc;
use crate::CodeOffset; use crate::CodeOffset;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use wasmer_runtime::TrapCode; use wasmer_vm::TrapCode;
/// Information about trap. /// Information about trap.
#[cfg_attr(feature = "enable-serde", derive(Deserialize, Serialize))] #[cfg_attr(feature = "enable-serde", derive(Deserialize, Serialize))]

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" }
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasmer-engine = { path = "../engine", version = "1.0.0-alpha.1" } wasmer-engine = { path = "../engine", version = "1.0.0-alpha.1" }
# flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" } # flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" }
region = "2.1" region = "2.1"

View File

@ -22,7 +22,7 @@ use wasmer_engine::{
}; };
#[cfg(feature = "compiler")] #[cfg(feature = "compiler")]
use wasmer_engine::{Engine, SerializableFunctionFrameInfo}; use wasmer_engine::{Engine, SerializableFunctionFrameInfo};
use wasmer_runtime::{MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex}; use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex};
/// A compiled wasm module, ready to be instantiated. /// A compiled wasm module, ready to be instantiated.
pub struct JITArtifact { pub struct JITArtifact {

View File

@ -8,7 +8,7 @@ use std::sync::Arc;
use std::{cmp, mem}; use std::{cmp, mem};
use wasm_common::entity::{EntityRef, PrimaryMap}; use wasm_common::entity::{EntityRef, PrimaryMap};
use wasmer_compiler::{CompiledFunctionUnwindInfo, FunctionBody, SectionBody}; use wasmer_compiler::{CompiledFunctionUnwindInfo, FunctionBody, SectionBody};
use wasmer_runtime::{Mmap, VMFunctionBody}; use wasmer_vm::{Mmap, VMFunctionBody};
/// The optimal alignment for functions. /// The optimal alignment for functions.
/// ///

View File

@ -13,7 +13,7 @@ use wasmer_compiler::{
CompileError, CustomSection, CustomSectionProtection, FunctionBody, SectionIndex, Target, CompileError, CustomSection, CustomSectionProtection, FunctionBody, SectionIndex, Target,
}; };
use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables};
use wasmer_runtime::{ use wasmer_vm::{
ModuleInfo, SignatureRegistry, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, ModuleInfo, SignatureRegistry, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline,
}; };

View File

@ -7,8 +7,8 @@ use wasmer_compiler::{
JumpTable, JumpTableOffsets, Relocation, RelocationKind, RelocationTarget, Relocations, JumpTable, JumpTableOffsets, Relocation, RelocationKind, RelocationTarget, Relocations,
SectionIndex, SectionIndex,
}; };
use wasmer_runtime::ModuleInfo; use wasmer_vm::ModuleInfo;
use wasmer_runtime::VMFunctionBody; use wasmer_vm::VMFunctionBody;
fn apply_relocation( fn apply_relocation(
body: usize, body: usize,

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" }
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
wasmer-engine = { path = "../engine", version = "1.0.0-alpha.1" } wasmer-engine = { path = "../engine", version = "1.0.0-alpha.1" }
wasmer-object = { path = "../object", version = "1.0.0-alpha.1" } wasmer-object = { path = "../object", version = "1.0.0-alpha.1" }
serde = { version = "1.0", features = ["derive", "rc"] } serde = { version = "1.0", features = ["derive", "rc"] }

View File

@ -32,8 +32,8 @@ use wasmer_engine::{
}; };
#[cfg(feature = "compiler")] #[cfg(feature = "compiler")]
use wasmer_object::{emit_compilation, emit_data, get_object_for_target, CompilationNamer}; use wasmer_object::{emit_compilation, emit_data, get_object_for_target, CompilationNamer};
use wasmer_runtime::{MemoryStyle, TableStyle}; use wasmer_vm::{MemoryStyle, TableStyle};
use wasmer_runtime::{ModuleInfo, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline}; use wasmer_vm::{ModuleInfo, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline};
/// A compiled wasm module, ready to be instantiated. /// A compiled wasm module, ready to be instantiated.
pub struct NativeArtifact { pub struct NativeArtifact {

View File

@ -10,7 +10,7 @@ use wasm_common::{Features, FunctionType};
use wasmer_compiler::Compiler; use wasmer_compiler::Compiler;
use wasmer_compiler::{CompileError, Target}; use wasmer_compiler::{CompileError, Target};
use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables};
use wasmer_runtime::{SignatureRegistry, VMSharedSignatureIndex, VMTrampoline}; use wasmer_vm::{SignatureRegistry, VMSharedSignatureIndex, VMTrampoline};
/// A WebAssembly `Native` Engine. /// A WebAssembly `Native` Engine.
#[derive(Clone)] #[derive(Clone)]

View File

@ -13,7 +13,7 @@ edition = "2018"
[dependencies] [dependencies]
wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../wasm-common", version = "1.0.0-alpha.1" }
wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false } wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha.1", default-features = false }
wasmer-runtime = { path = "../runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../vm", version = "1.0.0-alpha.1" }
target-lexicon = { version = "0.10", default-features = false } target-lexicon = { version = "0.10", default-features = false }
# flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" } # flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" }
backtrace = "0.3" backtrace = "0.3"

View File

@ -11,7 +11,7 @@ use wasm_common::{
SignatureIndex, TableIndex, SignatureIndex, TableIndex,
}; };
use wasmer_compiler::Features; use wasmer_compiler::Features;
use wasmer_runtime::{ use wasmer_vm::{
InstanceHandle, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex, InstanceHandle, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex,
}; };

View File

@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
use std::sync::Arc; use std::sync::Arc;
use wasm_common::FunctionType; use wasm_common::FunctionType;
use wasmer_compiler::{CompileError, Target}; use wasmer_compiler::{CompileError, Target};
use wasmer_runtime::{VMSharedSignatureIndex, VMTrampoline}; use wasmer_vm::{VMSharedSignatureIndex, VMTrampoline};
/// A unimplemented Wasmer `Engine`. /// A unimplemented Wasmer `Engine`.
/// ///

View File

@ -5,7 +5,7 @@ use crate::{ImportError, LinkError};
use more_asserts::assert_ge; use more_asserts::assert_ge;
use wasm_common::entity::{BoxedSlice, EntityRef, PrimaryMap}; use wasm_common::entity::{BoxedSlice, EntityRef, PrimaryMap};
use wasm_common::{ExternType, FunctionIndex, ImportIndex, MemoryIndex, TableIndex}; use wasm_common::{ExternType, FunctionIndex, ImportIndex, MemoryIndex, TableIndex};
use wasmer_runtime::{ use wasmer_vm::{
Export, Imports, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMFunctionImport, Export, Imports, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMFunctionImport,
VMFunctionKind, VMGlobalImport, VMMemoryImport, VMTableImport, VMFunctionKind, VMGlobalImport, VMMemoryImport, VMTableImport,
}; };

View File

@ -4,7 +4,7 @@ use std::error::Error;
use std::fmt; use std::fmt;
use std::sync::Arc; use std::sync::Arc;
use std::sync::RwLockReadGuard; use std::sync::RwLockReadGuard;
use wasmer_runtime::{raise_user_trap, Trap, TrapCode}; use wasmer_vm::{raise_user_trap, Trap, TrapCode};
/// A struct representing an aborted instruction execution, with a message /// A struct representing an aborted instruction execution, with a message
/// indicating the cause. /// indicating the cause.

View File

@ -5,7 +5,7 @@
//! //!
//! # Example //! # Example
//! ```ignore //! ```ignore
//! use wasmer_runtime::{ModuleInfo, FRAME_INFO}; //! use wasmer_vm::{ModuleInfo, FRAME_INFO};
//! //!
//! let module: ModuleInfo = ...; //! let module: ModuleInfo = ...;
//! FRAME_INFO.register(module, compiled_functions); //! FRAME_INFO.register(module, compiled_functions);
@ -17,7 +17,7 @@ use std::sync::{Arc, RwLock};
use wasm_common::entity::{BoxedSlice, EntityRef, PrimaryMap}; use wasm_common::entity::{BoxedSlice, EntityRef, PrimaryMap};
use wasm_common::LocalFunctionIndex; use wasm_common::LocalFunctionIndex;
use wasmer_compiler::{CompiledFunctionFrameInfo, SourceLoc, TrapInformation}; use wasmer_compiler::{CompiledFunctionFrameInfo, SourceLoc, TrapInformation};
use wasmer_runtime::{ModuleInfo, VMFunctionBody}; use wasmer_vm::{ModuleInfo, VMFunctionBody};
lazy_static::lazy_static! { lazy_static::lazy_static! {
/// This is a global cache of backtrace frame information for all active /// This is a global cache of backtrace frame information for all active

View File

@ -5,9 +5,9 @@ use wasm_common::{
LocalGlobalIndex, LocalMemoryIndex, LocalTableIndex, MemoryIndex, MemoryType, TableIndex, LocalGlobalIndex, LocalMemoryIndex, LocalTableIndex, MemoryIndex, MemoryType, TableIndex,
TableType, TableType,
}; };
use wasmer_runtime::MemoryError; use wasmer_vm::MemoryError;
use wasmer_runtime::{Memory, ModuleInfo, Table, VMGlobalDefinition}; use wasmer_vm::{Memory, ModuleInfo, Table, VMGlobalDefinition};
use wasmer_runtime::{MemoryStyle, TableStyle}; use wasmer_vm::{MemoryStyle, TableStyle};
/// Tunables for an engine /// Tunables for an engine
pub trait Tunables { pub trait Tunables {

View File

@ -1,5 +1,5 @@
[package] [package]
name = "wasmer-runtime" name = "wasmer-vm"
version = "1.0.0-alpha.1" version = "1.0.0-alpha.1"
authors = ["Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["Wasmer Engineering Team <engineering@wasmer.io>"]
description = "Runtime library support for Wasmer" description = "Runtime library support for Wasmer"

View File

@ -1,6 +1,6 @@
# Wasmer Runtime # Wasmer Runtime
This is the `wasmer-runtime` crate, which contains wasm runtime library This is the `wasmer-vm` crate, which contains wasm runtime library
support, supporting the wasm ABI used by any [`wasmer-engine`] implementation. support, supporting the wasm ABI used by any [`wasmer-engine`] implementation.
[`wasmer-engine`]: https://crates.io/crates/wasmer-engine [`wasmer-engine`]: https://crates.io/crates/wasmer-engine

View File

@ -1,7 +1,7 @@
// This file contains code from external sources. // This file contains code from external sources.
// Attributions: https://github.com/wasmerio/wasmer-reborn/blob/master/ATTRIBUTIONS.md // Attributions: https://github.com/wasmerio/wasmer-reborn/blob/master/ATTRIBUTIONS.md
//! Offsets and sizes of various structs in wasmer-runtime's vmcontext //! Offsets and sizes of various structs in wasmer-vm's vmcontext
//! module. //! module.
#![deny(intra_doc_link_resolution_failure)] #![deny(intra_doc_link_resolution_failure)]

View File

@ -9,7 +9,7 @@ publish = false
[dependencies] [dependencies]
wasm-common = { path = "../../../lib/wasm-common", version = "1.0.0-alpha.1" } wasm-common = { path = "../../../lib/wasm-common", version = "1.0.0-alpha.1" }
wasmer-compiler = { path = "../../../lib/compiler", version = "1.0.0-alpha.1" } wasmer-compiler = { path = "../../../lib/compiler", version = "1.0.0-alpha.1" }
wasmer-runtime = { path = "../../../lib/runtime", version = "1.0.0-alpha.1" } wasmer-vm = { path = "../../../lib/vm", version = "1.0.0-alpha.1" }
wasmer-engine = { path = "../../../lib/engine", version = "1.0.0-alpha.1" } wasmer-engine = { path = "../../../lib/engine", version = "1.0.0-alpha.1" }
serde = { version = "1.0", features = ["derive", "rc"], optional = true } serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde_bytes = { version = "0.11", optional = true } serde_bytes = { version = "0.11", optional = true }

View File

@ -14,7 +14,7 @@ use wasmer_compiler::CompileError;
#[cfg(feature = "compiler")] #[cfg(feature = "compiler")]
use wasmer_compiler::ModuleEnvironment; use wasmer_compiler::ModuleEnvironment;
use wasmer_engine::{Artifact, DeserializeError, Engine as _, SerializeError, Tunables}; use wasmer_engine::{Artifact, DeserializeError, Engine as _, SerializeError, Tunables};
use wasmer_runtime::{ use wasmer_vm::{
MemoryStyle, ModuleInfo, TableStyle, VMContext, VMFunctionBody, VMSharedSignatureIndex, MemoryStyle, ModuleInfo, TableStyle, VMContext, VMFunctionBody, VMSharedSignatureIndex,
}; };

View File

@ -5,7 +5,7 @@ use std::sync::Arc;
use wasm_common::FunctionType; use wasm_common::FunctionType;
use wasmer_compiler::{CompileError, Features, Target}; use wasmer_compiler::{CompileError, Features, Target};
use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables};
use wasmer_runtime::{ use wasmer_vm::{
SignatureRegistry, VMContext, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, SignatureRegistry, VMContext, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline,
}; };