Skip to content

Commit

Permalink
Removes REGISTER_OTHER_SCRATCH from ANCHOR_ANCHOR_INTERNAL_FUNCTION_C…
Browse files Browse the repository at this point in the history
…ALL_REG.
  • Loading branch information
Lichtso committed Sep 25, 2024
1 parent 64f9768 commit 4797a0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1508,9 +1508,8 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> {
// Load the frame pointer again since we've clobbered REGISTER_MAP[FRAME_PTR_REG]
self.emit_ins(X86Instruction::load(OperandSize::S64, REGISTER_PTR_TO_VM, REGISTER_MAP[FRAME_PTR_REG], stack_pointer_access));
// Restore the clobbered REGISTER_MAP[0]
self.emit_ins(X86Instruction::mov(OperandSize::S64, REGISTER_MAP[0], REGISTER_OTHER_SCRATCH));
self.emit_ins(X86Instruction::pop(REGISTER_MAP[0]));
self.emit_ins(X86Instruction::jump_reg(REGISTER_OTHER_SCRATCH, None)); // Tail call to host_target_address
self.emit_ins(X86Instruction::xchg(OperandSize::S64, REGISTER_MAP[0], RSP, Some(X86IndirectAccess::OffsetIndexShift(0, RSP, 0)))); // Swap REGISTER_MAP[0] and host_target_address
self.emit_ins(X86Instruction::return_near()); // Tail call to host_target_address

// Translates a vm memory address to a host memory address
for (access_type, len) in &[
Expand Down
1 change: 1 addition & 0 deletions src/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ impl X86Instruction {
}

/// Jump to absolute destination
#[allow(dead_code)]
#[inline]
pub const fn jump_reg(destination: u8, indirect: Option<X86IndirectAccess>) -> Self {
Self {
Expand Down

0 comments on commit 4797a0d

Please sign in to comment.