mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
Require backend:singlepass for suspend/resume.
This commit is contained in:
parent
9b4343eac5
commit
03e6311446
@ -44,6 +44,7 @@ pub mod vmcalls;
|
||||
#[cfg(all(unix, target_arch = "x86_64"))]
|
||||
pub use trampoline_x64 as trampoline;
|
||||
pub mod state;
|
||||
#[cfg(all(unix, target_arch = "x86_64"))]
|
||||
pub mod suspend;
|
||||
|
||||
use self::error::CompileResult;
|
||||
|
@ -112,6 +112,7 @@ struct Run {
|
||||
)]
|
||||
loader: Option<LoaderName>,
|
||||
|
||||
#[cfg(feature = "backend:singlepass")]
|
||||
#[structopt(long = "image-file")]
|
||||
image_file: Option<String>,
|
||||
|
||||
@ -508,6 +509,8 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
||||
mapped_dirs,
|
||||
);
|
||||
|
||||
#[cfg(feature = "backend:singlepass")]
|
||||
{
|
||||
if let Some(ref name) = options.image_file {
|
||||
use wasmer_runtime_core::suspend::{patch_import_object, SuspendConfig};
|
||||
patch_import_object(
|
||||
@ -517,11 +520,14 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let mut instance = module
|
||||
.instantiate(&import_object)
|
||||
.map_err(|e| format!("Can't instantiate module: {:?}", e))?;
|
||||
|
||||
#[cfg(feature = "backend:singlepass")]
|
||||
{
|
||||
if let Some(ref name) = options.image_file {
|
||||
if options.resume {
|
||||
use wasmer_runtime_core::state::x64::invoke_call_return_on_stack_raw_image;
|
||||
@ -552,6 +558,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let start: Func<(), ()> = instance.func("_start").map_err(|e| format!("{:?}", e))?;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user