Refactor UnwindInfo codes and frame_register (#2307)

* Refactor UnwindInfo codes and frame_register

* use isa word_size

* fix filetests

* Add comment about UnwindCode::PushRegister
This commit is contained in:
Yury Delendik
2020-10-22 14:52:42 -05:00
committed by GitHub
parent 4f104d3a4e
commit b10e027fef
8 changed files with 219 additions and 128 deletions

View File

@@ -14,7 +14,7 @@ pub(crate) fn create_unwind_info(
return Ok(None);
}
let unwind = match super::create_unwind_info(func, isa, None)? {
let unwind = match super::create_unwind_info(func, isa)? {
Some(u) => u,
None => {
return Ok(None);
@@ -27,12 +27,12 @@ pub(crate) fn create_unwind_info(
struct RegisterMapper;
impl crate::isa::unwind::winx64::RegisterMapper for RegisterMapper {
fn map(reg: RegUnit) -> u8 {
fn map(reg: RegUnit) -> crate::isa::unwind::winx64::MappedRegister {
use crate::isa::unwind::winx64::MappedRegister;
if GPR.contains(reg) {
GPR.index_of(reg) as u8
MappedRegister::Int(GPR.index_of(reg) as u8)
} else if FPR.contains(reg) {
// XMM register
reg as u8
MappedRegister::Xmm(reg as u8)
} else {
panic!()
}