mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 14:11:32 +00:00
Full preemptive snapshot/resume.
This commit is contained in:
@ -9,6 +9,7 @@ use crate::{
|
||||
};
|
||||
use smallvec::SmallVec;
|
||||
use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::fmt::Debug;
|
||||
use std::marker::PhantomData;
|
||||
@ -16,6 +17,9 @@ use std::sync::{Arc, RwLock};
|
||||
use wasmparser::{self, WasmDecoder};
|
||||
use wasmparser::{Operator, Type as WpType};
|
||||
|
||||
pub type BkptHandler = Box<Fn(BkptInfo) -> Result<(), Box<dyn Any>> + Send + Sync + 'static>;
|
||||
pub type BkptMap = Arc<HashMap<usize, BkptHandler>>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Event<'a, 'b> {
|
||||
Internal(InternalEvent),
|
||||
@ -26,7 +30,7 @@ pub enum Event<'a, 'b> {
|
||||
pub enum InternalEvent {
|
||||
FunctionBegin(u32),
|
||||
FunctionEnd,
|
||||
Breakpoint(Box<Fn(BkptInfo) + Send + Sync + 'static>),
|
||||
Breakpoint(BkptHandler),
|
||||
SetInternal(u32),
|
||||
GetInternal(u32),
|
||||
}
|
||||
@ -43,8 +47,8 @@ impl fmt::Debug for InternalEvent {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BkptInfo {
|
||||
pub throw: unsafe fn(Box<dyn Any>) -> !,
|
||||
pub struct BkptInfo<'a> {
|
||||
pub fault: Option<&'a dyn Any>,
|
||||
}
|
||||
|
||||
pub trait ModuleCodeGenerator<FCG: FunctionCodeGenerator<E>, RM: RunnableModule, E: Debug> {
|
||||
|
Reference in New Issue
Block a user