Commit 24d92be5 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [liftoff] Push the instance as part of frame construction

Port 593fbb69

Original Commit Message:

    Currently we first construct the frame (via
    {TurboAssembler::EnterFrame}), then we spill the instance to the
    respective slot (via {LiftoffAssembler::SpillInstance}). Instead, we
    should already spill the instance as part of frame construction. That
    allows for a more compact instruction to be used ("push" instead of
    "mov" on Intel), and on arm64 even allows to merge pushing into an
    existing instruction (where we currently push the zero register x31
    instead).

    This makes the prologue more similar to what TurboFan generates in
    {TurboAssembler::AssembleConstructFrame} (which does not use
    {TurboAssembler::EnterFrame}).

R=clemensb@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I0b87d73776b59ade36faea2f4772c63c89eb740e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3056455Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75942}
parent 8c057f17
......@@ -1411,6 +1411,9 @@ void TurboAssembler::EnterFrame(StackFrame::Type type,
mov(ip, Operand(StackFrame::TypeToMarker(type)));
PushCommonFrame(ip);
#if V8_ENABLE_WEBASSEMBLY
if (type == StackFrame::WASM) Push(kWasmInstanceRegister);
#endif // V8_ENABLE_WEBASSEMBLY
}
int TurboAssembler::LeaveFrame(StackFrame::Type type, int stack_adjustment) {
......
......@@ -124,7 +124,7 @@ void LiftoffAssembler::AlignFrameSize() {}
void LiftoffAssembler::PatchPrepareStackFrame(int offset,
SafepointTableBuilder*) {
int frame_size = GetTotalFrameSize() - kSystemPointerSize;
int frame_size = GetTotalFrameSize() - 2 * kSystemPointerSize;
constexpr int LayInstrSize = 6;
......
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