diff --git a/Cargo.lock b/Cargo.lock index 8408cfbd8..6bc1893aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2073,7 +2073,7 @@ dependencies = [ "wasmer-engine-dummy", "wasmer-engine-jit", "wasmer-engine-native", - "wasmer-runtime", + "wasmer-vm", "wat", "winapi", ] @@ -2161,7 +2161,7 @@ dependencies = [ "target-lexicon", "thiserror", "wasm-common", - "wasmer-runtime", + "wasmer-vm", "wasmparser", ] @@ -2181,7 +2181,7 @@ dependencies = [ "tracing", "wasm-common", "wasmer-compiler", - "wasmer-runtime", + "wasmer-vm", ] [[package]] @@ -2203,7 +2203,7 @@ dependencies = [ "target-lexicon", "wasm-common", "wasmer-compiler", - "wasmer-runtime", + "wasmer-vm", ] [[package]] @@ -2221,7 +2221,7 @@ dependencies = [ "smallvec", "wasm-common", "wasmer-compiler", - "wasmer-runtime", + "wasmer-vm", ] [[package]] @@ -2253,7 +2253,7 @@ dependencies = [ "thiserror", "wasm-common", "wasmer-compiler", - "wasmer-runtime", + "wasmer-vm", "winapi", ] @@ -2267,7 +2267,7 @@ dependencies = [ "wasm-common", "wasmer-compiler", "wasmer-engine", - "wasmer-runtime", + "wasmer-vm", ] [[package]] @@ -2282,7 +2282,7 @@ dependencies = [ "wasm-common", "wasmer-compiler", "wasmer-engine", - "wasmer-runtime", + "wasmer-vm", "winapi", ] @@ -2302,7 +2302,7 @@ dependencies = [ "wasmer-compiler", "wasmer-engine", "wasmer-object", - "wasmer-runtime", + "wasmer-vm", ] [[package]] @@ -2316,7 +2316,7 @@ dependencies = [ ] [[package]] -name = "wasmer-runtime" +name = "wasmer-vm" version = "1.0.0-alpha.1" dependencies = [ "backtrace", diff --git a/Makefile b/Makefile index 5c1753918..70545858e 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ test-llvm: test-packages: 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 wasmer-wasi --release @@ -181,8 +181,8 @@ package-docs: build-docs build-docs-capi mkdir -p "package/docs/c" cp -R target/doc package/docs/crates cp -R lib/c-api/doc/html package/docs/c-api - echo '' > package/docs/index.html - echo '' > package/docs/crates/index.html + echo '' > package/docs/index.html + echo '' > package/docs/crates/index.html package: package-wapm package-wasmer package-capi cp LICENSE package/LICENSE diff --git a/README.md b/README.md index 1a04a8440..dec65ed6b 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Wasmer runtime can be used as a library embedded in different languages, so you |   | 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 | ![last release](https://img.shields.io/crates/v/wasmer-runtime?style=flat-square) | ![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 | ![last release](https://img.shields.io/crates/v/wasmer-vm?style=flat-square) | ![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 | ![last release](https://img.shields.io/github/v/release/wasmerio/wasmer?style=flat-square) | ![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 | ![last release](https://img.shields.io/pypi/v/wasmer?style=flat-square) | ![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 | ![last release](https://img.shields.io/github/v/release/wasmerio/go-ext-wasm?style=flat-square) | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/go-ext-wasm?style=flat-square) | diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml index edfec7d0c..7c96d119c 100644 --- a/lib/api/Cargo.toml +++ b/lib/api/Cargo.toml @@ -9,7 +9,7 @@ readme = "README.md" edition = "2018" [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-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 } diff --git a/lib/api/src/exports.rs b/lib/api/src/exports.rs index d6ad03e38..109dde296 100644 --- a/lib/api/src/exports.rs +++ b/lib/api/src/exports.rs @@ -8,7 +8,7 @@ use std::{ sync::Arc, }; use thiserror::Error; -use wasmer_runtime::Export; +use wasmer_vm::Export; /// The `ExportError` can happen when trying to get a specific /// export [`Extern`] from the [`Instance`] exports. diff --git a/lib/api/src/externals/function.rs b/lib/api/src/externals/function.rs index 6cfbd7e21..5b2161d8b 100644 --- a/lib/api/src/externals/function.rs +++ b/lib/api/src/externals/function.rs @@ -8,7 +8,7 @@ use crate::RuntimeError; pub use inner::{FromToNativeWasmType, HostFunction, WasmTypeList, WithEnv, WithoutEnv}; use std::cell::RefCell; use std::cmp::max; -use wasmer_runtime::{ +use wasmer_vm::{ raise_user_trap, resume_panic, wasmer_call_trampoline, Export, ExportFunction, VMCallerCheckedAnyfunc, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, VMTrampoline, @@ -503,7 +503,7 @@ mod inner { use std::marker::PhantomData; use std::panic::{self, AssertUnwindSafe}; 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, /// or to convert `WasmNativeType` value to a Rust value. diff --git a/lib/api/src/externals/global.rs b/lib/api/src/externals/global.rs index 5479bbc3e..275bc40c1 100644 --- a/lib/api/src/externals/global.rs +++ b/lib/api/src/externals/global.rs @@ -6,7 +6,7 @@ use crate::GlobalType; use crate::Mutability; use crate::RuntimeError; use std::fmt; -use wasmer_runtime::{Export, ExportGlobal, VMGlobalDefinition}; +use wasmer_vm::{Export, ExportGlobal, VMGlobalDefinition}; #[derive(Clone)] pub struct Global { diff --git a/lib/api/src/externals/memory.rs b/lib/api/src/externals/memory.rs index c1a72df0e..a42b719e4 100644 --- a/lib/api/src/externals/memory.rs +++ b/lib/api/src/externals/memory.rs @@ -5,7 +5,7 @@ use crate::{MemoryType, MemoryView}; use std::slice; use std::sync::Arc; 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)] pub struct Memory { diff --git a/lib/api/src/externals/mod.rs b/lib/api/src/externals/mod.rs index 35063a3b4..f2405048d 100644 --- a/lib/api/src/externals/mod.rs +++ b/lib/api/src/externals/mod.rs @@ -13,7 +13,7 @@ pub use self::table::Table; use crate::exports::{ExportError, Exportable}; use crate::store::{Store, StoreObject}; use crate::ExternType; -use wasmer_runtime::Export; +use wasmer_vm::Export; #[derive(Clone)] pub enum Extern { diff --git a/lib/api/src/externals/table.rs b/lib/api/src/externals/table.rs index aa8280b6f..f3c44c39d 100644 --- a/lib/api/src/externals/table.rs +++ b/lib/api/src/externals/table.rs @@ -5,7 +5,7 @@ use crate::types::{Val, ValFuncRef}; use crate::RuntimeError; use crate::TableType; 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, /// which stores function references. diff --git a/lib/api/src/import_object.rs b/lib/api/src/import_object.rs index bdb9fd848..8da725e39 100644 --- a/lib/api/src/import_object.rs +++ b/lib/api/src/import_object.rs @@ -9,7 +9,7 @@ use std::{ sync::{Arc, Mutex}, }; use wasmer_engine::NamedResolver; -use wasmer_runtime::Export; +use wasmer_vm::Export; /// The `LikeNamespace` trait represents objects that act as a namespace for imports. /// For example, an `Instance` or `Namespace` could be @@ -62,7 +62,7 @@ impl ImportObject { /// /// # Usage /// ```ignore - /// # use wasmer_runtime::{ImportObject, Instance, Namespace}; + /// # use wasmer_vm::{ImportObject, Instance, Namespace}; /// let mut import_object = ImportObject::new(); /// import_object.get_export("module", "name"); /// ``` @@ -103,7 +103,7 @@ impl ImportObject { /// /// # Usage: /// ```ignore - /// # use wasmer_runtime::{ImportObject, Instance, Namespace}; + /// # use wasmer_vm::{ImportObject, Instance, Namespace}; /// let mut import_object = ImportObject::new(); /// /// import_object.register("namespace0", instance); @@ -250,7 +250,7 @@ mod test { use crate::{Global, Store, Val}; use wasm_common::Type; use wasmer_engine::ChainableNamedResolver; - use wasmer_runtime::Export; + use wasmer_vm::Export; #[test] fn chaining_works() { diff --git a/lib/api/src/instance.rs b/lib/api/src/instance.rs index 44c12ef01..9287f8bda 100644 --- a/lib/api/src/instance.rs +++ b/lib/api/src/instance.rs @@ -4,7 +4,7 @@ use crate::module::Module; use crate::store::Store; use crate::InstantiationError; use wasmer_engine::Resolver; -use wasmer_runtime::InstanceHandle; +use wasmer_vm::InstanceHandle; /// A WebAssembly Instance is a stateful, executable /// instance of a WebAssembly [`Module`]. diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index 950e6dea0..2b0e76a7e 100644 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -17,7 +17,7 @@ mod utils; pub mod internals { //! We use the internals module for exporting types that are only //! 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. pub use crate::externals::{WithEnv, WithoutEnv}; @@ -56,7 +56,7 @@ pub use wasmer_engine::{ ChainableNamedResolver, DeserializeError, Engine, InstantiationError, LinkError, NamedResolver, NamedResolverChain, Resolver, RuntimeError, SerializeError, }; -pub use wasmer_runtime::{raise_user_trap, MemoryError}; +pub use wasmer_vm::{raise_user_trap, MemoryError}; #[cfg(feature = "wat")] pub use wat::parse_bytes as wat2wasm; diff --git a/lib/api/src/module.rs b/lib/api/src/module.rs index 7a481d949..e24dc5570 100644 --- a/lib/api/src/module.rs +++ b/lib/api/src/module.rs @@ -9,7 +9,7 @@ use wasmer_compiler::CompileError; #[cfg(feature = "wat")] use wasmer_compiler::WasmError; use wasmer_engine::{Artifact, DeserializeError, Resolver, SerializeError}; -use wasmer_runtime::{ExportsIterator, ImportsIterator, InstanceHandle, ModuleInfo}; +use wasmer_vm::{ExportsIterator, ImportsIterator, InstanceHandle, ModuleInfo}; #[derive(Error, Debug)] pub enum IoCompileError { diff --git a/lib/api/src/native.rs b/lib/api/src/native.rs index 09616b409..ea0cd4d3b 100644 --- a/lib/api/src/native.rs +++ b/lib/api/src/native.rs @@ -16,7 +16,7 @@ use crate::externals::function::{ use crate::{FromToNativeWasmType, Function, FunctionType, RuntimeError, Store, WasmTypeList}; use std::panic::{catch_unwind, AssertUnwindSafe}; use wasm_common::NativeWasmType; -use wasmer_runtime::{ +use wasmer_vm::{ ExportFunction, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, }; @@ -123,7 +123,7 @@ macro_rules! impl_native_traits { rets_list.as_mut() }; unsafe { - wasmer_runtime::wasmer_call_trampoline( + wasmer_vm::wasmer_call_trampoline( self.vmctx, trampoline, self.address, @@ -147,7 +147,7 @@ macro_rules! impl_native_traits { // but we can't currently detect whether that's safe. // // 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); // // We always pass the vmctx // f( self.vmctx, $( $x, )* ) diff --git a/lib/api/src/ordered_resolver.rs b/lib/api/src/ordered_resolver.rs index adef4447a..5eaa480f2 100644 --- a/lib/api/src/ordered_resolver.rs +++ b/lib/api/src/ordered_resolver.rs @@ -9,7 +9,7 @@ use wasmer_engine::Resolver; use crate::exports::Exportable; use crate::Extern; -use wasmer_runtime::Export; +use wasmer_vm::Export; /// An `OrderedResolver` stores all the `externs` provided to an Instance /// in a Vec, so we can retrieve them later based on index. diff --git a/lib/api/src/tunables.rs b/lib/api/src/tunables.rs index 319be8b34..77c4c742c 100644 --- a/lib/api/src/tunables.rs +++ b/lib/api/src/tunables.rs @@ -5,8 +5,8 @@ use std::sync::Arc; use target_lexicon::{OperatingSystem, PointerWidth}; use wasmer_compiler::Target; use wasmer_engine::Tunables as BaseTunables; -use wasmer_runtime::MemoryError; -use wasmer_runtime::{LinearMemory, LinearTable, Memory, MemoryStyle, Table, TableStyle}; +use wasmer_vm::MemoryError; +use wasmer_vm::{LinearMemory, LinearTable, Memory, MemoryStyle, Table, TableStyle}; /// Tunable parameters for WebAssembly compilation. #[derive(Clone)] diff --git a/lib/api/src/types.rs b/lib/api/src/types.rs index 882b303b8..044361871 100644 --- a/lib/api/src/types.rs +++ b/lib/api/src/types.rs @@ -33,23 +33,23 @@ pub trait ValFuncRef { fn into_checked_anyfunc( &self, store: &Store, - ) -> Result; + ) -> Result; - 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 { fn into_checked_anyfunc( &self, store: &Store, - ) -> Result { + ) -> Result { if !self.comes_from_same_store(store) { return Err(RuntimeError::new("cross-`Store` values are not supported")); } Ok(match self { - Val::ExternRef(ExternRef::Null) => wasmer_runtime::VMCallerCheckedAnyfunc { + Val::ExternRef(ExternRef::Null) => wasmer_vm::VMCallerCheckedAnyfunc { func_ptr: ptr::null(), - type_index: wasmer_runtime::VMSharedSignatureIndex::default(), + type_index: wasmer_vm::VMSharedSignatureIndex::default(), vmctx: ptr::null_mut(), }, 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 { - if item.type_index == wasmer_runtime::VMSharedSignatureIndex::default() { + fn from_checked_anyfunc(item: wasmer_vm::VMCallerCheckedAnyfunc, store: &Store) -> Val { + if item.type_index == wasmer_vm::VMSharedSignatureIndex::default() { return Val::ExternRef(ExternRef::Null); } let signature = store .engine() .lookup_signature(item.type_index) .expect("Signature not found in store"); - let export = wasmer_runtime::ExportFunction { + let export = wasmer_vm::ExportFunction { address: item.func_ptr, signature, // All functions in tables are already Static (as dynamic functions // are converted to use the trampolines with static signatures). - kind: wasmer_runtime::VMFunctionKind::Static, + kind: wasmer_vm::VMFunctionKind::Static, vmctx: item.vmctx, }; let f = Function::from_export(store, export); diff --git a/lib/c-api/src/instance.rs b/lib/c-api/src/instance.rs index 883949a0a..c3cd257ca 100644 --- a/lib/c-api/src/instance.rs +++ b/lib/c-api/src/instance.rs @@ -41,7 +41,7 @@ pub(crate) struct CAPIInstance { pub(crate) ctx_data: Option>, } -/// 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 /// function) as the first argument. It is necessary to read the diff --git a/lib/c-api/src/memory.rs b/lib/c-api/src/memory.rs index 10a98a90d..8f0e92005 100644 --- a/lib/c-api/src/memory.rs +++ b/lib/c-api/src/memory.rs @@ -7,9 +7,9 @@ use crate::{ use std::{cell::Cell, ptr}; 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 /// imports of an instance, or to read it from exports of an instance /// with `wasmer_export_to_memory()`. diff --git a/lib/c-api/src/trampoline.rs b/lib/c-api/src/trampoline.rs index 4bcdbe080..fcaf899ed 100644 --- a/lib/c-api/src/trampoline.rs +++ b/lib/c-api/src/trampoline.rs @@ -2,7 +2,7 @@ use std::ffi::c_void; use std::mem; -use wasmer_runtime_core::trampoline::*; +use wasmer_vm_core::trampoline::*; #[repr(C)] pub struct wasmer_trampoline_buffer_builder_t; diff --git a/lib/c-api/wasmer.h b/lib/c-api/wasmer.h index 39137f85e..ae4219533 100644 --- a/lib/c-api/wasmer.h +++ b/lib/c-api/wasmer.h @@ -243,9 +243,9 @@ typedef 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 * imports of an instance, or to read it from exports of an instance * with `wasmer_export_to_memory()`. @@ -312,7 +312,7 @@ typedef 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 * function) as the first argument. It is necessary to read the diff --git a/lib/c-api/wasmer.hh b/lib/c-api/wasmer.hh index 1166c3044..5bffbb267 100644 --- a/lib/c-api/wasmer.hh +++ b/lib/c-api/wasmer.hh @@ -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 /// imports of an instance, or to read it from exports of an instance /// 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 /// function) as the first argument. It is necessary to read the diff --git a/lib/compiler-cranelift/Cargo.toml b/lib/compiler-cranelift/Cargo.toml index f42350e69..9ee9f8405 100644 --- a/lib/compiler-cranelift/Cargo.toml +++ b/lib/compiler-cranelift/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] 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 } cranelift-codegen = { version = "0.65", default-features = false } cranelift-frontend = { version = "0.65", default-features = false } diff --git a/lib/compiler-cranelift/src/compiler.rs b/lib/compiler-cranelift/src/compiler.rs index f41f6d7bf..a36037f6a 100644 --- a/lib/compiler-cranelift/src/compiler.rs +++ b/lib/compiler-cranelift/src/compiler.rs @@ -219,7 +219,7 @@ impl Compiler for CraneliftCompiler { .into_iter() .collect::>(); - use wasmer_runtime::VMOffsets; + use wasmer_vm::VMOffsets; let offsets = VMOffsets::new_for_trampolines(frontend_config.pointer_bytes()); // dynamic function trampolines (only for imported functions) let dynamic_function_trampolines = module diff --git a/lib/compiler-cranelift/src/func_environ.rs b/lib/compiler-cranelift/src/func_environ.rs index 67b4bf655..38b6fd683 100644 --- a/lib/compiler-cranelift/src/func_environ.rs +++ b/lib/compiler-cranelift/src/func_environ.rs @@ -16,9 +16,9 @@ use wasm_common::entity::EntityRef; use wasm_common::entity::PrimaryMap; use wasm_common::{FunctionIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex}; use wasmer_compiler::{WasmError, WasmResult}; -use wasmer_runtime::VMBuiltinFunctionIndex; -use wasmer_runtime::VMOffsets; -use wasmer_runtime::{MemoryStyle, ModuleInfo, TableStyle}; +use wasmer_vm::VMBuiltinFunctionIndex; +use wasmer_vm::VMOffsets; +use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle}; /// Compute an `ir::ExternalName` for a given wasm function index. pub fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName { diff --git a/lib/compiler-cranelift/src/sink.rs b/lib/compiler-cranelift/src/sink.rs index 4dc2a7e58..9d970d037 100644 --- a/lib/compiler-cranelift/src/sink.rs +++ b/lib/compiler-cranelift/src/sink.rs @@ -6,7 +6,7 @@ use cranelift_codegen::ir::{self, ExternalName}; use wasm_common::entity::EntityRef; use wasm_common::{FunctionIndex, LocalFunctionIndex}; 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 pub(crate) struct RelocSink<'a> { diff --git a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs index efbaee35d..3bd4a8761 100644 --- a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs +++ b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs @@ -18,7 +18,7 @@ use std::mem; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; use wasm_common::FunctionType; use wasmer_compiler::{CompileError, FunctionBody}; -use wasmer_runtime::VMOffsets; +use wasmer_vm::VMOffsets; /// Create a trampoline for invoking a WebAssembly function. pub fn make_trampoline_dynamic_function( diff --git a/lib/compiler-cranelift/src/translator/translation_utils.rs b/lib/compiler-cranelift/src/translator/translation_utils.rs index d5acb4110..1d3ff5413 100644 --- a/lib/compiler-cranelift/src/translator/translation_utils.rs +++ b/lib/compiler-cranelift/src/translator/translation_utils.rs @@ -13,7 +13,7 @@ use wasmer_compiler::wasm_unsupported; use wasmer_compiler::wasmparser; use wasmer_compiler::{JumpTable, RelocationKind}; use wasmer_compiler::{WasmError, WasmResult}; -use wasmer_runtime::libcalls::LibCall; +use wasmer_vm::libcalls::LibCall; /// Helper function translate a Function signature into Cranelift Ir pub fn signature_to_cranelift_ir( diff --git a/lib/compiler-llvm/Cargo.toml b/lib/compiler-llvm/Cargo.toml index be6b72df7..79199c248 100644 --- a/lib/compiler-llvm/Cargo.toml +++ b/lib/compiler-llvm/Cargo.toml @@ -11,7 +11,7 @@ readme = "README.md" [dependencies] 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" } target-lexicon = { version = "0.10", default-features = false } smallvec = "1" diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs index c69aaa6c0..0ce8e1093 100644 --- a/lib/compiler-llvm/src/object_file.rs +++ b/lib/compiler-llvm/src/object_file.rs @@ -7,7 +7,7 @@ use wasmer_compiler::{ CustomSections, FunctionAddressMap, FunctionBody, InstructionAddressMap, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex, SourceLoc, }; -use wasmer_runtime::libcalls::LibCall; +use wasmer_vm::libcalls::LibCall; use wasm_common::entity::entity_impl; #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] diff --git a/lib/compiler-llvm/src/translator/code.rs b/lib/compiler-llvm/src/translator/code.rs index e619546f6..79cedaf63 100644 --- a/lib/compiler-llvm/src/translator/code.rs +++ b/lib/compiler-llvm/src/translator/code.rs @@ -34,7 +34,7 @@ use wasmer_compiler::{ to_wasm_error, wptype_to_type, CompileError, FunctionBodyData, GenerateMiddlewareChain, 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 { CompileError::Codegen(format!("{}", err)) diff --git a/lib/compiler-llvm/src/translator/intrinsics.rs b/lib/compiler-llvm/src/translator/intrinsics.rs index d1e279801..6ba0ed941 100644 --- a/lib/compiler-llvm/src/translator/intrinsics.rs +++ b/lib/compiler-llvm/src/translator/intrinsics.rs @@ -26,8 +26,8 @@ use wasm_common::{ TableIndex, Type, }; use wasmer_compiler::CompileError; -use wasmer_runtime::ModuleInfo as WasmerCompilerModule; -use wasmer_runtime::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; +use wasmer_vm::ModuleInfo as WasmerCompilerModule; +use wasmer_vm::{MemoryStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; pub fn type_to_llvm_ptr<'ctx>( intrinsics: &Intrinsics<'ctx>, diff --git a/lib/compiler-llvm/src/translator/stackmap.rs b/lib/compiler-llvm/src/translator/stackmap.rs index 5225e9f5b..d23ebd1a5 100644 --- a/lib/compiler-llvm/src/translator/stackmap.rs +++ b/lib/compiler-llvm/src/translator/stackmap.rs @@ -2,8 +2,8 @@ use byteorder::{LittleEndian, ReadBytesExt}; use std::io::{self, Cursor}; -use wasmer_runtime_core::vm::Ctx; -use wasmer_runtime_core::{ +use wasmer_vm_core::vm::Ctx; +use wasmer_vm_core::{ module::Module, structures::TypedIndex, types::{GlobalIndex, LocalOrImport, TableIndex}, @@ -65,15 +65,15 @@ impl StackmapEntry { size_record: &StkSizeRecord, map_record: &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 wasmer_runtime_core::state::{ + use wasmer_vm_core::state::{ x64::{new_machine_state, X64Register, GPR}, FunctionStateMap, MachineStateDiff, MachineValue, OffsetInfo, RegisterIndex, SuspendOffset, WasmAbstractValue, }; - use wasmer_runtime_core::vm; + use wasmer_vm_core::vm; let func_base_addr = (size_record.function_address as usize) .checked_sub(code_addr) diff --git a/lib/compiler-singlepass/Cargo.toml b/lib/compiler-singlepass/Cargo.toml index a3c1ce9be..05989a69e 100644 --- a/lib/compiler-singlepass/Cargo.toml +++ b/lib/compiler-singlepass/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] 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 } rayon = "1.3" hashbrown = { version = "0.7", optional = true } diff --git a/lib/compiler-singlepass/src/codegen_x64.rs b/lib/compiler-singlepass/src/codegen_x64.rs index a4f4990d5..514d7e0bb 100644 --- a/lib/compiler-singlepass/src/codegen_x64.rs +++ b/lib/compiler-singlepass/src/codegen_x64.rs @@ -19,9 +19,7 @@ use wasmer_compiler::{ FunctionBody, Relocation, RelocationKind, RelocationTarget, SectionBody, SectionIndex, TrapInformation, }; -use wasmer_runtime::{ - MemoryStyle, ModuleInfo, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets, -}; +use wasmer_vm::{MemoryStyle, ModuleInfo, TableStyle, TrapCode, VMBuiltinFunctionIndex, VMOffsets}; /// The singlepass per-function code generator. pub struct FuncGen<'a> { diff --git a/lib/compiler-singlepass/src/compiler.rs b/lib/compiler-singlepass/src/compiler.rs index dc14dd227..2277d1ba1 100644 --- a/lib/compiler-singlepass/src/compiler.rs +++ b/lib/compiler-singlepass/src/compiler.rs @@ -19,7 +19,7 @@ use wasmer_compiler::{ ModuleTranslationState, Target, }; 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. /// It does the compilation in one pass diff --git a/lib/compiler/Cargo.toml b/lib/compiler/Cargo.toml index fe8f864f0..4c0bc00a8 100644 --- a/lib/compiler/Cargo.toml +++ b/lib/compiler/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["webassembly", "wasm", "compiler"] edition = "2018" [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" } wasmparser = { version = "0.57", optional = true, default-features = false } target-lexicon = { version = "0.10", default-features = false } diff --git a/lib/compiler/src/module.rs b/lib/compiler/src/module.rs index b22ad04f7..53321243a 100644 --- a/lib/compiler/src/module.rs +++ b/lib/compiler/src/module.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use std::sync::Arc; use wasm_common::entity::PrimaryMap; 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. /// diff --git a/lib/compiler/src/relocation.rs b/lib/compiler/src/relocation.rs index db181ec04..718137ec9 100644 --- a/lib/compiler/src/relocation.rs +++ b/lib/compiler/src/relocation.rs @@ -17,7 +17,7 @@ use crate::{Addend, CodeOffset, JumpTable}; use serde::{Deserialize, Serialize}; use wasm_common::entity::PrimaryMap; use wasm_common::LocalFunctionIndex; -use wasmer_runtime::libcalls::LibCall; +use wasmer_vm::libcalls::LibCall; /// Relocation kinds for every ISA. #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] diff --git a/lib/compiler/src/translator/environ.rs b/lib/compiler/src/translator/environ.rs index 90b6c8a6c..43bd78608 100644 --- a/lib/compiler/src/translator/environ.rs +++ b/lib/compiler/src/translator/environ.rs @@ -16,7 +16,7 @@ use wasm_common::{ ExportIndex, FunctionIndex, GlobalIndex, GlobalInit, GlobalType, ImportIndex, 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. #[derive(Hash)] diff --git a/lib/compiler/src/trap.rs b/lib/compiler/src/trap.rs index cfd3c1ff9..6a0a997d1 100644 --- a/lib/compiler/src/trap.rs +++ b/lib/compiler/src/trap.rs @@ -2,7 +2,7 @@ use crate::sourceloc::SourceLoc; use crate::CodeOffset; #[cfg(feature = "enable-serde")] use serde::{Deserialize, Serialize}; -use wasmer_runtime::TrapCode; +use wasmer_vm::TrapCode; /// Information about trap. #[cfg_attr(feature = "enable-serde", derive(Deserialize, Serialize))] diff --git a/lib/engine-jit/Cargo.toml b/lib/engine-jit/Cargo.toml index 75abfb493..b097d57cf 100644 --- a/lib/engine-jit/Cargo.toml +++ b/lib/engine-jit/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] 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-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" } # flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" } region = "2.1" diff --git a/lib/engine-jit/src/artifact.rs b/lib/engine-jit/src/artifact.rs index 0e15a545f..493f4d3fc 100644 --- a/lib/engine-jit/src/artifact.rs +++ b/lib/engine-jit/src/artifact.rs @@ -22,7 +22,7 @@ use wasmer_engine::{ }; #[cfg(feature = "compiler")] 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. pub struct JITArtifact { diff --git a/lib/engine-jit/src/code_memory.rs b/lib/engine-jit/src/code_memory.rs index 21c8bcd26..1705aab34 100644 --- a/lib/engine-jit/src/code_memory.rs +++ b/lib/engine-jit/src/code_memory.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use std::{cmp, mem}; use wasm_common::entity::{EntityRef, PrimaryMap}; use wasmer_compiler::{CompiledFunctionUnwindInfo, FunctionBody, SectionBody}; -use wasmer_runtime::{Mmap, VMFunctionBody}; +use wasmer_vm::{Mmap, VMFunctionBody}; /// The optimal alignment for functions. /// diff --git a/lib/engine-jit/src/engine.rs b/lib/engine-jit/src/engine.rs index 1a98da780..1d5c44235 100644 --- a/lib/engine-jit/src/engine.rs +++ b/lib/engine-jit/src/engine.rs @@ -13,7 +13,7 @@ use wasmer_compiler::{ CompileError, CustomSection, CustomSectionProtection, FunctionBody, SectionIndex, Target, }; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; -use wasmer_runtime::{ +use wasmer_vm::{ ModuleInfo, SignatureRegistry, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, }; diff --git a/lib/engine-jit/src/link.rs b/lib/engine-jit/src/link.rs index 8b67ac208..99b2ed9fc 100644 --- a/lib/engine-jit/src/link.rs +++ b/lib/engine-jit/src/link.rs @@ -7,8 +7,8 @@ use wasmer_compiler::{ JumpTable, JumpTableOffsets, Relocation, RelocationKind, RelocationTarget, Relocations, SectionIndex, }; -use wasmer_runtime::ModuleInfo; -use wasmer_runtime::VMFunctionBody; +use wasmer_vm::ModuleInfo; +use wasmer_vm::VMFunctionBody; fn apply_relocation( body: usize, diff --git a/lib/engine-native/Cargo.toml b/lib/engine-native/Cargo.toml index e4fe25d30..562e78032 100644 --- a/lib/engine-native/Cargo.toml +++ b/lib/engine-native/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] 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-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-object = { path = "../object", version = "1.0.0-alpha.1" } serde = { version = "1.0", features = ["derive", "rc"] } diff --git a/lib/engine-native/src/artifact.rs b/lib/engine-native/src/artifact.rs index ee37c4251..b7bb01567 100644 --- a/lib/engine-native/src/artifact.rs +++ b/lib/engine-native/src/artifact.rs @@ -32,8 +32,8 @@ use wasmer_engine::{ }; #[cfg(feature = "compiler")] use wasmer_object::{emit_compilation, emit_data, get_object_for_target, CompilationNamer}; -use wasmer_runtime::{MemoryStyle, TableStyle}; -use wasmer_runtime::{ModuleInfo, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline}; +use wasmer_vm::{MemoryStyle, TableStyle}; +use wasmer_vm::{ModuleInfo, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline}; /// A compiled wasm module, ready to be instantiated. pub struct NativeArtifact { diff --git a/lib/engine-native/src/engine.rs b/lib/engine-native/src/engine.rs index 00e10876a..26e293d6b 100644 --- a/lib/engine-native/src/engine.rs +++ b/lib/engine-native/src/engine.rs @@ -10,7 +10,7 @@ use wasm_common::{Features, FunctionType}; use wasmer_compiler::Compiler; use wasmer_compiler::{CompileError, Target}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; -use wasmer_runtime::{SignatureRegistry, VMSharedSignatureIndex, VMTrampoline}; +use wasmer_vm::{SignatureRegistry, VMSharedSignatureIndex, VMTrampoline}; /// A WebAssembly `Native` Engine. #[derive(Clone)] diff --git a/lib/engine/Cargo.toml b/lib/engine/Cargo.toml index 3d3539c7a..2ed749ee9 100644 --- a/lib/engine/Cargo.toml +++ b/lib/engine/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" [dependencies] 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-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 } # flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" } backtrace = "0.3" diff --git a/lib/engine/src/artifact.rs b/lib/engine/src/artifact.rs index f2730278c..b033f76e4 100644 --- a/lib/engine/src/artifact.rs +++ b/lib/engine/src/artifact.rs @@ -11,7 +11,7 @@ use wasm_common::{ SignatureIndex, TableIndex, }; use wasmer_compiler::Features; -use wasmer_runtime::{ +use wasmer_vm::{ InstanceHandle, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMSharedSignatureIndex, }; diff --git a/lib/engine/src/engine.rs b/lib/engine/src/engine.rs index 327e7ca4d..f2491b9f4 100644 --- a/lib/engine/src/engine.rs +++ b/lib/engine/src/engine.rs @@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; use std::sync::Arc; use wasm_common::FunctionType; use wasmer_compiler::{CompileError, Target}; -use wasmer_runtime::{VMSharedSignatureIndex, VMTrampoline}; +use wasmer_vm::{VMSharedSignatureIndex, VMTrampoline}; /// A unimplemented Wasmer `Engine`. /// diff --git a/lib/engine/src/resolver.rs b/lib/engine/src/resolver.rs index d3c8bf974..7b20f5554 100644 --- a/lib/engine/src/resolver.rs +++ b/lib/engine/src/resolver.rs @@ -5,7 +5,7 @@ use crate::{ImportError, LinkError}; use more_asserts::assert_ge; use wasm_common::entity::{BoxedSlice, EntityRef, PrimaryMap}; use wasm_common::{ExternType, FunctionIndex, ImportIndex, MemoryIndex, TableIndex}; -use wasmer_runtime::{ +use wasmer_vm::{ Export, Imports, MemoryStyle, ModuleInfo, TableStyle, VMFunctionBody, VMFunctionImport, VMFunctionKind, VMGlobalImport, VMMemoryImport, VMTableImport, }; diff --git a/lib/engine/src/trap/error.rs b/lib/engine/src/trap/error.rs index 381bf7cb2..981e81c8a 100644 --- a/lib/engine/src/trap/error.rs +++ b/lib/engine/src/trap/error.rs @@ -4,7 +4,7 @@ use std::error::Error; use std::fmt; use std::sync::Arc; 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 /// indicating the cause. diff --git a/lib/engine/src/trap/frame_info.rs b/lib/engine/src/trap/frame_info.rs index 89dc32fd6..bfcabee9a 100644 --- a/lib/engine/src/trap/frame_info.rs +++ b/lib/engine/src/trap/frame_info.rs @@ -5,7 +5,7 @@ //! //! # Example //! ```ignore -//! use wasmer_runtime::{ModuleInfo, FRAME_INFO}; +//! use wasmer_vm::{ModuleInfo, FRAME_INFO}; //! //! let module: ModuleInfo = ...; //! 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::LocalFunctionIndex; use wasmer_compiler::{CompiledFunctionFrameInfo, SourceLoc, TrapInformation}; -use wasmer_runtime::{ModuleInfo, VMFunctionBody}; +use wasmer_vm::{ModuleInfo, VMFunctionBody}; lazy_static::lazy_static! { /// This is a global cache of backtrace frame information for all active diff --git a/lib/engine/src/tunables.rs b/lib/engine/src/tunables.rs index ab8d32801..5d3bcc9c3 100644 --- a/lib/engine/src/tunables.rs +++ b/lib/engine/src/tunables.rs @@ -5,9 +5,9 @@ use wasm_common::{ LocalGlobalIndex, LocalMemoryIndex, LocalTableIndex, MemoryIndex, MemoryType, TableIndex, TableType, }; -use wasmer_runtime::MemoryError; -use wasmer_runtime::{Memory, ModuleInfo, Table, VMGlobalDefinition}; -use wasmer_runtime::{MemoryStyle, TableStyle}; +use wasmer_vm::MemoryError; +use wasmer_vm::{Memory, ModuleInfo, Table, VMGlobalDefinition}; +use wasmer_vm::{MemoryStyle, TableStyle}; /// Tunables for an engine pub trait Tunables { diff --git a/lib/runtime/Cargo.toml b/lib/vm/Cargo.toml similarity index 97% rename from lib/runtime/Cargo.toml rename to lib/vm/Cargo.toml index 477b478b2..f2a70fa98 100644 --- a/lib/runtime/Cargo.toml +++ b/lib/vm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wasmer-runtime" +name = "wasmer-vm" version = "1.0.0-alpha.1" authors = ["Wasmer Engineering Team "] description = "Runtime library support for Wasmer" diff --git a/lib/runtime/README.md b/lib/vm/README.md similarity index 87% rename from lib/runtime/README.md rename to lib/vm/README.md index cc473dcc1..3b0212460 100644 --- a/lib/runtime/README.md +++ b/lib/vm/README.md @@ -1,6 +1,6 @@ # 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. [`wasmer-engine`]: https://crates.io/crates/wasmer-engine diff --git a/lib/runtime/build.rs b/lib/vm/build.rs similarity index 100% rename from lib/runtime/build.rs rename to lib/vm/build.rs diff --git a/lib/runtime/src/export.rs b/lib/vm/src/export.rs similarity index 100% rename from lib/runtime/src/export.rs rename to lib/vm/src/export.rs diff --git a/lib/runtime/src/imports.rs b/lib/vm/src/imports.rs similarity index 100% rename from lib/runtime/src/imports.rs rename to lib/vm/src/imports.rs diff --git a/lib/runtime/src/instance.rs b/lib/vm/src/instance.rs similarity index 100% rename from lib/runtime/src/instance.rs rename to lib/vm/src/instance.rs diff --git a/lib/runtime/src/lib.rs b/lib/vm/src/lib.rs similarity index 100% rename from lib/runtime/src/lib.rs rename to lib/vm/src/lib.rs diff --git a/lib/runtime/src/libcalls.rs b/lib/vm/src/libcalls.rs similarity index 100% rename from lib/runtime/src/libcalls.rs rename to lib/vm/src/libcalls.rs diff --git a/lib/runtime/src/memory.rs b/lib/vm/src/memory.rs similarity index 100% rename from lib/runtime/src/memory.rs rename to lib/vm/src/memory.rs diff --git a/lib/runtime/src/mmap.rs b/lib/vm/src/mmap.rs similarity index 100% rename from lib/runtime/src/mmap.rs rename to lib/vm/src/mmap.rs diff --git a/lib/runtime/src/module.rs b/lib/vm/src/module.rs similarity index 100% rename from lib/runtime/src/module.rs rename to lib/vm/src/module.rs diff --git a/lib/runtime/src/probestack.rs b/lib/vm/src/probestack.rs similarity index 100% rename from lib/runtime/src/probestack.rs rename to lib/vm/src/probestack.rs diff --git a/lib/runtime/src/sig_registry.rs b/lib/vm/src/sig_registry.rs similarity index 100% rename from lib/runtime/src/sig_registry.rs rename to lib/vm/src/sig_registry.rs diff --git a/lib/runtime/src/table.rs b/lib/vm/src/table.rs similarity index 100% rename from lib/runtime/src/table.rs rename to lib/vm/src/table.rs diff --git a/lib/runtime/src/trap/helpers.c b/lib/vm/src/trap/helpers.c similarity index 100% rename from lib/runtime/src/trap/helpers.c rename to lib/vm/src/trap/helpers.c diff --git a/lib/runtime/src/trap/mod.rs b/lib/vm/src/trap/mod.rs similarity index 100% rename from lib/runtime/src/trap/mod.rs rename to lib/vm/src/trap/mod.rs diff --git a/lib/runtime/src/trap/trapcode.rs b/lib/vm/src/trap/trapcode.rs similarity index 100% rename from lib/runtime/src/trap/trapcode.rs rename to lib/vm/src/trap/trapcode.rs diff --git a/lib/runtime/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs similarity index 100% rename from lib/runtime/src/trap/traphandlers.rs rename to lib/vm/src/trap/traphandlers.rs diff --git a/lib/runtime/src/vmcontext.rs b/lib/vm/src/vmcontext.rs similarity index 100% rename from lib/runtime/src/vmcontext.rs rename to lib/vm/src/vmcontext.rs diff --git a/lib/runtime/src/vmoffsets.rs b/lib/vm/src/vmoffsets.rs similarity index 99% rename from lib/runtime/src/vmoffsets.rs rename to lib/vm/src/vmoffsets.rs index e0566ee2c..5266c2991 100644 --- a/lib/runtime/src/vmoffsets.rs +++ b/lib/vm/src/vmoffsets.rs @@ -1,7 +1,7 @@ // This file contains code from external sources. // 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. #![deny(intra_doc_link_resolution_failure)] diff --git a/tests/lib/engine-dummy/Cargo.toml b/tests/lib/engine-dummy/Cargo.toml index be51a309b..27c5a7a3c 100644 --- a/tests/lib/engine-dummy/Cargo.toml +++ b/tests/lib/engine-dummy/Cargo.toml @@ -9,7 +9,7 @@ publish = false [dependencies] wasm-common = { path = "../../../lib/wasm-common", 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" } serde = { version = "1.0", features = ["derive", "rc"], optional = true } serde_bytes = { version = "0.11", optional = true } diff --git a/tests/lib/engine-dummy/src/artifact.rs b/tests/lib/engine-dummy/src/artifact.rs index 7956cb185..9e316df9c 100644 --- a/tests/lib/engine-dummy/src/artifact.rs +++ b/tests/lib/engine-dummy/src/artifact.rs @@ -14,7 +14,7 @@ use wasmer_compiler::CompileError; #[cfg(feature = "compiler")] use wasmer_compiler::ModuleEnvironment; use wasmer_engine::{Artifact, DeserializeError, Engine as _, SerializeError, Tunables}; -use wasmer_runtime::{ +use wasmer_vm::{ MemoryStyle, ModuleInfo, TableStyle, VMContext, VMFunctionBody, VMSharedSignatureIndex, }; diff --git a/tests/lib/engine-dummy/src/engine.rs b/tests/lib/engine-dummy/src/engine.rs index f72a2d520..7f3e2658e 100644 --- a/tests/lib/engine-dummy/src/engine.rs +++ b/tests/lib/engine-dummy/src/engine.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use wasm_common::FunctionType; use wasmer_compiler::{CompileError, Features, Target}; use wasmer_engine::{Artifact, DeserializeError, Engine, EngineId, Tunables}; -use wasmer_runtime::{ +use wasmer_vm::{ SignatureRegistry, VMContext, VMFunctionBody, VMSharedSignatureIndex, VMTrampoline, };