Commit c4c28952 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[liftoff] Add early check in TransferStackSlot

Inline TransferStackSlot and compare the slots first. This is redundant
if they are different, but in most cases they are the same and doing
this check is beneficial.
Other methods of StackTransferRecipe are not called as often, and
inlining them seems negligible.

R=clemensb@chromium.org

Bug: v8:10576
Change-Id: Ibdaa714e3e40c95a79a0da3ca3170d1da7b62cf3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2249677
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68392}
parent 1c3f45a0
......@@ -82,35 +82,31 @@ class StackTransferRecipe {
DCHECK(load_dst_regs_.is_empty());
}
void TransferStackSlot(const VarState& dst, const VarState& src) {
V8_INLINE void TransferStackSlot(const VarState& dst, const VarState& src) {
DCHECK_EQ(dst.type(), src.type());
switch (dst.loc()) {
if (dst == src) return;
if (dst.is_reg()) {
LoadIntoRegister(dst.reg(), src, src.offset());
return;
}
DCHECK(dst.is_stack());
switch (src.loc()) {
case VarState::kStack:
switch (src.loc()) {
case VarState::kStack:
if (src.offset() == dst.offset()) break;
asm_->MoveStackValue(dst.offset(), src.offset(), src.type());
break;
case VarState::kRegister:
asm_->Spill(dst.offset(), src.reg(), src.type());
break;
case VarState::kIntConst:
asm_->Spill(dst.offset(), src.constant());
break;
}
DCHECK_NE(src.offset(), dst.offset());
asm_->MoveStackValue(dst.offset(), src.offset(), src.type());
break;
case VarState::kRegister:
LoadIntoRegister(dst.reg(), src, src.offset());
asm_->Spill(dst.offset(), src.reg(), src.type());
break;
case VarState::kIntConst:
DCHECK_EQ(dst, src);
asm_->Spill(dst.offset(), src.constant());
break;
}
}
void LoadIntoRegister(LiftoffRegister dst,
const LiftoffAssembler::VarState& src,
uint32_t src_offset) {
V8_INLINE void LoadIntoRegister(LiftoffRegister dst,
const LiftoffAssembler::VarState& src,
uint32_t src_offset) {
switch (src.loc()) {
case VarState::kStack:
LoadStackSlot(dst, src_offset, src.type());
......
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