YJIT: Add comments to peek and x86_merge

This commit is contained in:
Takashi Kokubun 2023-03-07 14:08:15 -08:00
parent 7f557d02c3
commit 3e731cd945
Notes: git 2023-03-07 23:00:02 +00:00
2 changed files with 4 additions and 0 deletions

View File

@ -1230,6 +1230,7 @@ impl AssemblerDrainingIterator {
self.insns.next().map(|insn| (index, insn))
}
/// Returns the next instruction without incrementing the iterator's index.
pub fn peek(&mut self) -> Option<&Insn> {
self.insns.peek()
}

View File

@ -105,6 +105,9 @@ impl Assembler
// These are the callee-saved registers in the x86-64 SysV ABI
// RBX, RSP, RBP, and R12R15
/// Merge IR instructions for the x86 platform. As of x86_split, all `out` operands
/// are Opnd::Out, but you sometimes want to use Opnd::Reg for example to shorten the
/// generated code, which is what this pass does.
fn x86_merge(mut self) -> Assembler {
let live_ranges: Vec<usize> = take(&mut self.live_ranges);
let mut asm = Assembler::new_with_label_names(take(&mut self.label_names));