x64: Migrate br_table to ISLE (#4615)

https://github.com/bytecodealliance/wasmtime/pull/4615
This commit is contained in:
Trevor Elliott
2022-08-04 15:12:37 -07:00
committed by GitHub
parent b4d7ab36f9
commit cd847d071d
5 changed files with 119 additions and 92 deletions

View File

@@ -746,6 +746,25 @@ where
None
}
}
#[inline]
fn jump_table_targets(
&mut self,
targets: &MachLabelSlice,
) -> Option<(MachLabel, BoxVecMachLabel)> {
if targets.is_empty() {
return None;
}
let default_label = targets[0];
let jt_targets = Box::new(SmallVec::from(&targets[1..]));
Some((default_label, jt_targets))
}
#[inline]
fn jump_table_size(&mut self, targets: &BoxVecMachLabel) -> u32 {
targets.len() as u32
}
}
impl<C> IsleContext<'_, C, Flags, IsaFlags, 6>