mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Various cleanups.
This commit is contained in:
parent
2262c8a6da
commit
6beb76c3ae
@ -15,7 +15,7 @@ impl FunctionMiddleware for CallTrace {
|
||||
) -> Result<(), Self::Error> {
|
||||
match op {
|
||||
Event::Internal(InternalEvent::FunctionBegin(id)) => {
|
||||
sink.push(Event::Internal(InternalEvent::Bkpt(Box::new(move |_| {
|
||||
sink.push(Event::Internal(InternalEvent::Breakpoint(Box::new(move |_| {
|
||||
println!("func ({})", id);
|
||||
}))))
|
||||
}
|
||||
|
@ -1,9 +1 @@
|
||||
pub mod call_trace;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ pub enum Event<'a, 'b> {
|
||||
pub enum InternalEvent {
|
||||
FunctionBegin(u32),
|
||||
FunctionEnd,
|
||||
Bkpt(Box<Fn(BkptInfo) + Send + Sync + 'static>),
|
||||
Breakpoint(Box<Fn(BkptInfo) + Send + Sync + 'static>),
|
||||
SetInternal(u32),
|
||||
GetInternal(u32),
|
||||
}
|
||||
@ -120,7 +120,7 @@ impl<
|
||||
impl CacheGen for Placeholder {
|
||||
fn generate_cache(&self) -> Result<(Box<[u8]>, Memory), CacheError> {
|
||||
Err(CacheError::Unknown(
|
||||
"the singlepass backend doesn't support caching yet".to_string(),
|
||||
"the streaming compiler API doesn't support caching yet".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
@ -148,7 +148,7 @@ impl<
|
||||
|
||||
unsafe fn from_cache(&self, _artifact: Artifact, _: Token) -> Result<ModuleInner, CacheError> {
|
||||
Err(CacheError::Unknown(
|
||||
"the singlepass backend doesn't support caching yet".to_string(),
|
||||
"the streaming compiler API doesn't support caching yet".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -1453,7 +1453,7 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
|
||||
Event::Wasm(x) => x,
|
||||
Event::Internal(x) => {
|
||||
match x {
|
||||
InternalEvent::Bkpt(callback) => {
|
||||
InternalEvent::Breakpoint(callback) => {
|
||||
a.emit_bkpt();
|
||||
self.breakpoints
|
||||
.as_mut()
|
||||
|
Loading…
Reference in New Issue
Block a user