mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-19 03:41:22 +00:00
Update api again and change SerializedCache to Artifact
This commit is contained in:
@ -4,7 +4,7 @@ use hashbrown::HashMap;
|
||||
use std::sync::Arc;
|
||||
use wasmer_runtime_core::{
|
||||
backend::{sys::Memory, CacheGen},
|
||||
cache::{Error, SerializedCache},
|
||||
cache::{Artifact, Error},
|
||||
module::{ModuleInfo, ModuleInner},
|
||||
structures::Map,
|
||||
types::{LocalFuncIndex, SigIndex},
|
||||
@ -61,7 +61,7 @@ pub struct BackendCache {
|
||||
}
|
||||
|
||||
impl BackendCache {
|
||||
pub fn from_cache(cache: SerializedCache) -> Result<(ModuleInfo, Memory, Self), Error> {
|
||||
pub fn from_cache(cache: Artifact) -> Result<(ModuleInfo, Memory, Self), Error> {
|
||||
let (info, backend_data, compiled_code) = cache.consume();
|
||||
|
||||
let backend_cache =
|
||||
|
@ -14,7 +14,7 @@ use cranelift_codegen::{
|
||||
};
|
||||
use target_lexicon::Triple;
|
||||
|
||||
use wasmer_runtime_core::cache::{Error as CacheError, SerializedCache};
|
||||
use wasmer_runtime_core::cache::{Artifact, Error as CacheError};
|
||||
use wasmer_runtime_core::{
|
||||
backend::{Compiler, Token},
|
||||
error::{CompileError, CompileResult},
|
||||
@ -53,11 +53,7 @@ impl Compiler for CraneliftCompiler {
|
||||
|
||||
/// Create a wasmer Module from an already-compiled cache.
|
||||
|
||||
unsafe fn from_cache(
|
||||
&self,
|
||||
cache: SerializedCache,
|
||||
_: Token,
|
||||
) -> Result<ModuleInner, CacheError> {
|
||||
unsafe fn from_cache(&self, cache: Artifact, _: Token) -> Result<ModuleInner, CacheError> {
|
||||
module::Module::from_cache(cache)
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ use cranelift_wasm;
|
||||
use hashbrown::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use wasmer_runtime_core::cache::{Error as CacheError, SerializedCache, WasmHash};
|
||||
use wasmer_runtime_core::cache::{Artifact, Error as CacheError, WasmHash};
|
||||
|
||||
use wasmer_runtime_core::{
|
||||
backend::Backend,
|
||||
@ -88,7 +88,7 @@ impl Module {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn from_cache(cache: SerializedCache) -> Result<ModuleInner, CacheError> {
|
||||
pub fn from_cache(cache: Artifact) -> Result<ModuleInner, CacheError> {
|
||||
let (info, compiled_code, backend_cache) = BackendCache::from_cache(cache)?;
|
||||
|
||||
let (func_resolver_builder, trampolines, handler_data) =
|
||||
|
Reference in New Issue
Block a user