summaryrefslogtreecommitdiff
path: root/yjit/src/backend/x86_64/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'yjit/src/backend/x86_64/mod.rs')
-rw-r--r--yjit/src/backend/x86_64/mod.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs
index 69e8d24ed7..a2ee94cf66 100644
--- a/yjit/src/backend/x86_64/mod.rs
+++ b/yjit/src/backend/x86_64/mod.rs
@@ -147,21 +147,23 @@ impl Assembler
let mut opnd_iter = insn.opnd_iter_mut();
while let Some(opnd) = opnd_iter.next() {
+ if let Opnd::Stack { .. } = opnd {
+ *opnd = asm.lower_stack_opnd(opnd);
+ }
unmapped_opnds.push(*opnd);
- *opnd = if is_load {
- iterator.map_opnd(*opnd)
- } else if let Opnd::Value(value) = opnd {
- // Since mov(mem64, imm32) sign extends, as_i64() makes sure
- // we split when the extended value is different.
- if !value.special_const_p() || imm_num_bits(value.as_i64()) > 32 {
- asm.load(iterator.map_opnd(*opnd))
- } else {
- Opnd::UImm(value.as_u64())
+ *opnd = match opnd {
+ Opnd::Value(value) if !is_load => {
+ // Since mov(mem64, imm32) sign extends, as_i64() makes sure
+ // we split when the extended value is different.
+ if !value.special_const_p() || imm_num_bits(value.as_i64()) > 32 {
+ asm.load(iterator.map_opnd(*opnd))
+ } else {
+ Opnd::UImm(value.as_u64())
+ }
}
- } else {
- iterator.map_opnd(*opnd)
- }
+ _ => iterator.map_opnd(*opnd),
+ };
}
// We are replacing instructions here so we know they are already
@@ -744,7 +746,6 @@ impl Assembler
nop(cb, (cb.jmp_ptr_bytes() - code_size) as u32);
}
}
- Insn::SpillTemp(_) => unreachable!("Insn::SpillTemp should have been lowered by lower_stack"),
};
// On failure, jump to the next page and retry the current insn
@@ -762,8 +763,7 @@ impl Assembler
/// Optimize and compile the stored instructions
pub fn compile_with_regs(self, cb: &mut CodeBlock, ocb: Option<&mut OutlinedCb>, regs: Vec<Reg>) -> Vec<u32> {
- let asm = self.lower_stack();
- let asm = asm.x86_split();
+ let asm = self.x86_split();
let mut asm = asm.alloc_regs(regs);
// Create label instances in the code block