Commit f468a85d authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

PPC/s390: [wasm][liftoff] Avoid x28 even without pointer compression

Port 8d0f5a04

Original Commit Message:

    Due to a recent change Liftoff used different register configurations
    in the pointer-compression and no-pointer-compression setups. This
    caused a mismatch between the registers used by Liftoff and the
    registers spilled by the WasmDebugBreak builtin.

    With this CL the same register configuration is used both with and
    without pointer compression. Even without x28 there are 24 registers
    that can be used. Moreover, 24 registers can be spilled without
    padding, which would be needed with 25 registers to preserve stack
    alignment.

    Drive-by change: Use Reglist in frame-constants on all platforms.

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

Change-Id: Ibad93faeaba88f929db16d239858da6e45ca673b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2756550
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#73379}
parent 39774379
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/macros.h" #include "src/base/macros.h"
#include "src/codegen/ppc/register-ppc.h"
#include "src/execution/frame-constants.h" #include "src/execution/frame-constants.h"
namespace v8 { namespace v8 {
...@@ -42,10 +43,11 @@ class WasmCompileLazyFrameConstants : public TypedFrameConstants { ...@@ -42,10 +43,11 @@ class WasmCompileLazyFrameConstants : public TypedFrameConstants {
// registers (see liftoff-assembler-defs.h). // registers (see liftoff-assembler-defs.h).
class WasmDebugBreakFrameConstants : public TypedFrameConstants { class WasmDebugBreakFrameConstants : public TypedFrameConstants {
public: public:
// {r3, r4, r5, r6, r7, r8, r9, r10, r11} static constexpr RegList kPushedGpRegs =
static constexpr uint32_t kPushedGpRegs = 0b111111111000; Register::ListOf(r3, r4, r5, r6, r7, r8, r9, r10, r11);
// {d0 .. d12}
static constexpr uint32_t kPushedFpRegs = 0b1111111111111; static constexpr RegList kPushedFpRegs = DoubleRegister::ListOf(
d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12);
static constexpr int kNumPushedGpRegisters = static constexpr int kNumPushedGpRegisters =
base::bits::CountPopulation(kPushedGpRegs); base::bits::CountPopulation(kPushedGpRegs);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/macros.h" #include "src/base/macros.h"
#include "src/codegen/s390/register-s390.h"
#include "src/execution/frame-constants.h" #include "src/execution/frame-constants.h"
namespace v8 { namespace v8 {
...@@ -45,10 +46,11 @@ class WasmCompileLazyFrameConstants : public TypedFrameConstants { ...@@ -45,10 +46,11 @@ class WasmCompileLazyFrameConstants : public TypedFrameConstants {
// registers (see liftoff-assembler-defs.h). // registers (see liftoff-assembler-defs.h).
class WasmDebugBreakFrameConstants : public TypedFrameConstants { class WasmDebugBreakFrameConstants : public TypedFrameConstants {
public: public:
// {r2, r3, r4, r5, r6, r7, r8} static constexpr RegList kPushedGpRegs =
static constexpr uint32_t kPushedGpRegs = 0b111111100; Register::ListOf(r2, r3, r4, r5, r6, r7, r8);
// {d0 .. d12}
static constexpr uint32_t kPushedFpRegs = 0b1111111111111; static constexpr RegList kPushedFpRegs = DoubleRegister::ListOf(
d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12);
static constexpr int kNumPushedGpRegisters = static constexpr int kNumPushedGpRegisters =
base::bits::CountPopulation(kPushedGpRegs); base::bits::CountPopulation(kPushedGpRegs);
......
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