Commit add24813 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[liftoff] Clean up definition of ValueKinds

Some ValueKinds were defined based on the size of a system pointer or
the size of a tagged value. In order to be able to reuse those
definitions in both LiftoffAssembler and LiftoffCompiler, define them as
public constants on LiftoffAssembler.
Also, avoid the "ValueType" suffix, since they are not ValueTypes, but
ValueKinds.

R=jkummerow@chromium.org

Change-Id: I38f9c9b6c4e6592d31ee58466b786bf24a55f19c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2743890Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73315}
parent a021e4d3
......@@ -25,7 +25,9 @@ namespace wasm {
using VarState = LiftoffAssembler::VarState;
using ValueKindSig = LiftoffAssembler::ValueKindSig;
constexpr ValueKind LiftoffAssembler::kIntPtr;
constexpr ValueKind LiftoffAssembler::kPointerKind;
constexpr ValueKind LiftoffAssembler::kTaggedKind;
constexpr ValueKind LiftoffAssembler::kSmiKind;
namespace {
......@@ -779,7 +781,7 @@ void LiftoffAssembler::ClearRegister(
if (reg != *use) continue;
if (replacement == no_reg) {
replacement = GetUnusedRegister(kGpReg, pinned).gp();
Move(replacement, reg, LiftoffAssembler::kIntPtr);
Move(replacement, reg, kPointerKind);
}
// We cannot leave this loop early. There may be multiple uses of {reg}.
*use = replacement;
......@@ -890,7 +892,8 @@ void LiftoffAssembler::PrepareCall(const ValueKindSig* sig,
param_regs.set(instance_reg);
if (target_instance && *target_instance != instance_reg) {
stack_transfers.MoveRegister(LiftoffRegister(instance_reg),
LiftoffRegister(*target_instance), kIntPtr);
LiftoffRegister(*target_instance),
kPointerKind);
}
int param_slots = static_cast<int>(call_descriptor->ParameterSlotCount());
......@@ -909,11 +912,10 @@ void LiftoffAssembler::PrepareCall(const ValueKindSig* sig,
if (!free_regs.is_empty()) {
LiftoffRegister new_target = free_regs.GetFirstRegSet();
stack_transfers.MoveRegister(new_target, LiftoffRegister(*target),
kIntPtr);
kPointerKind);
*target = new_target.gp();
} else {
stack_slots.Add(LiftoffAssembler::VarState(LiftoffAssembler::kIntPtr,
LiftoffRegister(*target), 0),
stack_slots.Add(VarState(kPointerKind, LiftoffRegister(*target), 0),
param_slots);
param_slots++;
*target = no_reg;
......
......@@ -73,7 +73,11 @@ class LiftoffAssembler : public TurboAssembler {
// Each slot in our stack frame currently has exactly 8 bytes.
static constexpr int kStackSlotSize = 8;
static constexpr ValueKind kIntPtr = kSystemPointerSize == 8 ? kI64 : kI32;
static constexpr ValueKind kPointerKind =
kSystemPointerSize == kInt32Size ? kI32 : kI64;
static constexpr ValueKind kTaggedKind =
kTaggedSize == kInt32Size ? kI32 : kI64;
static constexpr ValueKind kSmiKind = kTaggedKind;
using ValueKindSig = Signature<ValueKind>;
......
This diff is collapsed.
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