Commit 60e452b7 authored by Yolanda Chen's avatar Yolanda Chen Committed by Commit Bot

[x64] Eliminate unncessary push-pop pair in AssembleSwap

The current implementation in AssembleSwap will generate a push-pop pair to swap between a general register and a stack slot for both x64 and ia32 targets. This is unnecessary for x64 target, as we can use the kScratchRegister to save the general register and swap with the stack slot.

Change-Id: I10e0dc360dec22cdf5afa63ece3d5943685d7ecb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2394177Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Yolanda Chen <yolanda.chen@intel.com>
Cr-Commit-Position: refs/heads/master@{#69726}
parent 10348e8e
......@@ -4838,15 +4838,10 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
case MoveType::kRegisterToStack: {
if (source->IsRegister()) {
Register src = g.ToRegister(source);
__ pushq(src);
frame_access_state()->IncreaseSPDelta(1);
unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
kSystemPointerSize);
__ movq(src, g.ToOperand(destination));
frame_access_state()->IncreaseSPDelta(-1);
__ popq(g.ToOperand(destination));
unwinding_info_writer_.MaybeIncreaseBaseOffsetAt(__ pc_offset(),
-kSystemPointerSize);
Operand dst = g.ToOperand(destination);
__ movq(kScratchRegister, src);
__ movq(src, dst);
__ movq(dst, kScratchRegister);
} else {
DCHECK(source->IsFPRegister());
XMMRegister src = g.ToDoubleRegister(source);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment