Commit e02a625a authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

Revert "[ia32,x64] Make more use of the 'leave' instruction"

This reverts half of commit 8f0ab471.

Reason for revert: some performance regressions, possibly due
to 'leave' needing MSROM on some microarchitectures.

The half that is not reverted is the removal of 'enter'.


Original change's description:
> [ia32,x64] Make more use of the 'leave' instruction
>
> It is a little shorter and cheaper[1] than the equivalent
> "mov sp,bp; pop bp".
>
> Also remove support for the 'enter' instruction, since
> - it is unused,
> - it is neither shorter nor cheaper than the corresponding
>   push and mov (in fact more expensive[1]), and
> - our disassembler doesn't support it.
>
> [1] See https://www.agner.org/optimize/instruction_tables.pdf
>
> Change-Id: I6c99c2f3e53081aea55445a54e18eaf45baa79c2
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2482822
> Commit-Queue: Georg Neis <neis@chromium.org>
> Reviewed-by: Victor Gomes <victorgomes@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#70660}

TBR=neis@chromium.org,victorgomes@chromium.org
Bug: chromium:1141069
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I5c9ad64ee06b71c93eff256044ce49d1523737fb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2492327
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70718}
parent 7149623d
......@@ -975,7 +975,9 @@ void MacroAssembler::LeaveExitFrameEpilogue() {
}
void MacroAssembler::LeaveApiExitFrame() {
leave();
mov(esp, ebp);
pop(ebp);
LeaveExitFrameEpilogue();
}
......
......@@ -2495,7 +2495,8 @@ void TurboAssembler::LeaveFrame(StackFrame::Type type) {
Immediate(StackFrame::TypeToMarker(type)));
Check(equal, AbortReason::kStackFrameTypesMustMatch);
}
leave();
movq(rsp, rbp);
popq(rbp);
}
#ifdef V8_TARGET_OS_WIN
......@@ -2647,7 +2648,9 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles, bool pop_arguments) {
}
void MacroAssembler::LeaveApiExitFrame() {
leave();
movq(rsp, rbp);
popq(rbp);
LeaveExitFrameEpilogue();
}
......
......@@ -509,7 +509,10 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
} \
} while (false)
void CodeGenerator::AssembleDeconstructFrame() { __ leave(); }
void CodeGenerator::AssembleDeconstructFrame() {
__ mov(esp, ebp);
__ pop(ebp);
}
void CodeGenerator::AssemblePrepareTailCall() {
if (frame_access_state()->has_frame()) {
......
......@@ -681,7 +681,8 @@ void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen,
void CodeGenerator::AssembleDeconstructFrame() {
unwinding_info_writer_.MarkFrameDeconstructed(__ pc_offset());
__ leave();
__ movq(rsp, rbp);
__ popq(rbp);
}
void CodeGenerator::AssemblePrepareTailCall() {
......
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