Bug 1736405: Remove MLoadElementHole::needsHoleCheck. r=jandem

`MLoadElementHole::needsHoleCheck` is never set to `false`.

Drive-by change:
- Remove two method declarations without definitions.

Differential Revision: https://phabricator.services.mozilla.com/D128762
This commit is contained in:
André Bargull 2021-10-19 09:19:49 +00:00
Родитель 0e2b3de693
Коммит e5b87e74e0
5 изменённых файлов: 15 добавлений и 31 удалений

Просмотреть файл

@ -13081,19 +13081,22 @@ void CodeGenerator::visitLoadElementHole(LLoadElementHole* lir) {
masm.loadValue(BaseObjectElementIndex(elements, index), out);
// If a hole check is needed, and the value wasn't a hole, we're done.
// Otherwise, we'll load undefined.
if (lir->mir()->needsHoleCheck()) {
masm.branchTestMagic(Assembler::NotEqual, out, &done);
masm.moveValue(UndefinedValue(), out);
}
masm.jump(&done);
// If the value wasn't a hole, we're done. Otherwise, we'll load undefined.
masm.branchTestMagic(Assembler::NotEqual, out, &done);
masm.bind(&outOfBounds);
if (mir->needsNegativeIntCheck()) {
Label loadUndefined;
masm.jump(&loadUndefined);
masm.bind(&outOfBounds);
Label negative;
masm.branch32(Assembler::LessThan, index, Imm32(0), &negative);
bailoutFrom(&negative, lir->snapshot());
masm.bind(&loadUndefined);
} else {
masm.bind(&outOfBounds);
}
masm.moveValue(UndefinedValue(), out);

Просмотреть файл

@ -234,15 +234,9 @@ class CodeGenerator final : public CodeGeneratorSpecific {
const ConstantOrRegister& id,
const ConstantOrRegister& value, bool strict);
[[nodiscard]] bool generateBranchV(const ValueOperand& value, Label* ifTrue,
Label* ifFalse, FloatRegister fr);
void emitLambdaInit(Register resultReg, Register envChainReg,
const LambdaFunctionInfo& info);
void emitFilterArgumentsOrEval(LInstruction* lir, Register string,
Register temp1, Register temp2);
template <class IteratorObject, class OrderedHashTable>
void emitGetNextEntryForIterator(LGetNextEntryForIterator* lir);

Просмотреть файл

@ -6540,14 +6540,11 @@ class MLoadElementAndUnbox : public MBinaryInstruction,
// Load a value from the elements vector of a native object. If the index is
// out-of-bounds, or the indexed slot has a hole, undefined is returned instead.
class MLoadElementHole : public MTernaryInstruction, public NoTypePolicy::Data {
bool needsNegativeIntCheck_;
bool needsHoleCheck_;
bool needsNegativeIntCheck_ = true;
MLoadElementHole(MDefinition* elements, MDefinition* index,
MDefinition* initLength, bool needsHoleCheck)
: MTernaryInstruction(classOpcode, elements, index, initLength),
needsNegativeIntCheck_(true),
needsHoleCheck_(needsHoleCheck) {
MDefinition* initLength)
: MTernaryInstruction(classOpcode, elements, index, initLength) {
setResultType(MIRType::Value);
setMovable();
@ -6567,15 +6564,11 @@ class MLoadElementHole : public MTernaryInstruction, public NoTypePolicy::Data {
NAMED_OPERANDS((0, elements), (1, index), (2, initLength))
bool needsNegativeIntCheck() const { return needsNegativeIntCheck_; }
bool needsHoleCheck() const { return needsHoleCheck_; }
bool congruentTo(const MDefinition* ins) const override {
if (!ins->isLoadElementHole()) {
return false;
}
const MLoadElementHole* other = ins->toLoadElementHole();
if (needsHoleCheck() != other->needsHoleCheck()) {
return false;
}
if (needsNegativeIntCheck() != other->needsNegativeIntCheck()) {
return false;
}

Просмотреть файл

@ -1741,9 +1741,7 @@ bool WarpCacheIRTranspiler::emitLoadDenseElementHoleResult(
auto* length = MInitializedLength::New(alloc(), elements);
add(length);
bool needsHoleCheck = true;
auto* load =
MLoadElementHole::New(alloc(), elements, index, length, needsHoleCheck);
auto* load = MLoadElementHole::New(alloc(), elements, index, length);
add(load);
pushResult(load);

Просмотреть файл

@ -1868,10 +1868,6 @@ class LLoadElementHole : public LInstructionHelper<BOX_PIECES, 3, 0> {
setOperand(2, initLength);
}
const char* extraName() const {
return mir()->needsHoleCheck() ? "HoleCheck" : nullptr;
}
const MLoadElementHole* mir() const { return mir_->toLoadElementHole(); }
const LAllocation* elements() { return getOperand(0); }
const LAllocation* index() { return getOperand(1); }