mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-16 02:11:20 +00:00
Redesign the interface between the runtime and the backends.
This removes the ProtectedCaller and FuncResolver traits, simplifying call implementations and improving dynamic call throughput.
This commit is contained in:
@ -544,42 +544,23 @@ mod vm_ctx_tests {
|
||||
|
||||
fn generate_module() -> ModuleInner {
|
||||
use super::Func;
|
||||
use crate::backend::{
|
||||
sys::Memory, Backend, CacheGen, FuncResolver, ProtectedCaller, Token, UserTrapper,
|
||||
};
|
||||
use crate::backend::{sys::Memory, Backend, CacheGen, RunnableModule, UserTrapper};
|
||||
use crate::cache::Error as CacheError;
|
||||
use crate::error::RuntimeResult;
|
||||
use crate::typed_func::Wasm;
|
||||
use crate::types::{FuncIndex, LocalFuncIndex, SigIndex, Value};
|
||||
use crate::types::{LocalFuncIndex, SigIndex};
|
||||
use hashbrown::HashMap;
|
||||
use std::ptr::NonNull;
|
||||
struct Placeholder;
|
||||
impl FuncResolver for Placeholder {
|
||||
fn get(
|
||||
impl RunnableModule for Placeholder {
|
||||
fn get_func(
|
||||
&self,
|
||||
_module: &ModuleInner,
|
||||
_module: &ModuleInfo,
|
||||
_local_func_index: LocalFuncIndex,
|
||||
) -> Option<NonNull<Func>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
impl ProtectedCaller for Placeholder {
|
||||
fn call(
|
||||
&self,
|
||||
_module: &ModuleInner,
|
||||
_func_index: FuncIndex,
|
||||
_params: &[Value],
|
||||
_import_backing: &ImportBacking,
|
||||
_vmctx: *mut Ctx,
|
||||
_: Token,
|
||||
) -> RuntimeResult<Vec<Value>> {
|
||||
Ok(vec![])
|
||||
}
|
||||
fn get_wasm_trampoline(
|
||||
&self,
|
||||
_module: &ModuleInner,
|
||||
_sig_index: SigIndex,
|
||||
) -> Option<Wasm> {
|
||||
|
||||
fn get_trampoline(&self, _module: &ModuleInfo, _sig_index: SigIndex) -> Option<Wasm> {
|
||||
unimplemented!()
|
||||
}
|
||||
fn get_early_trapper(&self) -> Box<dyn UserTrapper> {
|
||||
@ -596,8 +577,7 @@ mod vm_ctx_tests {
|
||||
}
|
||||
|
||||
ModuleInner {
|
||||
func_resolver: Box::new(Placeholder),
|
||||
protected_caller: Box::new(Placeholder),
|
||||
runnable_module: Box::new(Placeholder),
|
||||
cache_gen: Box::new(Placeholder),
|
||||
info: ModuleInfo {
|
||||
memories: Map::new(),
|
||||
|
Reference in New Issue
Block a user