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

[Liftoff] Fix KIntConst typo

Now that I saw the typo I cannot unsee it anymore, but somehow this
typo went unrecognized for nearly 12 months (since
https://crrev.com/c/904443).

R=ahaas@chromium.org

Bug: v8:8562
Change-Id: Iafaeb2313dcfa305007c3c87e8f0440d8b15980e
Reviewed-on: https://chromium-review.googlesource.com/c/1436021Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59125}
parent d9784e11
......@@ -1490,7 +1490,7 @@ void LiftoffStackSlots::Construct() {
UNREACHABLE();
}
break;
case LiftoffAssembler::VarState::KIntConst: {
case LiftoffAssembler::VarState::kIntConst: {
DCHECK(src.type() == kWasmI32 || src.type() == kWasmI64);
UseScratchRegisterScope temps(asm_);
Register scratch = temps.Acquire();
......
......@@ -1025,7 +1025,7 @@ void LiftoffStackSlots::Construct() {
asm_->Poke(liftoff::GetRegFromType(slot.src_.reg(), slot.src_.type()),
poke_offset);
break;
case LiftoffAssembler::VarState::KIntConst:
case LiftoffAssembler::VarState::kIntConst:
DCHECK(slot.src_.type() == kWasmI32 || slot.src_.type() == kWasmI64);
if (slot.src_.i32_const() == 0) {
Register zero_reg = slot.src_.type() == kWasmI32 ? wzr : xzr;
......
......@@ -1780,7 +1780,7 @@ void LiftoffStackSlots::Construct() {
liftoff::push(asm_, src.reg(), src.type());
}
break;
case LiftoffAssembler::VarState::KIntConst:
case LiftoffAssembler::VarState::kIntConst:
// The high word is the sign extension of the low word.
asm_->push(Immediate(slot.half_ == kLowWord ? src.i32_const()
: src.i32_const() >> 31));
......
......@@ -103,7 +103,7 @@ class StackTransferRecipe {
case VarState::kRegister:
asm_->Spill(dst_index, src.reg(), src.type());
break;
case VarState::KIntConst:
case VarState::kIntConst:
asm_->Spill(dst_index, src.constant());
break;
}
......@@ -111,7 +111,7 @@ class StackTransferRecipe {
case VarState::kRegister:
LoadIntoRegister(dst.reg(), src, src_index);
break;
case VarState::KIntConst:
case VarState::kIntConst:
DCHECK_EQ(dst, src);
break;
}
......@@ -128,7 +128,7 @@ class StackTransferRecipe {
DCHECK_EQ(dst.reg_class(), src.reg_class());
if (dst != src.reg()) MoveRegister(dst, src.reg(), src.type());
break;
case VarState::KIntConst:
case VarState::kIntConst:
LoadConstant(dst, src.constant());
break;
}
......@@ -151,7 +151,7 @@ class StackTransferRecipe {
if (dst != src_half) MoveRegister(dst, src_half, kWasmI32);
break;
}
case VarState::KIntConst:
case VarState::kIntConst:
int32_t value = src.i32_const();
// The high word is the sign extension of the low word.
if (half == kHighWord) value = value >> 31;
......@@ -512,7 +512,7 @@ LiftoffRegister LiftoffAssembler::PopToRegister(LiftoffRegList pinned) {
case VarState::kRegister:
cache_state_.dec_used(slot.reg());
return slot.reg();
case VarState::KIntConst: {
case VarState::kIntConst: {
RegClass rc =
kNeedI64RegPair && slot.type() == kWasmI64 ? kGpRegPair : kGpReg;
LiftoffRegister reg = GetUnusedRegister(rc, pinned);
......@@ -566,7 +566,7 @@ void LiftoffAssembler::Spill(uint32_t index) {
Spill(index, slot.reg(), slot.type());
cache_state_.dec_used(slot.reg());
break;
case VarState::KIntConst:
case VarState::kIntConst:
Spill(index, slot.constant());
break;
}
......@@ -853,7 +853,7 @@ std::ostream& operator<<(std::ostream& os, VarState slot) {
return os << "s";
case VarState::kRegister:
return os << slot.reg();
case VarState::KIntConst:
case VarState::kIntConst:
return os << "c" << slot.i32_const();
}
UNREACHABLE();
......
......@@ -40,7 +40,7 @@ class LiftoffAssembler : public TurboAssembler {
class VarState {
public:
enum Location : uint8_t { kStack, kRegister, KIntConst };
enum Location : uint8_t { kStack, kRegister, kIntConst };
explicit VarState(ValueType type) : loc_(kStack), type_(type) {}
explicit VarState(ValueType type, LiftoffRegister r)
......@@ -48,7 +48,7 @@ class LiftoffAssembler : public TurboAssembler {
DCHECK_EQ(r.reg_class(), reg_class_for(type));
}
explicit VarState(ValueType type, int32_t i32_const)
: loc_(KIntConst), type_(type), i32_const_(i32_const) {
: loc_(kIntConst), type_(type), i32_const_(i32_const) {
DCHECK(type_ == kWasmI32 || type_ == kWasmI64);
}
......@@ -60,7 +60,7 @@ class LiftoffAssembler : public TurboAssembler {
return true;
case kRegister:
return reg_ == other.reg_;
case KIntConst:
case kIntConst:
return i32_const_ == other.i32_const_;
}
UNREACHABLE();
......@@ -70,19 +70,19 @@ class LiftoffAssembler : public TurboAssembler {
bool is_gp_reg() const { return loc_ == kRegister && reg_.is_gp(); }
bool is_fp_reg() const { return loc_ == kRegister && reg_.is_fp(); }
bool is_reg() const { return loc_ == kRegister; }
bool is_const() const { return loc_ == KIntConst; }
bool is_const() const { return loc_ == kIntConst; }
ValueType type() const { return type_; }
Location loc() const { return loc_; }
int32_t i32_const() const {
DCHECK_EQ(loc_, KIntConst);
DCHECK_EQ(loc_, kIntConst);
return i32_const_;
}
WasmValue constant() const {
DCHECK(type_ == kWasmI32 || type_ == kWasmI64);
DCHECK_EQ(loc_, KIntConst);
DCHECK_EQ(loc_, kIntConst);
return type_ == kWasmI32 ? WasmValue(i32_const_)
: WasmValue(int64_t{i32_const_});
}
......@@ -105,7 +105,7 @@ class LiftoffAssembler : public TurboAssembler {
union {
LiftoffRegister reg_; // used if loc_ == kRegister
int32_t i32_const_; // used if loc_ == KIntConst
int32_t i32_const_; // used if loc_ == kIntConst
};
};
......
......@@ -32,7 +32,7 @@ namespace internal {
namespace wasm {
constexpr auto kRegister = LiftoffAssembler::VarState::kRegister;
constexpr auto KIntConst = LiftoffAssembler::VarState::KIntConst;
constexpr auto kIntConst = LiftoffAssembler::VarState::kIntConst;
constexpr auto kStack = LiftoffAssembler::VarState::kStack;
namespace {
......@@ -1134,7 +1134,7 @@ class LiftoffCompiler {
case kRegister:
__ PushRegister(slot.type(), slot.reg());
break;
case KIntConst:
case kIntConst:
__ cache_state()->stack_state.emplace_back(imm.type, slot.i32_const());
break;
case kStack: {
......@@ -1178,7 +1178,7 @@ class LiftoffCompiler {
target_slot = source_slot;
if (is_tee) state.inc_used(target_slot.reg());
break;
case KIntConst:
case kIntConst:
if (target_slot.is_reg()) state.dec_used(target_slot.reg());
target_slot = source_slot;
break;
......
......@@ -1473,7 +1473,7 @@ void LiftoffStackSlots::Construct() {
liftoff::push(asm_, src.reg(), src.type());
}
break;
case LiftoffAssembler::VarState::KIntConst: {
case LiftoffAssembler::VarState::kIntConst: {
// The high word is the sign extension of the low word.
asm_->li(kScratchReg,
Operand(slot.half_ == kLowWord ? src.i32_const()
......
......@@ -1308,7 +1308,7 @@ void LiftoffStackSlots::Construct() {
case LiftoffAssembler::VarState::kRegister:
liftoff::push(asm_, src.reg(), src.type());
break;
case LiftoffAssembler::VarState::KIntConst: {
case LiftoffAssembler::VarState::kIntConst: {
asm_->li(kScratchReg, Operand(src.i32_const()));
asm_->push(kScratchReg);
break;
......
......@@ -1567,7 +1567,7 @@ void LiftoffStackSlots::Construct() {
case LiftoffAssembler::VarState::kRegister:
liftoff::push(asm_, src.reg(), src.type());
break;
case LiftoffAssembler::VarState::KIntConst:
case LiftoffAssembler::VarState::kIntConst:
asm_->pushq(Immediate(src.i32_const()));
break;
}
......
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