Skip to content

Commit

Permalink
Replace usage of REGISTER_OTHER_SCRATCH with REGISTER_SCRATCH and sta…
Browse files Browse the repository at this point in the history
…ck_slot_of_value_to_store.
  • Loading branch information
Lichtso committed Sep 25, 2024
1 parent 15e9355 commit 995afe9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,18 +1086,18 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> {
let stack_slot_of_value_to_store = X86IndirectAccess::OffsetIndexShift(-112, RSP, 0);
match value {
Some(Value::Register(reg)) => {
self.emit_ins(X86Instruction::mov(OperandSize::S64, reg, REGISTER_OTHER_SCRATCH));
self.emit_ins(X86Instruction::store(OperandSize::S64, reg, RSP, stack_slot_of_value_to_store));
}
Some(Value::Constant64(constant, user_provided)) => {
if user_provided && self.should_sanitize_constant(constant) {
self.emit_sanitized_load_immediate(OperandSize::S64, REGISTER_OTHER_SCRATCH, constant);
self.emit_sanitized_load_immediate(OperandSize::S64, REGISTER_SCRATCH, constant);
} else {
self.emit_ins(X86Instruction::load_immediate(OperandSize::S64, REGISTER_OTHER_SCRATCH, constant));
self.emit_ins(X86Instruction::load_immediate(OperandSize::S64, REGISTER_SCRATCH, constant));
}
self.emit_ins(X86Instruction::store(OperandSize::S64, REGISTER_SCRATCH, RSP, stack_slot_of_value_to_store));
}
_ => {}
}
self.emit_ins(X86Instruction::store(OperandSize::S64, REGISTER_OTHER_SCRATCH, RSP, stack_slot_of_value_to_store));

match vm_addr {
Value::RegisterPlusConstant64(reg, constant, user_provided) => {
Expand Down

0 comments on commit 995afe9

Please sign in to comment.