mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 06:38:22 +00:00
Created vm module
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
use std::{any::Any, marker::PhantomData};
|
||||
|
||||
#[cfg(feature = "js")]
|
||||
use crate::js::vm::VMFunctionEnvironment;
|
||||
#[cfg(feature = "sys")]
|
||||
use wasmer_vm::VMFunctionEnvironment;
|
||||
use crate::vm::VMFunctionEnvironment;
|
||||
|
||||
use crate::store::{AsStoreMut, AsStoreRef, StoreHandle, StoreMut, StoreObjects, StoreRef};
|
||||
|
||||
|
||||
@@ -211,3 +211,8 @@ impl VMFunctionEnvironment {
|
||||
&mut *self.contents
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) type VMExternTable = VMTable;
|
||||
pub(crate) type VMExternMemory = VMMemory;
|
||||
pub(crate) type VMExternGlobal = VMGlobal;
|
||||
pub(crate) type VMExternFunction = VMFunction;
|
||||
|
||||
@@ -445,6 +445,7 @@ mod ptr;
|
||||
mod store;
|
||||
mod typed_function;
|
||||
mod value;
|
||||
pub mod vm;
|
||||
|
||||
#[cfg(feature = "sys")]
|
||||
mod sys;
|
||||
|
||||
@@ -16,13 +16,19 @@ pub use wasmer_compiler::{Features, FrameInfo, LinkError, RuntimeError, Tunables
|
||||
|
||||
// TODO: should those be moved into wasmer::vm as well?
|
||||
pub use wasmer_vm::{raise_user_trap, MemoryError};
|
||||
pub mod vm {
|
||||
pub(crate) mod vm {
|
||||
//! The `vm` module re-exports wasmer-vm types.
|
||||
|
||||
pub use wasmer_vm::{
|
||||
MemoryError, MemoryStyle, TableStyle, VMExtern, VMMemory, VMMemoryDefinition,
|
||||
VMOwnedMemory, VMSharedMemory, VMTable, VMTableDefinition,
|
||||
use wasmer_vm::InternalStoreHandle;
|
||||
pub(crate) use wasmer_vm::{
|
||||
MemoryError, MemoryStyle, TableStyle, VMExtern, VMFunction, VMFunctionEnvironment,
|
||||
VMGlobal, VMMemory, VMMemoryDefinition, VMOwnedMemory, VMSharedMemory, VMTable,
|
||||
VMTableDefinition,
|
||||
};
|
||||
|
||||
pub(crate) type VMExternTable = InternalStoreHandle<VMTable>;
|
||||
pub(crate) type VMExternMemory = InternalStoreHandle<VMMemory>;
|
||||
pub(crate) type VMExternGlobal = InternalStoreHandle<VMGlobal>;
|
||||
pub(crate) type VMExternFunction = InternalStoreHandle<VMFunction>;
|
||||
}
|
||||
|
||||
#[cfg(feature = "wat")]
|
||||
|
||||
22
lib/api/src/vm.rs
Normal file
22
lib/api/src/vm.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
//! The `vm` module re-exports wasmer-vm types.
|
||||
|
||||
#[cfg(feature = "js")]
|
||||
pub(crate) use crate::js::vm::{
|
||||
VMExtern, VMExternFunction, VMExternGlobal, VMExternMemory, VMExternTable, VMFunction,
|
||||
VMFunctionEnvironment, VMGlobal, VMMemory, VMTable,
|
||||
};
|
||||
|
||||
#[cfg(feature = "sys")]
|
||||
pub(crate) use crate::sys::vm::{
|
||||
VMExtern, VMExternFunction, VMExternGlobal, VMExternMemory, VMExternTable,
|
||||
VMFunctionEnvironment,
|
||||
};
|
||||
|
||||
// Needed for tunables customization
|
||||
#[cfg(feature = "sys")]
|
||||
pub use wasmer_vm::{
|
||||
VMFunction, VMGlobal, VMMemory, VMMemoryDefinition, VMTable, VMTableDefinition,
|
||||
};
|
||||
|
||||
// Deprecated exports
|
||||
pub use wasmer_types::{MemoryError, MemoryStyle, TableStyle};
|
||||
Reference in New Issue
Block a user