Optimize backtraces.

This commit is contained in:
losfair
2019-06-26 11:28:46 +08:00
parent 8ea79a0e69
commit 2373d371ae
6 changed files with 100 additions and 75 deletions

View File

@ -4630,11 +4630,7 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
);
}
Operator::Unreachable => {
let state_diff_id =
Self::get_state_diff(&self.machine, &mut self.fsm, &mut self.control_stack);
let offset = a.get_offset().0;
self.fsm.trappable_offsets.insert(offset, state_diff_id);
Self::mark_trappable(a, &self.machine, &mut self.fsm, &mut self.control_stack);
a.emit_ud2();
self.unreachable_depth = 1;
}