Commit d88bd9a1 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[Liftoff][cleanup] Use more Register instead of LiftoffRegister

We generally try to use the most specific type, but sometimes we still
used LiftoffRegister even though it's statically known that it always
holds a GP register. Make these uses use Register directly. Note that
the conversion between Register and LiftoffRegister is a noop in
Release builds.

R=titzer@chromium.org

Bug: v8:6600
Change-Id: I1cf9aa727fb6fd71bbc1eed77df5e9d01e35ddee
Reviewed-on: https://chromium-review.googlesource.com/c/1278727Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56605}
parent 3ace9cde
...@@ -449,7 +449,7 @@ void LiftoffAssembler::SpillAllRegisters() { ...@@ -449,7 +449,7 @@ void LiftoffAssembler::SpillAllRegisters() {
void LiftoffAssembler::PrepareCall(FunctionSig* sig, void LiftoffAssembler::PrepareCall(FunctionSig* sig,
compiler::CallDescriptor* call_descriptor, compiler::CallDescriptor* call_descriptor,
Register* target, Register* target,
LiftoffRegister* target_instance) { Register* target_instance) {
uint32_t num_params = static_cast<uint32_t>(sig->parameter_count()); uint32_t num_params = static_cast<uint32_t>(sig->parameter_count());
// Input 0 is the call target. // Input 0 is the call target.
constexpr size_t kInputShift = 1; constexpr size_t kInputShift = 1;
...@@ -472,10 +472,12 @@ void LiftoffAssembler::PrepareCall(FunctionSig* sig, ...@@ -472,10 +472,12 @@ void LiftoffAssembler::PrepareCall(FunctionSig* sig,
compiler::LinkageLocation instance_loc = compiler::LinkageLocation instance_loc =
call_descriptor->GetInputLocation(kInputShift); call_descriptor->GetInputLocation(kInputShift);
DCHECK(instance_loc.IsRegister() && !instance_loc.IsAnyRegister()); DCHECK(instance_loc.IsRegister() && !instance_loc.IsAnyRegister());
LiftoffRegister instance_reg(Register::from_code(instance_loc.AsRegister())); Register instance_reg = Register::from_code(instance_loc.AsRegister());
param_regs.set(instance_reg); param_regs.set(instance_reg);
if (target_instance && *target_instance != instance_reg) { if (target_instance && *target_instance != instance_reg) {
stack_transfers.MoveRegister(instance_reg, *target_instance, kWasmIntPtr); stack_transfers.MoveRegister(LiftoffRegister(instance_reg),
LiftoffRegister(*target_instance),
kWasmIntPtr);
} }
// Now move all parameter values into the right slot for the call. // Now move all parameter values into the right slot for the call.
...@@ -551,7 +553,7 @@ void LiftoffAssembler::PrepareCall(FunctionSig* sig, ...@@ -551,7 +553,7 @@ void LiftoffAssembler::PrepareCall(FunctionSig* sig,
// Reload the instance from the stack. // Reload the instance from the stack.
if (!target_instance) { if (!target_instance) {
FillInstanceInto(instance_reg.gp()); FillInstanceInto(instance_reg);
} }
} }
......
...@@ -318,7 +318,7 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -318,7 +318,7 @@ class LiftoffAssembler : public TurboAssembler {
// register, or {no_reg} if target was spilled to the stack. // register, or {no_reg} if target was spilled to the stack.
void PrepareCall(FunctionSig*, compiler::CallDescriptor*, void PrepareCall(FunctionSig*, compiler::CallDescriptor*,
Register* target = nullptr, Register* target = nullptr,
LiftoffRegister* target_instance = nullptr); Register* target_instance = nullptr);
// Process return values of the call. // Process return values of the call.
void FinishCall(FunctionSig*, compiler::CallDescriptor*); void FinishCall(FunctionSig*, compiler::CallDescriptor*);
......
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