fn emit_reg_save(&mut self, reg: X86Register) {
        // Since we can only push 32-bit registers, pushing the low 8 bits of a register will also
        // push the high 8 bits (and vice versa), so we add them both to the saved list.

        if self.saved_host_regs.contains(&reg) || self.saved_host_regs.contains(&reg.other_half()) {
            // Already saved as part of its other half, or this was called twice with the same reg,
            // which really shouldn't happen.
            debug!("reg {:?} already saved, skipping", reg);
            return;
        }

        // 0x50 = push r32
        // I think on x64 this will push the corresponding 64-bit register, but that should be fine,
        // too.
        self.emit_raw(&[0x50 | reg.as_r32_value()]);

        self.saved_host_regs.push(reg);
    }
/// Emits code that will save the value of a host register.
///
/// Note that this will do nothing if the value was already saved, so this can't be used to
/// spill registers.
Emits code that will save the value of a host register.
Note that this will do nothing if the value was already saved, so this can't be used to
spill registers.
Emits code that will save the value of a host register . Note that this will do nothing if the value was already saved so this can ' t be used to spill registers .
fn emit_reg_save(&mut self, reg: X86Register) {
        // Since we can only push 32-bit registers, pushing the low 8 bits of a register will also
        // push the high 8 bits (and vice versa), so we add them both to the saved list.
        if self.saved_host_regs.contains(&reg) || self.saved_host_regs.contains(&reg.other_half()) {
            // Already saved as part of its other half, or this was called twice with the same reg,
            // which really shouldn't happen.
            debug!("reg {:?} already saved, skipping", reg);
            return;
        }
        // 0x50 = push r32
        // I think on x64 this will push the corresponding 64-bit register, but that should be fine,
        // too.
        self.emit_raw(&[0x50 | reg.as_r32_value()]);
        self.saved_host_regs.push(reg);
    }
fn emit_reg_save ( & mut self , reg : X86Register ) { // Since we can only push 32-bit registers, pushing the low 8 bits of a register will also // push the high 8 bits (and vice versa), so we add them both to the saved list. if self . saved_host_regs . contains ( & reg ) || self . saved_host_regs . contains ( & reg . other_half ( ) ) { // Already saved as part of its other half, or this was called twice with the same reg, // which really shouldn't happen. debug ! ( " " reg ) ; return ; } // 0x50 = push r32 // I think on x64 this will push the corresponding 64-bit register, but that should be fine, // too. self . emit_raw ( & [ 0x50 | reg . as_r32_value ( ) ] ) ; self . saved_host_regs . push ( reg ) ; }
Emits code that will save the value of a host register.
Emits code that will save the value of a host register .
&mut self
reg
X86Register
&mut self
reg
X86Register