Improve stack trace collection and rendering.

This commit is contained in:
losfair
2019-06-25 03:55:33 +08:00
parent 73eb04d269
commit fb7c3eee8a
6 changed files with 377 additions and 136 deletions

View File

@ -162,6 +162,7 @@ impl Machine {
} else {
self.state.stack_values.push(*mv);
}
self.state.wasm_stack.push(WasmAbstractValue::Runtime);
ret.push(loc);
}
@ -210,6 +211,7 @@ impl Machine {
}
_ => {}
}
self.state.wasm_stack.pop().unwrap();
}
if delta_stack_offset != 0 {
@ -236,6 +238,7 @@ impl Machine {
}
_ => {}
}
// Wasm state popping is deferred to `release_locations_only_osr_state`.
}
}
@ -262,6 +265,7 @@ impl Machine {
}
_ => {}
}
// Wasm state popping is deferred to `release_locations_only_osr_state`.
}
if delta_stack_offset != 0 {
@ -273,6 +277,15 @@ impl Machine {
}
}
pub fn release_locations_only_osr_state(
&mut self,
n: usize,
) {
for _ in 0..n {
self.state.wasm_stack.pop().unwrap();
}
}
pub fn release_locations_keep_state<E: Emitter>(&self, assembler: &mut E, locs: &[Location]) {
let mut delta_stack_offset: usize = 0;
let mut stack_offset = self.stack_offset.0;